]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0021684: EDF 2221 : Display the arguments and the name of the operations
authoreap <eap@opencascade.com>
Mon, 17 Jun 2013 12:42:04 +0000 (12:42 +0000)
committereap <eap@opencascade.com>
Mon, 17 Jun 2013 12:42:04 +0000 (12:42 +0000)
+  virtual GEOM::CreationInformation* GetCreationInformation();

src/GEOM_I/GEOM_Object_i.cc
src/GEOM_I/GEOM_Object_i.hh

index 3e206690d764b868cf25d1cc60c995ba4ba0a63e..3d1e9c686e8fdc976f3ebd49f122747303a19206 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_OStream.hxx>
-
-#include <GEOM_Object_i.hh>
-#include <GEOM_ISubShape.hxx>
-#include <GEOMImpl_Types.hxx>
+#include "GEOM_Object_i.hh"
 
-#include "utilities.h"
-#include <fstream>
-#include <sstream>
+#include "GEOM_ISubShape.hxx"
+#include "GEOMImpl_Types.hxx"
+#include "GEOM_BaseDriver.hxx"
 
+#include <utilities.h>
 #include <OpUtil.hxx>
 #include <Utils_ExceptHandlers.hxx>
-#include <TDF_Tool.hxx>
-#include <TDF_Label.hxx>
-#include <TCollection_AsciiString.hxx>
 
-#include <BRepTools_ShapeSet.hxx>
 #include <BRepTools.hxx>
+#include <BRepTools_ShapeSet.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 <fstream>
+#include <sstream>
+
+#include <Standard_Failure.hxx>
+#include <Standard_ErrorHandler.hxx>
+
 #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<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();
+}
index c903c61aa9208770cb0be21d0332d1420def9138..eed3220a9c3c63fca0d67e3bc76ffad850044a57 100644 (file)
@@ -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: