1 #ifndef __GEOM_GEN_I_H__
2 #define __GEOM_GEN_I_H__
4 #include "GEOMImpl_Gen.hxx"
7 #include <SALOMEconfig.h>
8 #include CORBA_SERVER_HEADER(GEOM_Gen)
10 #include CORBA_CLIENT_HEADER(SALOMEDS)
11 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
14 #include "SALOME_Component_i.hxx"
15 #include "SALOME_NamingService.hxx"
17 #include "GEOM_IBasicOperations_i.hh"
18 #include "GEOM_ITransformOperations_i.hh"
19 #include "GEOM_I3DPrimOperations_i.hh"
20 #include "GEOM_IShapesOperations_i.hh"
21 #include "GEOM_IBlocksOperations_i.hh"
22 #include "GEOM_IBooleanOperations_i.hh"
23 #include "GEOM_ICurvesOperations_i.hh"
24 #include "GEOM_ILocalOperations_i.hh"
25 #include "GEOM_IHealingOperations_i.hh"
26 #include "GEOM_IInsertOperations_i.hh"
27 #include "GEOM_IMeasureOperations_i.hh"
28 #include "GEOM_IGroupOperations_i.hh"
30 //#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
33 //=====================================================================
34 // GEOM_Gen_i : class definition
35 //=====================================================================
36 class GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual public Engines_Component_i
40 //-----------------------------------------------------------------------//
41 // Constructor / Destructor //
42 //-----------------------------------------------------------------------//
44 // constructor to be called for servant creation.
46 GEOM_Gen_i(CORBA::ORB_ptr orb,
47 PortableServer::POA_ptr poa,
48 PortableServer::ObjectId * contId,
49 const char *instanceName,
50 const char *interfaceName);
52 // destructor, doing nothing (for now)
53 virtual ~GEOM_Gen_i();
55 // generic method to be put in a super class
56 void register_name(char * name);
59 //-----------------------------------------------------------------------//
60 // Inherited methods from SALOMEDS::Driver //
61 //-----------------------------------------------------------------------//
63 SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
67 SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
71 CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent,
72 const SALOMEDS::TMPFile& theStream,
76 CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent,
77 const SALOMEDS::TMPFile& theStream,
81 void Close(SALOMEDS::SComponent_ptr theComponent);
82 char* ComponentDataType();
85 char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
86 const char* IORString,
87 CORBA::Boolean isMultiFile,
88 CORBA::Boolean isASCII);
89 char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
90 const char* aLocalPersistentID,
91 CORBA::Boolean isMultiFile,
92 CORBA::Boolean isASCII);
94 bool CanPublishInStudy(CORBA::Object_ptr theIOR);
95 SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
96 SALOMEDS::SObject_ptr theSObject,
97 CORBA::Object_ptr theObject,
98 const char* theName) throw (SALOME::SALOME_Exception) ;
100 CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
101 SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
102 CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
103 SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
104 CORBA::Long theObjectID,
105 SALOMEDS::SObject_ptr theObject);
107 /*! \brief Adds theObject in the study with a name = theName, if
108 * theFather is not null the object is placed under theFather
110 SALOMEDS::SObject_ptr AddInStudy (SALOMEDS::Study_ptr theStudy,
111 GEOM::GEOM_Object_ptr theObject,
113 GEOM::GEOM_Object_ptr theFather);
115 //-----------------------------------------------------------------------//
116 // Transaction methods //
117 //-----------------------------------------------------------------------//
119 //Undos one transaction in the document associated with theStudyID
120 virtual void Undo(CORBA::Long theStudyID);
122 //Redos one transaction in the document associated with theStudyID
123 virtual void Redo(CORBA::Long theStudyID);
125 //-----------------------------------------------------------------------//
126 // Operations methods //
127 //-----------------------------------------------------------------------//
129 //Returns a pointer to BasicOperations interface
130 virtual GEOM::GEOM_IBasicOperations_ptr GetIBasicOperations (CORBA::Long theStudyID)
131 throw (SALOME::SALOME_Exception);
133 //Returns a pointer to TransformOperations interface
134 virtual GEOM::GEOM_ITransformOperations_ptr GetITransformOperations (CORBA::Long theStudyID)
135 throw (SALOME::SALOME_Exception);
137 //Returns a pointer to 3DPrimOperations interface
138 virtual GEOM::GEOM_I3DPrimOperations_ptr GetI3DPrimOperations (CORBA::Long theStudyID)
139 throw (SALOME::SALOME_Exception);
141 //Returns a pointer to ShapesOperations interface
142 virtual GEOM::GEOM_IShapesOperations_ptr GetIShapesOperations (CORBA::Long theStudyID)
143 throw (SALOME::SALOME_Exception);
145 //Returns a pointer to BlocksOperations interface
146 virtual GEOM::GEOM_IBlocksOperations_ptr GetIBlocksOperations (CORBA::Long theStudyID)
147 throw (SALOME::SALOME_Exception);
149 //Returns a pointer to BooleanOperations interface
150 virtual GEOM::GEOM_IBooleanOperations_ptr GetIBooleanOperations (CORBA::Long theStudyID)
151 throw (SALOME::SALOME_Exception);
153 //Returns a pointer to CurvesOperations interface
154 virtual GEOM::GEOM_ICurvesOperations_ptr GetICurvesOperations (CORBA::Long theStudyID)
155 throw (SALOME::SALOME_Exception);
157 //Returns a pointer to LocalOperations interface
158 virtual GEOM::GEOM_ILocalOperations_ptr GetILocalOperations (CORBA::Long theStudyID)
159 throw (SALOME::SALOME_Exception);
161 //Returns a pointer to HealingOperations interface
162 virtual GEOM::GEOM_IHealingOperations_ptr GetIHealingOperations (CORBA::Long theStudyID)
163 throw (SALOME::SALOME_Exception);
165 //Returns a pointer to InsertOperations interface
166 virtual GEOM::GEOM_IInsertOperations_ptr GetIInsertOperations (CORBA::Long theStudyID)
167 throw (SALOME::SALOME_Exception);
169 //Returns a pointer to MeasureOperations interface
170 virtual GEOM::GEOM_IMeasureOperations_ptr GetIMeasureOperations (CORBA::Long theStudyID)
171 throw (SALOME::SALOME_Exception);
173 //Returns a pointer to GroupOperations interface
174 virtual GEOM::GEOM_IGroupOperations_ptr GetIGroupOperations (CORBA::Long theStudyID)
175 throw (SALOME::SALOME_Exception);
177 //Adds a new sub shape
178 virtual GEOM::GEOM_Object_ptr AddSubShape (GEOM::GEOM_Object_ptr theMainShape,
179 const GEOM::ListOfLong& theIndices);
181 virtual void RemoveObject(GEOM::GEOM_Object_ptr theObject);
183 virtual char* GetStringFromIOR(GEOM::GEOM_Object_ptr theObject);
185 virtual GEOM::GEOM_Object_ptr GetIORFromString(const char* stringIOR);
187 virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
188 CORBA::Boolean isPublished,
189 CORBA::Boolean& isValidScript);
191 char* GetDumpName (const char* theStudyEntry);
193 GEOM::string_array* GetAllDumpNames();
195 //-----------------------------------------------------------------------//
196 // Internal methods //
197 //-----------------------------------------------------------------------//
199 virtual GEOM::GEOM_Object_ptr GetObject(CORBA::Long theStudyID, const char* theEntry);
203 ::GEOMImpl_Gen* _impl;
204 SALOME_NamingService * name_service;