1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef __VISU_ENGINE_I_H__
24 #define __VISU_ENGINE_I_H__
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)
34 #include "SALOME_Component_i.hxx"
38 class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
39 public virtual ::Engines_Component_i
41 VISU_Gen_var myVisuGen;
43 VISU_Gen_i(const VISU::VISU_Gen_i &);
45 VISU_Gen_i(SALOME::Session_ptr session,
47 PortableServer::POA_ptr poa,
48 PortableServer::ObjectId * contId,
49 const char *instanceName,
50 const char *interfaceName);
51 virtual ~VISU_Gen_i();
53 virtual char* GetID();
54 virtual VISU::VISUType GetType();
56 virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
57 virtual SALOMEDS::Study_ptr GetCurrentStudy();
59 virtual ViewManager_ptr GetViewManager();
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);
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);
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);
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);
90 //Create Presentation Of Results
93 ScalarMapOnField(Result_ptr theResult,
94 const char* theMeshName,
95 VISU::Entity theEntity,
96 const char* theFieldName,
97 CORBA::Long theIteration);
101 GaussPointsOnField(Result_ptr theResult,
102 const char* theMeshName,
103 VISU::Entity theEntity,
104 const char* theFieldName,
105 CORBA::Long theIteration);
109 DeformedShapeOnField(Result_ptr theResult,
110 const char* theMeshName,
111 VISU::Entity theEntity,
112 const char* theFieldName,
113 CORBA::Long theIteration);
117 VectorsOnField(Result_ptr theResult,
118 const char* theMeshName,
119 VISU::Entity theEntity,
120 const char* theFieldName,
121 CORBA::Long theIteration);
125 IsoSurfacesOnField(Result_ptr theResult,
126 const char* theMeshName,
127 VISU::Entity theEntity,
128 const char* theFieldName,
129 CORBA::Long theIteration);
133 CutPlanesOnField(Result_ptr theResult,
134 const char* theMeshName,
135 VISU::Entity theEntity,
136 const char* theFieldName,
137 CORBA::Long theIteration);
141 CutLinesOnField(Result_ptr theResult,
142 const char* theMeshName,
143 VISU::Entity theEntity,
144 const char* theFieldName,
145 CORBA::Long theIteration);
149 CutSegmentOnField(Result_ptr theResult,
150 const char* theMeshName,
151 VISU::Entity theEntity,
152 const char* theFieldName,
153 CORBA::Long theIteration);
157 StreamLinesOnField(Result_ptr theResult,
158 const char* theMeshName,
159 VISU::Entity theEntity,
160 const char* theFieldName,
161 CORBA::Long theIteration);
165 Plot3DOnField(Result_ptr theResult,
166 const char* theMeshName,
167 VISU::Entity theEntity,
168 const char* theFieldName,
169 CORBA::Long theIteration);
171 //This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
173 DeformedShapeAndScalarMap_ptr
174 ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
175 const char* theMeshName,
176 VISU::Entity theEntity,
177 const char* theFieldName,
178 CORBA::Long theIteration);
181 DeformedShapeAndScalarMap_ptr
182 DeformedShapeAndScalarMapOnField(Result_ptr theResult,
183 const char* theMeshName,
184 VISU::Entity theEntity,
185 const char* theFieldName,
186 CORBA::Long theIteration);
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);
198 virtual void DeleteResult(Result_ptr theResult);
199 virtual void DeletePrs3d(Prs3d_ptr thePrs3d);
201 // inherited methods from SALOMEDS::Driver
202 virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
205 virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
208 virtual bool Load(SALOMEDS::SComponent_ptr,
209 const SALOMEDS::TMPFile &,
212 virtual bool LoadASCII(SALOMEDS::SComponent_ptr,
213 const SALOMEDS::TMPFile &,
217 virtual void Close(SALOMEDS::SComponent_ptr IORSComponent);
219 virtual char* ComponentDataType();
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);
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);
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);
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);
250 VISU::ColoredPrs3dCache_ptr
251 GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy);
255 virtual CORBA::Long CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
256 CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
257 CORBA::Boolean isAuto, const char* name);
259 virtual void EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
260 CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
261 CORBA::Boolean isAuto, const char* name);
263 /* Returns clipping plane by its Id */
264 virtual VISU::ClippingPlane* GetClippingPlane(CORBA::Long id);
266 /* Deletes clipping plane by its Id */
267 virtual CORBA::Boolean DeleteClippingPlane(CORBA::Long id);
269 /* Applyes a clipping plane with Id to presentation thePrs */
270 virtual CORBA::Boolean ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
272 /* Detaches a clipping plane with Id from presentation thePrs */
273 virtual CORBA::Boolean DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
275 /* Get number of clipping planes */
276 virtual CORBA::Long GetClippingPlanesNb();
278 /* Convert a set of VTK files to the MED file */
279 virtual CORBA::Boolean VTK2MED( const VISU::string_array& theVTKFiles,
280 const char* theMEDFile,
281 const char* theMeshName,
282 const VISU::double_array& theTStamps );
284 /* Load texture from file */
285 virtual CORBA::Long LoadTexture(const char* theTextureFile);