1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
4 * Config_DataModelReader.h
6 * Created on: Jul 21, 2015
10 #ifndef CONFIG_DATAMODELREADER_H_
11 #define CONFIG_DATAMODELREADER_H_
13 #include <Config_def.h>
14 #include <Config_XMLReader.h>
20 * \class Config_DataModelReader
22 * \brief Class that reads data model definition XML for
23 * further processing in the XGUI_DataModel
25 class Config_DataModelReader : public Config_XMLReader
31 CONFIG_EXPORT Config_DataModelReader();
32 CONFIG_EXPORT virtual ~Config_DataModelReader();
34 // ROOT folders propertiues *****************
35 /// Returns name of type of tree items in root
36 CONFIG_EXPORT std::string rootType() const { return myRootTypes; }
38 /// Returns number of folders under root
39 CONFIG_EXPORT int rootFoldersNumber() const { return myRootFolderNames.size(); }
41 /// Returns name of the folder by its Id
42 /// \param theId id of the folder
43 CONFIG_EXPORT std::string rootFolderName(int theId) const { return myRootFolderNames[theId]; }
45 /// Returns data type in the folder by its Id
46 /// \param theId id of the folder
47 CONFIG_EXPORT std::string rootFolderType(int theId) const { return myRootFolderTypes[theId]; }
49 /// Returns icon of a folder by its Id
50 /// \param theId id of the folder
51 CONFIG_EXPORT std::string rootFolderIcon(int theId) const { return myRootFolderIcons[theId]; }
53 /// Returns id of a folder containing the given type
54 /// \param theType type of objects in folder
55 CONFIG_EXPORT int rootFolderId(std::string theType) const;
57 /// Returns true if the folder can be shown without items
58 /// \param theId id of the folder
59 CONFIG_EXPORT bool rootShowEmpty(int theId) const { return myRootFolderShowEmpty[theId]; }
63 // SUB folders propertiues ********************
64 /// Returns name of type of tree items in sub document
65 CONFIG_EXPORT std::string subType() const { return mySubTypes; }
67 /// Returns number of folders under sub document
68 CONFIG_EXPORT int subFoldersNumber() const { return mySubFolderNames.size(); }
70 /// Returns name of the folder by its Id
71 /// \param theId id of the folder
72 CONFIG_EXPORT std::string subFolderName(int theId) const { return mySubFolderNames[theId]; }
74 /// Returns data type in the folder by its Id
75 /// \param theId id of the folder
76 CONFIG_EXPORT std::string subFolderType(int theId) const { return mySubFolderTypes[theId]; }
78 /// Returns icon of a folder by its Id
79 /// \param theId id of the folder
80 CONFIG_EXPORT std::string subFolderIcon(int theId) const { return mySubFolderIcons[theId]; }
82 /// Returns true if the folder can be shown without items
83 /// \param theId id of the folder
84 CONFIG_EXPORT bool subShowEmpty(int theId) const { return mySubFolderShowEmpty[theId]; }
86 /// Returns id of a folder containing the given type
87 /// \param theType type of objects in folder
88 CONFIG_EXPORT int subFolderId(std::string theType) const;
90 /// Returns true if the sub-document data tree has to be attached to Part Result node
91 /// Otherwise it has to be connected to Part feature node
92 CONFIG_EXPORT bool isAttachToResult() const { return myIsResultLink; }
95 /// Overloaded method. Defines how to process each node
96 virtual void processNode(xmlNodePtr theNode);
101 /// Root document data
102 std::vector<std::string> myRootFolderNames;
103 std::vector<std::string> myRootFolderTypes;
104 std::vector<std::string> myRootFolderIcons;
105 std::vector<bool> myRootFolderShowEmpty;
107 std::string myRootTypes;
109 /// Sub document data
110 std::vector<std::string> mySubFolderNames;
111 std::vector<std::string> mySubFolderTypes;
112 std::vector<std::string> mySubFolderIcons;
113 std::vector<bool> mySubFolderShowEmpty;
116 std::string mySubTypes;