1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #include "GEOM_IOperations_i.hh"
24 #include "GEOM_Engine.hxx"
26 #include "utilities.h"
28 #include "Utils_ExceptHandlers.hxx"
30 #include <Standard_Stream.hxx>
31 #include <TCollection_AsciiString.hxx>
32 #include <TDF_Tool.hxx>
34 //=============================================================================
36 * default constructor:
38 //=============================================================================
40 GEOM_IOperations_i::GEOM_IOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOM_IOperations* theImpl)
41 :SALOME::GenericObj_i( thePOA ), _impl(theImpl), _engine(theEngine)
45 //=============================================================================
49 //=============================================================================
51 GEOM_IOperations_i::~GEOM_IOperations_i()
55 //=============================================================================
59 //=============================================================================
60 CORBA::Boolean GEOM_IOperations_i::IsDone()
62 return _impl->IsDone();
66 //=============================================================================
70 //=============================================================================
71 void GEOM_IOperations_i::SetErrorCode(const char* theErrorCode)
73 _impl->SetErrorCode((char*)theErrorCode);
76 //=============================================================================
80 //=============================================================================
81 char* GEOM_IOperations_i::GetErrorCode()
83 return CORBA::string_dup(_impl->GetErrorCode());
86 //=============================================================================
90 //=============================================================================
91 CORBA::Long GEOM_IOperations_i::GetStudyID()
93 return _impl->GetDocID();
96 //=============================================================================
100 //=============================================================================
101 void GEOM_IOperations_i::StartOperation()
103 _impl->StartOperation();
106 //=============================================================================
110 //=============================================================================
111 void GEOM_IOperations_i::FinishOperation()
113 _impl->FinishOperation();
117 //=============================================================================
121 //=============================================================================
122 void GEOM_IOperations_i::AbortOperation()
124 _impl->AbortOperation();
127 //=============================================================================
131 //=============================================================================
132 GEOM::GEOM_Object_ptr GEOM_IOperations_i::GetObject(Handle(GEOM_Object) theObject)
134 GEOM::GEOM_Object_var GO;
135 if (theObject.IsNull()) return GO._retn();
136 TCollection_AsciiString anEntry;
137 TDF_Tool::Entry(theObject->GetEntry(), anEntry);
138 GO = _engine->GetObject(theObject->GetDocID(), anEntry.ToCString());
142 //=============================================================================
146 //=============================================================================
147 Handle(GEOM_Object) GEOM_IOperations_i::GetObjectImpl(GEOM::GEOM_Object_ptr theObject)
149 Handle(GEOM_Object) anImpl;
150 if (!CORBA::is_nil(theObject)) {
151 CORBA::String_var anEntry = theObject->GetEntry();
152 anImpl = GetImpl()->GetEngine()->GetObject
153 (theObject->GetStudyID(), anEntry);