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
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;
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() )
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 )
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,
///////////////////////////////////////////////////////////////////////////////
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