Salome HOME
Updated copyright comment
[modules/hexablock.git] / src / HEXABLOCK / HexDocument_trans.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 201351f..eaaf08e
@@ -1,12 +1,12 @@
 
 // C++ : La clase principale de Hexa
 
-// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -28,7 +28,6 @@
 #include "HexHexa.hxx"
 
 #include "HexElements.hxx"
-#include "HexCrossElements.hxx"
 
 #include "HexVector.hxx"
 #include "HexMatrix.hxx"
@@ -221,13 +220,29 @@ int Document::removeHexa (Hexa* cell)
    DumpStart ("removeHexa", cell);
 
    int ier = HOK;
-   if (cell==NULL)
+   if (BadElement (cell))
+      {
       ier = HERR;
-   else
-      cell->remove ();
+      DumpReturn (ier);
+      return ier;
+      }
 
-   DumpReturn (ier);
-   return ier;
+   update ();
+   Quads menage;
+   for (int nro = 0 ; nro < HQ_MAXI ; ++nro)
+       {
+       Quad* quad = cell->getQuad (nro);
+       if (EltIsValid(quad) && quad->getNbrParents()<=1)
+          menage.push_back (quad);
+       }
+
+   cell->remove ();
+   int nbdel = menage.size();
+   for (int nro = 0 ; nro < nbdel ; ++nro)
+       menage[nro]->remove();
+
+   DumpReturn (HOK);
+   return HOK;
 }
 // ========================================================= removeQuad
 int Document::removeQuad (Quad* cell)