Salome HOME
Bug moteur + ajout cas test
[modules/hexablock.git] / src / HEXABLOCK / HexEltBase.cxx
index 797ceb6110b82e5b4a085f4e51a42b5e47989fcf..5198b49917f9fa59b9bf3380eb0f736dd4d83fc4 100755 (executable)
@@ -80,7 +80,8 @@ void EltBase::remove ()
       return;
 
    el_root->setDeprecated (2);
-   el_type = EL_REMOVED;
+   el_type   = EL_REMOVED;
+   el_status = HERR;
    int nbp = el_parent.size();
    for (int nro=0 ; nro<nbp ; nro++)
        {
@@ -96,7 +97,8 @@ void EltBase::suppress ()
       return;
 
    el_root->setDeprecated (2);
-   el_type = EL_REMOVED;
+   el_type   = EL_REMOVED;
+   el_status = HERR;
 }
 // ========================================================= getName
 cpchar EltBase::getName  ()
@@ -126,14 +128,9 @@ void EltBase::printName  (cpchar sep)
 // ========================================================= dumpRef
 void EltBase::dumpRef ()
 {
-   int nbp = el_parent.size();
+   int  nbp   = el_parent.size();
    bool prems = true;
 
-   if (nbp==0)
-      {
-      printf ("\n");
-      }
-
    for (int nro=0 ; nro<nbp ; nro++)
        {
        if (el_parent[nro]->isHere ())
@@ -163,9 +160,10 @@ void EltBase::setId (int ln)
 // ========================================================= makeVarName
 char* EltBase::makeVarName (char* nom)
 {
-   static cpchar PREFIX[]  = {"Undef", "Node",  "Edge",  "Quad",  "Hexa",
-                              "Vect",  "Grid",  "Cyl",  "Pipe", "Group", "Law",
-                              "Xxxx",  "Xxxx",  "Xxxx" };
+   static cpchar PREFIX [EL_MAXI] = {"undef", "ver",   "edge",  "quad",  "hexa",
+                                     "vect",  "grid",  "cyl",  "pipe", "group",
+                                     "law", "shape", "subsh", "prop",
+                                     "doc",  "Xxxx" };
    sprintf (nom, "%s%d", PREFIX[el_type], el_id);
    return   nom;
 }
@@ -174,5 +172,15 @@ bool EltBase::debug (int niv)
 {
    return el_root != NULL && el_root->getLevel() > niv ;
 }
+// ========================================================= getNextName
+string EltBase::getNextName ()
+{
+   if (el_root != NULL)
+      return el_root->getNextName (el_type);
+
+   char name [16];
+   makeName  (el_type, 0, name);
+   return string (name);
+}
 END_NAMESPACE_HEXA