From 7d03d7203bbe4a74ab8d2d78ff30c13c77ec0627 Mon Sep 17 00:00:00 2001 From: eap Date: Mon, 17 Jun 2013 12:42:04 +0000 Subject: [PATCH] 0021684: EDF 2221 : Display the arguments and the name of the operations + virtual GEOM::CreationInformation* GetCreationInformation(); --- src/GEOM_I/GEOM_Object_i.cc | 61 +++++++++++++++++++++++++++++-------- src/GEOM_I/GEOM_Object_i.hh | 18 ++++++----- 2 files changed, 59 insertions(+), 20 deletions(-) diff --git a/src/GEOM_I/GEOM_Object_i.cc b/src/GEOM_I/GEOM_Object_i.cc index 3e206690d..3d1e9c686 100644 --- a/src/GEOM_I/GEOM_Object_i.cc +++ b/src/GEOM_I/GEOM_Object_i.cc @@ -20,27 +20,31 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#include - -#include -#include -#include +#include "GEOM_Object_i.hh" -#include "utilities.h" -#include -#include +#include "GEOM_ISubShape.hxx" +#include "GEOMImpl_Types.hxx" +#include "GEOM_BaseDriver.hxx" +#include #include #include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include #include #include +#include +#include + +#include +#include + #ifdef WNT #pragma warning( disable:4786 ) #endif @@ -521,3 +525,36 @@ char* GEOM_Object_i::GetParameters() return CORBA::string_dup(_impl->GetParameters().ToCString()); } +GEOM::CreationInformation* GEOM_Object_i::GetCreationInformation() +{ + GEOM::CreationInformation_var info = new GEOM::CreationInformation; + + Handle(GEOM_BaseDriver) driver = + Handle(GEOM_BaseDriver)::DownCast( _impl->GetCreationDriver() ); + if ( !driver.IsNull() ) + { + std::vector params; + std::string operationName; + try + { + OCC_CATCH_SIGNALS; + if ( driver->GetCreationInformation( operationName, params )) + { + info->operationName = operationName.c_str(); + info->params.length( params.size() ); + for ( size_t i = 0; i < params.size(); ++i ) + { + info->params[i].name = params[i].name.c_str(); + info->params[i].value = params[i].value.c_str(); + } + } + } + catch(...) + { +#ifdef _DEBUG_ + cout << "Ecxeption in GEOM_Object_i::GetCreationInformation()" << endl; +#endif + } + } + return info._retn(); +} diff --git a/src/GEOM_I/GEOM_Object_i.hh b/src/GEOM_I/GEOM_Object_i.hh index c903c61aa..eed3220a9 100644 --- a/src/GEOM_I/GEOM_Object_i.hh +++ b/src/GEOM_I/GEOM_Object_i.hh @@ -69,16 +69,16 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public virtual CORBA::Boolean GetAutoColor(); - void SetMarkerStd(GEOM::marker_type theType, GEOM::marker_size theSize); - - void SetMarkerTexture(CORBA::Long theTextureId); - - GEOM::marker_type GetMarkerType(); + virtual void SetMarkerStd(GEOM::marker_type theType, GEOM::marker_size theSize); - GEOM::marker_size GetMarkerSize(); + virtual void SetMarkerTexture(CORBA::Long theTextureId); + + virtual GEOM::marker_type GetMarkerType(); + + virtual GEOM::marker_size GetMarkerSize(); + + virtual CORBA::Long GetMarkerTexture(); - CORBA::Long GetMarkerTexture(); - virtual void SetStudyEntry(const char* theEntry); virtual char* GetStudyEntry(); @@ -105,6 +105,8 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public virtual char* GetParameters(); + virtual GEOM::CreationInformation* GetCreationInformation(); + Handle(GEOM_Object) GetImpl() { return _impl; } private: -- 2.39.2