+{ return order == ORDER_ANY ? myNbPrisms+myNbQuadPrisms+myNbBiQuadPrisms: order == ORDER_LINEAR ? myNbPrisms : myNbQuadPrisms+myNbBiQuadPrisms; }
+
+inline int // NbHexPrisms
+SMDS_MeshInfo::NbHexPrisms (SMDSAbs_ElementOrder order) const
+{ return order == ORDER_ANY ? myNbHexPrism : order == ORDER_LINEAR ? myNbHexPrism : 0; }
+
+inline int // NbElements
+SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const
+{
+ int nb = 0;
+ switch (type) {
+ case SMDSAbs_All:
+ for ( size_t i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i];
+ nb += myNbPolygons + myNbQuadPolygons + myNbPolyhedrons;
+ break;
+ case SMDSAbs_Volume:
+ nb = ( myNbTetras+ myNbPyramids+ myNbPrisms+ myNbHexas+ myNbHexPrism+
+ myNbQuadTetras+ myNbQuadPyramids+ myNbQuadPrisms+ myNbBiQuadPrisms + myNbQuadHexas+ myNbTriQuadHexas+
+ myNbPolyhedrons );
+ break;
+ case SMDSAbs_Face:
+ nb = ( myNbTriangles+ myNbQuadrangles+
+ myNbQuadTriangles+ myNbBiQuadTriangles+
+ myNbQuadQuadrangles+ myNbBiQuadQuadrangles+ myNbPolygons+ myNbQuadPolygons );
+ break;
+ case SMDSAbs_Edge:
+ nb = myNbEdges + myNbQuadEdges;
+ break;
+ case SMDSAbs_Node:
+ nb = myNbNodes;
+ break;
+ case SMDSAbs_0DElement:
+ nb = myNb0DElements;
+ break;
+ case SMDSAbs_Ball:
+ nb = myNbBalls;
+ break;
+ default:;
+ }
+ return nb;
+}
+
+inline int // NbEntities
+SMDS_MeshInfo::NbEntities(SMDSAbs_EntityType type) const
+{
+ switch (type) {
+ case SMDSEntity_Node: return myNbNodes;
+ case SMDSEntity_Edge: return myNbEdges;
+ case SMDSEntity_Quad_Edge: return myNbQuadEdges;
+ case SMDSEntity_Triangle: return myNbTriangles;
+ case SMDSEntity_Quad_Triangle: return myNbQuadTriangles;
+ case SMDSEntity_BiQuad_Triangle: return myNbBiQuadTriangles;
+ case SMDSEntity_Quadrangle: return myNbQuadrangles;
+ case SMDSEntity_Quad_Quadrangle: return myNbQuadQuadrangles;
+ case SMDSEntity_BiQuad_Quadrangle:return myNbBiQuadQuadrangles;
+ case SMDSEntity_Polygon: return myNbPolygons;
+ case SMDSEntity_Tetra: return myNbTetras;
+ case SMDSEntity_Quad_Tetra: return myNbQuadTetras;
+ case SMDSEntity_Pyramid: return myNbPyramids;
+ case SMDSEntity_Quad_Pyramid: return myNbQuadPyramids;
+ case SMDSEntity_Hexa: return myNbHexas;
+ case SMDSEntity_Quad_Hexa: return myNbQuadHexas;
+ case SMDSEntity_TriQuad_Hexa: return myNbTriQuadHexas;
+ case SMDSEntity_Penta: return myNbPrisms;
+ case SMDSEntity_Quad_Penta: return myNbQuadPrisms;
+ case SMDSEntity_BiQuad_Penta: return myNbBiQuadPrisms;
+ case SMDSEntity_Hexagonal_Prism: return myNbHexPrism;
+ case SMDSEntity_Polyhedra: return myNbPolyhedrons;
+ case SMDSEntity_0D: return myNb0DElements;
+ case SMDSEntity_Ball: return myNbBalls;
+ case SMDSEntity_Quad_Polygon: return myNbQuadPolygons;
+ case SMDSEntity_Quad_Polyhedra:
+ case SMDSEntity_Last:
+ break;
+ }
+ return 0;
+}
+
+inline int // NbElementsOfGeom
+SMDS_MeshInfo::NbElementsOfGeom(SMDSAbs_GeometryType geom) const
+{
+ switch ( geom ) {
+ // 0D:
+ case SMDSGeom_POINT: return myNb0DElements;
+ // 1D:
+ case SMDSGeom_EDGE: return (myNbEdges +
+ myNbQuadEdges);
+ // 2D:
+ case SMDSGeom_TRIANGLE: return (myNbTriangles +
+ myNbQuadTriangles +
+ myNbBiQuadTriangles );
+ case SMDSGeom_QUADRANGLE: return (myNbQuadrangles +
+ myNbQuadQuadrangles +
+ myNbBiQuadQuadrangles );
+ case SMDSGeom_POLYGON: return (myNbPolygons + myNbQuadPolygons );
+ // 3D:
+ case SMDSGeom_TETRA: return (myNbTetras +
+ myNbQuadTetras);
+ case SMDSGeom_PYRAMID: return (myNbPyramids +
+ myNbQuadPyramids);
+ case SMDSGeom_HEXA: return (myNbHexas +
+ myNbQuadHexas +
+ myNbTriQuadHexas);
+ case SMDSGeom_PENTA: return (myNbPrisms +
+ myNbQuadPrisms +
+ myNbBiQuadPrisms);
+ case SMDSGeom_HEXAGONAL_PRISM: return myNbHexPrism;
+ case SMDSGeom_POLYHEDRA: return myNbPolyhedrons;
+ // Discrete:
+ case SMDSGeom_BALL: return myNbBalls;
+ //
+ case SMDSGeom_NONE:
+ default:;
+ }
+ return 0;
+}
+
+inline void // setNb
+SMDS_MeshInfo::setNb(const SMDSAbs_EntityType geomType, const int nb)
+{
+ switch (geomType) {
+ case SMDSEntity_Node: myNbNodes = nb; break;
+ case SMDSEntity_0D: myNb0DElements = nb; break;
+ case SMDSEntity_Ball: myNbBalls = nb; break;
+ case SMDSEntity_BiQuad_Quadrangle:myNbBiQuadQuadrangles = nb; break;
+ case SMDSEntity_BiQuad_Triangle: myNbBiQuadTriangles = nb; break;
+ case SMDSEntity_Edge: myNbEdges = nb; break;
+ case SMDSEntity_Hexa: myNbHexas = nb; break;
+ case SMDSEntity_Hexagonal_Prism: myNbHexPrism = nb; break;
+ case SMDSEntity_Penta: myNbPrisms = nb; break;
+ case SMDSEntity_Polygon: myNbPolygons = nb; break;
+ case SMDSEntity_Polyhedra: myNbPolyhedrons = nb; break;
+ case SMDSEntity_Pyramid: myNbPyramids = nb; break;
+ case SMDSEntity_Quad_Edge: myNbQuadEdges = nb; break;
+ case SMDSEntity_Quad_Hexa: myNbQuadHexas = nb; break;
+ case SMDSEntity_Quad_Penta: myNbQuadPrisms = nb; break;
+ case SMDSEntity_BiQuad_Penta: myNbBiQuadPrisms = nb; break;
+ case SMDSEntity_Quad_Pyramid: myNbQuadPyramids = nb; break;
+ case SMDSEntity_Quad_Quadrangle: myNbQuadQuadrangles = nb; break;
+ case SMDSEntity_Quad_Tetra: myNbQuadTetras = nb; break;
+ case SMDSEntity_Quad_Triangle: myNbQuadTriangles = nb; break;
+ case SMDSEntity_Quadrangle: myNbQuadrangles = nb; break;
+ case SMDSEntity_Tetra: myNbTetras = nb; break;
+ case SMDSEntity_TriQuad_Hexa: myNbTriQuadHexas = nb; break;
+ case SMDSEntity_Triangle: myNbTriangles = nb; break;
+ case SMDSEntity_Quad_Polygon: myNbQuadPolygons = nb; break;
+ case SMDSEntity_Quad_Polyhedra:
+ case SMDSEntity_Last:
+ break;
+ }
+}