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 VISU_Gen_var myVisuGen;
25 SALOMEDS::Study_var myStudyDocument;
27 VISU_Gen_i(const VISU::VISU_Gen_i &);
29 VISU_Gen_i(CORBA::ORB_ptr theORB, PortableServer::POA_ptr thePOA,
30 SALOME_NamingService* theNamingService, QMutex* theMutex);
31 VISU_Gen_i(CORBA::ORB_ptr orb,
32 PortableServer::POA_ptr poa,
33 PortableServer::ObjectId * contId,
34 const char *instanceName,
35 const char *interfaceName);
36 virtual ~VISU_Gen_i();
38 virtual char* GetID();
39 virtual VISU::VISUType GetType() { return VISU::TVISUGEN;};
41 /*! SAN & VSR : Test QT_EVENT
42 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
44 virtual void DoSomething();
45 /*! SAN & VSR : Test QT_EVENT
46 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
48 virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
49 virtual SALOMEDS::Study_ptr GetCurrentStudy();
51 virtual ViewManager_ptr GetViewManager();
53 virtual SALOMEDS::SObject_ptr ImportTables(const char* theFileName);
54 virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName );
57 virtual Result_ptr ImportFile(const char* theFileName);
58 virtual Result_ptr CopyAndImportFile(const char* theFileName);
59 virtual Result_ptr ImportMed(SALOMEDS::SObject_ptr theMedSObject);
60 virtual Result_ptr ImportMedField(SALOME_MED::FIELD_ptr theField);
62 //Create Presentation Of Submeshes
63 virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity);
64 virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName,
65 VISU::Entity theEntity, const char* theFamilyName);
66 virtual Mesh_ptr GroupMesh(Result_ptr theResult, const char* theMeshName, const char* theGroupName);
68 //Create 3D collored Presentation Of Different Types
69 template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type
70 Prs3dOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
71 const char* theFieldName, CORBA::Double theIteration, bool theAddToStudy = true)
73 typedef typename TPrs3d_i::TInterface TPrs3d;
74 typename TPrs3d::_var_type aPrs3d;
75 if(myStudyDocument->GetProperties()->IsLocked()) return TPrs3d::_nil();
76 Mutex mt(myMutex,qApp);
77 Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
78 if(TPrs3d_i::IsPossible(pResult,theMeshName,theEntity,theFieldName,int(theIteration))){
79 TPrs3d_i* aPresent = new TPrs3d_i(pResult,theAddToStudy);
80 if(aPresent->Create(theMeshName,theEntity,theFieldName,int(theIteration)) != NULL)
81 return aPresent->_this();
83 aPresent->_remove_ref();
85 return TPrs3d::_nil();
88 virtual ScalarMap_ptr ScalarMapOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
89 const char* theFieldName, CORBA::Double theIteration);
90 virtual DeformedShape_ptr DeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
91 const char* theFieldName, CORBA::Double theIteration);
92 virtual Vectors_ptr VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
93 const char* theFieldName, CORBA::Double theIteration);
94 virtual IsoSurfaces_ptr IsoSurfacesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
95 const char* theFieldName, CORBA::Double theIteration);
96 virtual CutPlanes_ptr CutPlanesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
97 const char* theFieldName, CORBA::Double theIteration);
98 virtual CutLines_ptr CutLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
99 const char* theFieldName, CORBA::Double theIteration);
100 virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity,
101 const char* theFieldName, CORBA::Double theIteration);
102 //Create Digital Presentation
103 virtual Table_ptr CreateTable(const char* theTableEntry);
104 virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
105 virtual Container_ptr CreateContainer();
106 virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
108 // inherited methods from SALOMEDS::Driver
109 virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
112 virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
115 virtual bool Load(SALOMEDS::SComponent_ptr,
116 const SALOMEDS::TMPFile &,
119 virtual bool LoadASCII(SALOMEDS::SComponent_ptr,
120 const SALOMEDS::TMPFile &,
124 virtual void Close(SALOMEDS::SComponent_ptr IORSComponent);
126 virtual char* ComponentDataType();
128 virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
129 const char* IORString,
130 CORBA::Boolean isMultiFile,
131 CORBA::Boolean isASCII);
132 virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
133 const char* aLocalPersistentID,
134 CORBA::Boolean isMultiFile,
135 CORBA::Boolean isASCII);
137 virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR);
138 virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
139 SALOMEDS::SObject_ptr theSObject,
140 CORBA::Object_ptr theObject,
141 const char* theName) throw (SALOME::SALOME_Exception);
143 CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
144 SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
145 CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
146 SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
147 CORBA::Long theObjectID,
148 SALOMEDS::SObject_ptr theObject);