X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMDS%2FSMDS_ElementFactory.cxx;h=4e3081e28e301dd65e9e4bfc162a27ebfde97320;hb=499f29d24922cec66e41b41a0039a954993bc6df;hp=e5e29e065706ed04d6759abc0311db14616d4145;hpb=b09372829929f8f561495d6c16527134971a1909;p=modules%2Fsmesh.git diff --git a/src/SMDS/SMDS_ElementFactory.cxx b/src/SMDS/SMDS_ElementFactory.cxx index e5e29e065..4e3081e28 100644 --- a/src/SMDS/SMDS_ElementFactory.cxx +++ b/src/SMDS/SMDS_ElementFactory.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2021 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 @@ -218,7 +218,7 @@ const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const smIdType id ) co //================================================================================ /*! * \brief Return an SMDS ID by a Vtk one - * \param [inout] vtkID - Vtk ID + * \param [in] vtkID - Vtk ID * \return smIdType - SMDS ID */ //================================================================================ @@ -230,6 +230,18 @@ smIdType SMDS_ElementFactory::FromVtkToSmds( vtkIdType vtkID ) return vtkID + 1; } +//================================================================================ +/*! + * \brief Clear marked flag of all elements + */ +//================================================================================ + +void SMDS_ElementFactory::SetAllNotMarked() +{ + for ( SMDS_ElementChunk& chunk : myChunks ) + chunk.SetAllNotMarked(); +} + //================================================================================ /*! * \brief Mark the element as non-used @@ -637,6 +649,13 @@ void SMDS_ElementChunk::SetVTKID( const SMDS_MeshElement* e, const vtkIdType vtk } myFactory->mySmdsIDs[ vtkID ] = e->GetID() - 1; } + else + { + if ((size_t) e->GetID() <= myFactory->myVtkIDs.size() ) + myFactory->myVtkIDs[ e->GetID() - 1 ] = vtkID; + if ((size_t) vtkID < myFactory->mySmdsIDs.size() ) + myFactory->mySmdsIDs[ vtkID ] = e->GetID() - 1; + } } //================================================================================ @@ -727,6 +746,17 @@ void SMDS_ElementChunk::SetIsMarked( const SMDS_MeshElement* e, bool is ) myMarkedSet[ Index( e )] = is; } +//================================================================================ +/*! + * \brief Clear marked flag of all elements + */ +//================================================================================ + +void SMDS_ElementChunk::SetAllNotMarked() +{ + clearVector( myMarkedSet ); +} + //================================================================================ /*! * \brief Return SMDS_Position of a node on a shape