+ do not apply corrupted transformation (NaN) from SoCenterballManip
This commit is contained in:
parent
b8df4593c9
commit
29f3f0cfc2
|
@ -52,6 +52,7 @@
|
|||
#include "Document.h"
|
||||
#include "Window.h"
|
||||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Placement.h>
|
||||
#include <App/PropertyGeo.h>
|
||||
#include <App/GeoFeature.h>
|
||||
|
@ -62,6 +63,7 @@
|
|||
#endif
|
||||
#include "SoNavigationDragger.h"
|
||||
#include "SoFCUnifiedSelection.h"
|
||||
#include <boost/math/special_functions/fpclassify.hpp>
|
||||
|
||||
using namespace Gui;
|
||||
|
||||
|
@ -190,6 +192,7 @@ void ViewProviderGeometryObject::updateData(const App::Property* prop)
|
|||
pcTransform->rotation.setValue(q0,q1,q2,q3);
|
||||
pcTransform->translation.setValue(px,py,pz);
|
||||
pcTransform->center.setValue(0.0f,0.0f,0.0f);
|
||||
pcTransform->scaleFactor.setValue(1.0f,1.0f,1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -445,6 +448,12 @@ void ViewProviderGeometryObject::dragMotionCallback(void * data, SoDragger * d)
|
|||
SbVec3f center = manip->center.getValue();
|
||||
manip->rotation.getValue().getValue(q0, q1, q2, q3);
|
||||
|
||||
// it can happen that the values of the motion matrix is garbage
|
||||
if (boost::math::isnan(q0)) {
|
||||
Base::Console().Warning("NaN values received in ViewProviderGeometryObject::dragMotionCallback\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// get the placement
|
||||
ViewProviderGeometryObject* view = reinterpret_cast<ViewProviderGeometryObject*>(data);
|
||||
if (view && view->pcObject && view->pcObject->getTypeId().isDerivedFrom(App::GeoFeature::getClassTypeId())) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user