From c700d9d3687e92e153eda620553ceb77ee3b1db3 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 17 Mar 2014 10:56:38 +0100 Subject: [PATCH] + fix displacement of bounding box --- src/Gui/ViewProviderGeometryObject.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Gui/ViewProviderGeometryObject.cpp b/src/Gui/ViewProviderGeometryObject.cpp index d3b5fb66c..6da49ea28 100644 --- a/src/Gui/ViewProviderGeometryObject.cpp +++ b/src/Gui/ViewProviderGeometryObject.cpp @@ -56,6 +56,7 @@ #include #include #include +#include #if (COIN_MAJOR_VERSION > 2) #include #endif @@ -162,20 +163,11 @@ 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(prop)->getBoundingBox(); pcBoundingBox->minBounds.setValue(box.MinX, box.MinY, box.MinZ); pcBoundingBox->maxBounds.setValue(box.MaxX, box.MaxY, box.MaxZ); - if (pcBoundSwitch) { - SoGroup* grp = static_cast(pcBoundSwitch->getChild(0)); - SoTransform* trf = static_cast(grp->getChild(2)); - SbMatrix m; - m.setTransform(pcTransform->translation.getValue(), - pcTransform->rotation.getValue(), - pcTransform->scaleFactor.getValue(), - pcTransform->scaleOrientation.getValue(), - pcTransform->center.getValue()); - trf->setMatrix(m.inverse()); - } } else if (prop->isDerivedFrom(App::PropertyPlacement::getClassTypeId()) && strcmp(prop->getName(), "Placement") == 0) { @@ -562,7 +554,7 @@ void ViewProviderGeometryObject::showBoundingBox(bool show) color->rgb.setValue(r, g, b); pBoundingSep->addChild(color); - pBoundingSep->addChild(new SoTransform()); + pBoundingSep->addChild(new SoResetTransform()); pBoundingSep->addChild(pcBoundingBox); pcBoundingBox->coordsOn.setValue(false); pcBoundingBox->dimensionsOn.setValue(true);