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