00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __GEOM_GEN_I_H__
00024 #define __GEOM_GEN_I_H__
00025
00026 #include "GEOM_GEOM_I.hxx"
00027
00028 #include "GEOMImpl_Gen.hxx"
00029
00030
00031 #include <SALOMEconfig.h>
00032 #include CORBA_SERVER_HEADER(GEOM_Gen)
00033
00034 #include CORBA_CLIENT_HEADER(SALOMEDS)
00035 #include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
00036
00037
00038 #include "SALOME_Component_i.hxx"
00039 #include "SALOME_NamingService.hxx"
00040
00041 #include "GEOM_IBasicOperations_i.hh"
00042 #include "GEOM_ITransformOperations_i.hh"
00043 #include "GEOM_I3DPrimOperations_i.hh"
00044 #include "GEOM_IShapesOperations_i.hh"
00045 #include "GEOM_IBlocksOperations_i.hh"
00046 #include "GEOM_IBooleanOperations_i.hh"
00047 #include "GEOM_ICurvesOperations_i.hh"
00048 #include "GEOM_ILocalOperations_i.hh"
00049 #include "GEOM_IHealingOperations_i.hh"
00050 #include "GEOM_IInsertOperations_i.hh"
00051 #include "GEOM_IMeasureOperations_i.hh"
00052 #include "GEOM_IGroupOperations_i.hh"
00053 #include "GEOM_IAdvancedOperations_i.hh"
00054
00055 #include <TopTools_IndexedMapOfShape.hxx>
00056
00057 #include <set>
00058 #include <string>
00059
00060
00061
00062
00063
00064
00065
00066 class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual public Engines_Component_i
00067 {
00068 public:
00069
00070
00071
00072
00073
00074
00075 GEOM_Gen_i();
00076 GEOM_Gen_i(CORBA::ORB_ptr orb,
00077 PortableServer::POA_ptr poa,
00078 PortableServer::ObjectId * contId,
00079 const char *instanceName,
00080 const char *interfaceName);
00081
00082
00083 virtual ~GEOM_Gen_i();
00084
00085
00086 void register_name(char * name);
00087
00088
00089
00090
00091
00092
00093 SALOMEDS::TMPFile* Save(SALOMEDS::SComponent_ptr theComponent,
00094 const char* theURL,
00095 bool isMultiFile);
00096
00097 SALOMEDS::TMPFile* SaveASCII(SALOMEDS::SComponent_ptr theComponent,
00098 const char* theURL,
00099 bool isMultiFile);
00100
00101 CORBA::Boolean Load(SALOMEDS::SComponent_ptr theComponent,
00102 const SALOMEDS::TMPFile& theStream,
00103 const char* theURL,
00104 bool isMultiFile);
00105
00106 CORBA::Boolean LoadASCII(SALOMEDS::SComponent_ptr theComponent,
00107 const SALOMEDS::TMPFile& theStream,
00108 const char* theURL,
00109 bool isMultiFile);
00110
00111 void Close(SALOMEDS::SComponent_ptr theComponent);
00112 char* ComponentDataType();
00113
00114
00115 char* IORToLocalPersistentID(SALOMEDS::SObject_ptr theSObject,
00116 const char* IORString,
00117 CORBA::Boolean isMultiFile,
00118 CORBA::Boolean isASCII);
00119 char* LocalPersistentIDToIOR(SALOMEDS::SObject_ptr theSObject,
00120 const char* aLocalPersistentID,
00121 CORBA::Boolean isMultiFile,
00122 CORBA::Boolean isASCII);
00123
00124 bool CanPublishInStudy(CORBA::Object_ptr theIOR);
00125 SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
00126 SALOMEDS::SObject_ptr theSObject,
00127 CORBA::Object_ptr theObject,
00128 const char* theName) throw (SALOME::SALOME_Exception) ;
00129
00130 GEOM::ListOfGO* PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy,
00131 CORBA::Object_ptr theObject);
00132
00133 CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
00134 SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
00135 CORBA::Boolean CanPaste(const char* theComponentName, CORBA::Long theObjectID);
00136 SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
00137 CORBA::Long theObjectID,
00138 SALOMEDS::SObject_ptr theObject);
00139
00143 SALOMEDS::SObject_ptr AddInStudy (SALOMEDS::Study_ptr theStudy,
00144 GEOM::GEOM_Object_ptr theObject,
00145 const char* theName,
00146 GEOM::GEOM_Object_ptr theFather);
00147
00151 GEOM::ListOfGO* RestoreSubShapesO (SALOMEDS::Study_ptr theStudy,
00152 GEOM::GEOM_Object_ptr theObject,
00153 const GEOM::ListOfGO& theArgs,
00154 GEOM::find_shape_method theFindMethod,
00155 CORBA::Boolean theInheritFirstArg,
00156 CORBA::Boolean theAddPrefix);
00157
00161 GEOM::ListOfGO* RestoreGivenSubShapesO (SALOMEDS::Study_ptr theStudy,
00162 GEOM::GEOM_Object_ptr theObject,
00163 const GEOM::ListOfGO& theArgs,
00164 GEOM::find_shape_method theFindMethod,
00165 CORBA::Boolean theInheritFirstArg,
00166 CORBA::Boolean theAddPrefix);
00167
00171 GEOM::ListOfGO* RestoreSubShapesSO (SALOMEDS::Study_ptr theStudy,
00172 SALOMEDS::SObject_ptr theSObject,
00173 const GEOM::ListOfGO& theArgs,
00174 GEOM::find_shape_method theFindMethod,
00175 CORBA::Boolean theInheritFirstArg,
00176 CORBA::Boolean theAddPrefix);
00177
00178
00179
00180
00181
00182
00183 virtual void Undo(CORBA::Long theStudyID);
00184
00185
00186 virtual void Redo(CORBA::Long theStudyID);
00187
00188
00189
00190
00191
00192
00193 virtual GEOM::GEOM_IBasicOperations_ptr GetIBasicOperations (CORBA::Long theStudyID)
00194 throw (SALOME::SALOME_Exception);
00195
00196
00197 virtual GEOM::GEOM_ITransformOperations_ptr GetITransformOperations (CORBA::Long theStudyID)
00198 throw (SALOME::SALOME_Exception);
00199
00200
00201 virtual GEOM::GEOM_I3DPrimOperations_ptr GetI3DPrimOperations (CORBA::Long theStudyID)
00202 throw (SALOME::SALOME_Exception);
00203
00204
00205 virtual GEOM::GEOM_IShapesOperations_ptr GetIShapesOperations (CORBA::Long theStudyID)
00206 throw (SALOME::SALOME_Exception);
00207
00208
00209 virtual GEOM::GEOM_IBlocksOperations_ptr GetIBlocksOperations (CORBA::Long theStudyID)
00210 throw (SALOME::SALOME_Exception);
00211
00212
00213 virtual GEOM::GEOM_IBooleanOperations_ptr GetIBooleanOperations (CORBA::Long theStudyID)
00214 throw (SALOME::SALOME_Exception);
00215
00216
00217 virtual GEOM::GEOM_ICurvesOperations_ptr GetICurvesOperations (CORBA::Long theStudyID)
00218 throw (SALOME::SALOME_Exception);
00219
00220
00221 virtual GEOM::GEOM_ILocalOperations_ptr GetILocalOperations (CORBA::Long theStudyID)
00222 throw (SALOME::SALOME_Exception);
00223
00224
00225 virtual GEOM::GEOM_IHealingOperations_ptr GetIHealingOperations (CORBA::Long theStudyID)
00226 throw (SALOME::SALOME_Exception);
00227
00228
00229 virtual GEOM::GEOM_IInsertOperations_ptr GetIInsertOperations (CORBA::Long theStudyID)
00230 throw (SALOME::SALOME_Exception);
00231
00232
00233 virtual GEOM::GEOM_IMeasureOperations_ptr GetIMeasureOperations (CORBA::Long theStudyID)
00234 throw (SALOME::SALOME_Exception);
00235
00236
00237 virtual GEOM::GEOM_IGroupOperations_ptr GetIGroupOperations (CORBA::Long theStudyID)
00238 throw (SALOME::SALOME_Exception);
00239
00240
00241 virtual GEOM::GEOM_IAdvancedOperations_ptr GetIAdvancedOperations (CORBA::Long theStudyID)
00242 throw (SALOME::SALOME_Exception);
00243
00244
00245 virtual GEOM::GEOM_Object_ptr AddSubShape (GEOM::GEOM_Object_ptr theMainShape,
00246 const GEOM::ListOfLong& theIndices);
00247
00248 virtual void RemoveObject(GEOM::GEOM_Object_ptr theObject);
00249
00250 virtual char* GetStringFromIOR(GEOM::GEOM_Object_ptr theObject);
00251
00252 virtual GEOM::GEOM_Object_ptr GetIORFromString(const char* stringIOR);
00253
00254 virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
00255 CORBA::Boolean isPublished,
00256 CORBA::Boolean isMultiFile,
00257 CORBA::Boolean& isValidScript);
00258
00259 char* GetDumpName (const char* theStudyEntry);
00260
00261 GEOM::string_array* GetAllDumpNames();
00262
00263
00264 virtual bool hasObjectInfo();
00265 virtual char* getObjectInfo(CORBA::Long studyId, const char* entry);
00266
00267
00268
00269
00270
00271 virtual GEOM::GEOM_Object_ptr GetObject(CORBA::Long theStudyID, const char* theEntry);
00272
00273 private:
00274 GEOM::ListOfGO* RestoreSubShapes (SALOMEDS::Study_ptr theStudy,
00275 GEOM::GEOM_Object_ptr theObject,
00276 SALOMEDS::SObject_ptr theSObject,
00277 const GEOM::ListOfGO& theArgs,
00278 GEOM::find_shape_method theFindMethod,
00279 CORBA::Boolean theInheritFirstArg,
00280 CORBA::Boolean theAddPrefix);
00281
00282 GEOM::ListOfGO* RestoreSubShapesOneLevel (SALOMEDS::Study_ptr theStudy,
00283 SALOMEDS::SObject_ptr theOldSO,
00284 SALOMEDS::SObject_ptr theNewSO,
00285 GEOM::GEOM_Object_ptr theNewO,
00286 GEOM::ListOfGO& theOutArgs,
00287 GEOM::find_shape_method theFindMethod,
00288 CORBA::Boolean theAddPrefix);
00289
00290 GEOM::ListOfGO* RestoreGivenSubShapes (SALOMEDS::Study_ptr theStudy,
00291 GEOM::GEOM_Object_ptr theObject,
00292 SALOMEDS::SObject_ptr theSObject,
00293 const GEOM::ListOfGO& theArgs,
00294 GEOM::find_shape_method theFindMethod,
00295 CORBA::Boolean theInheritFirstArg,
00296 CORBA::Boolean theAddPrefix);
00297
00298 GEOM::ListOfGO* RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr theStudy,
00299 SALOMEDS::SObject_ptr theOldSO,
00300 SALOMEDS::SObject_ptr theNewSO,
00301 GEOM::GEOM_Object_ptr theNewO,
00302 std::set<std::string> theArgs,
00303 GEOM::find_shape_method theFindMethod,
00304 CORBA::Boolean theAddPrefix);
00305
00306
00307 void CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy,
00308 GEOM::GEOM_Object_var theMainShape,
00309 const TopTools_IndexedMapOfShape& anIndices,
00310 const TopTools_SequenceOfShape& SeqS,
00311 const TColStd_SequenceOfAsciiString& SeqN,
00312 const Standard_CString& GrName,
00313 GEOM::ListOfGO_var aResList);
00314
00315 private:
00316
00317 ::GEOMImpl_Gen* _impl;
00318 SALOME_NamingService * name_service;
00319 char * _name;
00320 };
00321
00322 #endif