X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_PreVisualObj.cxx;h=6ce1cbeee93aa846a410005266f15f58ad0ae54c;hp=f1aebce8df8c178ed6819c36cab3be7d763cdb90;hb=HEAD;hpb=6d32f944a0a115b6419184c50b57bf7c4eef5786 diff --git a/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx b/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx index f1aebce8d..3eacc1f17 100644 --- a/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx +++ b/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -22,15 +22,20 @@ #include "SMESHGUI_PreVisualObj.h" -#include +#include #include 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,7 +62,7 @@ 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 { return myMesh->GetMeshInfo().NbElements( theType ); } @@ -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 ) @@ -102,24 +107,24 @@ vtkUnstructuredGrid* SMESHGUI_PreVisualObj::GetUnstructuredGrid() } -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); } -vtkIdType SMESHGUI_PreVisualObj::GetElemVTKId( int theObjID ) +vtkIdType SMESHGUI_PreVisualObj::GetElemVTKId( vtkIdType theObjID ) { const SMDS_MeshElement* e = myMesh->FindElement(theObjID); return e ? e->GetVtkID() : -1;