update bounding box if the placement of a geometry changes
This commit is contained in:
@@ -185,12 +185,21 @@ void ViewProviderGeometryObject::attach(App::DocumentObject *pcObj)
|
||||
void ViewProviderGeometryObject::updateData(const App::Property* prop)
|
||||
{
|
||||
if (prop->isDerivedFrom(App::PropertyComplexGeoData::getClassTypeId())) {
|
||||
// Note: When the placement of non-parametric objects changes there is currently no update
|
||||
// of the bounding box information.
|
||||
Base::BoundBox3d box = static_cast<const App::PropertyComplexGeoData*>(prop)->getBoundingBox();
|
||||
pcBoundingBox->minBounds.setValue(box.MinX, box.MinY, box.MinZ);
|
||||
pcBoundingBox->maxBounds.setValue(box.MaxX, box.MaxY, box.MaxZ);
|
||||
}
|
||||
else if (prop->isDerivedFrom(App::PropertyPlacement::getClassTypeId())) {
|
||||
App::GeoFeature* geometry = dynamic_cast<App::GeoFeature*>(getObject());
|
||||
if (geometry && prop == &geometry->Placement) {
|
||||
const App::PropertyComplexGeoData* data = geometry->getPropertyOfGeometry();
|
||||
if (data) {
|
||||
Base::BoundBox3d box = data->getBoundingBox();
|
||||
pcBoundingBox->minBounds.setValue(box.MinX, box.MinY, box.MinZ);
|
||||
pcBoundingBox->maxBounds.setValue(box.MaxX, box.MaxY, box.MaxZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ViewProviderDragger::updateData(prop);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user