From 51457c36b03ceaa3e7b9c2ef0d4699bffa27300e Mon Sep 17 00:00:00 2001 From: spo Date: Mon, 30 Nov 2015 16:21:49 +0300 Subject: [PATCH] Add group name attribute for export --- src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp | 7 +++++++ src/ExchangePlugin/ExchangePlugin_ExportFeature.h | 6 ++++++ src/ExchangePlugin/export_widget.xml | 4 ++++ 3 files changed, 17 insertions(+) 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"> + + -- 2.39.2