1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File : VISU_Gen_i.hh
21 // Author : Alexey Petrov
24 #ifndef __VISU_GEN_I_H__
25 #define __VISU_GEN_I_H__
27 #include "VISUConfig.hh"
29 #include "SALOME_Component_i.hxx"
30 #include "SALOME_NamingService.hxx"
40 CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d,
41 const char* theMeshName,
42 VISU::Entity theEntity,
43 const char* theFieldName,
44 CORBA::Double theIteration);
46 class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
47 public virtual ::Engines_Component_i,
50 SALOMEDS::Study_var myStudyDocument;
52 VISU_Gen_i(const VISU::VISU_Gen_i &);
54 VISU_Gen_i(CORBA::ORB_ptr theORB,
55 PortableServer::POA_ptr thePOA,
56 SALOME_NamingService* theNamingService,
58 virtual ~VISU_Gen_i();
66 GetType() { return VISU::TVISUGEN;};
70 SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
82 ImportTables(const char* theFileName);
86 ExportTableToFile(SALOMEDS::SObject_ptr theTable,
87 const char* theFileName );
92 ImportFile(const char* theFileName);
96 CreateResult(const char* theFileName);
100 CopyAndImportFile(const char* theFileName);
104 ImportMed(SALOMEDS::SObject_ptr theMedSObject);
108 ImportMedField(SALOME_MED::FIELD_ptr theField);
111 //Rename Presentation Of Submeshes
113 RenameMeshInStudy(Result_ptr theResult,
114 std::string theMeshName,
115 int theEntity, // -1 for group indication
116 std::string theSubMeshName, // Family or Group name
117 std::string theNewName);
120 RenameEntityInStudy(Result_ptr theResult,
121 const char* theMeshName,
122 VISU::Entity theEntity,
123 const char* theNewName);
126 RenameFamilyInStudy(Result_ptr theResult,
127 const char* theMeshName,
128 VISU::Entity theEntity,
129 const char* theFamilyName,
130 const char* theNewName);
133 RenameGroupInStudy(Result_ptr theResult,
134 const char* theMeshName,
135 const char* theGroupName,
136 const char* theNewName);
138 //Create Presentation Of Submeshes
141 MeshOnEntity(Result_ptr theResult,
142 const char* theMeshName,
143 VISU::Entity theEntity);
147 FamilyMeshOnEntity(Result_ptr theResult,
148 const char* theMeshName,
149 VISU::Entity theEntity,
150 const char* theFamilyName);
154 GroupMesh(Result_ptr theResult,
155 const char* theMeshName,
156 const char* theGroupName);
158 //Create 3D collored Presentation Of Different Types
159 template<typename TPrs3d_i> TPrs3d_i*
160 CreatePrs3d(Result_ptr theResult,
161 const char* theMeshName,
162 VISU::Entity theEntity,
163 const char* theFieldName,
164 CORBA::Double theIteration,
165 bool theAddToStudy = true)
167 if(myStudyDocument->GetProperties()->IsLocked())
170 typedef typename TPrs3d_i::TInterface TPrs3d;
171 typename TPrs3d::_var_type aPrs3d;
173 if(Result_i* aResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
174 if(TPrs3d_i::IsPossible(aResult,theMeshName,theEntity,theFieldName,int(theIteration))){
175 TPrs3d_i* aPresent = new TPrs3d_i(aResult,theAddToStudy);
176 if(CreatColoredPrs3d(aPresent,theMeshName,theEntity,theFieldName,theIteration))
178 aPresent->_remove_ref();
184 template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type
185 Prs3dOnField(Result_ptr theResult,
186 const char* theMeshName,
187 VISU::Entity theEntity,
188 const char* theFieldName,
189 CORBA::Double theIteration,
190 bool theAddToStudy = true)
192 typedef typename TPrs3d_i::TInterface TPrs3d;
193 typename TPrs3d::_var_type aPrs3d;
194 if(TPrs3d_i* aPrs3d = CreatePrs3d<TPrs3d_i>(theResult,theMeshName,theEntity,theFieldName,theIteration,theAddToStudy))
195 return aPrs3d->_this();
196 return TPrs3d::_nil();
201 ScalarMapOnField(Result_ptr theResult,
202 const char* theMeshName,
203 VISU::Entity theEntity,
204 const char* theFieldName,
205 CORBA::Double theIteration);
209 GaussPointsOnField(Result_ptr theResult,
210 const char* theMeshName,
211 VISU::Entity theEntity,
212 const char* theFieldName,
213 CORBA::Double theIteration);
217 DeformedShapeOnField(Result_ptr theResult,
218 const char* theMeshName,
219 VISU::Entity theEntity,
220 const char* theFieldName,
221 CORBA::Double theIteration);
224 ScalarMapOnDeformedShape_ptr
225 ScalarMapOnDeformedShapeOnField(Result_ptr theResult,
226 const char* theMeshName,
227 VISU::Entity theEntity,
228 const char* theFieldName,
229 CORBA::Double theIteration);
232 VectorsOnField(Result_ptr theResult,
233 const char* theMeshName,
234 VISU::Entity theEntity,
235 const char* theFieldName,
236 CORBA::Double theIteration);
240 IsoSurfacesOnField(Result_ptr theResult,
241 const char* theMeshName,
242 VISU::Entity theEntity,
243 const char* theFieldName,
244 CORBA::Double theIteration);
248 CutPlanesOnField(Result_ptr theResult,
249 const char* theMeshName,
250 VISU::Entity theEntity,
251 const char* theFieldName,
252 CORBA::Double theIteration);
256 CutLinesOnField(Result_ptr theResult,
257 const char* theMeshName,
258 VISU::Entity theEntity,
259 const char* theFieldName,
260 CORBA::Double theIteration);
264 StreamLinesOnField(Result_ptr theResult,
265 const char* theMeshName,
266 VISU::Entity theEntity,
267 const char* theFieldName,
268 CORBA::Double theIteration);
272 Plot3DOnField(Result_ptr theResult,
273 const char* theMeshName,
274 VISU::Entity theEntity,
275 const char* theFieldName,
276 CORBA::Double theIteration);
278 //Create Digital Presentation
281 CreateTable(const char* theTableEntry);
285 CreateCurve(Table_ptr theTable,
287 CORBA::Long theVRow);
295 CreateAnimation(View3D_ptr theView3d);
299 DeleteResult(Result_ptr theResult);
303 DeletePrs3d(Prs3d_ptr thePrs3d);
305 // inherited methods from Engines::Component
308 DumpPython(CORBA::Object_ptr theStudy,
309 CORBA::Boolean theIsPublished,
310 CORBA::Boolean& theIsValidScript);
312 // inherited methods from SALOMEDS::Driver
315 Save(SALOMEDS::SComponent_ptr theComponent,
321 SaveASCII(SALOMEDS::SComponent_ptr theComponent,
327 Load(SALOMEDS::SComponent_ptr,
328 const SALOMEDS::TMPFile &,
334 LoadASCII(SALOMEDS::SComponent_ptr,
335 const SALOMEDS::TMPFile &,
341 Close(SALOMEDS::SComponent_ptr IORSComponent);
349 IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
350 const char* IORString,
351 CORBA::Boolean isMultiFile,
352 CORBA::Boolean isASCII);
356 LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
357 const char* aLocalPersistentID,
358 CORBA::Boolean isMultiFile,
359 CORBA::Boolean isASCII);
363 CanPublishInStudy(CORBA::Object_ptr theIOR);
366 SALOMEDS::SObject_ptr
367 PublishInStudy(SALOMEDS::Study_ptr theStudy,
368 SALOMEDS::SObject_ptr theSObject,
369 CORBA::Object_ptr theObject,
370 const char* theName) throw (SALOME::SALOME_Exception);
373 CanCopy(SALOMEDS::SObject_ptr theObject);
376 CopyFrom(SALOMEDS::SObject_ptr theObject,
377 CORBA::Long& theObjectID);
380 CanPaste(const char* theComponentName,
381 CORBA::Long theObjectID);
383 SALOMEDS::SObject_ptr
384 PasteInto(const SALOMEDS::TMPFile& theStream,
385 CORBA::Long theObjectID,
386 SALOMEDS::SObject_ptr theObject);