diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index 1ae380ce48d3..6dd70524cd4a 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -2489,7 +2489,7 @@ Base::BoundBox3d FemMesh::getBoundBox(void) const { Base::BoundBox3d box; - SMESHDS_Mesh* data = const_cast(getSMesh())->GetMeshDS(); + const SMESHDS_Mesh* data = getSMesh()->GetMeshDS(); SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator(); for (;aNodeIter->more();) { @@ -2533,7 +2533,7 @@ struct Fem::FemMesh::FemMeshInfo FemMesh::getInfo(void) const{ struct FemMeshInfo rtrn; - SMESHDS_Mesh* data = const_cast(getSMesh())->GetMeshDS(); + const SMESHDS_Mesh* data = getSMesh()->GetMeshDS(); const SMDS_MeshInfo& info = data->GetMeshInfo(); rtrn.numFaces = data->NbFaces(); rtrn.numNode = info.NbNodes(); diff --git a/src/Mod/Fem/App/FemMeshShapeObject.cpp b/src/Mod/Fem/App/FemMeshShapeObject.cpp index 2e9a5d20a00b..edc896cf9d7a 100644 --- a/src/Mod/Fem/App/FemMeshShapeObject.cpp +++ b/src/Mod/Fem/App/FemMeshShapeObject.cpp @@ -230,21 +230,6 @@ App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void) myNetGenMesher.Compute(); #endif - - - //SMESHDS_Mesh* data = const_cast(newMesh.getSMesh())->GetMeshDS(); - //const SMDS_MeshInfo& info = data->GetMeshInfo(); - //int numNode = info.NbNodes(); - //int numTria = info.NbTriangles(); - //int numQuad = info.NbQuadrangles(); - //int numPoly = info.NbPolygons(); - //int numVolu = info.NbVolumes(); - //int numTetr = info.NbTetras(); - //int numHexa = info.NbHexas(); - //int numPyrd = info.NbPyramids(); - //int numPris = info.NbPrisms(); - //int numHedr = info.NbPolyhedrons(); - // set the value to the object FemMesh.setValue(newMesh); diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index 6f2ca1116a9c..8d4630bde184 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -126,7 +126,7 @@ void FemVTKTools::importVTKMesh(vtkSmartPointer dataset, FemMesh* me vtkSmartPointer idlist= vtkSmartPointer::New(); //Now fill the SMESH datastructure - SMESH_Mesh* smesh = const_cast(mesh->getSMesh()); + SMESH_Mesh* smesh = mesh->getSMesh(); SMESHDS_Mesh* meshds = smesh->GetMeshDS(); meshds->ClearMesh(); @@ -446,8 +446,8 @@ void FemVTKTools::exportVTKMesh(const FemMesh* mesh, vtkSmartPointer(mesh->getSMesh()); - SMESHDS_Mesh* meshDS = smesh->GetMeshDS(); + const SMESH_Mesh* smesh = mesh->getSMesh(); + const SMESHDS_Mesh* meshDS = smesh->GetMeshDS(); // nodes Base::Console().Log(" Start: VTK mesh builder nodes.\n"); @@ -831,8 +831,8 @@ void FemVTKTools::exportFreeCADResult(const App::DocumentObject* result, vtkSmar Base::Console().Error("Result object does not correctly link to mesh"); return; } - SMESH_Mesh* smesh = const_cast(static_cast(meshObj)->FemMesh.getValue().getSMesh()); - SMESHDS_Mesh* meshDS = smesh->GetMeshDS(); + const SMESH_Mesh* smesh = static_cast(meshObj)->FemMesh.getValue().getSMesh(); + const SMESHDS_Mesh* meshDS = smesh->GetMeshDS(); // all result object meshes are in mm therefore for e.g. length outputs like // displacement we must divide by 1000 diff --git a/src/Mod/Fem/Gui/Command.cpp b/src/Mod/Fem/Gui/Command.cpp index f2069554d908..5d05de290986 100644 --- a/src/Mod/Fem/Gui/Command.cpp +++ b/src/Mod/Fem/Gui/Command.cpp @@ -975,7 +975,7 @@ void DefineNodesCallback(void* ud, SoEventCallback* n) if (docObj.size() != 1) return; - const SMESHDS_Mesh* data = const_cast(static_cast(docObj[0])->FemMesh.getValue().getSMesh())->GetMeshDS(); + const SMESHDS_Mesh* data = static_cast(docObj[0])->FemMesh.getValue().getSMesh()->GetMeshDS(); SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator(); Base::Vector3f pt2d; diff --git a/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp b/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp index 6658e0d7fb5c..ff21e2134eb2 100644 --- a/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp +++ b/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp @@ -94,7 +94,7 @@ QVariant PropertyFemMeshItem::value(const App::Property*) const const std::vector& props = getPropertyData(); for (std::vector::const_iterator pt = props.begin(); pt != props.end(); ++pt) { Fem::PropertyFemMesh* prop = static_cast(*pt); - SMESH_Mesh* mesh = const_cast(prop->getValue().getSMesh()); + const SMESH_Mesh* mesh = prop->getValue().getSMesh(); ctN += mesh->NbNodes(); ctE += mesh->NbEdges(); ctF += mesh->NbFaces(); @@ -154,7 +154,7 @@ int PropertyFemMeshItem::countNodes() const const std::vector& props = getPropertyData(); for (std::vector::const_iterator pt = props.begin(); pt != props.end(); ++pt) { Fem::PropertyFemMesh* prop = static_cast(*pt); - SMESH_Mesh* mesh = const_cast(prop->getValue().getSMesh()); + const SMESH_Mesh* mesh = prop->getValue().getSMesh(); ctN += mesh->NbNodes(); } @@ -167,7 +167,7 @@ int PropertyFemMeshItem::countEdges() const const std::vector& props = getPropertyData(); for (std::vector::const_iterator pt = props.begin(); pt != props.end(); ++pt) { Fem::PropertyFemMesh* prop = static_cast(*pt); - SMESH_Mesh* mesh = const_cast(prop->getValue().getSMesh()); + const SMESH_Mesh* mesh = prop->getValue().getSMesh(); ctE += mesh->NbEdges(); } @@ -180,7 +180,7 @@ int PropertyFemMeshItem::countFaces() const const std::vector& props = getPropertyData(); for (std::vector::const_iterator pt = props.begin(); pt != props.end(); ++pt) { Fem::PropertyFemMesh* prop = static_cast(*pt); - SMESH_Mesh* mesh = const_cast(prop->getValue().getSMesh()); + const SMESH_Mesh* mesh = prop->getValue().getSMesh(); ctF += mesh->NbFaces(); } @@ -193,7 +193,7 @@ int PropertyFemMeshItem::countPolygons() const const std::vector& props = getPropertyData(); for (std::vector::const_iterator pt = props.begin(); pt != props.end(); ++pt) { Fem::PropertyFemMesh* prop = static_cast(*pt); - SMESH_Mesh* mesh = const_cast(prop->getValue().getSMesh()); + const SMESH_Mesh* mesh = prop->getValue().getSMesh(); ctP += mesh->NbPolygons(); } @@ -206,7 +206,7 @@ int PropertyFemMeshItem::countVolumes() const const std::vector& props = getPropertyData(); for (std::vector::const_iterator pt = props.begin(); pt != props.end(); ++pt) { Fem::PropertyFemMesh* prop = static_cast(*pt); - SMESH_Mesh* mesh = const_cast(prop->getValue().getSMesh()); + const SMESH_Mesh* mesh = prop->getValue().getSMesh(); ctV += mesh->NbVolumes(); } @@ -219,7 +219,7 @@ int PropertyFemMeshItem::countPolyhedrons() const const std::vector& props = getPropertyData(); for (std::vector::const_iterator pt = props.begin(); pt != props.end(); ++pt) { Fem::PropertyFemMesh* prop = static_cast(*pt); - SMESH_Mesh* mesh = const_cast(prop->getValue().getSMesh()); + const SMESH_Mesh* mesh = prop->getValue().getSMesh(); ctH += mesh->NbPolyhedrons(); } @@ -232,7 +232,7 @@ int PropertyFemMeshItem::countGroups() const const std::vector& props = getPropertyData(); for (std::vector::const_iterator pt = props.begin(); pt != props.end(); ++pt) { Fem::PropertyFemMesh* prop = static_cast(*pt); - SMESH_Mesh* mesh = const_cast(prop->getValue().getSMesh()); + const SMESH_Mesh* mesh = prop->getValue().getSMesh(); ctG += mesh->NbGroup(); } diff --git a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp index 2119a9584ece..359fa5ce4298 100644 --- a/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp +++ b/src/Mod/Fem/Gui/TaskCreateNodeSet.cpp @@ -162,7 +162,7 @@ void TaskCreateNodeSet::DefineNodesCallback(void* ud, SoEventCallback* n) void TaskCreateNodeSet::DefineNodes(const Base::Polygon2d& polygon, const Gui::ViewVolumeProjection& proj, bool inner) { - const SMESHDS_Mesh* data = const_cast(pcObject->FemMesh.getValue()->FemMesh.getValue().getSMesh())->GetMeshDS(); + const SMESHDS_Mesh* data = pcObject->FemMesh.getValue()->FemMesh.getValue().getSMesh()->GetMeshDS(); SMDS_NodeIteratorPtr aNodeIter = data->nodesIterator(); Base::Vector3f pt2d; diff --git a/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp b/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp index c59944ac39a5..3716dba96ed5 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemMesh.cpp @@ -468,7 +468,7 @@ std::set ViewProviderFemMesh::getHighlightNodes() const void ViewProviderFemMesh::setHighlightNodes(const std::set& HighlightedNodes) { if (!HighlightedNodes.empty()) { - SMESHDS_Mesh* data = const_cast((static_cast(this->pcObject)->FemMesh).getValue().getSMesh())->GetMeshDS(); + const SMESHDS_Mesh* data = static_cast(this->pcObject)->FemMesh.getValue().getSMesh()->GetMeshDS(); pcAnoCoords->point.setNum(HighlightedNodes.size()); SbVec3f* verts = pcAnoCoords->point.startEditing(); @@ -722,7 +722,7 @@ void ViewProviderFEMMeshBuilder::createMesh(const App::Property* prop, const Fem::PropertyFemMesh* mesh = static_cast(prop); - SMESHDS_Mesh* data = const_cast(mesh->getValue().getSMesh())->GetMeshDS(); + const SMESHDS_Mesh* data = mesh->getValue().getSMesh()->GetMeshDS(); int numFaces = data->NbFaces(); int numNodes = data->NbNodes(); diff --git a/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp b/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp index 507b7c8bb586..195329227610 100644 --- a/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp +++ b/src/Mod/Fem/Gui/ViewProviderFemMeshPyImp.cpp @@ -257,8 +257,8 @@ Py::List ViewProviderFemMeshPy::getHighlightedNodes(void) const void ViewProviderFemMeshPy::setHighlightedNodes(Py::List arg) { ViewProviderFemMesh* vp = this->getViewProviderFemMeshPtr(); - SMESHDS_Mesh* data = const_cast((static_cast - (vp->getObject())->FemMesh).getValue().getSMesh())->GetMeshDS(); + const SMESHDS_Mesh* data = static_cast + (vp->getObject())->FemMesh.getValue().getSMesh()->GetMeshDS(); std::set res; for (Py::List::iterator it = arg.begin(); it != arg.end(); ++it) {