Back to index

salome-geom  6.5.0
GEOM_IOperations_i.cc
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #include "GEOM_IOperations_i.hh"
00024 
00025 #include "GEOM_Engine.hxx"
00026 
00027 #include "utilities.h"
00028 #include "OpUtil.hxx"
00029 #include "Utils_ExceptHandlers.hxx"
00030 
00031 #include <Standard_Stream.hxx>
00032 #include <TCollection_AsciiString.hxx>
00033 #include <TDF_Tool.hxx>
00034 
00035 //=============================================================================
00039 //=============================================================================
00040 
00041 GEOM_IOperations_i::GEOM_IOperations_i(PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, ::GEOM_IOperations* theImpl)
00042 :SALOME::GenericObj_i( thePOA ), _impl(theImpl), _engine(theEngine)
00043 {
00044 }
00045 
00046 //=============================================================================
00050 //=============================================================================
00051 
00052 GEOM_IOperations_i::~GEOM_IOperations_i()
00053 {}
00054 
00055 
00056 //=============================================================================
00060 //=============================================================================
00061 CORBA::Boolean GEOM_IOperations_i::IsDone()
00062 {
00063   return _impl->IsDone();
00064 }
00065 
00066 
00067 //=============================================================================
00071 //=============================================================================
00072 void GEOM_IOperations_i::SetErrorCode(const char* theErrorCode)
00073 {
00074   _impl->SetErrorCode((char*)theErrorCode);
00075 }
00076 
00077 //=============================================================================
00081 //=============================================================================
00082 char* GEOM_IOperations_i::GetErrorCode()
00083 {
00084   return CORBA::string_dup(_impl->GetErrorCode());
00085 }
00086 
00087 //=============================================================================
00091 //=============================================================================
00092 CORBA::Long GEOM_IOperations_i::GetStudyID()
00093 {
00094   return _impl->GetDocID();
00095 }
00096 
00097 //=============================================================================
00101 //=============================================================================
00102 void GEOM_IOperations_i::StartOperation()
00103 {
00104   _impl->StartOperation();
00105 }
00106 
00107 //=============================================================================
00111 //=============================================================================
00112 void GEOM_IOperations_i::FinishOperation()
00113 {
00114   _impl->FinishOperation();
00115 }
00116 
00117 
00118 //=============================================================================
00122 //=============================================================================
00123 void GEOM_IOperations_i::AbortOperation()
00124 {
00125   _impl->AbortOperation();
00126 }
00127 
00128 //=============================================================================
00132 //=============================================================================
00133 GEOM::GEOM_Object_ptr GEOM_IOperations_i::GetObject(Handle(GEOM_Object) theObject)
00134 {
00135   GEOM::GEOM_Object_var GO;
00136   if (theObject.IsNull()) return GO._retn();
00137   TCollection_AsciiString anEntry;
00138   TDF_Tool::Entry(theObject->GetEntry(), anEntry);
00139   GO = _engine->GetObject(theObject->GetDocID(), anEntry.ToCString());
00140   return GO._retn();
00141 }
00142 
00143 //=============================================================================
00147 //=============================================================================
00148 Handle(GEOM_Object) GEOM_IOperations_i::GetObjectImpl(GEOM::GEOM_Object_ptr theObject)
00149 {
00150   Handle(GEOM_Object) anImpl;
00151   if (!CORBA::is_nil(theObject)) {
00152     CORBA::String_var anEntry = theObject->GetEntry();
00153     anImpl = GetImpl()->GetEngine()->GetObject
00154       (theObject->GetStudyID(), anEntry);
00155   }
00156   return anImpl;
00157 }