]> SALOME platform Git repositories - modules/hexablock.git/blob - src/HEXABLOCK/HexDumpStudy.hxx
Salome HOME
Merge from V6_main 13/12/2012
[modules/hexablock.git] / src / HEXABLOCK / HexDumpStudy.hxx
1
2 // Class : Ecriture d'un dump python
3
4 // Copyright (C) 2009-2012  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/ 
21 // or email : webmaster.salome@opencascade.com
22
23 #ifndef __DUMP_STUDY_H_
24 #define __DUMP_STUDY_H_
25
26 #include "hexa_base.hxx"
27 #include <map>
28
29 BEGIN_NAMESPACE_HEXA
30
31
32 #define DumpStart(p,args) bool actif=el_root->glob->dump.start(this, p); if (actif)  el_root->glob->dump << args
33 #define DumpEnd       el_root->glob->dump.close (actif)
34 #define DumpReturn(v) el_root->glob->dump.close (actif,v)
35
36 #define DumpLock    bool actif=el_root->glob->dump.lock ()
37 #define DumpRestore            el_root->glob->dump.restore (actif)
38
39 class DumpStudy
40 {
41 public :
42     DumpStudy ();
43
44     DumpStudy& operator << (int      val);
45     DumpStudy& operator << (double   val);
46     DumpStudy& operator << (cpchar   val);
47     DumpStudy& operator << (EltBase* elt);
48     DumpStudy& operator << (Edges&   elt);
49     DumpStudy& operator << (Quads&   elt);
50     DumpStudy& operator << (Hexas&   elt);
51     DumpStudy& operator << (RealVector& elt);
52
53     bool start (EltBase* obj, cpchar method);
54     bool start (cpchar   obj, cpchar method);
55     void close (bool reactive);
56     void close (bool reactive, EltBase* retour);
57
58     bool lock ();
59     void restore (bool reactive);
60
61 private :
62    cpchar findName   (EltBase* elt);
63    void addArgVector (EnumElt type, TabElts& table);
64    void addArgument  (cpchar  arg);
65    void addArgument  (string& arg) { addArgument (arg.c_str()) ; }
66    void declareVectors ();
67    void addVector (cpchar name);
68    void majVector (cpchar value);
69    void closeVector ();
70
71 private :
72    std::map    <EltBase*, std::string> map_name;
73    std::vector <std::string>           tab_declar;
74
75    int    tab_count [EL_MAXI];
76    string curr_vector;
77    int    nbr_values;
78
79    FILE*  fic_dump;
80    string this_name;
81    string right_part;
82    bool   is_open;
83    int    nbr_nulls;
84    int    nbr_args;
85 };
86 END_NAMESPACE_HEXA
87 #endif