1 // SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESH_Gen_i.hxx
25 // Author : Paul RASCLE, EDF
29 #ifndef _SMESH_GEN_I_HXX_
30 #define _SMESH_GEN_I_HXX_
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SMESH_Gen)
34 #include CORBA_SERVER_HEADER(SMESH_Mesh)
35 #include CORBA_SERVER_HEADER(SMESH_Hypothesis)
36 #include CORBA_CLIENT_HEADER(GEOM_Gen)
37 #include CORBA_CLIENT_HEADER(GEOM_Shape)
38 #include CORBA_CLIENT_HEADER(SALOMEDS)
39 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
44 #include "SMESH_HypothesisFactory_i.hxx"
45 #include "SMESH_Mesh_i.hxx"
46 #include "SALOME_Component_i.hxx"
47 #include "SALOME_NamingService.hxx"
49 #include "SMESH_Gen.hxx"
50 #include "SMESH_topo.hxx"
51 #include "GEOM_Client.hxx"
57 typedef struct studyContext_iStruct
59 map<int,SMESH_Mesh_i*> mapMesh_i;
60 } StudyContext_iStruct;
63 public POA_SMESH::SMESH_Gen,
64 public Engines_Component_i
69 SMESH_Gen_i(CORBA::ORB_ptr orb,
70 PortableServer::POA_ptr poa,
71 PortableServer::ObjectId * contId,
72 const char *instanceName,
73 const char *interfaceName);
74 virtual ~SMESH_Gen_i();
76 SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const char* anHyp,
78 throw (SALOME::SALOME_Exception);
80 SMESH::SMESH_Mesh_ptr Init(GEOM::GEOM_Gen_ptr geomEngine,
82 GEOM::GEOM_Shape_ptr aShape)
83 throw (SALOME::SALOME_Exception);
85 SMESH::SMESH_Mesh_ptr Init(GEOM::GEOM_Gen_ptr geomEngine,
87 GEOM::GEOM_Shape_ptr aShape,
89 throw (SALOME::SALOME_Exception);
91 CORBA::Boolean Compute(SMESH::SMESH_Mesh_ptr aMesh,
92 GEOM::GEOM_Shape_ptr aShape)
93 throw (SALOME::SALOME_Exception);
95 CORBA::Boolean IsReadyToCompute(SMESH::SMESH_Mesh_ptr aMesh,
96 GEOM::GEOM_Shape_ptr aShape)
97 throw (SALOME::SALOME_Exception);
99 SMESH::long_array* GetSubShapesId(GEOM::GEOM_Gen_ptr geomEngine,
101 GEOM::GEOM_Shape_ptr mainShape,
102 const SMESH::shape_array& listOfSubShape)
103 throw (SALOME::SALOME_Exception);
105 SMESH::SMESH_Mesh_ptr Import(CORBA::Long studyId, const char* fileName,
106 const char* fileType);
108 // inherited methods from SALOMEDS::Driver
110 SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
113 bool Load(SALOMEDS::SComponent_ptr theComponent,
114 const SALOMEDS::TMPFile& theStream,
118 SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
121 bool LoadASCII(SALOMEDS::SComponent_ptr theComponent,
122 const SALOMEDS::TMPFile& theStream,
126 void Close(SALOMEDS::SComponent_ptr theComponent);
127 char* ComponentDataType();
129 char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
130 const char* IORString,
131 CORBA::Boolean isMultiFile,
132 CORBA::Boolean isASCII);
133 char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
134 const char* aLocalPersistentID,
135 CORBA::Boolean isMultiFile,
136 CORBA::Boolean isASCII);
138 bool CanPublishInStudy(CORBA::Object_ptr theIOR) { return false; }
139 SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
140 SALOMEDS::SObject_ptr theSObject,
141 CORBA::Object_ptr theObject,
142 const char* theName) throw (SALOME::SALOME_Exception) {
143 SALOMEDS::SObject_var aResultSO;
144 return aResultSO._retn();
147 CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject) {return false;}
148 SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) {return false;}
149 CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID) {return false;}
150 SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
151 CORBA::Long theObjectID,
152 SALOMEDS::SObject_ptr theObject) {
153 SALOMEDS::SObject_var aResultSO;
154 return aResultSO._retn();
157 GEOM_Client* _ShapeReader;
159 SMESH_topo* ExploreMainShape(GEOM::GEOM_Gen_ptr geomEngine,
161 GEOM::GEOM_Shape_ptr aShape);
164 void loadMesh(char * name, HDFfile * hdf_file, char * meshFile,
165 SALOMEDS::Study_var study);
166 void loadHypothesis(char * name, HDFfile * hdf_file, char * hypothesisFile,
168 void loadAlgorithms(char * name, HDFfile * hdf_file, char * algorithmsFile,
170 void loadAppliedHypothesis(HDFgroup * hdfGroupMeshId, bool _found,
171 SALOMEDS::Study_var Study, SMESH::SMESH_Mesh_var myNewMesh,
172 GEOM::GEOM_Shape_var aShape);
173 GEOM::GEOM_Gen_var getGeomEngine();
174 GEOM::GEOM_Shape_var getShape(SALOMEDS::Study_var Study, char * refFromFile);
176 void loadAppliedAlgorithms(HDFgroup * hdfGroupMeshId,
177 bool _found, SALOMEDS::Study_var Study, SMESH::SMESH_Mesh_var myNewMesh,
178 GEOM::GEOM_Shape_var aShape);
179 void loadSubMeshes(HDFgroup * hdfGroupMeshId, char * msgname,
180 SALOMEDS::Study_var Study, SMESH::SMESH_Mesh_var myNewMesh);
182 SMESH_HypothesisFactory_i _hypothesisFactory_i;
183 ::SMESH_Gen _impl; // no namespace here
185 map<int, StudyContext_iStruct*> _mapStudyContext_i;
186 map <string, string> _SMESHCorbaObj;