Salome HOME
Merge with version on tag OCC-V2_1_0d
[modules/geom.git] / src / GEOM_I / GEOM_IOperations_i.cc
1 using namespace std; 
2
3 #include "GEOM_IOperations_i.hh"
4
5 #include "utilities.h"
6 #include "OpUtil.hxx"
7 #include "Utils_ExceptHandlers.hxx"
8
9 #include "GEOM_Engine.hxx"
10
11 #include "GEOM_Gen_i.hh"
12
13 #include <TCollection_AsciiString.hxx>
14 #include <TDF_Tool.hxx>
15
16 //=============================================================================
17 /*!
18  *  default constructor:
19  */
20 //=============================================================================
21
22 GEOM_IOperations_i::GEOM_IOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOM_IOperations* theImpl)
23 :SALOME::GenericObj_i( thePOA ), _impl(theImpl), _engine(theEngine)
24 {
25   thePOA->activate_object(this);
26 }
27
28 //=============================================================================
29 /*!
30  *  destructor
31  */
32 //=============================================================================
33
34 GEOM_IOperations_i::~GEOM_IOperations_i()
35 {}
36
37
38 //=============================================================================
39 /*!  
40  *  IsDone
41  */
42 //============================================================================= 
43 CORBA::Boolean GEOM_IOperations_i::IsDone()
44 {
45   return _impl->IsDone();
46 }  
47
48
49 //=============================================================================
50 /*!    
51  *  SetErrorCode
52  */
53 //============================================================================= 
54 void GEOM_IOperations_i::SetErrorCode(const char* theErrorCode)
55 {
56   _impl->SetErrorCode((char*)theErrorCode);
57 }
58  
59 //=============================================================================
60 /*!
61  *  GetErrorCode
62  */
63 //============================================================================= 
64 char* GEOM_IOperations_i::GetErrorCode() 
65 {
66   return _impl->GetErrorCode();    
67 }
68    
69 //=============================================================================
70 /*!
71  *  GetStudyID
72  */
73 //============================================================================= 
74 CORBA::Long GEOM_IOperations_i::GetStudyID() 
75 {
76   return _impl->GetDocID();    
77 }
78    
79 //=============================================================================
80 /*!
81  *  StartOperation
82  */
83 //=============================================================================
84 void GEOM_IOperations_i::StartOperation()
85 {
86   _impl->StartOperation();
87 }
88
89 //=============================================================================
90 /*!
91  *  FinishOperation
92  */
93 //=============================================================================
94 void GEOM_IOperations_i::FinishOperation()
95 {
96   _impl->FinishOperation();
97 }
98
99
100 //=============================================================================
101 /*!
102  *  AboutOperation
103  */
104 //=============================================================================
105 void GEOM_IOperations_i::AbortOperation()
106 {
107   _impl->AbortOperation();
108 }
109
110 //=============================================================================
111 /*!
112  *  GetObject
113  */
114 //=============================================================================
115 GEOM::GEOM_Object_ptr GEOM_IOperations_i::GetObject(Handle(GEOM_Object) theObject)         
116 {
117   if(theObject.IsNull()) return NULL;
118   TCollection_AsciiString anEntry;
119   TDF_Tool::Entry(theObject->GetEntry(), anEntry);
120   GEOM::GEOM_Object_var GO = GEOM::GEOM_Object::_duplicate(_engine->GetObject(theObject->GetDocID(), anEntry.ToCString()));
121   return GO._retn();
122 }  
123