Salome HOME
a800d3f0551156be21b5945e76a4c38a480bc3d2
[modules/hexablock.git] / src / HEXABLOCK / Hex.hxx
1
2 // class : La clase principale de Hexa
3
4 // Copyright (C) 2009-2013  CEA/DEN, EDF R&D
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef __HEX_H
24 #define __HEX_H
25
26 #include "hexa_base.hxx"
27
28 BEGIN_NAMESPACE_HEXA
29
30 class Hex
31 {
32 public:
33    static Hex* getInstance ();
34
35    int       countDocument ();
36    Document* getDocument (int nro);
37    void      removeDocument (Document* doc);
38
39    Document* addDocument  (cpchar name="default");
40    Document* loadDocument (cpchar name);
41    Document* findDocument (cpchar name);
42    Document* findDocument (const string& name) 
43              { return findDocument (name.c_str()) ; }
44
45    int loadAllDocs (cpchar flow);
46    int saveAllDocs (cpchar filename);
47    void makeName   (cpchar radical, string& name);
48
49    void lockDump();
50    void restoreDump();
51      
52 // private:
53              //  Constructeur + destructeur
54     Hex ();
55    ~Hex ();
56
57 private:
58    static Hex* first_instance;
59    vector <Document*> liste_documents;
60    Globale*    glob;
61 };
62
63 END_NAMESPACE_HEXA
64 #endif