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:
@@ -128,7 +128,7 @@ SoSeparator* ViewProvider2DObject::createGrid(void)
|
||||
double zGrid = 0.0; // carpet-grid separation
|
||||
|
||||
SoGroup *parent = new Gui::SoSkipBoundingGroup();
|
||||
GridRoot->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(GridRoot);
|
||||
GridRoot->addChild(parent);
|
||||
SoBaseColor *mycolor;
|
||||
SoVertexProperty *vts;
|
||||
@@ -228,7 +228,7 @@ void ViewProvider2DObject::updateData(const App::Property* prop)
|
||||
if (prop->getTypeId() == Part::PropertyPartShape::getClassTypeId()) {
|
||||
Base::BoundBox3d bbox = static_cast<const Part::PropertyPartShape*>(prop)->getBoundingBox();
|
||||
if (!bbox.IsValid()) return;
|
||||
GridRoot->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(GridRoot);
|
||||
Base::Placement place = static_cast<const Part::PropertyPartShape*>(prop)->getComplexData()->getPlacement();
|
||||
place.invert();
|
||||
Base::ViewProjMatrix proj(place.toMatrix());
|
||||
@@ -252,11 +252,11 @@ void ViewProvider2DObject::onChanged(const App::Property* prop)
|
||||
if (ShowGrid.getValue())
|
||||
createGrid();
|
||||
else
|
||||
GridRoot->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(GridRoot);
|
||||
}
|
||||
if ((prop == &GridSize) || (prop == &GridStyle) || (prop == &TightGrid)) {
|
||||
if (ShowGrid.getValue()) {
|
||||
GridRoot->removeAllChildren();
|
||||
Gui::coinRemoveAllChildren(GridRoot);
|
||||
createGrid();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user