SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Represents a single Analysis defined within an Attribute Resource. More...
#include <Analyses.h>
Public Member Functions | |
const std::string & | name () const |
Return the name associated with the Analysis. | |
const std::string & | displayedName () const |
Return the string to represent the Analysis in UI's. | |
void | setLabel (const std::string &analysisLabel) |
const std::string & | label () const |
bool | hasLabel () const |
std::set< std::string > | categories () const |
Returns all of the categories associated with the Analysis, including it's parent's. | |
Analysis * | parent () const |
Method to retrieve an Analysis' parent Analysis. | |
bool | setParent (Analysis *p) |
Method to set an Analysis' parent Analysis. More... | |
const std::vector< Analysis * > & | children () const |
Returns the children Analyses of this Analysis. | |
void | setLocalCategories (const std::set< std::string > &cats) |
Methods to set and retrieve the categories locally associated with the Analysis. | |
const std::set< std::string > & | localCategories () const |
Methods to set and retrieve the categories locally associated with the Analysis. | |
void | setExclusive (bool mode) |
Methods to set and retrieve an Analysis' children exclusivity property. More... | |
bool | isExclusive () const |
Methods to set and retrieve an Analysis' children exclusivity property. More... | |
void | setRequired (bool mode) |
Methods to set and retrieve an Analysis' required property. More... | |
bool | isRequired () const |
Methods to set and retrieve an Analysis' required property. More... | |
void | buildAnalysisItem (smtk::attribute::DefinitionPtr &sitem) const |
Methods for generating Attribute Item Definitions for an Analysis. More... | |
void | buildAnalysisItem (smtk::attribute::GroupItemDefinitionPtr &gitem) const |
Methods for generating Attribute Item Definitions for an Analysis. More... | |
void | buildAnalysisItem (smtk::attribute::StringItemDefinitionPtr &sitem) const |
Methods for generating Attribute Item Definitions for an Analysis. More... | |
Protected Member Functions | |
Analysis (const std::string &name) | |
Protected Attributes | |
std::string | m_name |
Name of the Analysis. | |
Analysis * | m_parent { nullptr } |
Analysis' Parent. | |
bool | m_exclusive { false } |
Indicates if the Analysis' children are exclusive. | |
bool | m_required { false } |
Indicates if the Analysis is required. | |
std::string | m_label |
Optional label to be used for UIs. | |
std::set< std::string > | m_categories |
Categories locally assigned to the analysis. | |
std::vector< Analysis * > | m_children |
Children of the Analysis. | |
Friends | |
class | Analyses |
Represents a single Analysis defined within an Attribute Resource.
An Analysis represents a subset of information stored within an Attribute Resource that is required by the Analysis. This is accomplished by using the category information associated with the items and attributes. The subset of information is represented as a set of categories. An Analysis maintains a set of local categories. In addition, an Analysis can a parent Analysis associated with it (using the setParent method). The total set of categories is the union of the Analysis' local categories and the categories associated with it's parent.
Note that only the Analyses class can create or delete an Analysis
void Analyses::Analysis::buildAnalysisItem | ( | smtk::attribute::DefinitionPtr & | sitem | ) | const |
Methods for generating Attribute Item Definitions for an Analysis.
If the Item is being added either to a Attribute Definition or to a GroupItemDefinition then:
If the Analysis is being added to a StringItemDefinition, a discrete value using the Analysis' name will be added to the definition. If it does not have any children the method simply returns. Else if it's Exclusive Property is true, then in addition a new StringItemDefinition will be created and added as a conditional item to definition passed in, else an optional GroupItemDefinition is created and added as a conditional item. In either case the newly created ItemDefinition will be named using the Analysis' name and it will be passed to it's children's buildAnalysisItem method.
void smtk::attribute::Analyses::Analysis::buildAnalysisItem | ( | smtk::attribute::GroupItemDefinitionPtr & | gitem | ) | const |
Methods for generating Attribute Item Definitions for an Analysis.
If the Item is being added either to a Attribute Definition or to a GroupItemDefinition then:
If the Analysis is being added to a StringItemDefinition, a discrete value using the Analysis' name will be added to the definition. If it does not have any children the method simply returns. Else if it's Exclusive Property is true, then in addition a new StringItemDefinition will be created and added as a conditional item to definition passed in, else an optional GroupItemDefinition is created and added as a conditional item. In either case the newly created ItemDefinition will be named using the Analysis' name and it will be passed to it's children's buildAnalysisItem method.
void smtk::attribute::Analyses::Analysis::buildAnalysisItem | ( | smtk::attribute::StringItemDefinitionPtr & | sitem | ) | const |
Methods for generating Attribute Item Definitions for an Analysis.
If the Item is being added either to a Attribute Definition or to a GroupItemDefinition then:
If the Analysis is being added to a StringItemDefinition, a discrete value using the Analysis' name will be added to the definition. If it does not have any children the method simply returns. Else if it's Exclusive Property is true, then in addition a new StringItemDefinition will be created and added as a conditional item to definition passed in, else an optional GroupItemDefinition is created and added as a conditional item. In either case the newly created ItemDefinition will be named using the Analysis' name and it will be passed to it's children's buildAnalysisItem method.
|
inline |
Methods to set and retrieve an Analysis' children exclusivity property.
When defining an Analysis, it is important to model whether its children represent a set of analyses that can be combined arbitrary manner (Exclusion is false) or if only one of its children can be "selected" (Exclusion is true).
|
inline |
|
inline |
Methods to set and retrieve an Analysis' children exclusivity property.
When defining an Analysis, it is important to model whether its children represent a set of analyses that can be combined arbitrary manner (Exclusion is false) or if only one of its children can be "selected" (Exclusion is true).
bool Analyses::Analysis::setParent | ( | Analysis * | p | ) |
Method to set an Analysis' parent Analysis.
Initially an Analysis' parent is nullptr. When setting an Analysis' parent, if the parent is a pointer to the analysis itself, false is returned and nothing is changed. If the parent is the same as the analysis' current parent, nothing is changed and true is returned. If the prior parent is not nullptr, the Analysis is removed from the original parent's children. if the new parent is not nullptr then the Analysis is added to its children.
|
inline |