Salome HOME
projects
/
modules
/
smesh.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'OCCT780'
[modules/smesh.git]
/
src
/
SMDS
/
SMDS_ElementFactory.hxx
diff --git
a/src/SMDS/SMDS_ElementFactory.hxx
b/src/SMDS/SMDS_ElementFactory.hxx
index 517fc268e75d1dce4bb87205d0d682d6887e8f7e..1abc94e023dab7bf5459531b983b77c360985f7f 100644
(file)
--- a/
src/SMDS/SMDS_ElementFactory.hxx
+++ b/
src/SMDS/SMDS_ElementFactory.hxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-202
1 CEA/DEN, EDF R&D
, OPEN CASCADE
+// Copyright (C) 2007-202
4 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
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-40,6
+40,8
@@
#include <vtkType.h>
#include <vtkType.h>
+#include <smIdType.hxx>
+
class SMDS_ElementChunk;
class SMDS_Mesh;
class SMDS_MeshCell;
class SMDS_ElementChunk;
class SMDS_Mesh;
class SMDS_MeshCell;
@@
-67,8
+69,8
@@
protected:
TChunkVector myChunks; // array of chunks of elements
TChunkPtrSet myChunksWithUnused; // sorted chunks having unused elements
std::vector< vtkIdType > myVtkIDs; // myVtkIDs[ smdsID-1 ] == vtkID
TChunkVector myChunks; // array of chunks of elements
TChunkPtrSet myChunksWithUnused; // sorted chunks having unused elements
std::vector< vtkIdType > myVtkIDs; // myVtkIDs[ smdsID-1 ] == vtkID
- std::vector<
int >
mySmdsIDs; // mySmdsIDs[ vtkID ] == smdsID - 1
-
int
myNbUsedElements; // counter of elements
+ std::vector<
smIdType >
mySmdsIDs; // mySmdsIDs[ vtkID ] == smdsID - 1
+
smIdType
myNbUsedElements; // counter of elements
friend class SMDS_ElementChunk;
friend class SMDS_ElementChunk;
@@
-78,25
+80,25
@@
public:
virtual ~SMDS_ElementFactory();
//! Return minimal ID of a non-used element
virtual ~SMDS_ElementFactory();
//! Return minimal ID of a non-used element
-
int
GetFreeID();
+
smIdType
GetFreeID();
//! Return maximal ID of an used element
//! Return maximal ID of an used element
-
int
GetMaxID();
+
smIdType
GetMaxID();
//! Return minimal ID of an used element
//! Return minimal ID of an used element
-
int
GetMinID();
+
smIdType
GetMinID();
//! Return an element by ID. NULL if the element with the given ID is already used
//! Return an element by ID. NULL if the element with the given ID is already used
- SMDS_MeshElement* NewElement( const
int
id );
+ SMDS_MeshElement* NewElement( const
smIdType
id );
//! Return a SMDS_MeshCell by ID. NULL if the cell with the given ID is already used
//! Return a SMDS_MeshCell by ID. NULL if the cell with the given ID is already used
- SMDS_MeshCell* NewCell( const
int
id ) { return static_cast<SMDS_MeshCell*>( NewElement( id )); }
+ SMDS_MeshCell* NewCell( const
smIdType
id ) { return static_cast<SMDS_MeshCell*>( NewElement( id )); }
//! Return an used element by ID. NULL if the element with the given ID is not yet used
//! Return an used element by ID. NULL if the element with the given ID is not yet used
- const SMDS_MeshElement* FindElement( const
int
id ) const;
+ const SMDS_MeshElement* FindElement( const
smIdType
id ) const;
//! Return a number of used elements
//! Return a number of used elements
-
int
NbUsedElements() const { return myNbUsedElements; }
+
smIdType
NbUsedElements() const { return myNbUsedElements; }
//! Return an iterator on all element filtered using a given filter.
// nbElemsToReturn is used to optimize by stopping the iteration as soon as
//! Return an iterator on all element filtered using a given filter.
// nbElemsToReturn is used to optimize by stopping the iteration as soon as
@@
-114,19
+116,21
@@
public:
boost::shared_ptr< ElemIterator > GetShapeIterator( int shapeID,
size_t nbElemsToReturn,
const SMDS_MeshElement* sm1stElem );
boost::shared_ptr< ElemIterator > GetShapeIterator( int shapeID,
size_t nbElemsToReturn,
const SMDS_MeshElement* sm1stElem );
+ //! Clear marked flag of all elements
+ void SetAllNotMarked();
//! Mark the element as non-used
void Free( const SMDS_MeshElement* );
//! Return an SMDS ID by a Vtk one
//! Mark the element as non-used
void Free( const SMDS_MeshElement* );
//! Return an SMDS ID by a Vtk one
-
int
FromVtkToSmds( vtkIdType vtkID );
+
smIdType
FromVtkToSmds( vtkIdType vtkID );
//! De-allocate all elements
virtual void Clear();
//! Remove unused elements located not at the end of the last chunk.
// Minimize allocated memory
//! De-allocate all elements
virtual void Clear();
//! Remove unused elements located not at the end of the last chunk.
// Minimize allocated memory
- virtual void Compact(std::vector<
int
>& idCellsOldToNew);
+ virtual void Compact(std::vector<
smIdType
>& idCellsOldToNew);
//! Return true if Compact() will change IDs of elements
virtual bool CompactChangePointers();
//! Return true if Compact() will change IDs of elements
virtual bool CompactChangePointers();
@@
-149,10
+153,10
@@
public:
~SMDS_NodeFactory();
//! Return a SMDS_MeshNode by ID. NULL if the node with the given ID is already used
~SMDS_NodeFactory();
//! Return a SMDS_MeshNode by ID. NULL if the node with the given ID is already used
- SMDS_MeshNode* NewNode(
int
id ) { return (SMDS_MeshNode*) NewElement(id); }
+ SMDS_MeshNode* NewNode(
smIdType
id ) { return (SMDS_MeshNode*) NewElement(id); }
//! Return an used node by ID. NULL if the node with the given ID is not yet used
//! Return an used node by ID. NULL if the node with the given ID is not yet used
- const SMDS_MeshNode* FindNode(
int
id ) { return (const SMDS_MeshNode*) FindElement(id); }
+ const SMDS_MeshNode* FindNode(
smIdType
id ) { return (const SMDS_MeshNode*) FindElement(id); }
//! Set a total number of sub-shapes in the main shape
void SetNbShapes( size_t nbShapes );
//! Set a total number of sub-shapes in the main shape
void SetNbShapes( size_t nbShapes );
@@
-168,7
+172,7
@@
public:
//! Remove unused nodes located not at the end of the last chunk.
// Minimize allocated memory
//! Remove unused nodes located not at the end of the last chunk.
// Minimize allocated memory
- virtual void Compact(std::vector<
int
>& idNodesOldToNew);
+ virtual void Compact(std::vector<
smIdType
>& idNodesOldToNew);
//! Return true if Compact() will change IDs of node
virtual bool CompactChangePointers();
//! Return true if Compact() will change IDs of node
virtual bool CompactChangePointers();
@@
-277,7
+281,7
@@
struct _RangeSet
rNext = mySet.upper_bound( theIndex );
r = rNext - 1;
}
rNext = mySet.upper_bound( theIndex );
r = rNext - 1;
}
- int
rSize = Size( r ); // range size
+ int rSize = Size( r ); // range size
attr_t rValue = r->myValue;
if ( rValue == theValue )
return rValue; // it happens while compacting
attr_t rValue = r->myValue;
if ( rValue == theValue )
return rValue; // it happens while compacting
@@
-370,7
+374,7
@@
class SMDS_ElementChunk
{
SMDS_ElementFactory* myFactory; // holder of this chunk
SMDS_MeshElement* myElements; // array of elements
{
SMDS_ElementFactory* myFactory; // holder of this chunk
SMDS_MeshElement* myElements; // array of elements
-
int
my1stID; // ID of myElements[0]
+
smIdType
my1stID; // ID of myElements[0]
TBitSet myMarkedSet; // mark some elements
TUsedRangeSet myUsedRanges; // ranges of used/unused elements
TSubIDRangeSet mySubIDRanges; // ranges of elements on the same sub-shape
TBitSet myMarkedSet; // mark some elements
TUsedRangeSet myUsedRanges; // ranges of used/unused elements
TSubIDRangeSet mySubIDRanges; // ranges of elements on the same sub-shape
@@
-381,7
+385,7
@@
class SMDS_ElementChunk
public:
public:
- SMDS_ElementChunk( SMDS_ElementFactory* factory = 0,
int
id0 = 0 );
+ SMDS_ElementChunk( SMDS_ElementFactory* factory = 0,
smIdType
id0 = 0 );
~SMDS_ElementChunk();
//! Return an element by an index [0,ChunkSize()]
~SMDS_ElementChunk();
//! Return an element by an index [0,ChunkSize()]
@@
-391,7
+395,7
@@
public:
const SMDS_MeshElement* Element(int index) const { return & myElements[index]; }
//! Return ID of the first non-used element
const SMDS_MeshElement* Element(int index) const { return & myElements[index]; }
//! Return ID of the first non-used element
-
int
GetUnusedID() const;
+
smIdType
GetUnusedID() const;
//! Mark an element as used
void UseElement( const int index );
//! Mark an element as used
void UseElement( const int index );
@@
-403,10
+407,10
@@
public:
static bool IsUsed( const _UsedRange& r ) { return r.myValue; }
//! Return index of an element in the chunk
static bool IsUsed( const _UsedRange& r ) { return r.myValue; }
//! Return index of an element in the chunk
- int Index( const SMDS_MeshElement* e ) const { return
e - myElements
; }
+ int Index( const SMDS_MeshElement* e ) const { return
(int)( e - myElements )
; }
//! Return ID of the 1st element in the chunk
//! Return ID of the 1st element in the chunk
-
int
Get1stID() const { return my1stID; }
+
smIdType
Get1stID() const { return my1stID; }
//! Return pointer to on-shape-parameters of a node
TParam* GetPositionPtr( const SMDS_MeshElement* node, bool allocate=false );
//! Return pointer to on-shape-parameters of a node
TParam* GetPositionPtr( const SMDS_MeshElement* node, bool allocate=false );
@@
-429,9
+433,9
@@
public:
// Methods called by SMDS_MeshElement
// Methods called by SMDS_MeshElement
-
int
GetID( const SMDS_MeshElement* e ) const;
+
smIdType
GetID( const SMDS_MeshElement* e ) const;
-
int
GetVtkID( const SMDS_MeshElement* e ) const;
+
vtkIdType
GetVtkID( const SMDS_MeshElement* e ) const;
void SetVTKID( const SMDS_MeshElement* e, const vtkIdType id );
int GetShapeID( const SMDS_MeshElement* e ) const;
void SetVTKID( const SMDS_MeshElement* e, const vtkIdType id );
int GetShapeID( const SMDS_MeshElement* e ) const;
@@
-439,6
+443,7
@@
public:
bool IsMarked ( const SMDS_MeshElement* e ) const;
void SetIsMarked( const SMDS_MeshElement* e, bool is );
bool IsMarked ( const SMDS_MeshElement* e ) const;
void SetIsMarked( const SMDS_MeshElement* e, bool is );
+ void SetAllNotMarked();
SMDS_PositionPtr GetPosition( const SMDS_MeshNode* n ) const;
void SetPosition( const SMDS_MeshNode* n, const SMDS_PositionPtr& pos, int shapeID );
SMDS_PositionPtr GetPosition( const SMDS_MeshNode* n ) const;
void SetPosition( const SMDS_MeshNode* n, const SMDS_PositionPtr& pos, int shapeID );
@@
-563,7
+568,7
@@
SMDS_ElementFactory::GetShapeIterator( int shapeID,
size_t nbElemsToReturn,
const SMDS_MeshElement* sm1stElem )
{
size_t nbElemsToReturn,
const SMDS_MeshElement* sm1stElem )
{
-
int
iChunk = sm1stElem ? (( sm1stElem->GetID() - 1 ) / ChunkSize()) : 0;
+
smIdType
iChunk = sm1stElem ? (( sm1stElem->GetID() - 1 ) / ChunkSize()) : 0;
typedef _ChunkIterator< ElemIterator, TSubIDRangeSet > TChuckIterator;
return boost::make_shared< TChuckIterator >( myChunks,
& SMDS_ElementChunk::GetSubIDRangesMinMax,
typedef _ChunkIterator< ElemIterator, TSubIDRangeSet > TChuckIterator;
return boost::make_shared< TChuckIterator >( myChunks,
& SMDS_ElementChunk::GetSubIDRangesMinMax,