X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOM_I%2FGEOM_BaseObject_i.cc;h=e6d2bb8372d69c2b091051477c8f2ad0568ac20a;hb=5d340bb0d6761b4a61913395814a5f18845c96a9;hp=53558052370b6fec06f3a6cf6f30502ef28735f3;hpb=b51357b79dff28f1970125b19b018d392dfb0e75;p=modules%2Fgeom.git diff --git a/src/GEOM_I/GEOM_BaseObject_i.cc b/src/GEOM_I/GEOM_BaseObject_i.cc index 535580523..e6d2bb837 100644 --- a/src/GEOM_I/GEOM_BaseObject_i.cc +++ b/src/GEOM_I/GEOM_BaseObject_i.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -39,7 +39,7 @@ #include #endif -#ifdef WNT +#ifdef WIN32 #pragma warning( disable:4786 ) #endif @@ -51,7 +51,7 @@ GEOM_BaseObject_i::GEOM_BaseObject_i (PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine, - Handle(GEOM_BaseObject) theImpl) + Handle(::GEOM_BaseObject) theImpl) : SALOME::GenericObj_i( thePOA ), _engine(theEngine), _impl(theImpl) { } @@ -64,7 +64,7 @@ GEOM_BaseObject_i::GEOM_BaseObject_i (PortableServer::POA_ptr thePOA, GEOM_BaseObject_i::~GEOM_BaseObject_i() { - MESSAGE("GEOM_BaseObject_i::~GEOM_BaseObject_i"); + //MESSAGE("GEOM_BaseObject_i::~GEOM_BaseObject_i"); GEOM_Engine::GetEngine()->RemoveObject(_impl); } @@ -85,24 +85,24 @@ char* GEOM_BaseObject_i::GetEntry() //============================================================================= /*! - * GetStudyID + * GetType */ //============================================================================= -CORBA::Long GEOM_BaseObject_i::GetStudyID() +CORBA::Long GEOM_BaseObject_i::GetType() { - return _impl->GetDocID(); + return _impl->GetType(); } //============================================================================= /*! - * GetType + * GetTick */ //============================================================================= -CORBA::Long GEOM_BaseObject_i::GetType() +CORBA::Long GEOM_BaseObject_i::GetTick() { - return _impl->GetType(); + return _impl->GetTic(); } //============================================================================= @@ -170,10 +170,10 @@ GEOM::ListOfGBO* GEOM_BaseObject_i::GetDependency() TCollection_AsciiString anEntry; for (int i = 1; i<=aLength; i++) { - Handle(GEOM_BaseObject) anObj = Handle(GEOM_BaseObject)::DownCast(aSeq->Value(i)); + Handle(::GEOM_BaseObject) anObj = Handle(::GEOM_BaseObject)::DownCast(aSeq->Value(i)); if (anObj.IsNull()) continue; TDF_Tool::Entry(anObj->GetEntry(), anEntry); - GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetDocID(), (char*) anEntry.ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject((char*) anEntry.ToCString()); aList[i-1] = obj; } @@ -200,10 +200,9 @@ GEOM::ListOfGBO* GEOM_BaseObject_i::GetLastDependency() TCollection_AsciiString anEntry; for (int i = 1; i<=aLength; i++) { - Handle(GEOM_BaseObject) anObj = Handle(GEOM_BaseObject)::DownCast(aSeq->Value(i)); + Handle(::GEOM_BaseObject) anObj = Handle(::GEOM_BaseObject)::DownCast(aSeq->Value(i)); if (anObj.IsNull()) continue; - GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetDocID(), - anObj->GetEntryString().ToCString()); + GEOM::GEOM_BaseObject_var obj = _engine->GetObject(anObj->GetEntryString().ToCString()); aList[i-1] = GEOM::GEOM_BaseObject::_duplicate( obj ); } @@ -257,50 +256,59 @@ char* GEOM_BaseObject_i::GetParameters() */ //================================================================================ -GEOM::CreationInformation* GEOM_BaseObject_i::GetCreationInformation() +GEOM::CreationInformationSeq* GEOM_BaseObject_i::GetCreationInformation() { - GEOM::CreationInformation_var info = new GEOM::CreationInformation; + GEOM::CreationInformationSeq_var info = new GEOM::CreationInformationSeq(); - Handle(GEOM_BaseDriver) driver = - Handle(GEOM_BaseDriver)::DownCast( _impl->GetCreationDriver() ); - if ( !driver.IsNull() ) + int nbFun = _impl->GetNbFunctions(); + info->length( nbFun ); + int nbI = 0; + for ( int i = 1; i <= nbFun; ++i ) { - std::vector params; - std::string operationName; - try + Handle(::GEOM_BaseDriver) driver = + Handle(::GEOM_BaseDriver)::DownCast( _impl->GetCreationDriver( i )); + if ( !driver.IsNull() ) { - OCC_CATCH_SIGNALS; - if ( driver->GetCreationInformation( operationName, params )) + std::vector params; + std::string operationName; + try { - info->operationName = operationName.c_str(); - info->params.length( params.size() ); - for ( size_t i = 0; i < params.size(); ++i ) + OCC_CATCH_SIGNALS; + if ( driver->GetCreationInformation( operationName, params )) { - info->params[i].name = params[i].name.c_str(); - info->params[i].value = params[i].value.c_str(); + info[nbI].operationName = operationName.c_str(); + info[nbI].params.length( params.size() ); + for ( size_t i = 0; i < params.size(); ++i ) + { + info[nbI].params[i].name = params[i].name.c_str(); + info[nbI].params[i].value = params[i].value.c_str(); + } + nbI++; } - } #ifdef _DEBUG_ - if ( operationName.empty() ) - { - cout << endl << endl << endl << "Warning: " << endl << "Dear developer!!!" << endl - << " Consider implementing " - << typeid(*(driver.operator->())).name() << "::GetCreationInformation() " << endl - << " for the case of operation which has created '" << GetName() << "' object" << endl - << "PLEEEEEEEASE" << endl - << "\tPLEEEEEEEASE" << endl - << "\t\tPLEEEEEEEASE" << endl - << "\t\t\tPLEEEEEEEASE" << endl - << "\t\t\t\tPLEEEEEEEASE" << endl; - } + if ( operationName.empty() ) + { + cout << endl << endl << endl << "Warning: " << endl << "Dear developer!!!" << endl + << " Consider implementing " + << typeid(*(driver.operator->())).name() << "::GetCreationInformation() " << endl + << " for the case of operation which has created '" << GetName() << "' object" << endl + << "PLEEEEEEEASE" << endl + << "\tPLEEEEEEEASE" << endl + << "\t\tPLEEEEEEEASE" << endl + << "\t\t\tPLEEEEEEEASE" << endl + << "\t\t\t\tPLEEEEEEEASE" << endl; + } #endif - } - catch(...) - { + } + catch(...) + { #ifdef _DEBUG_ - cout << "Ecxeption in GEOM_BaseObject_i::GetCreationInformation()" << endl; + cout << "Ecxeption in GEOM_BaseObject_i::GetCreationInformation()" << endl; #endif + } } } + info->length( nbI ); + return info._retn(); }