X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_DataModelReader.h;h=d17f54eaeef01d6dc12b30890fc57c9af9e38015;hb=853e0eec6016120b641efa6adf427a239cf203cf;hp=caba2b6b848cbc2b5a66101bdeda2a1d9595feb2;hpb=3e3fc52de000b4d8e51fdcffe7f72f82237833ad;p=modules%2Fshaper.git diff --git a/src/Config/Config_DataModelReader.h b/src/Config/Config_DataModelReader.h index caba2b6b8..d17f54eae 100644 --- a/src/Config/Config_DataModelReader.h +++ b/src/Config/Config_DataModelReader.h @@ -32,6 +32,7 @@ class Config_DataModelReader : public Config_XMLReader CONFIG_EXPORT Config_DataModelReader(); CONFIG_EXPORT virtual ~Config_DataModelReader(); + // ROOT folders propertiues ***************** /// Returns name of type of tree items in root CONFIG_EXPORT std::string rootType() const { return myRootTypes; } @@ -50,16 +51,70 @@ class Config_DataModelReader : public Config_XMLReader /// \param theId id of the folder CONFIG_EXPORT std::string rootFolderIcon(int theId) const { return myRootFolderIcons[theId]; } - protected: + /// Returns id of a folder containing the given type + /// \param theType type of objects in folder + CONFIG_EXPORT int rootFolderId(std::string theType) const; + + /// Returns true if the folder can be shown without items + /// \param theId id of the folder + CONFIG_EXPORT bool rootShowEmpty(int theId) const { return myRootFolderShowEmpty[theId]; } + + + + // SUB folders propertiues ******************** + /// Returns name of type of tree items in sub document + CONFIG_EXPORT std::string subType() const { return mySubTypes; } + + /// Returns number of folders under sub document + CONFIG_EXPORT int subFoldersNumber() const { return mySubFolderNames.size(); } + + /// Returns name of the folder by its Id + /// \param theId id of the folder + CONFIG_EXPORT std::string subFolderName(int theId) const { return mySubFolderNames[theId]; } + + /// Returns data type in the folder by its Id + /// \param theId id of the folder + CONFIG_EXPORT std::string subFolderType(int theId) const { return mySubFolderTypes[theId]; } + + /// Returns icon of a folder by its Id + /// \param theId id of the folder + CONFIG_EXPORT std::string subFolderIcon(int theId) const { return mySubFolderIcons[theId]; } + + /// Returns true if the folder can be shown without items + /// \param theId id of the folder + CONFIG_EXPORT bool subShowEmpty(int theId) const { return mySubFolderShowEmpty[theId]; } + + /// Returns id of a folder containing the given type + /// \param theType type of objects in folder + CONFIG_EXPORT int subFolderId(std::string theType) const; + + /// Returns true if the sub-document data tree has to be attached to Part Result node + /// Otherwise it has to be connected to Part feature node + CONFIG_EXPORT bool isAttachToResult() const { return myIsResultLink; } + +protected: /// Overloaded method. Defines how to process each node virtual void processNode(xmlNodePtr theNode); private: + bool isRootReading; + + /// Root document data std::vector myRootFolderNames; std::vector myRootFolderTypes; std::vector myRootFolderIcons; + std::vector myRootFolderShowEmpty; std::string myRootTypes; + + /// Sub document data + std::vector mySubFolderNames; + std::vector mySubFolderTypes; + std::vector mySubFolderIcons; + std::vector mySubFolderShowEmpty; + + bool myIsResultLink; + std::string mySubTypes; };