1 // Copyright (C) 2007-2012 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
23 #include "GEOM_IOperations_i.hh"
25 #include "GEOM_Engine.hxx"
27 #include "utilities.h"
29 #include "Utils_ExceptHandlers.hxx"
31 #include <Standard_Stream.hxx>
32 #include <TCollection_AsciiString.hxx>
33 #include <TDF_Tool.hxx>
35 //=============================================================================
37 * default constructor:
39 //=============================================================================
41 GEOM_IOperations_i::GEOM_IOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOM_IOperations* theImpl)
42 :SALOME::GenericObj_i( thePOA ), _impl(theImpl), _engine(theEngine)
46 //=============================================================================
50 //=============================================================================
52 GEOM_IOperations_i::~GEOM_IOperations_i()
56 //=============================================================================
60 //=============================================================================
61 CORBA::Boolean GEOM_IOperations_i::IsDone()
63 return _impl->IsDone();
67 //=============================================================================
71 //=============================================================================
72 void GEOM_IOperations_i::SetErrorCode(const char* theErrorCode)
74 _impl->SetErrorCode((char*)theErrorCode);
77 //=============================================================================
81 //=============================================================================
82 char* GEOM_IOperations_i::GetErrorCode()
84 return CORBA::string_dup(_impl->GetErrorCode());
87 //=============================================================================
91 //=============================================================================
92 CORBA::Long GEOM_IOperations_i::GetStudyID()
94 return _impl->GetDocID();
97 //=============================================================================
101 //=============================================================================
102 void GEOM_IOperations_i::StartOperation()
104 _impl->StartOperation();
107 //=============================================================================
111 //=============================================================================
112 void GEOM_IOperations_i::FinishOperation()
114 _impl->FinishOperation();
118 //=============================================================================
122 //=============================================================================
123 void GEOM_IOperations_i::AbortOperation()
125 _impl->AbortOperation();
128 //=============================================================================
132 //=============================================================================
133 GEOM::GEOM_Object_ptr GEOM_IOperations_i::GetObject(Handle(GEOM_Object) theObject)
135 GEOM::GEOM_Object_var GO;
136 if (theObject.IsNull()) return GO._retn();
137 TCollection_AsciiString anEntry;
138 TDF_Tool::Entry(theObject->GetEntry(), anEntry);
139 GO = _engine->GetObject(theObject->GetDocID(), anEntry.ToCString());
143 //=============================================================================
147 //=============================================================================
148 Handle(GEOM_Object) GEOM_IOperations_i::GetObjectImpl(GEOM::GEOM_Object_ptr theObject)
150 Handle(GEOM_Object) anImpl;
151 if (!CORBA::is_nil(theObject)) {
152 CORBA::String_var anEntry = theObject->GetEntry();
153 anImpl = GetImpl()->GetEngine()->GetObject
154 (theObject->GetStudyID(), anEntry);