Salome HOME
IPAL52828: No Creation Info available for a GEOM object imported from XAO file
authoreap <eap@opencascade.com>
Thu, 16 Jul 2015 17:45:48 +0000 (20:45 +0300)
committereap <eap@opencascade.com>
Thu, 16 Jul 2015 17:45:48 +0000 (20:45 +0300)
resources/CMakeLists.txt
resources/import.png [new file with mode: 0644]
src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx
src/GEOMGUI/GEOM_images.ts
src/XAOPlugin/XAOPlugin_Driver.cxx
src/XAOPlugin/XAOPlugin_Driver.hxx
src/XAOPlugin/XAOPlugin_IOperations.cxx

index 44d86e7bc11cb47a801ed72da73ecbbfcc3e465d..3d47d93edc22f23ef4df2f7c95802f4b251a5e97 100755 (executable)
@@ -114,6 +114,7 @@ SET( _res_files
   fuse_collinear_edges.png
   geometry.png
   import_picture.png
+  import.png
   limit_tolerance.png
   line.png
   line2points.png
diff --git a/resources/import.png b/resources/import.png
new file mode 100644 (file)
index 0000000..71690c9
Binary files /dev/null and b/resources/import.png differ
index 5c3681e28df6f1fa778bac57d987225ebce38c1c..35a59ccfb6c2ab2022e1589a4577e9b64d7739d4 100644 (file)
@@ -124,7 +124,10 @@ void GEOMGUI_CreationInfoWdg::setInfo( GEOM::CreationInformationSeq& info )
           }
           // get icon
           QString prefix = plugin_name.isEmpty() ? "GEOM" : plugin_name;
-          icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false );
+          if ( name.startsWith( "Import"))
+            icon = resMgr->loadPixmap( "GEOM", tr("ICO_IMPORT_SHAPE"), true );
+          else
+            icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false );
 
           // translate operation name
           operationName = tr( ("MEN_"+name).toLatin1().constData() );
index 1e906fe81d893ff92ef2f265522c3b6f91d4c324..cfcccd313b526d0aa9f64ae1c859f2be4c1d67d4 100644 (file)
             <source>ICO_TRANSFER_DATA</source>
             <translation>transfer_data.png</translation>
         </message>
+        <message>
+            <source>ICO_IMPORT_SHAPE</source>
+            <translation>import.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_POINT_FACE</source>
             <translation>pointonface.png</translation>
index 01803c13681969f6f33f4fd33e13e9855912171f..607c7b3df3b1f49448601554c3d0d46159be5448 100644 (file)
@@ -100,6 +100,23 @@ Standard_Integer XAOPlugin_Driver::Execute(TFunction_Logbook& log) const
   return 1;
 }
 
-IMPLEMENT_STANDARD_HANDLE (XAOPlugin_Driver, TFunction_Driver);
-IMPLEMENT_STANDARD_RTTIEXT(XAOPlugin_Driver, TFunction_Driver);
+//=======================================================================
+//function : GetCreationInformation
+//purpose  : Returns a name of creation operation and names and values of
+//           creation parameters
+//=======================================================================
+
+bool XAOPlugin_Driver::GetCreationInformation(std::string&             theOperationName,
+                                              std::vector<GEOM_Param>& theParams)
+{
+  if (Label().IsNull()) return false;
+  Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
+
+  theOperationName = "ImportXAO";
+  AddParam( theParams, "File name", function->GetString( GetFileNameTag() ));
+  return true;
+}
+
+IMPLEMENT_STANDARD_HANDLE (XAOPlugin_Driver, GEOM_BaseDriver);
+IMPLEMENT_STANDARD_RTTIEXT(XAOPlugin_Driver, GEOM_BaseDriver);
  
index 1d36b839bf6278575474a050b0402d8157b254a4..9a8885e96ad53fc5b54ed3ae01b2c3c148d1767d 100644 (file)
 #ifndef _XAOPlugin_Driver_HXX
 #define _XAOPlugin_Driver_HXX
 
-// OCCT includes
-#include <TFunction_Driver.hxx>
+#include "GEOM_BaseDriver.hxx"
 
-DEFINE_STANDARD_HANDLE(XAOPlugin_Driver, TFunction_Driver);
+DEFINE_STANDARD_HANDLE(XAOPlugin_Driver, GEOM_BaseDriver);
 
-class XAOPlugin_Driver: public TFunction_Driver
+class XAOPlugin_Driver: public GEOM_BaseDriver
 {
 public:
   XAOPlugin_Driver();
@@ -39,7 +38,12 @@ public:
   Standard_Boolean MustExecute(const TFunction_Logbook&) const;
   virtual void Validate(TFunction_Logbook&) const {}
 
-DEFINE_STANDARD_RTTI(XAOPlugin_Driver)
+  virtual bool GetCreationInformation(std::string&             theOperationName,
+                                     std::vector<GEOM_Param>& theParams);
+
+  static int GetFileNameTag() { return 1; } // where to store file name in GEOM_Function
+
+  DEFINE_STANDARD_RTTI(XAOPlugin_Driver)
 };
 
 #endif // _XAOPlugin_Driver_HXX
index d491cad2b49d02911a741359797061cc3ac0f928..d8c886274f57b19a6f7af9d30444b4f41ad78052 100644 (file)
@@ -470,6 +470,8 @@ bool XAOPlugin_IOperations::ImportXAO( const char* fileName,
   if (function.IsNull()) return false;
   if (function->GetDriverGUID() != XAOPlugin_Driver::GetID()) return false;
 
+  function->SetString( XAOPlugin_Driver::GetFileNameTag(), fileName );
+
   // set the geometry
   if (xaoGeometry->getFormat() == XAO::BREP)
   {