Salome HOME
Dump Python extension
[modules/geom.git] / src / GEOM_I / GEOM_IOperations_i.cc
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 #include "GEOM_IOperations_i.hh"
21
22 #include "GEOM_Engine.hxx"
23
24 #include "utilities.h"
25 #include "OpUtil.hxx"
26 #include "Utils_ExceptHandlers.hxx"
27
28 #include <Standard_Stream.hxx>
29 #include <TCollection_AsciiString.hxx>
30 #include <TDF_Tool.hxx>
31
32 //=============================================================================
33 /*!
34  *  default constructor:
35  */
36 //=============================================================================
37
38 GEOM_IOperations_i::GEOM_IOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOM_IOperations* theImpl)
39 :SALOME::GenericObj_i( thePOA ), _impl(theImpl), _engine(theEngine)
40 {
41 }
42
43 //=============================================================================
44 /*!
45  *  destructor
46  */
47 //=============================================================================
48
49 GEOM_IOperations_i::~GEOM_IOperations_i()
50 {}
51
52
53 //=============================================================================
54 /*!
55  *  IsDone
56  */
57 //=============================================================================
58 CORBA::Boolean GEOM_IOperations_i::IsDone()
59 {
60   return _impl->IsDone();
61 }
62
63
64 //=============================================================================
65 /*!
66  *  SetErrorCode
67  */
68 //=============================================================================
69 void GEOM_IOperations_i::SetErrorCode(const char* theErrorCode)
70 {
71   _impl->SetErrorCode((char*)theErrorCode);
72 }
73
74 //=============================================================================
75 /*!
76  *  GetErrorCode
77  */
78 //=============================================================================
79 char* GEOM_IOperations_i::GetErrorCode()
80 {
81   return CORBA::string_dup(_impl->GetErrorCode());
82 }
83
84 //=============================================================================
85 /*!
86  *  GetStudyID
87  */
88 //=============================================================================
89 CORBA::Long GEOM_IOperations_i::GetStudyID()
90 {
91   return _impl->GetDocID();
92 }
93
94 //=============================================================================
95 /*!
96  *  StartOperation
97  */
98 //=============================================================================
99 void GEOM_IOperations_i::StartOperation()
100 {
101   _impl->StartOperation();
102 }
103
104 //=============================================================================
105 /*!
106  *  FinishOperation
107  */
108 //=============================================================================
109 void GEOM_IOperations_i::FinishOperation()
110 {
111   _impl->FinishOperation();
112 }
113
114
115 //=============================================================================
116 /*!
117  *  AbortOperation
118  */
119 //=============================================================================
120 void GEOM_IOperations_i::AbortOperation()
121 {
122   _impl->AbortOperation();
123 }
124
125 //=============================================================================
126 /*!
127  *  SetParameters
128  */
129 //=============================================================================
130 void GEOM_IOperations_i::SetParameters(const char* theParameters)
131 {
132   _impl->SetParameters((char*)theParameters);
133 }
134
135 //=============================================================================
136 /*!
137  *  GetParameters
138  */
139 //=============================================================================
140 char* GEOM_IOperations_i::GetParameters()
141 {
142   return CORBA::string_dup(_impl->GetParameters());
143 }
144
145 //=============================================================================
146 /*!
147  *  GetObject
148  */
149 //=============================================================================
150 GEOM::GEOM_Object_ptr GEOM_IOperations_i::GetObject(Handle(GEOM_Object) theObject)
151 {
152   if(theObject.IsNull()) return NULL;
153   TCollection_AsciiString anEntry;
154   TDF_Tool::Entry(theObject->GetEntry(), anEntry);
155   GEOM::GEOM_Object_var GO = _engine->GetObject(theObject->GetDocID(), anEntry.ToCString());
156   return GO._retn();
157 }