Salome HOME
Fix #1596: export XAO
authorspo <sergey.pokhodenko@opencascade.com>
Fri, 24 Jun 2016 09:13:57 +0000 (12:13 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Fri, 24 Jun 2016 09:13:57 +0000 (12:13 +0300)
src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp
src/ExchangePlugin/ExchangePlugin_ExportFeature.h
src/ExchangePlugin/export_widget.xml

index 81c62671d95e8ffb77f6ba63cee5a25ea0c840c7..1cbd1962b779101b47b4e76a81d2d1b82d463a76 100644 (file)
@@ -57,16 +57,26 @@ void ExchangePlugin_ExportFeature::initAttributes()
 {
   data()->addAttribute(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID(), ModelAPI_AttributeString::typeId());
   data()->addAttribute(ExchangePlugin_ExportFeature::FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
+  data()->addAttribute(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID(), ModelAPI_AttributeString::typeId());
   data()->addAttribute(ExchangePlugin_ExportFeature::FILE_FORMAT_ID(), ModelAPI_AttributeString::typeId());
   data()->addAttribute(ExchangePlugin_ExportFeature::SELECTION_LIST_ID(), ModelAPI_AttributeSelectionList::typeId());
   data()->addAttribute(ExchangePlugin_ExportFeature::XAO_AUTHOR_ID(), ModelAPI_AttributeString::typeId());
   data()->addAttribute(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID(), ModelAPI_AttributeString::typeId());
 
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ExchangePlugin_ExportFeature::SELECTION_LIST_ID());
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID());
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ExchangePlugin_ExportFeature::XAO_AUTHOR_ID());
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID());
 }
 
+void ExchangePlugin_ExportFeature::attributeChanged(const std::string& theID)
+{
+  if (theID == XAO_FILE_PATH_ID()) {
+    string(ExchangePlugin_ExportFeature::FILE_PATH_ID())->setValue(
+      string(ExchangePlugin_ExportFeature::XAO_FILE_PATH_ID())->value());
+  }
+}
+
 /*
  * Computes or recomputes the results
  */
index 4ffce6277496e0d34e95d5b6eb118bc56943b965..5ec91c660f65b2230fe5b2be15f8be630f291265 100644 (file)
@@ -41,6 +41,12 @@ public:
     static const std::string MY_FILE_PATH_ID("file_path");
     return MY_FILE_PATH_ID;
   }
+  /// attribute name of xao file path
+  inline static const std::string& XAO_FILE_PATH_ID()
+  {
+    static const std::string MY_XAO_FILE_PATH_ID("xao_file_path");
+    return MY_XAO_FILE_PATH_ID;
+  }
   /// attribute name of file format
   inline static const std::string& FILE_FORMAT_ID()
   {
@@ -79,6 +85,9 @@ public:
   /// Request for initialization of data model of the feature: adding all attributes
   EXCHANGEPLUGIN_EXPORT virtual void initAttributes();
 
+  /// Reimplemented from ModelAPI_Feature::attributeChanged()
+  EXCHANGEPLUGIN_EXPORT virtual void attributeChanged(const std::string& theID);
+
   /// Computes or recomputes the results
   EXCHANGEPLUGIN_EXPORT virtual void execute();
 
index 914ef4508fac508acb8a6fd2c08fc2bccdf9ba84..cc06c1e2e7b8b6e7fbcfd9ef61d2cb3efb26c173 100644 (file)
@@ -17,7 +17,7 @@
       </multi_selector>
     </case>
     <case id="XAO" title="XAO">
-      <export_file_selector id="file_path"
+      <export_file_selector id="xao_file_path"
                             type="save"
                             title="Export file"
                             path="">