1 // Copyright (C) 2007-2011 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 // File : VISU_Gen_i.hh
24 // Author : Alexey Petrov
27 #ifndef __VISU_GEN_I_H__
28 #define __VISU_GEN_I_H__
30 #include "VISUConfig.hh"
33 #include "SALOME_Component_i.hxx"
34 #include "SALOME_NamingService.hxx"
35 #include "VISU_ColoredPrs3d_i.hh"
36 #include "VISU_ClippingPlaneMgr.hxx"
38 #include <VTKViewer_MarkerDef.h>
45 //----------------------------------------------------------------------------
46 typedef std::map<int, VTK::MarkerMap> StudyId2MarkerMap;
48 //----------------------------------------------------------------------------
49 class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
50 public virtual ::Engines_Component_i,
53 SALOMEDS::Study_var myStudyDocument;
54 VISU_ClippingPlaneMgr myClippingPlaneMgr;
56 StudyId2MarkerMap myMarkerMap;
58 VISU_Gen_i(const VISU::VISU_Gen_i &);
60 VISU_Gen_i(CORBA::ORB_ptr theORB,
61 PortableServer::POA_ptr thePOA,
62 SALOME_NamingService* theNamingService,
74 GetType() { return VISU::TVISUGEN;};
78 SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
90 ImportTables(const char* theFileName, bool theFirstStrAsTitle = false);
94 ExportTableToFile(SALOMEDS::SObject_ptr theTable,
95 const char* theFileName );
100 ImportFile(const char* theFileName);
104 CreateResult(const char* theFileName);
108 CopyAndImportFile(const char* theFileName);
112 ImportMed(SALOMEDS::SObject_ptr theMedSObject);
116 ImportMedField(SALOME_MED::FIELD_ptr theField);
119 //Rename Presentation Of Submeshes
121 RenameMeshInStudy(Result_ptr theResult,
122 const std::string& theMeshName,
123 int theEntity, // -1 for group indication
124 const std::string& theSubMeshName, // Family or Group name
125 const std::string& theNewName);
128 RenameEntityInStudy(Result_ptr theResult,
129 const char* theMeshName,
130 VISU::Entity theEntity,
131 const char* theNewName);
134 RenameFamilyInStudy(Result_ptr theResult,
135 const char* theMeshName,
136 VISU::Entity theEntity,
137 const char* theFamilyName,
138 const char* theNewName);
141 RenameGroupInStudy(Result_ptr theResult,
142 const char* theMeshName,
143 const char* theGroupName,
144 const char* theNewName);
146 //Create Presentation Of Submeshes
149 MeshOnEntity(Result_ptr theResult,
150 const char* theMeshName,
151 VISU::Entity theEntity);
155 FamilyMeshOnEntity(Result_ptr theResult,
156 const char* theMeshName,
157 VISU::Entity theEntity,
158 const char* theFamilyName);
162 GroupMesh(Result_ptr theResult,
163 const char* theMeshName,
164 const char* theGroupName);
167 CreatePrs3d(VISUType theType,
168 SALOMEDS::Study_ptr theStudy);
172 ScalarMapOnField(Result_ptr theResult,
173 const char* theMeshName,
174 VISU::Entity theEntity,
175 const char* theFieldName,
176 CORBA::Long theIteration);
180 GaussPointsOnField(Result_ptr theResult,
181 const char* theMeshName,
182 VISU::Entity theEntity,
183 const char* theFieldName,
184 CORBA::Long theIteration);
188 DeformedShapeOnField(Result_ptr theResult,
189 const char* theMeshName,
190 VISU::Entity theEntity,
191 const char* theFieldName,
192 CORBA::Long theIteration);
194 //This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
196 DeformedShapeAndScalarMap_ptr
197 ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
198 const char* theMeshName,
199 VISU::Entity theEntity,
200 const char* theFieldName,
201 CORBA::Long theIteration);
204 DeformedShapeAndScalarMap_ptr
205 DeformedShapeAndScalarMapOnField(Result_ptr theResult,
206 const char* theMeshName,
207 VISU::Entity theEntity,
208 const char* theFieldName,
209 CORBA::Long theIteration);
213 VectorsOnField(Result_ptr theResult,
214 const char* theMeshName,
215 VISU::Entity theEntity,
216 const char* theFieldName,
217 CORBA::Long theIteration);
221 IsoSurfacesOnField(Result_ptr theResult,
222 const char* theMeshName,
223 VISU::Entity theEntity,
224 const char* theFieldName,
225 CORBA::Long theIteration);
229 CutPlanesOnField(Result_ptr theResult,
230 const char* theMeshName,
231 VISU::Entity theEntity,
232 const char* theFieldName,
233 CORBA::Long theIteration);
237 CutLinesOnField(Result_ptr theResult,
238 const char* theMeshName,
239 VISU::Entity theEntity,
240 const char* theFieldName,
241 CORBA::Long theIteration);
245 CutSegmentOnField(Result_ptr theResult,
246 const char* theMeshName,
247 VISU::Entity theEntity,
248 const char* theFieldName,
249 CORBA::Long theIteration);
253 StreamLinesOnField(Result_ptr theResult,
254 const char* theMeshName,
255 VISU::Entity theEntity,
256 const char* theFieldName,
257 CORBA::Long theIteration);
261 Plot3DOnField(Result_ptr theResult,
262 const char* theMeshName,
263 VISU::Entity theEntity,
264 const char* theFieldName,
265 CORBA::Long theIteration);
267 //Create Digital Presentation
270 CreateTable(const char* theTableEntry);
274 CreateCurve(Table_ptr theTable,
276 CORBA::Long theVRow);
280 CreateCurveWithZ(Table_ptr theTable,
283 CORBA::Long theZRow);
287 CreateCurveWithZExt(Table_ptr theTable,
291 CORBA::Boolean theIsV2);
299 CreateAnimation(View3D_ptr theView3d);
303 CreateEvolution(XYPlot_ptr theXYPLot);
307 DeleteResult(Result_ptr theResult);
311 DeletePrs3d(Prs3d_ptr thePrs3d);
313 // inherited methods from Engines::Component
316 DumpPython(CORBA::Object_ptr theStudy,
317 CORBA::Boolean theIsPublished,
318 CORBA::Boolean theIsMultiFile,
319 CORBA::Boolean& theIsValidScript);
321 // inherited methods from SALOMEDS::Driver
324 Save(SALOMEDS::SComponent_ptr theComponent,
330 SaveASCII(SALOMEDS::SComponent_ptr theComponent,
336 Load(SALOMEDS::SComponent_ptr,
337 const SALOMEDS::TMPFile &,
343 LoadASCII(SALOMEDS::SComponent_ptr,
344 const SALOMEDS::TMPFile &,
350 Close(SALOMEDS::SComponent_ptr IORSComponent);
358 IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
359 const char* IORString,
360 CORBA::Boolean isMultiFile,
361 CORBA::Boolean isASCII);
365 LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
366 const char* aLocalPersistentID,
367 CORBA::Boolean isMultiFile,
368 CORBA::Boolean isASCII);
372 CanPublishInStudy(CORBA::Object_ptr theIOR);
375 SALOMEDS::SObject_ptr
376 PublishInStudy(SALOMEDS::Study_ptr theStudy,
377 SALOMEDS::SObject_ptr theSObject,
378 CORBA::Object_ptr theObject,
379 const char* theName) throw (SALOME::SALOME_Exception);
382 CanCopy(SALOMEDS::SObject_ptr theObject);
385 CopyFrom(SALOMEDS::SObject_ptr theObject,
386 CORBA::Long& theObjectID);
389 CanPaste(const char* theComponentName,
390 CORBA::Long theObjectID);
392 SALOMEDS::SObject_ptr
393 PasteInto(const SALOMEDS::TMPFile& theStream,
394 CORBA::Long theObjectID,
395 SALOMEDS::SObject_ptr theObject);
398 VISU::ColoredPrs3dCache_ptr
399 GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy);
402 virtual CORBA::Long CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
403 CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
404 CORBA::Boolean isAuto, const char* name);
406 virtual void EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
407 CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
408 CORBA::Boolean isAuto, const char* name);
410 /* Returns clipping plane by its Id */
411 virtual VISU::ClippingPlane* GetClippingPlane(CORBA::Long id);
413 /* Deletes clipping plane by its Id */
414 virtual CORBA::Boolean DeleteClippingPlane(CORBA::Long id);
416 /* Applyes a clipping plane with Id to presentation thePrs */
417 virtual CORBA::Boolean ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
419 /* Detaches a clipping plane with Id from presentation thePrs */
420 virtual CORBA::Boolean DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
422 /* Get number of clipping planes */
423 virtual CORBA::Long GetClippingPlanesNb();
425 VISU_ClippingPlaneMgr& GetClippingPlaneMgr() { return myClippingPlaneMgr; }
427 /* Convert a set of VTK files to the MED file */
430 VTK2MED(const VISU::string_array& theVTKFiles,
431 const char* theMEDFile,
432 const char* theMeshName,
433 const VISU::double_array& theTStamps);
435 /* Load texture from file */
436 virtual CORBA::Long LoadTexture(const char* theTextureFile);
438 StudyId2MarkerMap& GetMarkerMap() { return myMarkerMap; }