0021684: EDF 2221 : Display the arguments and the name of the operations

+  virtual GEOM::CreationInformation* GetCreationInformation();
This commit is contained in:
eap 2013-06-17 12:42:04 +00:00
parent c0b87081f9
commit 7d03d7203b
2 changed files with 62 additions and 23 deletions

View File

@ -20,26 +20,30 @@
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
#include "GEOM_Object_i.hh"
#include "GEOM_ISubShape.hxx"
#include "GEOMImpl_Types.hxx"
#include "GEOM_BaseDriver.hxx"
#include <utilities.h>
#include <OpUtil.hxx>
#include <Utils_ExceptHandlers.hxx>
#include <BRepTools.hxx>
#include <BRepTools_ShapeSet.hxx>
#include <Standard_OStream.hxx> #include <Standard_OStream.hxx>
#include <TCollection_AsciiString.hxx>
#include <TDF_Label.hxx>
#include <TDF_Tool.hxx>
#include <TopAbs.hxx>
#include <TopoDS_Iterator.hxx>
#include <GEOM_Object_i.hh>
#include <GEOM_ISubShape.hxx>
#include <GEOMImpl_Types.hxx>
#include "utilities.h"
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <OpUtil.hxx> #include <Standard_Failure.hxx>
#include <Utils_ExceptHandlers.hxx> #include <Standard_ErrorHandler.hxx>
#include <TDF_Tool.hxx>
#include <TDF_Label.hxx>
#include <TCollection_AsciiString.hxx>
#include <BRepTools_ShapeSet.hxx>
#include <BRepTools.hxx>
#include <TopAbs.hxx>
#include <TopoDS_Iterator.hxx>
#ifdef WNT #ifdef WNT
#pragma warning( disable:4786 ) #pragma warning( disable:4786 )
@ -521,3 +525,36 @@ char* GEOM_Object_i::GetParameters()
return CORBA::string_dup(_impl->GetParameters().ToCString()); 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<GEOM_Param> 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();
}

View File

@ -69,15 +69,15 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public
virtual CORBA::Boolean GetAutoColor(); virtual CORBA::Boolean GetAutoColor();
void SetMarkerStd(GEOM::marker_type theType, GEOM::marker_size theSize); virtual void SetMarkerStd(GEOM::marker_type theType, GEOM::marker_size theSize);
void SetMarkerTexture(CORBA::Long theTextureId); virtual void SetMarkerTexture(CORBA::Long theTextureId);
GEOM::marker_type GetMarkerType(); virtual GEOM::marker_type GetMarkerType();
GEOM::marker_size GetMarkerSize(); virtual GEOM::marker_size GetMarkerSize();
CORBA::Long GetMarkerTexture(); virtual CORBA::Long GetMarkerTexture();
virtual void SetStudyEntry(const char* theEntry); virtual void SetStudyEntry(const char* theEntry);
@ -105,6 +105,8 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public
virtual char* GetParameters(); virtual char* GetParameters();
virtual GEOM::CreationInformation* GetCreationInformation();
Handle(GEOM_Object) GetImpl() { return _impl; } Handle(GEOM_Object) GetImpl() { return _impl; }
private: private: