mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-28 02:10:35 +05:00
Fix for id shitf +2147483647
This commit is contained in:
parent
9216aa146e
commit
44811efade
@ -39,8 +39,6 @@ namespace
|
||||
|
||||
const int theDefaultShapeDim = 3;
|
||||
|
||||
const smIdType idShift = 2147483647;
|
||||
|
||||
// classes allowing to modify parameters of SMDS_Position stored in SMDS_ElementFactory
|
||||
|
||||
struct _EdgePosition : public SMDS_EdgePosition
|
||||
@ -230,7 +228,7 @@ const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const smIdType ID ) co
|
||||
|
||||
smIdType SMDS_ElementFactory::FromVtkToSmds( vtkIdType VTKID )
|
||||
{
|
||||
vtkIdType vtkID = VTKID - idShift;
|
||||
vtkIdType vtkID = VTKID;
|
||||
if ( vtkID >= 0 && vtkID < (vtkIdType)mySmdsIDs.size() )
|
||||
return mySmdsIDs[vtkID] + 1;
|
||||
return vtkID + 1 + idShift;
|
||||
@ -251,7 +249,7 @@ void SMDS_ElementFactory::Free( const SMDS_MeshElement* e )
|
||||
if ( !myVtkIDs.empty() )
|
||||
{
|
||||
size_t id = e->GetID() - 1 - idShift;
|
||||
size_t vtkID = e->GetVtkID() - idShift;
|
||||
size_t vtkID = e->GetVtkID();
|
||||
if ( id < myVtkIDs.size() )
|
||||
myVtkIDs[ id ] = -1;
|
||||
if ( vtkID < mySmdsIDs.size() )
|
||||
|
@ -53,6 +53,10 @@ struct _ChunkCompare {
|
||||
typedef boost::ptr_vector<SMDS_ElementChunk> TChunkVector;
|
||||
typedef std::set<SMDS_ElementChunk*,_ChunkCompare> TChunkPtrSet;
|
||||
|
||||
const smIdType idShift = 2147483647;
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
/*!
|
||||
* \brief Allocate SMDS_MeshElement's (SMDS_MeshCell's or SMDS_MeshNode's )
|
||||
@ -565,7 +569,7 @@ SMDS_ElementFactory::GetShapeIterator( int shapeID,
|
||||
size_t nbElemsToReturn,
|
||||
const SMDS_MeshElement* sm1stElem )
|
||||
{
|
||||
smIdType iChunk = sm1stElem ? (( sm1stElem->GetID() - 1 ) / ChunkSize()) : 0;
|
||||
smIdType iChunk = sm1stElem ? (( sm1stElem->GetID() - 1 - idShift) / ChunkSize()) : 0;
|
||||
typedef _ChunkIterator< ElemIterator, TSubIDRangeSet > TChuckIterator;
|
||||
return boost::make_shared< TChuckIterator >( myChunks,
|
||||
& SMDS_ElementChunk::GetSubIDRangesMinMax,
|
||||
|
@ -1000,7 +1000,7 @@ const SMDS_MeshNode * SMDS_Mesh::FindNode(smIdType ID) const
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(vtkIdType vtkId) const
|
||||
{
|
||||
return myNodeFactory->FindNode( vtkId + 1 );
|
||||
return myNodeFactory->FindNode( FromVtkToSmds( vtkId ));
|
||||
}
|
||||
|
||||
const SMDS_MeshElement * SMDS_Mesh::FindElementVtk(vtkIdType IDelem) const
|
||||
|
Loading…
Reference in New Issue
Block a user