Gui: add coinRemoveAllChildren to work around Coin3D bug
See bug description: https://bitbucket.org/Coin3D/coin/pull-requests/119/fix-sochildlist-auditing/diff Because of path based rendering (SoFCPathAnnotation) in mouse over highlight, this bug causes crash more frequently here comparing to upstream. All C++ calling of SoGroup::removeAllChildren() is replaced by Gui::coinRemoveAllChildren(), and python code is fixed by monkey patching SoGroup.removeAllChildren() in FreeCADGuiInit.py.
This commit is contained in:
@@ -118,7 +118,7 @@ void ViewProviderFemConstraintBearing::updateData(const App::Property* prop)
|
||||
|
||||
if (strcmp(prop->getName(),"BasePoint") == 0) {
|
||||
// Remove and recreate the symbol
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
|
||||
// This should always point outside of the cylinder
|
||||
Base::Vector3d normal = pcConstraint->NormalDirection.getValue();
|
||||
|
||||
@@ -121,7 +121,7 @@ void ViewProviderFemConstraintContact::updateData(const App::Property* prop)
|
||||
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
|
||||
|
||||
// Points and Normals are always updated together
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
|
||||
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
|
||||
//Define base and normal directions
|
||||
|
||||
@@ -186,7 +186,7 @@ void ViewProviderFemConstraintDisplacement::updateData(const App::Property* prop
|
||||
int idrotz = 0;
|
||||
#else
|
||||
// Note: Points and Normals are always updated together
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
#endif
|
||||
|
||||
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
|
||||
|
||||
@@ -143,7 +143,7 @@ void ViewProviderFemConstraintFixed::updateData(const App::Property* prop)
|
||||
int idx = 0;
|
||||
#else
|
||||
// Note: Points and Normals are always updated together
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
#endif
|
||||
|
||||
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
|
||||
|
||||
@@ -170,7 +170,7 @@ void ViewProviderFemConstraintFluidBoundary::updateData(const App::Property* pro
|
||||
int idx = 0;
|
||||
#else
|
||||
// Redraw all arrows
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
#endif
|
||||
// This should always point outside of the solid
|
||||
Base::Vector3d normal = pcConstraint->NormalDirection.getValue();
|
||||
@@ -272,7 +272,7 @@ void ViewProviderFemConstraintFluidBoundary::updateData(const App::Property* pro
|
||||
int idx = 0;
|
||||
#else
|
||||
// Note: Points and Normals are always updated together
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
#endif
|
||||
|
||||
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
|
||||
|
||||
@@ -139,7 +139,7 @@ void ViewProviderFemConstraintForce::updateData(const App::Property* prop)
|
||||
int idx = 0;
|
||||
#else
|
||||
// Redraw all arrows
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
#endif
|
||||
// This should always point outside of the solid
|
||||
Base::Vector3d normal = pcConstraint->NormalDirection.getValue();
|
||||
|
||||
@@ -115,7 +115,7 @@ void ViewProviderFemConstraintGear::updateData(const App::Property* prop)
|
||||
if (strcmp(prop->getName(),"BasePoint") == 0) {
|
||||
if (pcConstraint->Height.getValue() > Precision::Confusion()) {
|
||||
// Remove and recreate the symbol
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
|
||||
Base::Vector3d base = pcConstraint->BasePoint.getValue();
|
||||
Base::Vector3d axis = pcConstraint->Axis.getValue();
|
||||
|
||||
@@ -120,7 +120,7 @@ void ViewProviderFemConstraintHeatflux::updateData(const App::Property* prop)
|
||||
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
|
||||
|
||||
// Note: Points and Normals are always updated together
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
|
||||
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
|
||||
//Define base and normal directions
|
||||
|
||||
@@ -119,7 +119,7 @@ void ViewProviderFemConstraintPlaneRotation::updateData(const App::Property* pro
|
||||
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
|
||||
|
||||
// Points and Normals are always updated together
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
|
||||
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
|
||||
//Define base and normal directions
|
||||
|
||||
@@ -127,7 +127,7 @@ void ViewProviderFemConstraintPressure::updateData(const App::Property* prop)
|
||||
int idx = 0;
|
||||
#else
|
||||
// Redraw all arrows
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
#endif
|
||||
|
||||
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
|
||||
|
||||
@@ -114,7 +114,7 @@ void ViewProviderFemConstraintPulley::updateData(const App::Property* prop)
|
||||
if (strcmp(prop->getName(),"BasePoint") == 0) {
|
||||
if (pcConstraint->Height.getValue() > Precision::Confusion()) {
|
||||
// Remove and recreate the symbol
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
|
||||
// This should always point outside of the cylinder
|
||||
Base::Vector3d base = pcConstraint->BasePoint.getValue();
|
||||
|
||||
@@ -119,7 +119,7 @@ void ViewProviderFemConstraintTemperature::updateData(const App::Property* prop)
|
||||
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
|
||||
|
||||
// Note: Points and Normals are always updated together
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
|
||||
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
|
||||
//Define base and normal directions
|
||||
|
||||
@@ -135,7 +135,7 @@ void ViewProviderFemConstraintTransform::updateData(const App::Property* prop)
|
||||
std::vector<Base::Vector3d>::const_iterator n = normals.begin();
|
||||
|
||||
// Points and Normals are always updated together
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
|
||||
for (std::vector<Base::Vector3d>::const_iterator p = points.begin(); p != points.end(); p++) {
|
||||
SbVec3f base(p->x, p->y, p->z);
|
||||
@@ -269,7 +269,7 @@ void ViewProviderFemConstraintTransform::updateData(const App::Property* prop)
|
||||
} else if (transform_type == "Cylindrical") {
|
||||
|
||||
// Points and Normals are always updated together
|
||||
pShapeSep->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(pShapeSep);
|
||||
|
||||
const std::vector<Base::Vector3d>& points = pcConstraint->Points.getValues();
|
||||
const std::vector<Base::Vector3d>& normals = pcConstraint->Normals.getValues();
|
||||
|
||||
Reference in New Issue
Block a user