diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index 8de574064..b1748cf62 100755 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -806,23 +806,14 @@ Base::Matrix4D FemMesh::getTransform(void) const Base::BoundBox3d FemMesh::getBoundBox(void) const { Base::BoundBox3d box; - try { - // If the shape is empty an exception may be thrown - Bnd_Box bounds; - BRepBndLib::Add(myMesh->GetShapeToMesh(), bounds); - bounds.SetGap(0.0); - Standard_Real xMin, yMin, zMin, xMax, yMax, zMax; - bounds.Get(xMin, yMin, zMin, xMax, yMax, zMax); - box.MinX = xMin; - box.MaxX = xMax; - box.MinY = yMin; - box.MaxY = yMax; - box.MinZ = zMin; - box.MaxZ = zMax; - } - catch (Standard_Failure) { - } + SMESHDS_Mesh* data = const_cast(getSMesh())->GetMeshDS(); + + SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator(); + for (;aNodeIter->more();) { + const SMDS_MeshNode* aNode = aNodeIter->next(); + box.Add(Base::Vector3d(aNode->X(),aNode->Y(),aNode->Z())); + } return box; } diff --git a/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp b/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp index ff9c2e886..fb28e1236 100755 --- a/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp @@ -231,6 +231,9 @@ void ViewProviderFemMesh::attach(App::DocumentObject *pcObj) { ViewProviderGeometryObject::attach(pcObj); + // Move 'coords' before the switch + pcRoot->insertChild(pcCoords,pcRoot->findChild(reinterpret_cast(pcModeSwitch))); + // Annotation sets SoGroup* pcAnotRoot = new SoAnnotation(); @@ -252,7 +255,7 @@ void ViewProviderFemMesh::attach(App::DocumentObject *pcObj) // flat SoGroup* pcFlatRoot = new SoGroup(); // face nodes - pcFlatRoot->addChild(pcCoords); + //pcFlatRoot->addChild(pcCoords); pcFlatRoot->addChild(pShapeHints); pcFlatRoot->addChild(pcShapeMaterial); pcFlatRoot->addChild(pcMatBinding); @@ -264,7 +267,7 @@ void ViewProviderFemMesh::attach(App::DocumentObject *pcObj) SoLightModel* pcLightModel = new SoLightModel(); pcLightModel->model = SoLightModel::BASE_COLOR; SoGroup* pcWireRoot = new SoGroup(); - pcWireRoot->addChild(pcCoords); + //pcWireRoot->addChild(pcCoords); pcWireRoot->addChild(pcDrawStyle); pcWireRoot->addChild(pcLightModel); SoBaseColor* color = new SoBaseColor(); @@ -278,7 +281,7 @@ void ViewProviderFemMesh::attach(App::DocumentObject *pcObj) SoGroup* pcPointsRoot = new SoSeparator(); pcPointsRoot->addChild(pcPointMaterial); pcPointsRoot->addChild(pcPointStyle); - pcPointsRoot->addChild(pcCoords); + //pcPointsRoot->addChild(pcCoords); pointset = new SoPointSet; pcPointsRoot->addChild(pointset); addDisplayMaskMode(pcPointsRoot, "Nodes"); @@ -318,6 +321,8 @@ void ViewProviderFemMesh::attach(App::DocumentObject *pcObj) addDisplayMaskMode(pcElemNodesRoot, "Elements & Nodes"); + + } void ViewProviderFemMesh::setDisplayMode(const char* ModeName)