Set placement property to read-only for skecth/ dress up features

This commit is contained in:
wmayer
2012-04-06 12:29:18 +02:00
parent 1ec0f37af1
commit 2d2df1b1a3
6 changed files with 37 additions and 1 deletions

View File

@@ -48,4 +48,14 @@ void DressUp::positionByBase(void)
this->Placement.setValue(base->Placement.getValue());
}
void DressUp::onChanged(const App::Property* prop)
{
if (prop == &Base) {
// if attached to a sketch then mark it as read-only
this->Placement.StatusBits.set(2, Base.getValue() != 0);
}
Feature::onChanged(prop);
}
}

View File

@@ -41,7 +41,10 @@ public:
/// updates the Placement property from the Placement of Base
void positionByBase(void);
};
protected:
void onChanged(const App::Property* prop);
};
} //namespace PartDesign

View File

@@ -89,6 +89,16 @@ void SketchBased::positionBySketch(void)
}
}
void SketchBased::onChanged(const App::Property* prop)
{
if (prop == &Sketch) {
// if attached to a sketch then mark it as read-only
this->Placement.StatusBits.set(2, Sketch.getValue() != 0);
}
Feature::onChanged(prop);
}
bool SketchBased::isInside(const TopoDS_Wire& wire1, const TopoDS_Wire& wire2) const
{
Bnd_Box box1;

View File

@@ -51,6 +51,7 @@ public:
int getSketchAxisCount(void) const;
protected:
void onChanged(const App::Property* prop);
TopoDS_Face validateFace(const TopoDS_Face&) const;
TopoDS_Shape makeFace(const std::vector<TopoDS_Wire>&) const;
TopoDS_Shape makeFace(std::list<TopoDS_Wire>&) const; // for internal use only