Renamed SketchBased::Base property to BaseFeature because of name clash with Revolution::Base property

This commit is contained in:
jrheinlaender 2013-04-07 08:06:53 +04:30 committed by Stefan Tröger
parent 339666adcf
commit c93d425393
4 changed files with 8 additions and 20 deletions

View File

@ -37,6 +37,7 @@
#include "Body.h"
#include "Feature.h"
#include <Base/Console.h>
namespace PartDesign {
@ -61,17 +62,6 @@ TopoDS_Shape Feature::getSolid(const TopoDS_Shape& shape)
return TopoDS_Shape();
}
PartDesign::Body* Feature::getBody()
{
std::vector<App::DocumentObject*> bodies = this->getDocument()->getObjectsOfType(PartDesign::Body::getClassTypeId());
for (std::vector<App::DocumentObject*>::const_iterator b = bodies.begin(); b != bodies.end(); b++) {
PartDesign::Body* body = static_cast<PartDesign::Body*>(*b);
if (body->hasFeature(this))
return body;
}
return NULL;
}
const gp_Pnt Feature::getPointFromFace(const TopoDS_Face& f)
{
if (!f.Infinite()) {

View File

@ -45,12 +45,9 @@ class PartDesignExport Feature : public Part::Feature
PROPERTY_HEADER(PartDesign::Feature);
public:
Feature();
protected:
/// Get the body feature which this feature belongs to
Body* getBody();
Feature();
protected:
/**
* Get a solid of the given shape. If no solid is found an exception is raised.
*/

View File

@ -98,7 +98,7 @@ PROPERTY_SOURCE(PartDesign::SketchBased, PartDesign::Feature)
SketchBased::SketchBased()
{
ADD_PROPERTY(Base,(0));
ADD_PROPERTY(BaseFeature,(0));
ADD_PROPERTY_TYPE(Sketch,(0),"SketchBased", App::Prop_None, "Reference to sketch");
ADD_PROPERTY_TYPE(Midplane,(0),"SketchBased", App::Prop_None, "Extrude symmetric to sketch face");
ADD_PROPERTY_TYPE(Reversed, (0),"SketchBased", App::Prop_None, "Reverse extrusion direction");
@ -106,7 +106,8 @@ SketchBased::SketchBased()
short SketchBased::mustExecute() const
{
if (Sketch.isTouched() ||
if (BaseFeature.isTouched() ||
Sketch.isTouched() ||
Midplane.isTouched() ||
Reversed.isTouched())
return 1;
@ -233,7 +234,7 @@ const TopoDS_Shape& SketchBased::getSupportShape() const {
}
const TopoDS_Shape& SketchBased::getBaseShape() const {
App::DocumentObject* BaseLink = Base.getValue();
App::DocumentObject* BaseLink = BaseFeature.getValue();
if (BaseLink == NULL) throw Base::Exception("Base property not set");
Part::Feature* BaseObject = NULL;
if (BaseLink->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))

View File

@ -46,7 +46,7 @@ public:
// Common properties for all sketch based features
/// Base feature which this feature will be fused into or cut out of
App::PropertyLink Base;
App::PropertyLink BaseFeature;
/// Sketch used to create this feature
App::PropertyLink Sketch;
/// Reverse extrusion direction