Salome HOME
fix "Clear mesh data"
authoreap <eap@opencascade.com>
Thu, 16 Oct 2008 07:32:41 +0000 (07:32 +0000)
committereap <eap@opencascade.com>
Thu, 16 Oct 2008 07:32:41 +0000 (07:32 +0000)
src/SMDS/SMDS_Mesh.cxx
src/SMDS/SMDS_MeshInfo.hxx

index 1283fb5e365d1aae27338e20f39b3ecad20e77b5..0b1e3cf9d0ecf42bc2da2042198948c9a22e52e4 100644 (file)
@@ -1928,7 +1928,7 @@ void SMDS_Mesh::Clear()
   while(itc!=myChildren.end())
     (*itc)->Clear();
 
-  myInfo = SMDS_MeshInfo();
+  myInfo.Clear();
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index 8f541c26728a6c60304f27132e49380773792167..7ef925f1727885f6bdec22135e3f04e5f5eb4270 100644 (file)
@@ -2,11 +2,11 @@
 // Created   : Mon Sep 24 18:32:41 2007
 // Author    : Edward AGAPOV (eap)
 
-using namespace std;
-
 #ifndef SMDS_MeshInfo_HeaderFile
 #define SMDS_MeshInfo_HeaderFile
 
+using namespace std;
+
 #include "SMESH_SMDS.hxx"
 
 #include "SMDS_MeshElement.hxx"
@@ -16,6 +16,7 @@ class SMDS_EXPORT SMDS_MeshInfo
 public:
 
   inline SMDS_MeshInfo();
+  inline void Clear();
 
   int NbNodes() const { return myNbNodes; }
 
@@ -125,6 +126,9 @@ 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; }
 
 inline int // index
 SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes)