]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add group name attribute for export
authorspo <sergey.pokhodenko@opencascade.com>
Mon, 30 Nov 2015 13:21:49 +0000 (16:21 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Wed, 9 Dec 2015 05:16:49 +0000 (08:16 +0300)
src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp
src/ExchangePlugin/ExchangePlugin_ExportFeature.h
src/ExchangePlugin/export_widget.xml

index e96779bd7441a5b202a5ee4c974c4306c8575576..39522d5908d9391026cae1fcb87d7dd5b759ad33 100644 (file)
@@ -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());
 }
 
 /*
@@ -178,6 +180,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());
index 8b57ed612ee6720d0486a35a0bcd494fd7690959..4ffce6277496e0d34e95d5b6eb118bc56943b965 100644 (file)
@@ -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
index d00baf07b66282151363a1e99e82e0cf08a5715d..60f0454caf084f5e1aa1a46152a86c6460bde5aa 100644 (file)
                    label="Author"
                    placeholder="Please input the author">
       </stringvalue>
+      <stringvalue id="xao_geometry_name"
+                   label="Geometry name"
+                   placeholder="Please input the geometry name">
+      </stringvalue>
     </case>
   </switch>
 </source>