App: add pure virtual methods to PropertyGeometry to delegate it to the geometry of sub-classes
Following the law of Demeter add some wrapper methods to PropertyGeometry and implement them in sub-classes. As a side-effect this makes some const_cast obsolete
This commit is contained in:
@@ -541,14 +541,12 @@ void Feature::onChanged(const App::Property* prop)
|
||||
{
|
||||
// if the placement has changed apply the change to the point data as well
|
||||
if (prop == &this->Placement) {
|
||||
TopoShape& shape = const_cast<TopoShape&>(this->Shape.getShape());
|
||||
shape.setTransform(this->Placement.getValue().toMatrix());
|
||||
this->Shape.setTransform(this->Placement.getValue().toMatrix());
|
||||
}
|
||||
// if the point data has changed check and adjust the transformation as well
|
||||
else if (prop == &this->Shape) {
|
||||
if (this->isRecomputing()) {
|
||||
TopoShape& shape = const_cast<TopoShape&>(this->Shape.getShape());
|
||||
shape.setTransform(this->Placement.getValue().toMatrix());
|
||||
this->Shape.setTransform(this->Placement.getValue().toMatrix());
|
||||
}
|
||||
else {
|
||||
Base::Placement p;
|
||||
|
||||
Reference in New Issue
Block a user