]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_Gen_i.hh
Salome HOME
df9a352c47c31d400ebc7b0480a65e844ea9e1ab
[modules/visu.git] / src / VISU_I / VISU_Gen_i.hh
1 //  Copyright (C) 2003  CEA/DEN, EDF R&D
2 //
3 //
4 //
5 //  File   : VISU_GEN_i.h file
6 //  Author : Alexey Petrov
7 //  Module : VISU
8 //  $Header: 
9
10 #ifndef __VISU_GEN_I_H__
11 #define __VISU_GEN_I_H__
12
13 #include "VISUConfig.hh"
14
15 #include "SALOME_Component_i.hxx"
16 #include "SALOME_NamingService.hxx"
17
18 namespace VISU{
19   class Result_i;
20   class VISU_Gen_i : public virtual POA_VISU::VISU_Gen,
21                      public virtual ::Engines_Component_i,
22                      public virtual Base_i
23   {
24     VISU_Gen_var myVisuGen;
25     SALOMEDS::Study_var myStudyDocument;
26     VISU_Gen_i();
27     VISU_Gen_i(const VISU::VISU_Gen_i &);
28   public:
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();
37
38     virtual char* GetID();
39     virtual VISU::VISUType GetType() { return VISU::TVISUGEN;};
40
41 /*! SAN & VSR : Test QT_EVENT 
42 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
43 */
44     virtual void DoSomething();
45 /*! SAN & VSR : Test QT_EVENT
46 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
47 */
48     virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
49     virtual SALOMEDS::Study_ptr GetCurrentStudy();
50
51     virtual ViewManager_ptr GetViewManager();
52
53     virtual SALOMEDS::SObject_ptr ImportTables(const char* theFileName);
54     virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName );
55
56     //Create Result
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);
61
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);
67
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)
72     {
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();
82         else
83           aPresent->_remove_ref();
84       }
85       return TPrs3d::_nil();
86     }
87
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);
107     
108     // inherited methods from SALOMEDS::Driver
109     virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
110                                     const char* theURL,
111                                     bool isMultiFile);
112     virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
113                                          const char* theURL,
114                                          bool isMultiFile);
115     virtual bool Load(SALOMEDS::SComponent_ptr,
116                       const SALOMEDS::TMPFile &,
117                       const char* theURL,
118                       bool isMultiFile);
119     virtual bool LoadASCII(SALOMEDS::SComponent_ptr,
120                            const SALOMEDS::TMPFile &,
121                            const char* theURL,
122                            bool isMultiFile);
123
124     virtual void Close(SALOMEDS::SComponent_ptr IORSComponent); 
125
126     virtual char* ComponentDataType();
127
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);
136     
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);
142
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);
149   };
150 }
151 #endif