]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add API Python to export ROOT and add translation to export ROOT
authorcgenraul <clarisse.genrault@cea.fr>
Fri, 2 Oct 2020 14:35:03 +0000 (16:35 +0200)
committercgenraul <clarisse.genrault@cea.fr>
Fri, 2 Oct 2020 14:35:03 +0000 (16:35 +0200)
src/ExchangeAPI/ExchangeAPI_Export.cpp
src/ExchangeAPI/ExchangeAPI_Export.h
src/ExchangePlugin/CMakeLists.txt
src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp
src/ExchangePlugin/ExchangePlugin_ExportFeature.h
src/ExchangePlugin/ExchangePlugin_ExportRoot.cpp
src/ExchangePlugin/ExchangePlugin_ExportRoot.h
src/ExchangePlugin/export_widget.xml
src/GeomAlgoAPI/GeomAlgoAPI_ROOTExport.cpp
src/GeomAlgoAPI/GeomAlgoAPI_ROOTExport.h
src/PythonAPI/model/exchange/__init__.py

index fa1ab009e885ea54f52438e9754466c91d7dc332..7cdb2ea256ebca0eb270d5134f3c0963810fbd07 100644 (file)
@@ -72,7 +72,7 @@ ExchangeAPI_Export::ExchangeAPI_Export(const std::shared_ptr<ModelAPI_Feature>&
 }
 
 
-/// Constructor with values for export in other formats than XAO.
+/// Constructor with values for export in other formats than XAO or ROOT.
 ExchangeAPI_Export::ExchangeAPI_Export(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                               const std::string & theFilePath,
                               const std::list<ModelHighAPI_Selection> & theSelectionList,
@@ -89,6 +89,29 @@ ExchangeAPI_Export::ExchangeAPI_Export(const std::shared_ptr<ModelAPI_Feature>&
   apply(); // finish operation to make sure the export is done on the current state of the history
 }
 
+/// Constructor with values for ROOT export.
+ExchangeAPI_Export::ExchangeAPI_Export(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                                       const std::string & theFilePath,
+                                       const std::string & theManagerName,
+                                       const std::string & theManagerTitle,
+                                       const std::string & theMatFile,
+                                       const std::string & theRootNameFile,
+                                       const ModelHighAPI_Selection & theMainObject)
+: ModelHighAPI_Interface(theFeature)
+{
+  initialize();
+  fillAttribute("ROOT", theFeature->string(ExchangePlugin_ExportFeature::EXPORT_TYPE_ID()));
+  fillAttribute(theFilePath, theFeature->string(ExchangePlugin_ExportFeature::ROOT_FILE_PATH_ID()));
+  fillAttribute(theManagerName, theFeature->string(ExchangePlugin_ExportFeature::ROOT_MANAGER_NAME_ID()));
+  fillAttribute(theManagerTitle, theFeature->string(ExchangePlugin_ExportFeature::ROOT_MANAGER_TITLE_ID()));
+  fillAttribute(theMatFile, theFeature->string(ExchangePlugin_ExportFeature::MAT_FILE_ID()));
+  fillAttribute(theRootNameFile, theFeature->string(ExchangePlugin_ExportFeature::EXP_NAME_FILE_ID()));
+  fillAttribute(theMainObject, theFeature->selection(ExchangePlugin_ExportFeature::MAIN_OBJECT_ID()));
+  fillAttribute("ROOT", theFeature->string(ExchangePlugin_ExportFeature::FILE_FORMAT_ID()));
+  execute();
+  apply(); // finish operation to make sure the export is done on the current state of the history
+}
+
 ExchangeAPI_Export::~ExchangeAPI_Export()
 {
 }
@@ -142,6 +165,24 @@ void ExchangeAPI_Export::dump(ModelHighAPI_Dumper& theDumper) const
       theDumper << ", '" << theGeometryName << "'";
     theDumper << ")" << std::endl;
   }
