Salome HOME
Updated copyright comment
[modules/hexablock.git] / src / HEXABLOCK / Hex.cxx
old mode 100755 (executable)
new mode 100644 (file)
index bcd5cbb..4df633b
@@ -1,12 +1,12 @@
 
 // C++ : La clase principale de Hexa
 
-// Copyright (C) 2009-2012  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
@@ -33,17 +33,15 @@ Hex* Hex::first_instance = NULL;
 // ======================================================== Constructeur
 Hex::Hex ()
 {
-   setlocale (LC_NUMERIC, "C");
+   //setlocale (LC_NUMERIC, "C"); // VSR 2020-03-11: commented out - initial locale has to be restored somewhere...
    glob = Globale::getInstance ();
 }
 // ======================================================== Destructeur
 Hex::~Hex ()
 {
-#ifndef NO_CASCADE
    int nbre = liste_documents.size();
    for (int nd=0 ; nd<nbre ; nd++) 
        delete liste_documents [nd];
-#endif
 }
 // ======================================================== countDocument
 int Hex::countDocument ()
@@ -87,7 +85,7 @@ Document* Hex::addDocument (cpchar nomdoc)
    if (actif)
        glob->dump << nomdoc;
 
-   string name;
+   std::string name;
    makeName (nomdoc, name);
    Document* doc = new Document (name.c_str(), this);
 
@@ -162,7 +160,7 @@ Document* Hex::findDocument (cpchar name)
    return NULL;
 }
 // ======================================================== makeName
-void Hex::makeName (cpchar radical, string& name)
+void Hex::makeName (cpchar radical, std::string& name)
 {
    char cnum [8];
    int  numero = 0;
@@ -197,4 +195,37 @@ Hex* Hex::getInstance  ()
 
    return first_instance;
 }
+// ======================================================== what (?)
+void Hex::what ()
+{
+   bool actif = glob->dump.start ("hexablock", "what", false);
+
+   Globale* glob = Globale::getInstance  ();
+   glob->mess.printMessage();
+
+   glob->dump.close (actif);
+}
+// ======================================================== sizeofMessage
+int Hex::sizeofMessage ()
+{
+   return glob->mess.sizeofMessage (); 
+}
+// ======================================================== getMessageLine
+cpchar Hex::getMessageLine (int nlig)
+{ 
+   return glob->mess.getLine (nlig);
+}
+// ======================================================== hex_instance
+Hex* hex_instance ()
+{
+   Hex*   hexa = Hex::getInstance ();
+   return hexa;
+}
+// ======================================================== what (fonction)
+void what ()
+{
+   Hex* hexa = Hex::getInstance ();
+   hexa->what ();
+}
+
 END_NAMESPACE_HEXA