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)
9 #include CORBA_SERVER_HEADER(SALOMEDS)
10 #include CORBA_SERVER_HEADER(SALOMEDS_Attributes)
13 #include "SALOME_Component_i.hxx"
15 #include "SALOME_NamingService.hxx"
17 //#include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
19 #include "GEOM_IBasicOperations_i.hh"
20 #include "GEOM_ITransformOperations_i.hh"
21 #include "GEOM_I3DPrimOperations_i.hh"
22 #include "GEOM_IShapesOperations_i.hh"
23 #include "GEOM_IBlocksOperations_i.hh"
24 #include "GEOM_IBooleanOperations_i.hh"
25 #include "GEOM_ICurvesOperations_i.hh"
26 #include "GEOM_ILocalOperations_i.hh"
27 #include "GEOM_IHealingOperations_i.hh"
28 #include "GEOM_IInsertOperations_i.hh"
29 #include "GEOM_IMeasureOperations_i.hh"
30 #include "GEOM_IGroupOperations_i.hh"
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 //-----------------------------------------------------------------------//
43 // constructor to be called for servant creation.
45 GEOM_Gen_i(CORBA::ORB_ptr orb,
46 PortableServer::POA_ptr poa,
47 PortableServer::ObjectId * contId,
48 const char *instanceName,
49 const char *interfaceName);
51 // destructor, doing nothing (for now)
52 virtual ~GEOM_Gen_i();
54 // generic method to be put in a super class
55 void register_name(char * name);
58 //-----------------------------------------------------------------------//
59 // Inherited methods from SALOMEDS::Driver //
60 //-----------------------------------------------------------------------//
62 SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
66 SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
70 CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent,
71 const SALOMEDS::TMPFile& theStream,
75 CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent,
76 const SALOMEDS::TMPFile& theStream,
80 void Close(SALOMEDS::SComponent_ptr theComponent);
81 char* ComponentDataType();
84 char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
85 const char* IORString,
86 CORBA::Boolean isMultiFile,
87 CORBA::Boolean isASCII);
88 char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
89 const char* aLocalPersistentID,
90 CORBA::Boolean isMultiFile,
91 CORBA::Boolean isASCII);
93 bool CanPublishInStudy(CORBA::Object_ptr theIOR);
94 SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
95 SALOMEDS::SObject_ptr theSObject,
96 CORBA::Object_ptr theObject,
97 const char* theName) throw (SALOME::SALOME_Exception) ;
99 CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
100 SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
101 CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
102 SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
103 CORBA::Long theObjectID,
104 SALOMEDS::SObject_ptr theObject);
106 //Adds theObject in the study with a name = theName, if theFather is not null the object is placed under theFather
107 SALOMEDS::SObject_ptr AddInStudy(SALOMEDS::Study_ptr theStudy, GEOM::GEOM_Object_ptr theObject, const char* theName, GEOM::GEOM_Object_ptr theFather);
109 //-----------------------------------------------------------------------//
110 // Transaction methods //
111 //-----------------------------------------------------------------------//
113 //Undos one transaction in the document associated with theStudyID
114 virtual void Undo(CORBA::Long theStudyID);
116 //Redos one transaction in the document associated with theStudyID
117 virtual void Redo(CORBA::Long theStudyID);
119 //-----------------------------------------------------------------------//
120 // Operations methods //
121 //-----------------------------------------------------------------------//
123 //Returns a pointer to BasicOperations interface
124 virtual GEOM::GEOM_IBasicOperations_ptr GetIBasicOperations (CORBA::Long theStudyID)
125 throw (SALOME::SALOME_Exception);
127 //Returns a pointer to TransformOperations interface
128 virtual GEOM::GEOM_ITransformOperations_ptr GetITransformOperations (CORBA::Long theStudyID)
129 throw (SALOME::SALOME_Exception);
131 //Returns a pointer to 3DPrimOperations interface
132 virtual GEOM::GEOM_I3DPrimOperations_ptr GetI3DPrimOperations (CORBA::Long theStudyID)
133 throw (SALOME::SALOME_Exception);
135 //Returns a pointer to ShapesOperations interface
136 virtual GEOM::GEOM_IShapesOperations_ptr GetIShapesOperations (CORBA::Long theStudyID)
137 throw (SALOME::SALOME_Exception);
139 //Returns a pointer to BlocksOperations interface
140 virtual GEOM::GEOM_IBlocksOperations_ptr GetIBlocksOperations (CORBA::Long theStudyID)
141 throw (SALOME::SALOME_Exception);
143 //Returns a pointer to BooleanOperations interface
144 virtual GEOM::GEOM_IBooleanOperations_ptr GetIBooleanOperations (CORBA::Long theStudyID)
145 throw (SALOME::SALOME_Exception);
147 //Returns a pointer to CurvesOperations interface
148 virtual GEOM::GEOM_ICurvesOperations_ptr GetICurvesOperations (CORBA::Long theStudyID)
149 throw (SALOME::SALOME_Exception);
151 //Returns a pointer to LocalOperations interface
152 virtual GEOM::GEOM_ILocalOperations_ptr GetILocalOperations (CORBA::Long theStudyID)
153 throw (SALOME::SALOME_Exception);
155 //Returns a pointer to HealingOperations interface
156 virtual GEOM::GEOM_IHealingOperations_ptr GetIHealingOperations (CORBA::Long theStudyID)
157 throw (SALOME::SALOME_Exception);
159 //Returns a pointer to InsertOperations interface
160 virtual GEOM::GEOM_IInsertOperations_ptr GetIInsertOperations (CORBA::Long theStudyID)
161 throw (SALOME::SALOME_Exception);
163 //Returns a pointer to MeasureOperations interface
164 virtual GEOM::GEOM_IMeasureOperations_ptr GetIMeasureOperations (CORBA::Long theStudyID)
165 throw (SALOME::SALOME_Exception);
167 //Returns a pointer to GroupOperations interface
168 virtual GEOM::GEOM_IGroupOperations_ptr GetIGroupOperations (CORBA::Long theStudyID)
169 throw (SALOME::SALOME_Exception);
171 //Adds a new sub shape
172 virtual GEOM::GEOM_Object_ptr AddSubShape(GEOM::GEOM_Object_ptr theMainShape, const GEOM::ListOfLong& theIndices);
174 virtual void RemoveObject(GEOM::GEOM_Object_ptr theObject);
176 virtual char* GetStringFromIOR(GEOM::GEOM_Object_ptr theObject);
178 virtual GEOM::GEOM_Object_ptr GetIORFromString(const char* stringIOR);
180 virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
181 CORBA::Boolean isPublished,
182 CORBA::Boolean& isValidScript);
184 char* GetDumpName (const char* theStudyEntry);
186 GEOM::string_array* GetAllDumpNames();
188 //********************************************************************************************************//
190 //********************************************************************************************************//
191 virtual GEOM::GEOM_Object_ptr GetObject(CORBA::Long theStudyID, const char* theEntry);
195 ::GEOMImpl_Gen* _impl;
196 SALOME_NamingService * name_service;