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 // File : VISU_Gen_i.hh
23 // Author : Alexey Petrov
26 #ifndef __VISU_GEN_I_H__
27 #define __VISU_GEN_I_H__
29 #include "VISUConfig.hh"
32 #include "SALOME_Component_i.hxx"
33 #include "SALOME_NamingService.hxx"
34 #include "VISU_ColoredPrs3d_i.hh"
35 #include "VISU_ClippingPlaneMgr.hxx"
41 //----------------------------------------------------------------------------
42 class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
43 public virtual ::Engines_Component_i,
46 SALOMEDS::Study_var myStudyDocument;
47 VISU_ClippingPlaneMgr myClippingPlaneMgr;
49 VISU_Gen_i(const VISU::VISU_Gen_i &);
51 VISU_Gen_i(CORBA::ORB_ptr theORB,
52 PortableServer::POA_ptr thePOA,
53 SALOME_NamingService* theNamingService,
65 GetType() { return VISU::TVISUGEN;};
69 SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
81 ImportTables(const char* theFileName);
85 ExportTableToFile(SALOMEDS::SObject_ptr theTable,
86 const char* theFileName );
91 ImportFile(const char* theFileName);
95 CreateResult(const char* theFileName);
99 CopyAndImportFile(const char* theFileName);
103 ImportMed(SALOMEDS::SObject_ptr theMedSObject);
107 ImportMedField(SALOME_MED::FIELD_ptr theField);
110 //Rename Presentation Of Submeshes
112 RenameMeshInStudy(Result_ptr theResult,
113 const std::string& theMeshName,
114 int theEntity, // -1 for group indication
115 const std::string& theSubMeshName, // Family or Group name
116 const std::string& theNewName);
119 RenameEntityInStudy(Result_ptr theResult,
120 const char* theMeshName,
121 VISU::Entity theEntity,
122 const char* theNewName);
125 RenameFamilyInStudy(Result_ptr theResult,
126 const char* theMeshName,
127 VISU::Entity theEntity,
128 const char* theFamilyName,
129 const char* theNewName);
132 RenameGroupInStudy(Result_ptr theResult,
133 const char* theMeshName,
134 const char* theGroupName,
135 const char* theNewName);
137 //Create Presentation Of Submeshes
140 MeshOnEntity(Result_ptr theResult,
141 const char* theMeshName,
142 VISU::Entity theEntity);
146 FamilyMeshOnEntity(Result_ptr theResult,
147 const char* theMeshName,
148 VISU::Entity theEntity,
149 const char* theFamilyName);
153 GroupMesh(Result_ptr theResult,
154 const char* theMeshName,
155 const char* theGroupName);
158 CreatePrs3d(VISUType theType,
159 SALOMEDS::Study_ptr theStudy);
163 ScalarMapOnField(Result_ptr theResult,
164 const char* theMeshName,
165 VISU::Entity theEntity,
166 const char* theFieldName,
167 CORBA::Long theIteration);
171 GaussPointsOnField(Result_ptr theResult,
172 const char* theMeshName,
173 VISU::Entity theEntity,
174 const char* theFieldName,
175 CORBA::Long theIteration);
179 DeformedShapeOnField(Result_ptr theResult,
180 const char* theMeshName,
181 VISU::Entity theEntity,
182 const char* theFieldName,
183 CORBA::Long theIteration);
185 //This function is obsolete. Use DeformedShapeAndScalarMapOnField instead.
187 DeformedShapeAndScalarMap_ptr
188 ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
189 const char* theMeshName,
190 VISU::Entity theEntity,
191 const char* theFieldName,
192 CORBA::Long theIteration);
195 DeformedShapeAndScalarMap_ptr
196 DeformedShapeAndScalarMapOnField(Result_ptr theResult,
197 const char* theMeshName,
198 VISU::Entity theEntity,
199 const char* theFieldName,
200 CORBA::Long theIteration);
204 VectorsOnField(Result_ptr theResult,
205 const char* theMeshName,
206 VISU::Entity theEntity,
207 const char* theFieldName,
208 CORBA::Long theIteration);
212 IsoSurfacesOnField(Result_ptr theResult,
213 const char* theMeshName,
214 VISU::Entity theEntity,
215 const char* theFieldName,
216 CORBA::Long theIteration);
220 CutPlanesOnField(Result_ptr theResult,
221 const char* theMeshName,
222 VISU::Entity theEntity,
223 const char* theFieldName,
224 CORBA::Long theIteration);
228 CutLinesOnField(Result_ptr theResult,
229 const char* theMeshName,
230 VISU::Entity theEntity,
231 const char* theFieldName,
232 CORBA::Long theIteration);
236 CutSegmentOnField(Result_ptr theResult,
237 const char* theMeshName,
238 VISU::Entity theEntity,
239 const char* theFieldName,
240 CORBA::Long theIteration);
244 StreamLinesOnField(Result_ptr theResult,
245 const char* theMeshName,
246 VISU::Entity theEntity,
247 const char* theFieldName,
248 CORBA::Long theIteration);
252 Plot3DOnField(Result_ptr theResult,
253 const char* theMeshName,
254 VISU::Entity theEntity,
255 const char* theFieldName,
256 CORBA::Long theIteration);
258 //Create Digital Presentation
261 CreateTable(const char* theTableEntry);
265 CreateCurve(Table_ptr theTable,
267 CORBA::Long theVRow);
270 CreateCurveWithZ(Table_ptr theTable,
273 CORBA::Long theZRow);
281 CreateAnimation(View3D_ptr theView3d);
285 CreateEvolution(XYPlot_ptr theXYPLot);
289 DeleteResult(Result_ptr theResult);
293 DeletePrs3d(Prs3d_ptr thePrs3d);
295 // inherited methods from Engines::Component
298 DumpPython(CORBA::Object_ptr theStudy,
299 CORBA::Boolean theIsPublished,
300 CORBA::Boolean& theIsValidScript);
302 // inherited methods from SALOMEDS::Driver
305 Save(SALOMEDS::SComponent_ptr theComponent,
311 SaveASCII(SALOMEDS::SComponent_ptr theComponent,
317 Load(SALOMEDS::SComponent_ptr,
318 const SALOMEDS::TMPFile &,
324 LoadASCII(SALOMEDS::SComponent_ptr,
325 const SALOMEDS::TMPFile &,
331 Close(SALOMEDS::SComponent_ptr IORSComponent);
339 IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
340 const char* IORString,
341 CORBA::Boolean isMultiFile,
342 CORBA::Boolean isASCII);
346 LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
347 const char* aLocalPersistentID,
348 CORBA::Boolean isMultiFile,
349 CORBA::Boolean isASCII);
353 CanPublishInStudy(CORBA::Object_ptr theIOR);
356 SALOMEDS::SObject_ptr
357 PublishInStudy(SALOMEDS::Study_ptr theStudy,
358 SALOMEDS::SObject_ptr theSObject,
359 CORBA::Object_ptr theObject,
360 const char* theName) throw (SALOME::SALOME_Exception);
363 CanCopy(SALOMEDS::SObject_ptr theObject);
366 CopyFrom(SALOMEDS::SObject_ptr theObject,
367 CORBA::Long& theObjectID);
370 CanPaste(const char* theComponentName,
371 CORBA::Long theObjectID);
373 SALOMEDS::SObject_ptr
374 PasteInto(const SALOMEDS::TMPFile& theStream,
375 CORBA::Long theObjectID,
376 SALOMEDS::SObject_ptr theObject);
379 VISU::ColoredPrs3dCache_ptr
380 GetColoredPrs3dCache(SALOMEDS::Study_ptr theStudy);
383 virtual CORBA::Long CreateClippingPlane(CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
384 CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
385 CORBA::Boolean isAuto, const char* name);
387 virtual void EditClippingPlane(CORBA::Long id, CORBA::Double X,CORBA::Double Y, CORBA::Double Z,
388 CORBA::Double dX, CORBA::Double dY, CORBA::Double dZ,
389 CORBA::Boolean isAuto, const char* name);
391 /* Returns clipping plane by its Id */
392 virtual VISU::ClippingPlane* GetClippingPlane(CORBA::Long id);
394 /* Deletes clipping plane by its Id */
395 virtual CORBA::Boolean DeleteClippingPlane(CORBA::Long id);
397 /* Applyes a clipping plane with Id to presentation thePrs */
398 virtual CORBA::Boolean ApplyClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
400 /* Detaches a clipping plane with Id from presentation thePrs */
401 virtual CORBA::Boolean DetachClippingPlane(Prs3d_ptr thePrs, CORBA::Long id);
403 /* Get number of clipping planes */
404 virtual CORBA::Long GetClippingPlanesNb();
406 VISU_ClippingPlaneMgr& GetClippingPlaneMgr() { return myClippingPlaneMgr; }
408 /* Convert a set of VTK files to the MED file */
411 VTK2MED(const VISU::string_array& theVTKFiles,
412 const char* theMEDFile,
413 const char* theMeshName,
414 const VISU::double_array& theTStamps);