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)
12 #include "SALOME_Component_i.hxx"
14 #include "SALOME_NamingService.hxx"
16 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
18 #include "GEOM_IBasicOperations_i.hh"
19 #include "GEOM_ITransformOperations_i.hh"
20 #include "GEOM_I3DPrimOperations_i.hh"
21 #include "GEOM_IShapesOperations_i.hh"
22 #include "GEOM_IBlocksOperations_i.hh"
23 #include "GEOM_IBooleanOperations_i.hh"
24 #include "GEOM_ICurvesOperations_i.hh"
25 #include "GEOM_ILocalOperations_i.hh"
26 #include "GEOM_IHealingOperations_i.hh"
27 #include "GEOM_IInsertOperations_i.hh"
28 #include "GEOM_IMeasureOperations_i.hh"
29 #include "GEOM_IGroupOperations_i.hh"
31 //=====================================================================
32 // GEOM_Gen_i : class definition
33 //=====================================================================
34 class GEOM_Gen_i: public POA_GEOM::GEOM_Gen, public Engines_Component_i
38 //-----------------------------------------------------------------------//
39 // Constructor / Destructor //
40 //-----------------------------------------------------------------------//
41 // constructor to be called for servant creation.
43 GEOM_Gen_i(CORBA::ORB_ptr orb,
44 PortableServer::POA_ptr poa,
45 PortableServer::ObjectId * contId,
46 const char *instanceName,
47 const char *interfaceName);
49 // destructor, doing nothing (for now)
50 virtual ~GEOM_Gen_i();
52 // generic method to be put in a super class
53 void register_name(char * name);
56 //-----------------------------------------------------------------------//
57 // Inherited methods from SALOMEDS::Driver //
58 //-----------------------------------------------------------------------//
60 SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
64 SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
68 CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent,
69 const SALOMEDS::TMPFile& theStream,
73 CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent,
74 const SALOMEDS::TMPFile& theStream,
78 void Close(SALOMEDS::SComponent_ptr theComponent);
79 char* ComponentDataType();
82 char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
83 const char* IORString,
84 CORBA::Boolean isMultiFile,
85 CORBA::Boolean isASCII);
86 char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
87 const char* aLocalPersistentID,
88 CORBA::Boolean isMultiFile,
89 CORBA::Boolean isASCII);
91 bool CanPublishInStudy(CORBA::Object_ptr theIOR);
92 SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
93 SALOMEDS::SObject_ptr theSObject,
94 CORBA::Object_ptr theObject,
95 const char* theName) throw (SALOME::SALOME_Exception) ;
97 CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
98 SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
99 CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
100 SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
101 CORBA::Long theObjectID,
102 SALOMEDS::SObject_ptr theObject);
104 //Adds theObject in the study with a name = theName, if theFather is not null the object is placed under theFather
105 SALOMEDS::SObject_ptr AddInStudy(SALOMEDS::Study_ptr theStudy, GEOM::GEOM_Object_ptr theObject, const char* theName, GEOM::GEOM_Object_ptr theFather);
107 //-----------------------------------------------------------------------//
108 // Transaction methods //
109 //-----------------------------------------------------------------------//
111 //Undos one transaction in the document associated with theStudyID
112 virtual void Undo(CORBA::Long theStudyID);
114 //Redos one transaction in the document associated with theStudyID
115 virtual void Redo(CORBA::Long theStudyID);
117 //-----------------------------------------------------------------------//
118 // Operations methods //
119 //-----------------------------------------------------------------------//
121 //Returns a pointer to BasicOperations interface
122 virtual GEOM::GEOM_IBasicOperations_ptr GetIBasicOperations (CORBA::Long theStudyID)
123 throw (SALOME::SALOME_Exception);
125 //Returns a pointer to TransformOperations interface
126 virtual GEOM::GEOM_ITransformOperations_ptr GetITransformOperations (CORBA::Long theStudyID)
127 throw (SALOME::SALOME_Exception);
129 //Returns a pointer to 3DPrimOperations interface
130 virtual GEOM::GEOM_I3DPrimOperations_ptr GetI3DPrimOperations (CORBA::Long theStudyID)
131 throw (SALOME::SALOME_Exception);
133 //Returns a pointer to ShapesOperations interface
134 virtual GEOM::GEOM_IShapesOperations_ptr GetIShapesOperations (CORBA::Long theStudyID)
135 throw (SALOME::SALOME_Exception);
137 //Returns a pointer to BlocksOperations interface
138 virtual GEOM::GEOM_IBlocksOperations_ptr GetIBlocksOperations (CORBA::Long theStudyID)
139 throw (SALOME::SALOME_Exception);
141 //Returns a pointer to BooleanOperations interface
142 virtual GEOM::GEOM_IBooleanOperations_ptr GetIBooleanOperations (CORBA::Long theStudyID)
143 throw (SALOME::SALOME_Exception);
145 //Returns a pointer to CurvesOperations interface
146 virtual GEOM::GEOM_ICurvesOperations_ptr GetICurvesOperations (CORBA::Long theStudyID)
147 throw (SALOME::SALOME_Exception);
149 //Returns a pointer to LocalOperations interface
150 virtual GEOM::GEOM_ILocalOperations_ptr GetILocalOperations (CORBA::Long theStudyID)
151 throw (SALOME::SALOME_Exception);
153 //Returns a pointer to HealingOperations interface
154 virtual GEOM::GEOM_IHealingOperations_ptr GetIHealingOperations (CORBA::Long theStudyID)
155 throw (SALOME::SALOME_Exception);
157 //Returns a pointer to InsertOperations interface
158 virtual GEOM::GEOM_IInsertOperations_ptr GetIInsertOperations (CORBA::Long theStudyID)
159 throw (SALOME::SALOME_Exception);
161 //Returns a pointer to MeasureOperations interface
162 virtual GEOM::GEOM_IMeasureOperations_ptr GetIMeasureOperations (CORBA::Long theStudyID)
163 throw (SALOME::SALOME_Exception);
165 //Returns a pointer to GroupOperations interface
166 virtual GEOM::GEOM_IGroupOperations_ptr GetIGroupOperations (CORBA::Long theStudyID)
167 throw (SALOME::SALOME_Exception);
169 //Adds a new sub shape
170 virtual GEOM::GEOM_Object_ptr AddSubShape(GEOM::GEOM_Object_ptr theMainShape, const GEOM::ListOfLong& theIndices);
172 virtual void RemoveObject(GEOM::GEOM_Object_ptr theObject);
174 virtual char* GetStringFromIOR(GEOM::GEOM_Object_ptr theObject);
176 virtual GEOM::GEOM_Object_ptr GetIORFromString(const char* stringIOR);
178 //********************************************************************************************************//
180 //********************************************************************************************************//
181 virtual GEOM::GEOM_Object_ptr GetObject(CORBA::Long theStudyID, const char* theEntry);
185 ::GEOMImpl_Gen* _impl;
186 SALOME_NamingService * name_service;