Simplified datum features by making use of the placement property

This commit is contained in:
jrheinlaender
2013-05-09 11:26:32 +04:30
committed by Stefan Tröger
parent 449aee2178
commit c7d4ab22b9
11 changed files with 121 additions and 111 deletions

View File

@@ -185,16 +185,16 @@ void ViewProviderBody::updateData(const App::Property* prop)
PartDesign::Body* body = static_cast<PartDesign::Body*>(getObject());
std::vector<App::DocumentObject*> features = body->Model.getValues();
for (std::vector<App::DocumentObject*>::const_iterator f = features.begin(); f != features.end(); f++) {
App::PropertyVector* baseProp = NULL;
App::PropertyPlacement* plm = NULL;
if ((*f)->getTypeId().isDerivedFrom(PartDesign::Line::getClassTypeId()))
baseProp = &(static_cast<PartDesign::Line*>(*f)->_Base);
plm = &(static_cast<PartDesign::Line*>(*f)->Placement);
else if ((*f)->getTypeId().isDerivedFrom(PartDesign::Plane::getClassTypeId()))
baseProp = &(static_cast<PartDesign::Plane*>(*f)->_Base);
plm = &(static_cast<PartDesign::Plane*>(*f)->Placement);
if (baseProp != NULL) {
if (plm != NULL) {
Gui::ViewProviderDocumentObject* vp = dynamic_cast<Gui::ViewProviderDocumentObject*>(Gui::Application::Instance->getViewProvider(*f));
if (vp != NULL)
vp->updateData(baseProp);
vp->updateData(plm);
}
}