Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / VISU_I / VISU_ResultUtils.hh
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  VISU OBJECT : interactive object for VISU entities implementation
21 //  File   : VISU_ResultUtils.hh
22 //  Author : Alexey PETROV
23 //  Module : VISU
24 //
25 #ifndef __VISU_RESULT_UTILS_H__
26 #define __VISU_RESULT_UTILS_H__
27
28 #include "VISU_Result_i.hh"
29 #include "SALOME_Event.h"
30
31 #include <set>
32
33 namespace VISU
34 {
35   //----------------------------------------------------------------------------
36   struct TUpdateObjBrowser: public SALOME_Event
37   {
38     int myStudyId;
39     CORBA::Boolean* myIsDone;
40     TUpdateObjBrowser(const int theStudyId, CORBA::Boolean* theIsDone);
41
42     virtual
43     void
44     Execute();
45   };
46
47
48   //----------------------------------------------------------------------------
49   struct TResultManager
50   {
51     Result_i* myResult;
52
53     TResultManager(Result_i* theResult);
54
55     ~TResultManager();
56   };
57
58
59   //----------------------------------------------------------------------------
60   struct TTransactionManager
61   {
62     _PTR(StudyBuilder) myStudyBuilder;
63
64     TTransactionManager(_PTR(Study) theStudyDocument);
65
66     ~TTransactionManager();
67   };
68
69
70   //----------------------------------------------------------------------------
71   QString
72   GenerateName(const std::string& theName);
73
74
75   //----------------------------------------------------------------------------
76   bool
77   SplitName(const std::string& theName,
78             std::string& theBase,
79             std::string& theSuffix,
80             char theDelimeter = ':');
81
82
83   //----------------------------------------------------------------------------
84   std::string
85   MakeFileName(const std::string& theName,
86                const void* thePointer);
87     
88     
89   //----------------------------------------------------------------------------
90   void
91   BuildEntities(Result_i* theResult,
92                 Result_i::PInput theInput,
93                 CORBA::Boolean* theIsDone,
94                 const std::string& theResultEntry,
95                 CORBA::Boolean theIsAtOnce,
96                 CORBA::Boolean theIsBuildGroups,
97                 CORBA::Boolean theIsBuildFields,
98                 CORBA::Boolean theIsBuildParts,
99                 _PTR(Study) theStudy);
100
101   
102   //----------------------------------------------------------------------------
103   void
104   BuildGroups(Result_i* theResult,
105               Result_i::PInput theInput,
106               CORBA::Boolean* theIsDone,
107               CORBA::Boolean theIsBuild,
108               CORBA::Boolean theIsAtOnce,
109               _PTR(Study) theStudy);
110
111   
112   //----------------------------------------------------------------------------
113   void
114   BuildFields(Result_i* theResult,
115               Result_i::PInput theInput,
116               CORBA::Boolean* theIsDone,
117               CORBA::Boolean theIsBuild,
118               CORBA::Boolean theIsAtOnce,
119               _PTR(Study) theStudy);
120
121   
122   //----------------------------------------------------------------------------
123   void
124   BuildMinMax(Result_i* theResult,
125               Result_i::PInput theInput,
126               CORBA::Boolean* theIsDone,
127               CORBA::Boolean theIsBuild);
128
129
130   //----------------------------------------------------------------------------
131   void
132   BuildFieldDataTree(Result_i* theResult,
133                      Result_i::PInput theInput,
134                      CORBA::Boolean* theIsFieldsDone,
135                      CORBA::Boolean theIsBuildFields,
136                      CORBA::Boolean* theIsMinMaxDone,
137                      CORBA::Boolean theIsBuildMinMax,
138                      _PTR(Study) theStudy);
139
140   //----------------------------------------------------------------------------
141   bool
142   RemoveFile(const std::string& theFileName,
143              bool theRemoveEmptyDir = true);
144
145   //----------------------------------------------------------------------------
146   bool
147   CopyFile(const std::string& theSourceFileName,
148            const std::string& theTargetFileName);
149
150   //----------------------------------------------------------------------------
151 }
152
153
154 #endif // __VISU_RESULT_UTILS_H__