+  else if (exportType == "ROOT") {
+    std::string aTmpROOTFile =
+                aBase->string(ExchangePlugin_ExportFeature::ROOT_FILE_PATH_ID())->value();
+    correctSeparators(aTmpROOTFile);
+    theDumper << "exportToROOT(" << aDocName << ", '" << aTmpROOTFile << "'" ;
+    std::string theManagerName = aBase->string(ExchangePlugin_ExportFeature::ROOT_MANAGER_NAME_ID())->value();
+    theDumper << ", '" << theManagerName << "'";
+    std::string theManagerTitle =aBase->string(ExchangePlugin_ExportFeature::ROOT_MANAGER_TITLE_ID())->value();
+    theDumper << ", '" << theManagerTitle << "'";
+    std::string theMatFile = aBase->string(ExchangePlugin_ExportFeature::MAT_FILE_ID())->value();
+    theDumper << ", '" << theMatFile << "'";
+    std::string theExpNameFile = aBase->string(ExchangePlugin_ExportFeature::EXP_NAME_FILE_ID())->value();
+    theDumper << ", '" << theExpNameFile << "'";
+    AttributeSelectionPtr anAttrObject =
+      aBase->selection(ExchangePlugin_ExportFeature::MAIN_OBJECT_ID());
+    theDumper << ", " << anAttrObject;
+    theDumper << ")" << std::endl;
+  }
   else {
     std::string aFilePath = aBase->string(ExchangePlugin_ExportFeature::FILE_PATH_ID())->value();
     correctSeparators(aFilePath);
@@ -188,4 +229,19 @@ ExportPtr exportToXAO(const std::shared_ptr<ModelAPI_Document> & thePart,
   return ExportPtr(new ExchangeAPI_Export(aFeature, theFilePath, theSelectedShape, "XAO"));
 }
 
+ExportPtr exportToROOT(const std::shared_ptr<ModelAPI_Document> & thePart,
+                       const std::string & theFilePath,
+                       const std::string & theManagerName,
+                       const std::string & theManagerTitle,
+                       const std::string & theMatFile,
+                       const std::string & theRootNameFile,
+                       const ModelHighAPI_Selection& theMainObject)
+{
+  apply(); // finish previous operation to make sure all previous operations are done
+  std::shared_ptr<ModelAPI_Feature> aFeature =
+    thePart->addFeature(ExchangePlugin_ExportFeature::ID());
+  return ExportPtr(new ExchangeAPI_Export(aFeature, theFilePath, theManagerName, theManagerTitle,
+                                          theMatFile, theRootNameFile, theMainObject));
+}
+
 //--------------------------------------------------------------------------------------
index 6cfddfd8f65d13500e2b984bb59d85dc39a4dff5..2c8aacd7c5cb0e2281a632c064aa71903b570b40 100644 (file)
@@ -54,24 +54,33 @@ public:
 
   /// Constructor with values for XAO of selected result export.
   EXCHANGEAPI_EXPORT
-    explicit ExchangeAPI_Export(const std::shared_ptr<ModelAPI_Feature>& theFeature,
-      const std::string & theFilePath,
-      const ModelHighAPI_Selection& theResult,
-      const std::string & theAuthor,
-      const std::string & theGeometryName = std::string());
+  explicit ExchangeAPI_Export(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                              const std::string & theFilePath,
+                              const ModelHighAPI_Selection& theResult,
+                              const std::string & theAuthor,
+                              const std::string & theGeometryName = std::string());
 
-  /// Constructor with values for export in other formats than XAO.
+  /// Constructor with values for export in other formats than XAO or ROOT.
   EXCHANGEAPI_EXPORT
   explicit ExchangeAPI_Export(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                               const std::string & theFilePath,
                               const std::list<ModelHighAPI_Selection> & theSelectionList,
                               const std::string & theFileFormat = std::string());
+  
+  EXCHANGEAPI_EXPORT
+  explicit ExchangeAPI_Export(const std::shared_ptr<ModelAPI_Feature>& theFeature,
+                              const std::string & theFilePath,
+                              const std::string & theManagerName,
+                              const std::string & theManagerTitle,
+                              const std::string & theMatFile,
+                              const std::string & theRootNameFile,
+                              const ModelHighAPI_Selection & theMainObject);
 
   /// Destructor.
   EXCHANGEAPI_EXPORT
   virtual ~ExchangeAPI_Export();
 
-  INTERFACE_7(ExchangePlugin_ExportFeature::ID(),
+  INTERFACE_12(ExchangePlugin_ExportFeature::ID(),
              exportType, ExchangePlugin_ExportFeature::EXPORT_TYPE_ID(),
              ModelAPI_AttributeString, /** ExportType */,
              filePath, ExchangePlugin_ExportFeature::FILE_PATH_ID(),
@@ -85,7 +94,18 @@ public:
              xaoAuthor, ExchangePlugin_ExportFeature::XAO_AUTHOR_ID(),
              ModelAPI_AttributeString, /** xao author */,
              xaoGeometryName, ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID(),
-             ModelAPI_AttributeString, /** xao geometry name */)
+             ModelAPI_AttributeString, /** xao geometry name */,
+             rootFilePath, ExchangePlugin_ExportFeature::ROOT_FILE_PATH_ID(),
+             ModelAPI_AttributeString, /** root file path */,
+             rootMainObject, ExchangePlugin_ExportFeature::MAIN_OBJECT_ID(),
+             ModelAPI_AttributeSelection, /**root main ovject */,
+             rootManagerName, ExchangePlugin_ExportFeature::ROOT_MANAGER_NAME_ID(),
+             ModelAPI_AttributeString, /** root manager name */,
+             rootManagerTitle, ExchangePlugin_ExportFeature::ROOT_MANAGER_TITLE_ID(),
+             ModelAPI_AttributeString, /** root manager title */,
+             rootNameFile , ExchangePlugin_ExportFeature::EXP_NAME_FILE_ID(),
+             ModelAPI_AttributeString, /** root name file */
+             )
 
   /// Dump wrapped feature
   EXCHANGEAPI_EXPORT
@@ -123,6 +143,18 @@ ExportPtr exportToXAO(const std::shared_ptr<ModelAPI_Document> & thePart,
   const std::string & theAuthor = std::string(),
   const std::string & theGeometryName = std::string());
 
+ /**\ingroup CPPHighAPI
+ * \brief Exports to ROOT file all features of the current document.
+ */
+ EXCHANGEAPI_EXPORT
+ ExportPtr exportToROOT(const std::shared_ptr<ModelAPI_Document> & thePart,
+                        const std::string & theFilePath,
+                        const std::string & theManagerName,
+                        const std::string & theManagerTitle,
+                        const std::string & theMatFile,
+                        const std::string & theRootNameFile,
+                        const ModelHighAPI_Selection& theMainObject);
+
 //--------------------------------------------------------------------------------------
 //--------------------------------------------------------------------------------------
 #endif /* SRC_EXCHANGEAPI_EXCHANGEAPI_EXPORT_H_ */
index cc82d7da6efdcc25743127d50d6b7f364b68c884..5a727b1bcb57803427b7bb8fc47a84adbb315973 100644 (file)
@@ -29,6 +29,7 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/Events
                     ${PROJECT_SOURCE_DIR}/src/XAO
                     ${PROJECT_SOURCE_DIR}/src/PrimitivesPlugin
                     ${PROJECT_SOURCE_DIR}/src/CollectionPlugin
+                    ${PROJECT_SOURCE_DIR}/src/FeaturesPlugin
 )
 
 SET(PROJECT_HEADERS
@@ -88,5 +89,6 @@ ADD_UNIT_TESTS(TestImport.py
                Test2459.py
                TestExportToXAOWithFields.py
                TestExportToXAOWithGroupNotUpdated.py
+               TestExportToROOT.py
                TestExport_FiniteValidator.py
 )
index 0d2752db7737e2100e212fada5360316a42afdf1..1734424ab2a5c8f183c0a9d1349e5d6a62e4d7a5 100644 (file)
@@ -108,10 +108,15 @@ void ExchangePlugin_ExportFeature::initAttributes()
     ModelAPI_AttributeString::typeId());
   data()->addAttribute(ExchangePlugin_ExportFeature::XAO_GEOMETRY_NAME_ID(),
     ModelAPI_AttributeString::typeId());
