X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMDS%2FSMDS_MeshInfo.hxx;h=66e7177d24d8eda1e3f4ba6e4c618e90dcd32003;hb=a269dcbbdfa2b052e6f330c7cf51f2b0580e316f;hp=2227824883d2e7c722cf53b4774cf14b7a6ea02a;hpb=4592fecfcf7f19fbb7650f63c49947e0ac9b108b;p=modules%2Fsmesh.git diff --git a/src/SMDS/SMDS_MeshInfo.hxx b/src/SMDS/SMDS_MeshInfo.hxx index 222782488..66e7177d2 100644 --- a/src/SMDS/SMDS_MeshInfo.hxx +++ b/src/SMDS/SMDS_MeshInfo.hxx @@ -41,6 +41,7 @@ public: int NbNodes() const { return myNbNodes; } inline int NbElements(SMDSAbs_ElementType type=SMDSAbs_All) const; + inline int NbEntities(SMDSAbs_EntityType type) const; int Nb0DElements() const { return myNb0DElements; } inline int NbEdges (SMDSAbs_ElementOrder order = ORDER_ANY) const; @@ -100,38 +101,43 @@ inline SMDS_MeshInfo::SMDS_MeshInfo(): myNbPolyhedrons(0) { // Number of nodes in standard element types - // n v f e 0 - // o o a d d - // d l c g - // e e e - // -------------- - // 1 * + // n v f e 0 n + // o o a d d o + // d l c g d + // e e e e + // s + // ----------------- + // 0 * + // 1 . * // 2 * - // 3 * - // 4 * * * + // 3 . * + // 4 * . . // 5 * - // 6 * * + // 6 * . // 7 - // 8 * * + // 8 * . // 9 // 10 * - // 11 - // 12 + // 11 * + // 12 * // 13 * - // 14 + // 14 * // 15 * - // 16 + // 16 * // 17 // 18 // 19 // 20 * // // So to have a unique index for each type basing on nb of nodes, we use a shift: - myShift.resize(SMDSAbs_Volume + 1, 0); - myShift[ SMDSAbs_Face ] = +8; // 3->11, 4->12, 6->14, 8->16 - myShift[ SMDSAbs_Edge ] = -2; // 2->0, 4->2 + myShift.resize(SMDSAbs_NbElementTypes, 0); + + myShift[ SMDSAbs_Face ] = +8; // 3->11, 4->12, 6->14, 8->16 + myShift[ SMDSAbs_Edge ] = -2; // 2->0, 4->2 + myShift[ SMDSAbs_0DElement ] = +2; // 1->3 myNb.resize( index( SMDSAbs_Volume,20 ) + 1, NULL); + myNb[ index( SMDSAbs_Node,1 )] = & myNbNodes; myNb[ index( SMDSAbs_0DElement,1 )] = & myNb0DElements; @@ -153,11 +159,13 @@ inline SMDS_MeshInfo::SMDS_MeshInfo(): myNb[ index( SMDSAbs_Volume, 15)] = & myNbQuadPrisms; myNb[ index( SMDSAbs_Volume, 20)] = & myNbQuadHexas; } + inline void // Clear SMDS_MeshInfo::Clear() { for ( int i=0; i