]> SALOME platform Git repositories - modules/visu.git/blob - src/VISU_I/VISU_Gen_i.hh
Salome HOME
Roll-back previous integration
[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     virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
42     virtual SALOMEDS::Study_ptr GetCurrentStudy();
43
44     virtual ViewManager_ptr GetViewManager();
45
46     virtual SALOMEDS::SObject_ptr ImportTables(const char* theFileName);
47     virtual CORBA::Boolean ExportTableToFile(SALOMEDS::SObject_ptr theTable, const char* theFileName );
48
49     //Create Result
50     virtual Result_ptr ImportFile(const char* theFileName);
51     virtual Result_ptr CopyAndImportFile(const char* theFileName);
52     virtual Result_ptr ImportMed(SALOMEDS::SObject_ptr theMedSObject);
53     virtual Result_ptr ImportMedField(SALOME_MED::FIELD_ptr theField);
54
55     //Create Presentation Of Submeshes
56     virtual Mesh_ptr MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity);
57     virtual Mesh_ptr FamilyMeshOnEntity(Result_ptr theResult, const char* theMeshName, 
58                                         VISU::Entity theEntity, const char* theFamilyName);
59     virtual Mesh_ptr GroupMesh(Result_ptr theResult, const char* theMeshName, const char* theGroupName);
60
61     //Create 3D collored Presentation Of Different Types
62     template<typename TPrs3d_i> typename TPrs3d_i::TInterface::_var_type 
63     Prs3dOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
64                const char* theFieldName, CORBA::Double theIteration, bool theAddToStudy = true)
65     {
66       typedef typename TPrs3d_i::TInterface TPrs3d;
67       typename TPrs3d::_var_type aPrs3d;
68       if(myStudyDocument->GetProperties()->IsLocked()) return TPrs3d::_nil();
69       Mutex mt(myMutex,qApp);
70       Result_i* pResult = dynamic_cast<Result_i*>(GetServant(theResult).in());
71       if(TPrs3d_i::IsPossible(pResult,theMeshName,theEntity,theFieldName,int(theIteration))){
72         TPrs3d_i* aPresent = new TPrs3d_i(pResult,theAddToStudy);
73         if(aPresent->Create(theMeshName,theEntity,theFieldName,int(theIteration)) != NULL)
74           return aPresent->_this();
75         else
76           aPresent->_remove_ref();
77       }
78       return TPrs3d::_nil();
79     }
80
81     virtual ScalarMap_ptr ScalarMapOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
82                                            const char* theFieldName, CORBA::Double theIteration);
83     virtual DeformedShape_ptr DeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
84                                                    const char* theFieldName, CORBA::Double theIteration);
85     virtual Vectors_ptr VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
86                                        const char* theFieldName, CORBA::Double theIteration);
87     virtual IsoSurfaces_ptr IsoSurfacesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
88                                                const char* theFieldName, CORBA::Double theIteration);
89     virtual CutPlanes_ptr CutPlanesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
90                                            const char* theFieldName, CORBA::Double theIteration);
91     virtual CutLines_ptr CutLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
92                                          const char* theFieldName, CORBA::Double theIteration);
93     virtual StreamLines_ptr StreamLinesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, 
94                                                const char* theFieldName, CORBA::Double theIteration);
95     //Create Digital Presentation
96     virtual Table_ptr CreateTable(const char* theTableEntry);
97     virtual Curve_ptr CreateCurve(Table_ptr theTable, CORBA::Long theHRow, CORBA::Long theVRow);
98     virtual Container_ptr CreateContainer();
99     virtual Animation_ptr CreateAnimation(View3D_ptr theView3d);
100     
101     // inherited methods from SALOMEDS::Driver
102     virtual SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
103                                     const char* theURL,
104                                     bool isMultiFile);
105     virtual SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
106                                          const char* theURL,
107                                          bool isMultiFile);
108     virtual bool Load(SALOMEDS::SComponent_ptr,
109                       const SALOMEDS::TMPFile &,
110                       const char* theURL,
111                       bool isMultiFile);
112     virtual bool LoadASCII(SALOMEDS::SComponent_ptr,
113                            const SALOMEDS::TMPFile &,
114                            const char* theURL,
115                            bool isMultiFile);
116
117     virtual void Close(SALOMEDS::SComponent_ptr IORSComponent); 
118
119     virtual char* ComponentDataType();
120
121     virtual char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
122                                          const char* IORString,
123                                          CORBA::Boolean isMultiFile,
124                                          CORBA::Boolean isASCII);
125     virtual char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
126                                          const char* aLocalPersistentID,
127                                          CORBA::Boolean isMultiFile,
128                                          CORBA::Boolean isASCII);
129     
130     virtual bool CanPublishInStudy(CORBA::Object_ptr theIOR);
131     virtual SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
132                                                  SALOMEDS::SObject_ptr theSObject,
133                                                  CORBA::Object_ptr theObject,
134                                                  const char* theName) throw (SALOME::SALOME_Exception);
135
136     CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
137     SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
138     CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
139     SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
140                                     CORBA::Long theObjectID,
141                                     SALOMEDS::SObject_ptr theObject);
142   };
143 }
144 #endif