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 CORBA::Boolean Compute(SMESH::SMESH_Mesh_ptr aMesh,
86 GEOM::GEOM_Shape_ptr aShape)
87 throw (SALOME::SALOME_Exception);
89 CORBA::Boolean IsReadyToCompute(SMESH::SMESH_Mesh_ptr aMesh,
90 GEOM::GEOM_Shape_ptr aShape)
91 throw (SALOME::SALOME_Exception);
93 SMESH::long_array* GetSubShapesId(GEOM::GEOM_Gen_ptr geomEngine,
95 GEOM::GEOM_Shape_ptr mainShape,
96 const SMESH::shape_array& listOfSubShape)
97 throw (SALOME::SALOME_Exception);
100 // inherited methods from SALOMEDS::Driver
102 SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
105 bool Load(SALOMEDS::SComponent_ptr theComponent,
106 const SALOMEDS::TMPFile& theStream,
110 SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
113 bool LoadASCII(SALOMEDS::SComponent_ptr theComponent,
114 const SALOMEDS::TMPFile& theStream,
118 void Close(SALOMEDS::SComponent_ptr theComponent);
119 char* ComponentDataType();
121 char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
122 const char* IORString,
123 CORBA::Boolean isMultiFile,
124 CORBA::Boolean isASCII);
125 char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
126 const char* aLocalPersistentID,
127 CORBA::Boolean isMultiFile,
128 CORBA::Boolean isASCII);
130 bool CanPublishInStudy(CORBA::Object_ptr theIOR) { return false; }
131 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 SALOMEDS::SObject_var aResultSO;
136 return aResultSO._retn();
139 CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject) {return false;}
140 SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID) {return false;}
141 CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID) {return false;}
142 SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
143 CORBA::Long theObjectID,
144 SALOMEDS::SObject_ptr theObject) {
145 SALOMEDS::SObject_var aResultSO;
146 return aResultSO._retn();
149 GEOM_Client* _ShapeReader;
151 SMESH_topo* ExploreMainShape(GEOM::GEOM_Gen_ptr geomEngine,
153 GEOM::GEOM_Shape_ptr aShape);
156 SMESH_HypothesisFactory_i _hypothesisFactory_i;
157 ::SMESH_Gen _impl; // no namespace here
158 int _localId; // unique Id of created objects, within SMESH_Gen_i entity
160 map<int, StudyContext_iStruct*> _mapStudyContext_i;
161 map <string, string> _SMESHCorbaObj;