correct SMDS_MeshInfo, SMDS_Mesh

This commit is contained in:
Viktor UZLOV 2021-01-27 18:34:57 +03:00
parent 3ec8ebee18
commit 964d47b2a0
2 changed files with 73 additions and 72 deletions

View File

@ -815,9 +815,9 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids, SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<smIdType> & nodes_ids,
const smIdType ID) const smIdType ID)
{ {
int nbNodes = nodes_ids.size(); smIdType nbNodes = nodes_ids.size();
std::vector<const SMDS_MeshNode*> nodes (nbNodes); std::vector<const SMDS_MeshNode*> nodes (nbNodes);
for (int i = 0; i < nbNodes; i++) { for (smIdType i = 0; i < nbNodes; i++) {
nodes[i] = myNodeFactory->FindNode( nodes_ids[i] ); nodes[i] = myNodeFactory->FindNode( nodes_ids[i] );
if (!nodes[i]) return NULL; if (!nodes[i]) return NULL;
} }
@ -911,9 +911,9 @@ SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector<smIdTy
const std::vector<int> & quantities, const std::vector<int> & quantities,
const smIdType ID) const smIdType ID)
{ {
int nbNodes = nodes_ids.size(); smIdType nbNodes = nodes_ids.size();
std::vector<const SMDS_MeshNode*> nodes (nbNodes); std::vector<const SMDS_MeshNode*> nodes (nbNodes);
for (int i = 0; i < nbNodes; i++) { for (smIdType i = 0; i < nbNodes; i++) {
nodes[i] = myNodeFactory->FindNode(nodes_ids[i]); nodes[i] = myNodeFactory->FindNode(nodes_ids[i]);
if (!nodes[i]) return NULL; if (!nodes[i]) return NULL;
} }
@ -1589,7 +1589,7 @@ SMDS_NodeIteratorPtr SMDS_Mesh::nodesIterator() const
SMDS_ElemIteratorPtr SMDS_Mesh::elementGeomIterator(SMDSAbs_GeometryType type) const SMDS_ElemIteratorPtr SMDS_Mesh::elementGeomIterator(SMDSAbs_GeometryType type) const
{ {
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
return myCellFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::GeomFilter( type ), return myCellFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::GeomFilter( type ),
nbElems); nbElems);
} }
@ -1600,7 +1600,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementEntityIterator(SMDSAbs_EntityType type) c
{ {
return myNodeFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::NonNullFilter ); return myNodeFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::NonNullFilter );
} }
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
return myCellFactory->GetIterator<SMDS_ElemIterator>( new SMDS_MeshElement::EntityFilter( type ), return myCellFactory->GetIterator<SMDS_ElemIterator>( new SMDS_MeshElement::EntityFilter( type ),
nbElems); nbElems);
} }
@ -1620,7 +1620,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const
return myNodeFactory->GetIterator< TIterator >( new SMDS_MeshElement::NonNullFilter ); return myNodeFactory->GetIterator< TIterator >( new SMDS_MeshElement::NonNullFilter );
default: default:
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type );
return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( type ), return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( type ),
nbElems); nbElems);
} }
@ -1634,7 +1634,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const
SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const
{ {
typedef SMDS_EdgeIterator TIterator; typedef SMDS_EdgeIterator TIterator;
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbEdges(); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbEdges();
return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Edge ), return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Edge ),
nbElems); nbElems);
} }
@ -1646,7 +1646,7 @@ SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const
SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const
{ {
typedef SMDS_FaceIterator TIterator; typedef SMDS_FaceIterator TIterator;
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbFaces(); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbFaces();
return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Face ), return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Face ),
nbElems); nbElems);
} }
@ -1658,7 +1658,7 @@ SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const
SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator() const SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator() const
{ {
typedef SMDS_VolumeIterator TIterator; typedef SMDS_VolumeIterator TIterator;
int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes(); smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes();
return return
myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Volume ), myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Volume ),
nbElems ); nbElems );
@ -1705,7 +1705,7 @@ intersectionOfSets( std::set<const SMDS_MeshElement*> vs[], int numberOfSets )
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
static std::set<const SMDS_MeshElement*> * getFinitElements(const SMDS_MeshElement * element) static std::set<const SMDS_MeshElement*> * getFinitElements(const SMDS_MeshElement * element)
{ {
int numberOfSets=element->NbNodes(); smIdType numberOfSets=element->NbNodes();
std::set<const SMDS_MeshElement*> *initSet = new std::set<const SMDS_MeshElement*>[numberOfSets]; std::set<const SMDS_MeshElement*> *initSet = new std::set<const SMDS_MeshElement*>[numberOfSets];
SMDS_NodeIteratorPtr itNodes = element->nodeIterator(); SMDS_NodeIteratorPtr itNodes = element->nodeIterator();
@ -2973,16 +2973,16 @@ void SMDS_Mesh::CompactMesh()
for ( ; holder != myElemHolders.end(); ++holder ) for ( ; holder != myElemHolders.end(); ++holder )
(*holder)->beforeCompacting(); (*holder)->beforeCompacting();
} }
int oldCellSize = myCellFactory->GetMaxID(); smIdType oldCellSize = myCellFactory->GetMaxID();
// remove "holes" in SMDS numeration // remove "holes" in SMDS numeration
std::vector<int> idNodesOldToNew, idCellsNewToOld, idCellsOldToNew; std::vector<smIdType> idNodesOldToNew, idCellsNewToOld, idCellsOldToNew;
myNodeFactory->Compact( idNodesOldToNew ); myNodeFactory->Compact( idNodesOldToNew );
myCellFactory->Compact( idCellsNewToOld ); myCellFactory->Compact( idCellsNewToOld );
// make VTK IDs correspond to SMDS IDs // make VTK IDs correspond to SMDS IDs
int newNodeSize = myNodeFactory->NbUsedElements(); smIdType newNodeSize = myNodeFactory->NbUsedElements();
int newCellSize = myCellFactory->NbUsedElements(); smIdType newCellSize = myCellFactory->NbUsedElements();
myGrid->compactGrid( idNodesOldToNew, newNodeSize, idCellsNewToOld, newCellSize ); myGrid->compactGrid( idNodesOldToNew, newNodeSize, idCellsNewToOld, newCellSize );
if ( idsChange && !myElemHolders.empty() ) if ( idsChange && !myElemHolders.empty() )

