1 // Copyright (C) 2007-2008 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
22 #ifndef __VISU_ENGINE_I_H__
23 #define __VISU_ENGINE_I_H__
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)
33 #include "SALOME_Component_i.hxx"
37 class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
38 public virtual ::Engines_Component_i
40 VISU_Gen_var myVisuGen;
42 VISU_Gen_i(const VISU::VISU_Gen_i &);
44 VISU_Gen_i(SALOME::Session_ptr session,
46 PortableServer::POA_ptr poa,
47 PortableServer::ObjectId * contId,
48 const char *instanceName,
49 const char *interfaceName);
50 virtual ~VISU_Gen_i();
52 virtual char* GetID();
53 virtual VISU::VISUType GetType();
55 virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
56 virtual SALOMEDS::Study_ptr GetCurrentStudy();
58 virtual ViewManager_ptr GetViewManager();
60 virtual SALOMEDS::SObject_ptr ImportTables(const char* theFileName);
61 virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName);
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);
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);
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);
84 //Create Presentation Of Results
87 ScalarMapOnField(Result_ptr theResult,
88 const char* theMeshName,
89 VISU::Entity theEntity,
90 const char* theFieldName,
91 CORBA::Long theIteration);
95 GaussPointsOnField(Result_ptr theResult,
96 const char* theMeshName,
97 VISU::Entity theEntity,
98 const char* theFieldName,
99 CORBA::Long theIteration);
103 DeformedShapeOnField(Result_ptr theResult,
104 const char* theMeshName,
105 VISU::Entity theEntity,
106 const char* theFieldName,
107 CORBA::Long theIteration);
111 VectorsOnField(Result_ptr theResult,
112 const char* theMeshName,
113 VISU::Entity theEntity,
114 const char* theFieldName,
115 CORBA::Long theIteration);
119 IsoSurfacesOnField(Result_ptr theResult,
120 const char* theMeshName,
121 VISU::Entity theEntity,
122 const char* theFieldName,
123 CORBA::Long theIteration);
127 CutPlanesOnField(Result_ptr theResult,
128 const char* theMeshName,
129 VISU::Entity theEntity,
130 const char* theFieldName,
131 CORBA::Long theIteration);
135 CutLinesOnField(Result_ptr theResult,
136 const char* theMeshName,
137 VISU::Entity theEntity,
138 const char* theFieldName,
139 CORBA::Long theIteration);
143 CutSegmentOnField(Result_ptr theResult,
144 const char* theMeshName,
145 VISU::Entity theEntity,
146 const char* theFieldName,
147 CORBA::Long theIteration);
151 StreamLinesOnField(Result_ptr theResult,
152 const char* theMeshName,
153 VISU::Entity theEntity,
154 const char* theFieldName,
155 CORBA::Long theIteration);
159 Plot3DOnField(Result_ptr theResult,
160 const char* theMeshName,
161 VISU::Entity theEntity,
162 const char* theFieldName,
163 CORBA::Long theIteration);
165 //This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
167 DeformedShapeAndScalarMap_ptr
168 ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
169 const char* theMeshName,
170 VISU::Entity theEntity,
171 const char* theFieldName,
172 CORBA::Long theIteration);
175 DeformedShapeAndScalarMap_ptr
176 DeformedShapeAndScalarMapOnField(Result_ptr theResult,
177 const char* theMeshName,
178 VISU::Entity theEntity,
179 const char* theFieldName,
180 CORBA::Long theIteration);
182 //Create Digital Presentation
183 virtual Table_ptr CreateTable(const char* theTableEntry);
184 virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
185 virtual Curve_ptr CreateCurveWithZ(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow, CORBA::Long theZRow);
186 virtual Container_ptr CreateContainer();
187 virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
189 virtual void DeleteResult(Result_ptr theResult);
190 virtual void DeletePrs3d(Prs3d_ptr thePrs3d);
192 // inherited methods from SALOMEDS::Driver
193 virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
196 virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
199 virtual bool Load(SALOMEDS::SComponent_ptr,
200 const SALOMEDS::TMPFile &,
203 virtual bool LoadASCII(SALOMEDS::SComponent_ptr,
204 const SALOMEDS::TMPFile &,
208 virtual void Close(SALOMEDS::SComponent_ptr IORSComponent);
210 virtual char* ComponentDataType();
212 virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
213 const char* IORString,
214 CORBA::Boolean isMultiFile,
215 CORBA::Boolean isASCII);
216 virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
217 const char* aLocalPersistentID,
218 CORBA::Boolean isMultiFile,
219 CORBA::Boolean isASCII);
221 virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR);
222 virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
223 SALOMEDS::SObject_ptr theSObject,
224 CORBA::Object_ptr theObject,
225 const char* theName) throw (SALOME::SALOME_Exception);
227 CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
228 SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
229 CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
230 SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
231 CORBA::Long theObjectID,
232 SALOMEDS::SObject_ptr theObject);
234 // inherited methods from Engines::Component
235 virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
236 CORBA::Boolean theIsPublished,
237 CORBA::Boolean& theIsValidScript);
240 VISU::ColoredPrs3dCache_ptr
241 GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy);
245 virtual CORBA::Long CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
246 CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
247 CORBA::Boolean isAuto, const char* name);
249 virtual void EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
250 CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
251 CORBA::Boolean isAuto, const char* name);
253 /* Returns clipping plane by its Id */
254 virtual VISU::ClippingPlane* GetClippingPlane(CORBA::Long id);
256 /* Deletes clipping plane by its Id */
257 virtual CORBA::Boolean DeleteClippingPlane(CORBA::Long id);
259 /* Applyes a clipping plane with Id to presentation thePrs */
260 virtual CORBA::Boolean ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
262 /* Detaches a clipping plane with Id from presentation thePrs */
263 virtual CORBA::Boolean DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
265 /* Get number of clipping planes */
266 virtual CORBA::Long GetClippingPlanesNb();
268 /* Convert a set of VTK files to the MED file */
269 virtual CORBA::Boolean VTK2MED( const VISU::string_array& theVTKFiles,
270 const char* theMEDFile,
271 const char* theMeshName,
272 const VISU::double_array& theTStamps );