Salome HOME
Correct bugs, connected with 0D Elements implementation (IMP 20089, BUG 21300)
authorjfa <jfa@opencascade.com>
Tue, 4 Aug 2009 12:22:34 +0000 (12:22 +0000)
committerjfa <jfa@opencascade.com>
Tue, 4 Aug 2009 12:22:34 +0000 (12:22 +0000)
src/SMDS/SMDSAbs_ElementType.hxx
src/SMDS/SMDS_MeshInfo.hxx
src/SMESH_I/SMESH_Gen_i_1.cxx

index e759adb91a3a550bf0604a75a9e83970ab790c9c..d907064cdc16a4237c78a5541eaa7cafba41b6e6 100644 (file)
@@ -22,7 +22,7 @@
 //  SMESH SMDS : implementaion of Salome mesh data structure
 //  File   : SMDSAbs_ElementType.hxx
 //  Module : SMESH
-//
+
 #ifndef _SMDSAbs_ElementType_HeaderFile
 #define _SMDSAbs_ElementType_HeaderFile
 
@@ -33,10 +33,10 @@ enum SMDSAbs_ElementType
 {
        SMDSAbs_All,
        SMDSAbs_Node,
-        SMDSAbs_0DElement,
        SMDSAbs_Edge,
        SMDSAbs_Face,
        SMDSAbs_Volume,
+        SMDSAbs_0DElement,
         SMDSAbs_NbElementTypes
 };
 
index 2227824883d2e7c722cf53b4774cf14b7a6ea02a..ca0b5ab4c503ba9f5174aefd59824eaf91893bd1 100644 (file)
@@ -100,38 +100,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 +158,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<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=0;
   myNbPolygons=myNbPolyhedrons=0;
 }
+
 inline int // index
 SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes) const
 { return nbNodes + myShift[ type ]; }
@@ -237,8 +244,12 @@ SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const
   case SMDSAbs_Edge:
     nb = myNbEdges + myNbQuadEdges;
     break;
+  case SMDSAbs_0DElement:
+    nb = myNb0DElements;
+    break;
   case SMDSAbs_Node:
     nb = myNbNodes;
+    break;
   default:;
   }
   return nb;
index a001e6a83d4513286831cadd7bfcda906e9f1e4d..bce1e6eb530db0e6d710be26024c952fe16417f5 100644 (file)
@@ -674,8 +674,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr    theStudy
     }
     int aType = (int)theGroup->GetType();
     const char* aRootNames[] = {
-      "Compound Groups", "Groups of Nodes", "Group of 0D Elements",
-      "Groups of Edges", "Groups of Faces", "Groups of Volumes" };
+      "Compound Groups", "Groups of Nodes", "Groups of Edges",
+      "Groups of Faces", "Groups of Volumes", "Groups of 0D Elements" };
 
     // Currently, groups with heterogenous content are not supported
     if ( aType != SMESH::ALL ) {