Salome HOME
Fix for the "0051899: curves are not shown in opened study" issue.
[modules/visu.git] / src / ENGINE / VISU_Engine_i.hh
1 // Copyright (C) 2007-2013  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
23 #ifndef __VISU_ENGINE_I_H__
24 #define __VISU_ENGINE_I_H__
25
26 // IDL headers
27 #include "SALOMEconfig.h"
28 #include CORBA_SERVER_HEADER(VISU_Gen)
29 #include CORBA_SERVER_HEADER(MED)
30 #include CORBA_SERVER_HEADER(SALOME_Session)
31 #include CORBA_SERVER_HEADER(SALOMEDS)
32 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
33
34 #include "SALOME_Component_i.hxx"
35
36 namespace VISU
37 {
38   class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
39                      public virtual ::Engines_Component_i
40   {
41     VISU_Gen_var myVisuGen;
42     VISU_Gen_i();
43     VISU_Gen_i(const VISU::VISU_Gen_i &);
44   public:
45     VISU_Gen_i(SALOME::Session_ptr session,
46                CORBA::ORB_ptr orb,
47                PortableServer::POA_ptr poa,
48                PortableServer::ObjectId * contId, 
49                const char *instanceName, 
50                const char *interfaceName);
51     virtual ~VISU_Gen_i();
52
53     virtual char* GetID();
54     virtual VISU::VISUType GetType();
55
56     virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
57     virtual SALOMEDS::Study_ptr GetCurrentStudy();
58
59     virtual ViewManager_ptr GetViewManager();
60
61     virtual SALOMEDS::SObject_ptr ImportTables(const char* theFileName,
62                                                bool theFirstStrAsTitle = false);
63     virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable,
64                                              const char* theFileName);
65
66     //Create Result
67     virtual Result_ptr ImportFile(const char* theFileName);
68     virtual Result_ptr CreateResult(const char* theFileName);
69     virtual Result_ptr CopyAndImportFile(const char* theFileName);
70     virtual Result_ptr ImportMed(SALOMEDS::SObject_ptr theMedSObject);
71     virtual Result_ptr ImportMedField(SALOME_MED::FIELD_ptr theField);
72
73     //Create Presentation Of Submeshes
74     virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName,
75                                   VISU::Entity theEntity);
76     virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName,
77                                         VISU::Entity theEntity, const char* theFamilyName);
78     virtual Mesh_ptr GroupMesh(Result_ptr theResult, const char* theMeshName,
79                                const char* theGroupName);
80
81     //Rename Presentation Of Submeshes
82     virtual void RenameEntityInStudy(Result_ptr theResult, const char* theMeshName,
83                                      VISU::Entity theEntity, const char* theNewName);
84     virtual void RenameFamilyInStudy(Result_ptr theResult, const char* theMeshName,
85                                      VISU::Entity theEntity,
86                                      const char* theFamilyName, const char* theNewName);
87     virtual void RenameGroupInStudy (Result_ptr theResult, const char* theMeshName,
88                                      const char* theGroupName, const char* theNewName);
89
90     //Create Presentation Of Results
91     virtual 
92     ScalarMap_ptr
93     ScalarMapOnField(Result_ptr theResult, 
94                      const char* theMeshName, 
95                      VISU::Entity theEntity,
96                      const char* theFieldName, 
97                      CORBA::Long theIteration);
98
99     virtual 
100     GaussPoints_ptr 
101     GaussPointsOnField(Result_ptr theResult, 
102                        const char* theMeshName, 
103                        VISU::Entity theEntity,
104                        const char* theFieldName, 
105                        CORBA::Long theIteration);
106
107     virtual 
108     DeformedShape_ptr
109     DeformedShapeOnField(Result_ptr theResult, 
110                          const char* theMeshName, 
111                          VISU::Entity theEntity,
112                          const char* theFieldName, 
113                          CORBA::Long theIteration);
114
115     virtual 
116     Vectors_ptr
117     VectorsOnField(Result_ptr theResult, 
118                    const char* theMeshName, 
119                    VISU::Entity theEntity,
120                    const char* theFieldName, 
121                    CORBA::Long theIteration);
122
123     virtual
124     IsoSurfaces_ptr
125     IsoSurfacesOnField(Result_ptr theResult, 
126                        const char* theMeshName, 
127                        VISU::Entity theEntity,
128                        const char* theFieldName, 
129                        CORBA::Long theIteration);
130
131     virtual
132     CutPlanes_ptr
133     CutPlanesOnField(Result_ptr theResult, 
134                      const char* theMeshName, 
135                      VISU::Entity theEntity,
136                      const char* theFieldName, 
137                      CORBA::Long theIteration);
138
139     virtual
140     CutLines_ptr
141     CutLinesOnField(Result_ptr theResult, 
142                     const char* theMeshName, 
143                     VISU::Entity theEntity,
144                     const char* theFieldName, 
145                     CORBA::Long theIteration);
146
147     virtual
148     CutSegment_ptr
149     CutSegmentOnField(Result_ptr theResult, 
150                       const char* theMeshName, 
151                       VISU::Entity theEntity,
152                       const char* theFieldName, 
153                       CORBA::Long theIteration);
154
155     virtual
156     StreamLines_ptr 
157     StreamLinesOnField(Result_ptr theResult, 
158                        const char* theMeshName, 
159                        VISU::Entity theEntity,
160                        const char* theFieldName, 
161                        CORBA::Long theIteration);
162
163     virtual
164     Plot3D_ptr
165     Plot3DOnField(Result_ptr theResult, 
166                   const char* theMeshName, 
167                   VISU::Entity theEntity,
168                   const char* theFieldName, 
169                   CORBA::Long theIteration);
170
171     //This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
172     virtual
173     DeformedShapeAndScalarMap_ptr
174     ScalarMapOnDeformedShapeOnField(Result_ptr theResult, 
175                                     const char* theMeshName, 
176                                     VISU::Entity theEntity,
177                                     const char* theFieldName, 
178                                     CORBA::Long theIteration);
179
180     virtual
181     DeformedShapeAndScalarMap_ptr
182     DeformedShapeAndScalarMapOnField(Result_ptr theResult, 
183                                      const char* theMeshName, 
184                                      VISU::Entity theEntity,
185                                      const char* theFieldName, 
186                                      CORBA::Long theIteration);
187     
188     //Create Digital Presentation
189     virtual Table_ptr CreateTable(const char* theTableEntry);
190     virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
191     virtual Curve_ptr CreateCurveWithZ(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow);
192     virtual Curve_ptr CreateCurveWithZExt(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow,
193                                           CORBA::Boolean theIsV2);
194     virtual Container_ptr CreateContainer();
195     virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
196     virtual Evolution_ptr CreateEvolution(XYPlot_ptr theXYPlot);
197     
198     virtual void DeleteResult(Result_ptr theResult);
199     virtual void DeletePrs3d(Prs3d_ptr thePrs3d);
200
201     // inherited methods from SALOMEDS::Driver
202     virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
203                                     const char* theURL,
204                                     bool isMultiFile);
205     virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
206                                          const char* theURL,
207                                          bool isMultiFile);
208     virtual bool Load(SALOMEDS::SComponent_ptr,
209                       const SALOMEDS::TMPFile &,
210                       const char* theURL,
211                       bool isMultiFile);
212     virtual bool LoadASCII(SALOMEDS::SComponent_ptr,
213                            const SALOMEDS::TMPFile &,
214                            const char* theURL,
215                            bool isMultiFile);
216
217     virtual void Close(SALOMEDS::SComponent_ptr IORSComponent); 
218
219     virtual char* ComponentDataType();
220
221     virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
222                                          const char* IORString,
223                                          CORBA::Boolean isMultiFile,
224                                          CORBA::Boolean isASCII);
225     virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
226                                          const char* aLocalPersistentID,
227                                          CORBA::Boolean isMultiFile,
228                                          CORBA::Boolean isASCII);
229
230     virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR);
231     virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
232                                                  SALOMEDS::SObject_ptr theSObject,
233                                                  CORBA::Object_ptr theObject,
234                                                  const char* theName) throw (SALOME::SALOME_Exception);
235
236     CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
237     SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
238     CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
239     SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
240                                     CORBA::Long theObjectID,
241                                     SALOMEDS::SObject_ptr theObject);
242
243     // inherited methods from Engines::Component
244     virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
245                                          CORBA::Boolean theIsPublished,
246                                          CORBA::Boolean theIsMultiFile,
247                                          CORBA::Boolean& theIsValidScript);   
248
249     virtual char* getVersion();
250
251     virtual
252     VISU::ColoredPrs3dCache_ptr
253     GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy);
254     
255
256
257     virtual CORBA::Long CreateClippingPlane(CORBA::Double X,CORBA::Double  Y, CORBA::Double Z, 
258                                             CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, 
259                                             CORBA::Boolean isAuto, const char* name);
260
261     virtual void EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double  Y, CORBA::Double Z, 
262                                    CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ, 
263                                    CORBA::Boolean isAuto, const char* name);
264
265     /* Returns clipping plane by its Id */
266     virtual VISU::ClippingPlane* GetClippingPlane(CORBA::Long id);
267     
268     /* Deletes clipping plane by its Id */
269     virtual CORBA::Boolean DeleteClippingPlane(CORBA::Long id);
270     
271     /* Applyes a clipping plane with Id to presentation thePrs */
272     virtual CORBA::Boolean ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
273     
274     /* Detaches a clipping plane with Id from presentation thePrs */
275     virtual CORBA::Boolean DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
276     
277     /* Get number of clipping planes */
278     virtual CORBA::Long GetClippingPlanesNb();
279
280     /* Convert a set of VTK files to the MED file */
281     virtual CORBA::Boolean VTK2MED( const VISU::string_array& theVTKFiles,
282                                     const char* theMEDFile,
283                                     const char* theMeshName,
284                                     const VISU::double_array& theTStamps );
285
286     /* Load texture from file */
287     virtual CORBA::Long LoadTexture(const char* theTextureFile);
288   };
289 };
290
291
292 #endif