View File

@ -30,6 +30,7 @@
#include "SMDS_MeshElement.hxx" #include "SMDS_MeshElement.hxx"
#include<utilities.h> #include<utilities.h>
#include <smIdType.hxx>
class SMDS_EXPORT SMDS_MeshInfo class SMDS_EXPORT SMDS_MeshInfo
{ {
@ -39,39 +40,39 @@ public:
inline SMDS_MeshInfo& operator=(const SMDS_MeshInfo& other); inline SMDS_MeshInfo& operator=(const SMDS_MeshInfo& other);
inline void Clear(); inline void Clear();
inline int NbElements(SMDSAbs_ElementType type=SMDSAbs_All) const; inline smIdType NbElements(SMDSAbs_ElementType type=SMDSAbs_All) const;
inline int NbElements(SMDSAbs_EntityType type) const { return NbEntities(type); } inline smIdType NbElements(SMDSAbs_EntityType type) const { return NbEntities(type); }
inline int NbElements(SMDSAbs_GeometryType type) const { return NbElementsOfGeom(type); } inline smIdType NbElements(SMDSAbs_GeometryType type) const { return NbElementsOfGeom(type); }
inline int NbEntities(SMDSAbs_EntityType type) const; inline smIdType NbEntities(SMDSAbs_EntityType type) const;
inline int NbElementsOfGeom(SMDSAbs_GeometryType geom) const; inline smIdType NbElementsOfGeom(SMDSAbs_GeometryType geom) const;
int NbNodes() const { return myNbNodes; } smIdType NbNodes() const { return myNbNodes; }
int Nb0DElements() const { return myNb0DElements; } smIdType Nb0DElements() const { return myNb0DElements; }
int NbBalls() const { return myNbBalls; } smIdType NbBalls() const { return myNbBalls; }
inline int NbEdges (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbEdges (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbFaces (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbFaces (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbTriangles (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbTriangles (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbBiQuadTriangles() const { return myNbBiQuadTriangles; } smIdType NbBiQuadTriangles() const { return myNbBiQuadTriangles; }
int NbBiQuadQuadrangles() const { return myNbBiQuadQuadrangles; } smIdType NbBiQuadQuadrangles() const { return myNbBiQuadQuadrangles; }
inline int NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbVolumes (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbVolumes (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbTetras (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbTetras (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbHexas (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbHexas (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const;
inline int NbHexPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const; inline smIdType NbHexPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
int NbTriQuadHexas() const { return myNbTriQuadHexas; } smIdType NbTriQuadHexas() const { return myNbTriQuadHexas; }
int NbQuadPrisms() const { return myNbQuadPrisms; } smIdType NbQuadPrisms() const { return myNbQuadPrisms; }
int NbBiQuadPrisms() const { return myNbBiQuadPrisms; } smIdType NbBiQuadPrisms() const { return myNbBiQuadPrisms; }
int NbPolyhedrons() const { return myNbPolyhedrons; } smIdType NbPolyhedrons() const { return myNbPolyhedrons; }
protected: protected:
inline void addWithPoly(const SMDS_MeshElement* el); inline void addWithPoly(const SMDS_MeshElement* el);
inline void setNb(const SMDSAbs_EntityType geomType, const int nb); inline void setNb(const SMDSAbs_EntityType geomType, const smIdType nb);
private: private:
friend class SMDS_Mesh; friend class SMDS_Mesh;
@ -79,27 +80,27 @@ private:
// methods to count NOT POLY elements // methods to count NOT POLY elements
inline void remove(const SMDS_MeshElement* el); inline void remove(const SMDS_MeshElement* el);
inline void add (const SMDS_MeshElement* el); inline void add (const SMDS_MeshElement* el);
inline int index(SMDSAbs_ElementType type, int nbNodes) const; inline smIdType index(SMDSAbs_ElementType type, smIdType nbNodes) const;
// methods to remove elements of ANY kind // methods to remove elements of ANY kind
inline void RemoveEdge(const SMDS_MeshElement* el); inline void RemoveEdge(const SMDS_MeshElement* el);
inline void RemoveFace(const SMDS_MeshElement* el); inline void RemoveFace(const SMDS_MeshElement* el);
inline void RemoveVolume(const SMDS_MeshElement* el); inline void RemoveVolume(const SMDS_MeshElement* el);
int myNbNodes; smIdType myNbNodes;
int myNb0DElements; smIdType myNb0DElements;
int myNbBalls; smIdType myNbBalls;
int myNbEdges , myNbQuadEdges ; smIdType myNbEdges , myNbQuadEdges ;
int myNbTriangles , myNbQuadTriangles, myNbBiQuadTriangles ; smIdType myNbTriangles , myNbQuadTriangles, myNbBiQuadTriangles ;
int myNbQuadrangles, myNbQuadQuadrangles, myNbBiQuadQuadrangles; smIdType myNbQuadrangles, myNbQuadQuadrangles, myNbBiQuadQuadrangles;
int myNbPolygons , myNbQuadPolygons; smIdType myNbPolygons , myNbQuadPolygons;
int myNbTetras , myNbQuadTetras ; smIdType myNbTetras , myNbQuadTetras ;
int myNbHexas , myNbQuadHexas, myNbTriQuadHexas; smIdType myNbHexas , myNbQuadHexas, myNbTriQuadHexas;
int myNbPyramids, myNbQuadPyramids; smIdType myNbPyramids, myNbQuadPyramids;
int myNbPrisms , myNbQuadPrisms, myNbBiQuadPrisms; smIdType myNbPrisms , myNbQuadPrisms, myNbBiQuadPrisms;
int myNbHexPrism; smIdType myNbHexPrism;
int myNbPolyhedrons; smIdType myNbPolyhedrons;
std::vector<int*> myNb; // pointers to myNb... fields std::vector<int*> myNb; // pointers to myNb... fields
std::vector<int> myShift; // shift to get an index in myNb by elem->NbNodes() std::vector<int> myShift; // shift to get an index in myNb by elem->NbNodes()
@ -212,8 +213,8 @@ SMDS_MeshInfo::Clear()
myNbPolygons=myNbQuadPolygons=myNbPolyhedrons=0; myNbPolygons=myNbQuadPolygons=myNbPolyhedrons=0;
} }
inline int // index inline smIdType // index
SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes) const SMDS_MeshInfo::index(SMDSAbs_ElementType type, smIdType nbNodes) const
{ return nbNodes + myShift[ type ]; } { return nbNodes + myShift[ type ]; }
inline void // remove inline void // remove
@ -250,54 +251,54 @@ inline void // RemoveVolume
SMDS_MeshInfo::RemoveVolume(const SMDS_MeshElement* el) SMDS_MeshInfo::RemoveVolume(const SMDS_MeshElement* el)
{ if ( el->IsPoly() ) --myNbPolyhedrons; else remove( el ); } { if ( el->IsPoly() ) --myNbPolyhedrons; else remove( el ); }
inline int // NbEdges inline smIdType // NbEdges
SMDS_MeshInfo::NbEdges (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbEdges (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbEdges+myNbQuadEdges : order == ORDER_LINEAR ? myNbEdges : myNbQuadEdges; } { return order == ORDER_ANY ? myNbEdges+myNbQuadEdges : order == ORDER_LINEAR ? myNbEdges : myNbQuadEdges; }
inline int // NbFaces inline smIdType // NbFaces
SMDS_MeshInfo::NbFaces (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbFaces (SMDSAbs_ElementOrder order) const
{ return NbTriangles(order)+NbQuadrangles(order)+(order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons ); } { return NbTriangles(order)+NbQuadrangles(order)+(order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons ); }
inline int // NbTriangles inline smIdType // NbTriangles
SMDS_MeshInfo::NbTriangles (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbTriangles (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbTriangles+myNbQuadTriangles+myNbBiQuadTriangles : order == ORDER_LINEAR ? myNbTriangles : myNbQuadTriangles+myNbBiQuadTriangles; } { return order == ORDER_ANY ? myNbTriangles+myNbQuadTriangles+myNbBiQuadTriangles : order == ORDER_LINEAR ? myNbTriangles : myNbQuadTriangles+myNbBiQuadTriangles; }
inline int // NbQuadrangles inline smIdType // NbQuadrangles
SMDS_MeshInfo::NbQuadrangles(SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbQuadrangles(SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbQuadrangles+myNbQuadQuadrangles+myNbBiQuadQuadrangles : order == ORDER_LINEAR ? myNbQuadrangles : myNbQuadQuadrangles+myNbBiQuadQuadrangles; } { return order == ORDER_ANY ? myNbQuadrangles+myNbQuadQuadrangles+myNbBiQuadQuadrangles : order == ORDER_LINEAR ? myNbQuadrangles : myNbQuadQuadrangles+myNbBiQuadQuadrangles; }
inline int // NbPolygons inline smIdType // NbPolygons
SMDS_MeshInfo::NbPolygons(SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbPolygons(SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons; } { return order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons; }
inline int // NbVolumes inline smIdType // NbVolumes
SMDS_MeshInfo::NbVolumes (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbVolumes (SMDSAbs_ElementOrder order) const
{ return NbTetras(order) + NbHexas(order) + NbPyramids(order) + NbPrisms(order) + NbHexPrisms(order) + (order == ORDER_QUADRATIC ? 0 : myNbPolyhedrons); } { return NbTetras(order) + NbHexas(order) + NbPyramids(order) + NbPrisms(order) + NbHexPrisms(order) + (order == ORDER_QUADRATIC ? 0 : myNbPolyhedrons); }
inline int // NbTetras inline smIdType // NbTetras
SMDS_MeshInfo::NbTetras (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbTetras (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbTetras+myNbQuadTetras : order == ORDER_LINEAR ? myNbTetras : myNbQuadTetras; } { return order == ORDER_ANY ? myNbTetras+myNbQuadTetras : order == ORDER_LINEAR ? myNbTetras : myNbQuadTetras; }
inline int // NbHexas inline smIdType // NbHexas
SMDS_MeshInfo::NbHexas (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbHexas (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbHexas+myNbQuadHexas+myNbTriQuadHexas : order == ORDER_LINEAR ? myNbHexas : myNbQuadHexas+myNbTriQuadHexas; } { return order == ORDER_ANY ? myNbHexas+myNbQuadHexas+myNbTriQuadHexas : order == ORDER_LINEAR ? myNbHexas : myNbQuadHexas+myNbTriQuadHexas; }
inline int // NbPyramids inline smIdType // NbPyramids
SMDS_MeshInfo::NbPyramids(SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbPyramids(SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbPyramids+myNbQuadPyramids : order == ORDER_LINEAR ? myNbPyramids : myNbQuadPyramids; } { return order == ORDER_ANY ? myNbPyramids+myNbQuadPyramids : order == ORDER_LINEAR ? myNbPyramids : myNbQuadPyramids; }
inline int // NbPrisms inline smIdType // NbPrisms
SMDS_MeshInfo::NbPrisms (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbPrisms (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbPrisms+myNbQuadPrisms+myNbBiQuadPrisms: order == ORDER_LINEAR ? myNbPrisms : myNbQuadPrisms+myNbBiQuadPrisms; } { return order == ORDER_ANY ? myNbPrisms+myNbQuadPrisms+myNbBiQuadPrisms: order == ORDER_LINEAR ? myNbPrisms : myNbQuadPrisms+myNbBiQuadPrisms; }
inline int // NbHexPrisms inline smIdType // NbHexPrisms
SMDS_MeshInfo::NbHexPrisms (SMDSAbs_ElementOrder order) const SMDS_MeshInfo::NbHexPrisms (SMDSAbs_ElementOrder order) const
{ return order == ORDER_ANY ? myNbHexPrism : order == ORDER_LINEAR ? myNbHexPrism : 0; } { return order == ORDER_ANY ? myNbHexPrism : order == ORDER_LINEAR ? myNbHexPrism : 0; }
inline int // NbElements inline smIdType // NbElements
SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const
{ {
int nb = 0; smIdType nb = 0;
switch (type) { switch (type) {
case SMDSAbs_All: case SMDSAbs_All:
for ( size_t i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i]; for ( size_t i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i];
@ -330,7 +331,7 @@ SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const
return nb; return nb;
} }
inline int // NbEntities inline smIdType // NbEntities
SMDS_MeshInfo::NbEntities(SMDSAbs_EntityType type) const SMDS_MeshInfo::NbEntities(SMDSAbs_EntityType type) const
{ {
switch (type) { switch (type) {
@ -366,7 +367,7 @@ SMDS_MeshInfo::NbEntities(SMDSAbs_EntityType type) const
return 0; return 0;
} }
inline int // NbElementsOfGeom inline smIdType // NbElementsOfGeom
SMDS_MeshInfo::NbElementsOfGeom(SMDSAbs_GeometryType geom) const SMDS_MeshInfo::NbElementsOfGeom(SMDSAbs_GeometryType geom) const
{ {
switch ( geom ) { switch ( geom ) {