]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_MultiResult_i.hh
Salome HOME
1bbfad1b7c9740d5a14ec06e22ca4aaaac8d6c17
[modules/visu.git] / src / VISU_I / VISU_MultiResult_i.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_MultiResult_i.hh
24 //  Author : Alexey PETROV
25 //  Module : VISU
26 //
27 #ifndef __VISU_MULTI_RESULT_I_H__
28 #define __VISU_MULTI_RESULT_I_H__
29
30 #ifndef ENABLE_MULTIPR
31 #  define RESULT_CLASS_NAME Result_i
32 #else
33 #  define RESULT_CLASS_NAME MultiResult_i
34
35 #include "VISU_Result_i.hh"
36 #include "MULTIPR_Obj.hxx"
37
38 #include <set>
39
40 namespace VISU
41 {
42   //----------------------------------------------------------------------------
43   class MultiResult_i : public virtual Result_i
44   {
45     MultiResult_i(const MultiResult_i&);
46
47   public:
48     typedef Result_i TSuperClass;
49
50     MultiResult_i(SALOMEDS::Study_ptr theStudy,
51                   const ESourceId& theSourceId,
52                   const ECreationId& theCreationId,
53                   CORBA::Boolean theIsBuildImmediately,
54                   CORBA::Boolean theIsBuildFields,
55                   CORBA::Boolean theIsBuildMinMax,
56                   CORBA::Boolean theIsBuildGroups);
57
58     MultiResult_i();
59
60     virtual
61     ~MultiResult_i();
62
63     virtual
64     CORBA::Boolean
65     IsDone();
66
67     virtual
68     VISU::Result::EntityNames* 
69     GetPartNames(const char* theMeshName);
70
71     virtual
72     VISU::Result::Resolutions* 
73     GetResolutions(const char* theMeshName, 
74                    const char* thePartName);
75
76     virtual
77     VISU::Result::Resolution
78     GetResolution(const char* theMeshName, 
79                   const char* thePartName);
80
81     virtual
82     void 
83     SetResolution(const char* theMeshName, 
84                   const char* thePartName, 
85                   VISU::Result::Resolution theResolution);
86
87
88     typedef std::string TPartName;
89     typedef std::vector<TPartName> TPartNames;
90
91     typedef size_t TPartID;
92     typedef std::string TPath;
93     typedef std::string TMeshName;
94
95     struct TPartInfo
96     {
97       TMeshName myMeshName;
98       TPartName myName;
99       TPartID myPartID;
100       TPath myPath;
101       TFileName myFileName;
102     };
103
104     typedef std::map<TFileName, TPartInfo> TPartInfos;
105     TPartInfos myPartInfos;
106
107     typedef std::map<TPartName, TFileName> TPartName2FileName;
108     typedef std::map<TPartName, VISU::Result::Resolution> TPartName2Resolution;
109     typedef std::set<VISU::Result::Resolution> TResolutions;
110
111     typedef std::set<std::string> TRepresentationKey;
112     typedef std::map<TRepresentationKey, PInput> TRepresentation2Input;
113
114     typedef std::set<TPartName> TSubPartNames;
115     typedef std::map<TPartName, TSubPartNames> TMainPart2SubPartNames;
116
117   private:
118     multipr::Obj myMultiprObj;
119     TPartName2FileName myPartName2FileName;
120     TPartName2Resolution myPartName2Resolution;
121     TMainPart2SubPartNames myMainPart2SubPartNames;
122
123     TRepresentation2Input myRepresentation2Input;
124
125   protected:
126     virtual
127     Storable* 
128     Build(SALOMEDS::SObject_ptr theSObject,
129           CORBA::Boolean theIsAtOnce = true) ;
130
131     virtual
132     void
133     BuildDataTree(const std::string& theResultEntry);
134
135   public:
136     virtual 
137     size_t
138     IsPossible();
139
140     virtual
141     Storable* 
142     Create(const char* theFileName);
143
144     virtual 
145     Storable*
146     Restore(SALOMEDS::SObject_ptr theSObject,
147             const Storable::TRestoringMap& theMap,
148             const std::string& thePrefix,
149             CORBA::Boolean theIsMultiFile);
150
151     //---------------------------------------------------------------
152     virtual 
153     bool
154     Save(SALOMEDS::SComponent_ptr theComponent,
155          const std::string& theURL,
156          bool theIsMultiFile,
157          bool theIsASCII,
158          TFileNames& theFileNames,
159          TFileNames& theFiles);
160
161     virtual 
162     CORBA::Boolean 
163     CanCopy(SALOMEDS::SObject_ptr theObject);
164
165     virtual
166     void
167     ToStream(std::ostringstream& theStr);
168
169     virtual
170     PInput
171     GetInput(const std::string& theMeshName = "",
172              VISU::Entity theEntity = VISU::NONE,
173              const std::string& theFieldName = "", 
174              CORBA::Long theTimeStampNumber = -1);
175   };
176
177 }
178
179 #endif // ENABLE_MULTIPR
180
181 #endif // __VISU_MULTI_RESULT_I_H__