From: spo Date: Mon, 30 Nov 2015 13:21:49 +0000 (+0300) Subject: Add group name attribute for export X-Git-Tag: V_2.4.0~60 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a07ffbb46528d54ef7cdf49cea4cd4f2391cc1c7;p=modules%2Fshaper.git Add group name attribute for export --- diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp index 437bae808..e0505cc9a 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp @@ -60,9 +60,11 @@ void ExchangePlugin_ExportFeature::initAttributes() 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_AUTHOR_ID()); + ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ExchangePlugin_ExportFeature::ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID()); } /* @@ -183,6 +185,11 @@ void ExchangePlugin_ExportFeature::exportXAO(const std::string& theFileName) return; } + // geometry name + + std::string aGeometryName = string(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID())->value(); + aXao.getGeometry()->setName(aGeometryName); + // groups int aGroupCount = document()->size(ModelAPI_ResultGroup::group()); diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h index 8b57ed612..4ffce6277 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.h +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.h @@ -59,6 +59,12 @@ public: static const std::string MY_XAO_AUTHOR_ID("xao_author"); return MY_XAO_AUTHOR_ID; } + /// attribute name of geometry name for XAO format + inline static const std::string& XAO_GEOMETRY_NAME_ID() + { + static const std::string MY_XAO_GEOMETRY_NAME_ID("xao_geometry_name"); + return MY_XAO_GEOMETRY_NAME_ID; + } /// Default constructor EXCHANGEPLUGIN_EXPORT ExchangePlugin_ExportFeature(); /// Default destructor diff --git a/src/ExchangePlugin/export_widget.xml b/src/ExchangePlugin/export_widget.xml index d00baf07b..60f0454ca 100644 --- a/src/ExchangePlugin/export_widget.xml +++ b/src/ExchangePlugin/export_widget.xml @@ -28,6 +28,10 @@ label="Author" placeholder="Please input the author"> + +