Salome HOME
Revert "23418: [OCC] Mesh: Minimization of memory usage of SMESH"
[modules/smesh.git] / src / SMESH_I / SMESH_MeshEditor_i.cxx
index 2bd6040631cc82ee6d8b3811d0b2031cb73743fe..d7afbed39f5ec69c7c73eefbbf905161daf70672 100644 (file)
@@ -42,6 +42,7 @@
 #include "SMDS_Mesh0DElement.hxx"
 #include "SMDS_MeshFace.hxx"
 #include "SMDS_MeshVolume.hxx"
+#include "SMDS_PolyhedralVolumeOfNodes.hxx"
 #include "SMDS_SetIterator.hxx"
 #include "SMDS_VolumeTool.hxx"
 #include "SMESHDS_Group.hxx"
@@ -533,9 +534,7 @@ SMESH::MeshPreviewStruct* SMESH_MeshEditor_i::GetPreviewData()
     SMESHDS_Mesh* aMeshDS;
     std::unique_ptr< SMESH_MeshPartDS > aMeshPartDS;
     if ( hasBadElems ) {
-      const list<const SMDS_MeshElement*>& badElems =
-        static_cast<SMESH_BadInputElements*>( getEditor().GetError().get() )->myBadElements;
-      aMeshPartDS.reset( new SMESH_MeshPartDS( badElems ));
+      aMeshPartDS.reset( new SMESH_MeshPartDS( getEditor().GetError()->myBadElements ));
       aMeshDS = aMeshPartDS.get();
     }
     else {
@@ -681,7 +680,7 @@ SMESH::ComputeError* SMESH_MeshEditor_i::GetLastError()
     errOut->code       = -( errIn->myName < 0 ? errIn->myName + 1: errIn->myName ); // -1 -> 0
     errOut->comment    = errIn->myComment.c_str();
     errOut->subShapeID = -1;
-    errOut->hasBadMesh = errIn->HasBadElems();
+    errOut->hasBadMesh = !errIn->myBadElements.empty();
   }
   else
   {
@@ -6964,7 +6963,7 @@ CORBA::Long SMESH_MeshEditor_i::MakeBoundaryElements(SMESH::Bnd_Dimension dim,
   // group of boundary elements
   SMESH_Group* smesh_group = 0;
   SMDSAbs_ElementType elemType = (dim == SMESH::BND_2DFROM3D) ? SMDSAbs_Volume : SMDSAbs_Face;
-  if ( strlen( groupName ))
+  if ( strlen(groupName) )
   {
     SMESH::ElementType groupType = SMESH::ElementType( int(elemType)-1 );
     group_var = mesh_i->CreateGroup( groupType, groupName );