1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : VISU_GEN_i.h file
6 // Author : Alexey Petrov
10 #ifndef __VISU_GEN_I_H__
11 #define __VISU_GEN_I_H__
13 #include "VISUConfig.hh"
15 #include "SALOME_Component_i.hxx"
16 #include "SALOME_NamingService.hxx"
20 class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
21 public virtual ::Engines_Component_i,
24 SALOMEDS::Study_var myStudyDocument;
26 VISU_Gen_i(const VISU::VISU_Gen_i &);
28 VISU_Gen_i(CORBA::ORB_ptr theORB,
29 PortableServer::POA_ptr thePOA,
30 SALOME_NamingService* theNamingService,
32 virtual ~VISU_Gen_i();
34 virtual char* GetID();
35 virtual VISU::VISUType GetType() { return VISU::TVISUGEN;};
37 virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
38 virtual SALOMEDS::Study_ptr GetCurrentStudy();
40 virtual ViewManager_ptr GetViewManager();
42 virtual SALOMEDS::SObject_ptr ImportTables(const char* theFileName);
43 virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName );
46 virtual Result_ptr ImportFile(const char* theFileName);
47 virtual Result_ptr CopyAndImportFile(const char* theFileName);
48 virtual Result_ptr ImportMed(SALOMEDS::SObject_ptr theMedSObject);
49 virtual Result_ptr ImportMedField(SALOME_MED::FIELD_ptr theField);
51 //Create Presentation Of Submeshes
52 virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity);
53 virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName,
54 VISU::Entity theEntity, const char* theFamilyName);
55 virtual Mesh_ptr GroupMesh(Result_ptr theResult, const char* theMeshName, const char* theGroupName);
57 //Create 3D collored Presentation Of Different Types
58 template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type
59 Prs3dOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
60 const char* theFieldName, CORBA::Double theIteration, bool theAddToStudy = true)
62 typedef typename TPrs3d_i::TInterface TPrs3d;
63 typename TPrs3d::_var_type aPrs3d;
64 if(myStudyDocument->GetProperties()->IsLocked()) return TPrs3d::_nil();
66 if(Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in())){
67 if(TPrs3d_i::IsPossible(pResult,theMeshName,theEntity,theFieldName,int(theIteration))){
68 TPrs3d_i* aPresent = new TPrs3d_i(pResult,theAddToStudy);
69 if(aPresent->Create(theMeshName,theEntity,theFieldName,int(theIteration)) != NULL)
70 return aPresent->_this();
72 aPresent->_remove_ref();
75 return TPrs3d::_nil();
78 virtual ScalarMap_ptr ScalarMapOnField(Result_ptr theResult,
79 const char* theMeshName, VISU::Entity theEntity,
80 const char* theFieldName, CORBA::Double theIteration);
81 virtual DeformedShape_ptr DeformedShapeOnField(Result_ptr theResult,
82 const char* theMeshName, VISU::Entity theEntity,
83 const char* theFieldName, CORBA::Double theIteration);
84 virtual Vectors_ptr VectorsOnField(Result_ptr theResult,
85 const char* theMeshName, VISU::Entity theEntity,
86 const char* theFieldName, CORBA::Double theIteration);
87 virtual IsoSurfaces_ptr IsoSurfacesOnField(Result_ptr theResult,
88 const char* theMeshName, VISU::Entity theEntity,
89 const char* theFieldName, CORBA::Double theIteration);
90 virtual CutPlanes_ptr CutPlanesOnField(Result_ptr theResult,
91 const char* theMeshName, VISU::Entity theEntity,
92 const char* theFieldName, CORBA::Double theIteration);
93 virtual CutLines_ptr CutLinesOnField(Result_ptr theResult,
94 const char* theMeshName, VISU::Entity theEntity,
95 const char* theFieldName, CORBA::Double theIteration);
96 virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult,
97 const char* theMeshName, VISU::Entity theEntity,
98 const char* theFieldName, CORBA::Double theIteration);
99 //Create Digital Presentation
100 virtual Table_ptr CreateTable(const char* theTableEntry);
101 virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
102 virtual Container_ptr CreateContainer();
103 virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
105 virtual void DeleteResult(Result_ptr theResult);
106 virtual void DeletePrs3d(Prs3d_ptr thePrs3d);
108 // inherited methods from Engines::Component
111 DumpPython(CORBA::Object_ptr theStudy,
112 CORBA::Boolean theIsPublished,
113 CORBA::Boolean& theIsValidScript);
114 // inherited methods from SALOMEDS::Driver
115 virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
118 virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
121 virtual bool Load(SALOMEDS::SComponent_ptr,
122 const SALOMEDS::TMPFile &,
125 virtual bool LoadASCII(SALOMEDS::SComponent_ptr,
126 const SALOMEDS::TMPFile &,
130 virtual void Close(SALOMEDS::SComponent_ptr IORSComponent);
132 virtual char* ComponentDataType();
134 virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
135 const char* IORString,
136 CORBA::Boolean isMultiFile,
137 CORBA::Boolean isASCII);
138 virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
139 const char* aLocalPersistentID,
140 CORBA::Boolean isMultiFile,
141 CORBA::Boolean isASCII);
143 virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR);
144 virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
145 SALOMEDS::SObject_ptr theSObject,
146 CORBA::Object_ptr theObject,
147 const char* theName) throw (SALOME::SALOME_Exception);
149 CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
150 SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
151 CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
152 SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
153 CORBA::Long theObjectID,
154 SALOMEDS::SObject_ptr theObject);