+  
   data()->addAttribute(ExchangePlugin_ExportFeature::ROOT_MANAGER_NAME_ID(),
     ModelAPI_AttributeString::typeId());
   data()->addAttribute(ExchangePlugin_ExportFeature::ROOT_MANAGER_TITLE_ID(),
     ModelAPI_AttributeString::typeId());
+  data()->addAttribute(ExchangePlugin_ExportFeature::EXP_NAME_FILE_ID(),
+    ModelAPI_AttributeString::typeId());
+  data()->addAttribute(ExchangePlugin_ExportFeature::MAIN_OBJECT_ID(),
+    ModelAPI_AttributeSelection::typeId());
   data()->addAttribute(ExchangePlugin_ExportFeature::MAT_FILE_ID(),
     ModelAPI_AttributeString::typeId());
 
@@ -626,6 +631,13 @@ void ExchangePlugin_ExportFeature::exportROOT(const std::string& theFileName)
         anAlgo->buildBox(anObjectName, anOx, anOy, anOz, aDx, aDy, aDz);
         aListNamesOfFeatures.push_back(anObjectName);
         aListNamesOfFeatures.push_back(aCurFeature->data()->name());
+      } else if (aCurFeature->getKind() == "Translation") {
+        double aDx, aDy, aDz;
+        std::string anObjectName = aCurFeature->firstResult()->data()->name();
+        ExchangePlugin_ExportRoot::computeTranslation(aCurFeature, aDx, aDy, aDz);
+        anAlgo->buildTranslation(anObjectName, aDx, aDy, aDz);
+        aListNamesOfFeatures.push_back(anObjectName);
+        aListNamesOfFeatures.push_back(aCurFeature->data()->name());
       }
   }
   
