From: spo Date: Fri, 24 Jun 2016 09:13:57 +0000 (+0300) Subject: Fix #1596: export XAO X-Git-Tag: V_2.4.0~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f6bc37f4a5d4f269f44528c7ec946fc0c474d673;p=modules%2Fshaper.git Fix #1596: export XAO --- diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp index 81c62671d..1cbd1962b 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp @@ -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 */ diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h index 4ffce6277..5ec91c660 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h @@ -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(); diff --git a/src/ExchangePlugin/export_widget.xml b/src/ExchangePlugin/export_widget.xml index 914ef4508..cc06c1e2e 100644 --- a/src/ExchangePlugin/export_widget.xml +++ b/src/ExchangePlugin/export_widget.xml @@ -17,7 +17,7 @@ -