Salome HOME
Merge branch 'V9_9_BR'
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_PreVisualObj.cxx
index 3e05490da123b34c4cd4535924effe166d5d8277..78eded6e631428e38bf6579af2a506296cc9e022 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 
 #include "SMESHGUI_PreVisualObj.h"
 
-#include <SMDS_Mesh.hxx>
+#include <SMESHDS_Mesh.hxx>
 #include <SMESH_Actor.h>
 
 SMESHGUI_PreVisualObj::SMESHGUI_PreVisualObj()
 {
-  myMesh = new SMDS_Mesh();
+  myMesh = new SMESHDS_Mesh(0,true);
 }
 
-bool SMESHGUI_PreVisualObj::Update( int theIsClear = true )
+SMDS_Mesh* SMESHGUI_PreVisualObj::GetMesh() const
+{
+  return myMesh;
+}
+
+bool SMESHGUI_PreVisualObj::Update( int /*theIsClear*/)
 {
   return false;
 }
@@ -40,7 +45,7 @@ void SMESHGUI_PreVisualObj::UpdateFunctor( const SMESH::Controls::FunctorPtr& th
   if ( theFunctor ) theFunctor->SetMesh( GetMesh() );
 }
 
-int SMESHGUI_PreVisualObj::GetElemDimension( const int theObjId )
+int SMESHGUI_PreVisualObj::GetElemDimension( const smIdType theObjId )
 {
   if ( const SMDS_MeshElement* anElem = myMesh->FindElement( theObjId ))
   {
@@ -57,9 +62,9 @@ int SMESHGUI_PreVisualObj::GetElemDimension( const int theObjId )
   return -1;
 }
 
-int SMESHGUI_PreVisualObj::GetNbEntities( const SMDSAbs_ElementType theType ) const
+smIdType SMESHGUI_PreVisualObj::GetNbEntities( const SMDSAbs_ElementType theType ) const
 {
-  myMesh->GetMeshInfo().NbElements( theType );
+  return myMesh->GetMeshInfo().NbElements( theType );
 }
 
 SMESH::SMESH_Mesh_ptr SMESHGUI_PreVisualObj::GetMeshServer()
@@ -72,10 +77,10 @@ SMESH::SMESH_Mesh_ptr SMESHGUI_PreVisualObj::GetMeshServer()
 // purpose  : Retrieve ids of nodes from edge of elements ( edge is numbered from 1 )
 //=================================================================================
 
-bool SMESHGUI_PreVisualObj::GetEdgeNodes( const int theElemId,
-                                          const int theEdgeNum,
-                                          int&      theNodeId1,
-                                          int&      theNodeId2 ) const
+bool SMESHGUI_PreVisualObj::GetEdgeNodes( const smIdType theElemId,
+                                          const int      theEdgeNum,
+                                          smIdType&      theNodeId1,
+                                          smIdType&      theNodeId2 ) const
 {
   const SMDS_MeshElement* e = myMesh->FindElement( theElemId );
   if ( !e || e->GetType() != SMDSAbs_Face )
@@ -98,31 +103,31 @@ bool SMESHGUI_PreVisualObj::IsValid() const
 
 vtkUnstructuredGrid* SMESHGUI_PreVisualObj::GetUnstructuredGrid()
 {
-  return myMesh->getGrid();
+  return myMesh->GetGrid();
 }
 
 
-vtkIdType SMESHGUI_PreVisualObj::GetNodeObjId( int theVTKID )
+vtkIdType SMESHGUI_PreVisualObj::GetNodeObjId( vtkIdType theVTKID )
 {
   const SMDS_MeshNode* aNode = myMesh->FindNodeVtk( theVTKID );
   return aNode ? aNode->GetID() : -1;
 }
 
-vtkIdType SMESHGUI_PreVisualObj::GetNodeVTKId( int theObjID )
+vtkIdType SMESHGUI_PreVisualObj::GetNodeVTKId( vtkIdType theObjID )
 {
   const SMDS_MeshNode* aNode = myMesh->FindNode( theObjID );
   return aNode ? aNode->GetID() : -1;
 }
 
-vtkIdType SMESHGUI_PreVisualObj::GetElemObjId( int theVTKID )
+vtkIdType SMESHGUI_PreVisualObj::GetElemObjId( vtkIdType theVTKID )
 {
-  return this->GetMesh()->fromVtkToSmds(theVTKID);
+  return this->GetMesh()->FromVtkToSmds(theVTKID);
 }
 
-vtkIdType SMESHGUI_PreVisualObj::GetElemVTKId( int theObjID )
+vtkIdType SMESHGUI_PreVisualObj::GetElemVTKId( vtkIdType theObjID )
 {
   const SMDS_MeshElement* e = myMesh->FindElement(theObjID);
-  return e ? e->getVtkId() : -1;
+  return e ? e->GetVtkID() : -1;
 }
 
 void SMESHGUI_PreVisualObj::ClearEntitiesFlags()