@@ -647,7 +659,18 @@ void ExchangePlugin_ExportFeature::exportROOT(const std::string& theFileName)
       }
   }
 
-  anAlgo->buildEnd();
+  std::string aExportFileName = string(ExchangePlugin_ExportFeature::EXP_NAME_FILE_ID())->value();
+  AttributeSelectionPtr anObjectAttr = selection(MAIN_OBJECT_ID());
+  FeaturePtr aFeature = anObjectAttr->contextFeature();
+  std::string aNameShape ="";
+  if (aFeature.get()) {
+    aNameShape = aFeature->firstResult()->data()->name();
+  } else {
+    ObjectPtr anObject = anObjectAttr->contextObject();
+    aNameShape = anObject->data()->name();
+  }
+          
+  anAlgo->buildEnd(aNameShape, aExportFileName);
 
   // Create the file with the content
   anAlgo->write();
index 5d5060cbcf42f2cf16946ff3b71dfd78fa6c4d3f..415212db920513b1a89bc830c628d2b9a9e91584 100644 (file)
@@ -103,6 +103,18 @@ public:
     static const std::string MY_ROOT_MANAGER_TITLE_ID("root_manager_title");
     return MY_ROOT_MANAGER_TITLE_ID;
   }
+  /// attribute name of file export 
+  inline static const std::string& EXP_NAME_FILE_ID()
+  {
+    static const std::string MY_EXP_NAME_FILE_ID("root_name_file");
+    return MY_EXP_NAME_FILE_ID;
+  }
+  /// Attribute name of the main solid.
+  inline static const std::string& MAIN_OBJECT_ID()
+  {
+    static const std::string MY_MAIN_OBJECT_ID("root_main_object");
+    return MY_MAIN_OBJECT_ID;
+  }
   /// attribute name of materials file
   inline static const std::string& MAT_FILE_ID()
   {
index a4244a2dbd4de9c6ab541405a6e000428f27b684..ebab302ddcf94f362bae22eeff10e80d53475535 100644 (file)
@@ -27,6 +27,7 @@
 
 #include <CollectionPlugin_Group.h>
 #include <ExchangePlugin_Tools.h>
+#include <FeaturesPlugin_Translation.h>
 #include <PrimitivesPlugin_Box.h>
 
 #include <fstream>
@@ -81,7 +82,8 @@ void ExchangePlugin_ExportRoot::computeBox(FeaturePtr theCurFeature,
                                            double& OX, double& OY, double& OZ,
                                            double& DX, double& DY, double& DZ)
 {
-  std::string aMethodName = theCurFeature->data()->string(PrimitivesPlugin_Box::CREATION_METHOD())->value();
+  std::string aMethodName =
+    theCurFeature->data()->string(PrimitivesPlugin_Box::CREATION_METHOD())->value();
   if (aMethodName == "BoxByDimensions") {
     DX = (theCurFeature->data()->real(PrimitivesPlugin_Box::DX_ID())->value())/2;
     DY = (theCurFeature->data()->real(PrimitivesPlugin_Box::DY_ID())->value())/2;
@@ -90,8 +92,10 @@ void ExchangePlugin_ExportRoot::computeBox(FeaturePtr theCurFeature,
     OY = DY;
     OZ = DZ;
   } else if (aMethodName == "BoxByTwoPoints") {
-    AttributeSelectionPtr aRef1 = theCurFeature->data()->selection(PrimitivesPlugin_Box::POINT_FIRST_ID());
-    AttributeSelectionPtr aRef2 = theCurFeature->data()->selection(PrimitivesPlugin_Box::POINT_SECOND_ID());
+    AttributeSelectionPtr aRef1 =
+      theCurFeature->data()->selection(PrimitivesPlugin_Box::POINT_FIRST_ID());
+    AttributeSelectionPtr aRef2 =
+      theCurFeature->data()->selection(PrimitivesPlugin_Box::POINT_SECOND_ID());
     GeomShapePtr aShape1 = aRef1->value();
     if (!aShape1.get())
       aShape1 = aRef1->context()->shape();
@@ -122,6 +126,18 @@ void ExchangePlugin_ExportRoot::computeBox(FeaturePtr theCurFeature,
   }
 }
 
+void ExchangePlugin_ExportRoot::computeTranslation(FeaturePtr theCurFeature,
+                                                   double& DX, double& DY, double& DZ)
+{
+  std::string aMethodName =
+    theCurFeature->data()->string(FeaturesPlugin_Translation::CREATION_METHOD())->value();
+  if (aMethodName == "ByDimensions") {
+    DX = theCurFeature->data()->real(FeaturesPlugin_Translation::DX_ID())->value();
+    DY = theCurFeature->data()->real(FeaturesPlugin_Translation::DY_ID())->value();
+    DZ = theCurFeature->data()->real(FeaturesPlugin_Translation::DZ_ID())->value();
+  }
+}
+
 void ExchangePlugin_ExportRoot::computeGroup(FeaturePtr theCurFeature,
                                              std::vector<std::string>& theListNames)
 {
index b82bf09547b547ea3f415b136a85be16fa981abf..66c3a76a91651a42af9a959b1e611e1273a05fc6 100644 (file)
@@ -40,6 +40,9 @@ public:
   static void computeBox(FeaturePtr theCurFeature,
                          double& OX, double& OY, double& OZ, double& DX, double& DY, double& DZ);
   
+  /// Compute ....
+  static void computeTranslation(FeaturePtr theCurFeature, double& DX, double& DY, double& DZ);
+  
   /// Compute ....
   static void computeGroup(FeaturePtr theCurFeature, std::vector<std::string>& theListNames);
 };
index c413805641d8ab08c76551e0e09184c81eca8c81..af10009e3d0d6d228dd6aa73fdc2ea5eafecf127 100644 (file)
       </stringvalue>
       <stringvalue id="root_manager_title"
                    label="Manager title"
-                   placeholder="Please input the title of the manager">
+                   placeholder="Please input the title of the title">
       </stringvalue>
+      <stringvalue id="root_name_file"
+                   label="Name file export"
+                   placeholder="Please input the name of file export">
+      </stringvalue>
+      <shape_selector id="root_main_object"
+                      icon=""
+                      label="Main object"
+                      tooltip="Select solid object"
+                      shape_types="solids"
+                      default=""
+                      geometrical_selection="true">
+        <validator id="GeomValidators_ShapeType" parameters="solid"/>
+      </shape_selector>
       <file_selector id="mat_file" title="Materials file" path="">
       </file_selector>
     </case>
index 31fc748eba47d08b93dd8f63e1756579cd800372..9bc8a2d85467a03cbb2f31e12ce9bc1cf0b3a207 100644 (file)
@@ -52,11 +52,21 @@ void GeomAlgoAPI_ROOTExport::buildBox(const std::string& theObjectName,
 {
   myContent += "Double_t point_"+theObjectName+"[3] = {"+doubleToString(theOX)+",";
   myContent += doubleToString(theOY)+","+doubleToString(theOZ)+"};\n";
-  myContent += "TGeoBBox* " + theObjectName + "= new TGeoBBox(\"" +theObjectName + "\",";
+  myContent += "TGeoBBox *" + theObjectName + "_tmp = new TGeoBBox(\"" +theObjectName + "_tmp\",";
   myContent += doubleToString(theDX)+","+doubleToString(theDY)+","+doubleToString(theDZ)+",point_";
   myContent += theObjectName + ");\n";
 }
 
+//=================================================================================================
+void GeomAlgoAPI_ROOTExport::buildTranslation(const std::string& theObjectName,
+                                              const double theDX, const double theDY,
+                                              const double theDZ)
+{
+  myContent += "TGeoTranslation *" + theObjectName;
+  myContent += "_tmp = new TGeoTranslation(\"" + theObjectName + "_tmp\",";
+  myContent += doubleToString(theDX) + "," + doubleToString(theDY) + ",";
+  myContent += doubleToString(theDZ) + ");\n";
+}
 
 //=================================================================================================
 void GeomAlgoAPI_ROOTExport::buildMatAndMedium(
@@ -85,13 +95,23 @@ void GeomAlgoAPI_ROOTExport::BuildVolume(const std::string theName,
                                          const std::string theGeometryName,
                                          const std::string theMediumName)
 {
-  myContent += "TGeoVolume *" + theName + " = new TGeoVolume(\"" + theName;
-  myContent += "\"," + theGeometryName + "," + theMediumName + ");\n";
+  myContent += "TGeoVolume *" + theGeometryName + " = new TGeoVolume(\"" + theName;
+  myContent += "\"," + theGeometryName + "_tmp," + theMediumName + ");\n";
 }
 
 //=================================================================================================
-void GeomAlgoAPI_ROOTExport::buildEnd()
+void GeomAlgoAPI_ROOTExport::buildEnd(const std::string theSolidName,
+                                      const std::string theExportName)
 {
+  myContent += "// ####################################\n";
+  myContent += "geom->SetTopVolume(" + theSolidName + ");\n";
+  myContent += "geom->CloseGeometry();\n";
+  myContent += theSolidName + "->SetVisContainers(kTRUE);\n";
+  myContent += "geom->SetTopVisible(kTRUE);\n";
+  myContent += "geom->Export(\"" + theExportName + "\");\n";
+  myContent += "geom->CheckOverlaps(0.0001);\n";
+  myContent += "geom->PrintOverlaps();\n";
+  myContent += theSolidName + "->Draw();\n";
   myContent += "}";
 }
 
index 7349a534b31b0f2139e17d7b3f87bd4e40a605c0..4f0492eb391b7e8674ca45fa4e6ecae1a3604792 100644 (file)
@@ -43,6 +43,11 @@ public:
   GEOMALGOAPI_EXPORT void buildBox(const std::string& theObjectName,
                                    const double theOX, const double theOY, const double theOZ,
                                    const double theDX, const double theDY, const double theDZ);
+  
+  /// Build translation
+  GEOMALGOAPI_EXPORT void buildTranslation(const std::string& theObjectName,
+                                           const double theDX, const double theDY,
+                                           const double theDZ);
 
   /// Build mat and medium
   GEOMALGOAPI_EXPORT void buildMatAndMedium(
@@ -55,7 +60,7 @@ public:
                                       const std::string theMediumName);
   
   /// Build the end of file
-  GEOMALGOAPI_EXPORT void buildEnd();
+  GEOMALGOAPI_EXPORT void buildEnd(const std::string theName, const std::string theExportName);
 
   /// Write the file
   GEOMALGOAPI_EXPORT bool write();
index 308e1e6f3929ba4b695a77e6065b8d0cd8ffa40d..05901f874c8b0002dc645c82a8ce8f963657e5c5 100644 (file)
@@ -19,4 +19,4 @@
 """Package for Exchange plugin for the Parametric Geometry API of the Modeler.
 """
 
-from ExchangeAPI import addImport, exportToFile, exportToXAO
\ No newline at end of file
+from ExchangeAPI import addImport, exportToFile, exportToXAO, exportToROOT