]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_ResultUtils.hh
Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/visu.git] / src / VISU_I / VISU_ResultUtils.hh
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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 //  VISU OBJECT : interactive object for VISU entities implementation
23 //  File   : VISU_ResultUtils.hh
24 //  Author : Alexey PETROV
25 //  Module : VISU
26 //
27 #ifndef __VISU_RESULT_UTILS_H__
28 #define __VISU_RESULT_UTILS_H__
29
30 #include "VISU_Result_i.hh"
31 #include "SALOME_Event.h"
32
33 #include <set>
34
35 namespace VISU
36 {
37   //----------------------------------------------------------------------------
38   struct TUpdateObjBrowser: public SALOME_Event
39   {
40     int myStudyId;
41     CORBA::Boolean* myIsDone;
42     TUpdateObjBrowser(const int theStudyId, CORBA::Boolean* theIsDone);
43
44     virtual
45     void
46     Execute();
47   };
48
49
50   //----------------------------------------------------------------------------
51   struct TResultManager
52   {
53     Result_i* myResult;
54
55     TResultManager(Result_i* theResult);
56
57     ~TResultManager();
58   };
59
60
61   //----------------------------------------------------------------------------
62   struct TTransactionManager
63   {
64     _PTR(StudyBuilder) myStudyBuilder;
65
66     TTransactionManager(_PTR(Study) theStudyDocument);
67
68     ~TTransactionManager();
69   };
70
71
72   //----------------------------------------------------------------------------
73   QString
74   GenerateName(const std::string& theName);
75
76
77   //----------------------------------------------------------------------------
78   bool
79   SplitName(const std::string& theName,
80             std::string& theBase,
81             std::string& theSuffix,
82             char theDelimeter = ':');
83
84
85   //----------------------------------------------------------------------------
86   std::string
87   MakeFileName(const std::string& theName,
88                const void* thePointer);
89     
90     
91   //----------------------------------------------------------------------------
92   void
93   BuildEntities(Result_i* theResult,
94                 Result_i::PInput theInput,
95                 CORBA::Boolean* theIsDone,
96                 const std::string& theResultEntry,
97                 CORBA::Boolean theIsAtOnce,
98                 CORBA::Boolean theIsBuildGroups,
99                 CORBA::Boolean theIsBuildFields,
100                 CORBA::Boolean theIsBuildParts,
101                 _PTR(Study) theStudy);
102
103   
104   //----------------------------------------------------------------------------
105   void
106   BuildGroups(Result_i* theResult,
107               Result_i::PInput theInput,
108               CORBA::Boolean* theIsDone,
109               CORBA::Boolean theIsBuild,
110               CORBA::Boolean theIsAtOnce,
111               _PTR(Study) theStudy);
112
113   
114   //----------------------------------------------------------------------------
115   void
116   BuildFields(Result_i* theResult,
117               Result_i::PInput theInput,
118               CORBA::Boolean* theIsDone,
119               CORBA::Boolean theIsBuild,
120               CORBA::Boolean theIsAtOnce,
121               _PTR(Study) theStudy);
122
123   
124   //----------------------------------------------------------------------------
125   void
126   BuildMinMax(Result_i* theResult,
127               Result_i::PInput theInput,
128               CORBA::Boolean* theIsDone,
129               CORBA::Boolean theIsBuild);
130
131
132   //----------------------------------------------------------------------------
133   void
134   BuildFieldDataTree(Result_i* theResult,
135                      Result_i::PInput theInput,
136                      CORBA::Boolean* theIsFieldsDone,
137                      CORBA::Boolean theIsBuildFields,
138                      CORBA::Boolean* theIsMinMaxDone,
139                      CORBA::Boolean theIsBuildMinMax,
140                      _PTR(Study) theStudy);
141
142   //----------------------------------------------------------------------------
143   bool
144   RemoveFile(const std::string& theFileName,
145              bool theRemoveEmptyDir = true);
146
147   //----------------------------------------------------------------------------
148   bool
149   CopyFile(const std::string& theSourceFileName,
150            const std::string& theTargetFileName);
151
152   //----------------------------------------------------------------------------
153 }
154
155
156 #endif // __VISU_RESULT_UTILS_H__