Salome HOME
Copyright update 2021
[modules/shaper_study.git] / src / StudyData / StudyData_XAO.h
index bc963810a96efc579798596a138ca7ac7dd4bff6..ba530156ba0db07f225b938f4bb9cd3297cc7aba 100644 (file)
@@ -1,7 +1,4 @@
-// Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2019-2021  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -24,6 +21,8 @@
 
 #include "StudyData.h"
 #include <XAO_Xao.hxx>
+#include <XAO_Step.hxx>
+#include <XAO_Field.hxx>
 
 #include <list>
 #include <map>
@@ -36,6 +35,10 @@ class StudyData_XAO
   XAO::Xao* myExport; ///< the XAO instance for export
   XAO::Xao* myImport; ///< the XAO instance for export
   std::map<int, XAO::Group*> myGroups; ///< id of group to the group structure
+  std::map<int, XAO::Field*> myFields; ///< id of field to the field structure
+  std::map<int, std::map<int, XAO::Step*> > mySteps; ///< id of field to the field structure
+  int myCurrentElementID; ///< to add elements of step one by one
+  XAO::stepIterator myStepIterator; ///< contains a current steps iterator (on import)
 
 public:
   StudyData_EXPORT StudyData_XAO();
@@ -48,6 +51,18 @@ public:
   // sets the selection for an already added group
   StudyData_EXPORT void AddGroupSelection(const int theGroupID, const int theSelection);
 
+  // add a new field for export to XAO; returns id of this field
+  StudyData_EXPORT int AddField(const int theValType, const int theSelType,
+                                const int theCompsNum, const std::string theFieldName);
+  // set the component name for the exported field
+  StudyData_EXPORT void SetFieldComponent(const int theFieldID, const int theCompIndex,
+                                          const std::string theCompName);
+  // adds a step to the exported field
+  StudyData_EXPORT void AddStep(const int theFieldID, const int theStepID, const int theStampID);
+  // adds the value to the step of the exported field. values must come one by one (row by row)
+  StudyData_EXPORT void AddStepValue(
+    const int theFieldID, const int theStepID, std::string theValue);
+
   // performs the export to XAO
   StudyData_EXPORT void Export(const std::string theFileName);
 
@@ -62,6 +77,25 @@ public:
 
   // Returns a selection list of indices of the group
   StudyData_EXPORT std::list<long> GetGroupSelection(const int theGroupID);
+
+  // Returns a value type of the imported field
+  StudyData_EXPORT int GetValuesType(const int theFieldID);
+  // Returns a selection type of the imported field
+  StudyData_EXPORT int GetSelectionType(const int theFieldID);
+  // Returns components names of the imported field
+  StudyData_EXPORT std::list<std::string> GetComponents(const int theFieldID);
+  // Starts iteration of steps
+  StudyData_EXPORT void BeginSteps(const int theFieldID);
+  // Returns true if steps iteration contains a current step
+  StudyData_EXPORT bool More(const int theFieldID);
+  // Iterates the step iterator contains a current step
+  StudyData_EXPORT void Next();
+  // Returns a stamp ID of the imported field step
+  StudyData_EXPORT int GetStamp();
+  // Returns a step ID of the imported field step
+  StudyData_EXPORT int GetStepIndex();
+  // Returns string values of the imported field step
+  StudyData_EXPORT std::list<std::string> GetValues();
 };
 
 #endif // !StudyData_XAO_H