SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
smtk::attribute::Analyses Class Reference

Represents a set of Analyses defined within an Attribute Resource. More...

#include <Analyses.h>

Collaboration diagram for smtk::attribute::Analyses:
[legend]

Classes

class  Analysis
 Represents a single Analysis defined within an Attribute Resource. More...
 

Public Member Functions

 Analyses ()=default
 Basic constructor - Note that by default top level Analyses are not Exclusive.
 
Analysiscreate (const std::string &name)
 Create a new Analysis and return it. More...
 
Analysisfind (const std::string &name) const
 Retrieve an Analysis based on its name. If none exists, nullptr is returned.
 
std::vector< Analysis * > topLevel () const
 Return all Analysis Instances that do not have a parent Analysis.
 
const std::vector< Analysis * > & analyses () const
 Return all Analysis Instances.
 
std::size_t size () const
 Return the number of Analysis Instances.
 
bool setAnalysisParent (const std::string &analysis, const std::string &parent)
 Convience method that set's an Analysis' Parent by using their names. More...
 
DefinitionPtr buildAnalysesDefinition (smtk::attribute::ResourcePtr resource, const std::string &type, const std::string &label="Analysis") const
 Create an Attribute Definition to represent the Analysis Instances maintained by the Analyses. More...
 
void getAnalysisAttributeCategories (smtk::attribute::ConstAttributePtr attribute, std::set< std::string > &cats)
 Calculate the set of categories associated with an Analysis Attribute's settings.
 
std::set< std::string > getAnalysisAttributeCategories (smtk::attribute::ConstAttributePtr attribute)
 
 ~Analyses ()
 Destroys the Instance and deletes all Analysis Instances contained within.
 
void setTopLevelExclusive (bool mode)
 Methods to set and retrieve the exclusivity property pertaining the top level Analysis Instances. More...
 
bool areTopLevelExclusive () const
 Methods to set and retrieve the exclusivity property pertaining the top level Analysis Instances. More...
 

Protected Member Functions

void getAnalysisItemCategories (ConstItemPtr item, std::set< std::string > &cats, bool itemNotAnalysis)
 Calculate the set of categories associated with an Analysis Attribute's Item. More...
 

Protected Attributes

bool m_topLevelExclusive
 Indicates if the top level Analysis Instances are exclusive. More...
 
std::vector< Analysis * > m_analyses
 Analysis Instances managed by the Analyses Instance.
 

Detailed Description

Represents a set of Analyses defined within an Attribute Resource.

Member Function Documentation

◆ areTopLevelExclusive()

bool smtk::attribute::Analyses::areTopLevelExclusive ( ) const
inline

Methods to set and retrieve the exclusivity property pertaining the top level Analysis Instances.

This property behaves similarly to an Analysis's Exclusive property. If true, then only one of the top level Analysis Instances can be choosen. Else any combination of top level analysis instances are allowed.

◆ buildAnalysesDefinition()

DefinitionPtr Analyses::buildAnalysesDefinition ( smtk::attribute::ResourcePtr  resource,
const std::string &  type,
const std::string &  label = "Analysis" 
) const

Create an Attribute Definition to represent the Analysis Instances maintained by the Analyses.

The Definition will be named using type and will be part of resource.

If type already exists in resource then no Definition will be created and a nullptr will be returned. If the top level exclusive property is false then each top level Analysis's buildAnalysisItem method will be called using the newly created Definition. Else a new StringItemDefinition will be created using label as its name and each top level Analysis's buildAnalysisItem method will be called using it as its input argument.

The resulting definition will have the following structure:

  • Either one item (in the case of Exclusive Top-level Definitions) with a discrete value per top-level Analysis, or one item per top-level Analysis
  • Every Analysis with children will generate either a string or group item depending the its Exclusive Property
  • Childless Analysis Instances will only generate an item if its parent has Exclusive = false or its a top-level Analysis and Analyses has TopLevelExclusive = false. When Exclusive is true (in ether the Analysis or Analyses case) the resulting String Item will have a set of discrete values (one for either child or top-level Analysis) and optionally an item representing an Analysis' children associated with that discrete value.

◆ create()

Analyses::Analysis * Analyses::create ( const std::string &  name)

Create a new Analysis and return it.

Note that the name must be unique with respects to the other Analysis Instances defined within this Instance. If the name is not unique no Analysis is created and nullptr is returned.

◆ getAnalysisItemCategories()

void Analyses::getAnalysisItemCategories ( ConstItemPtr  item,
std::set< std::string > &  cats,
bool  itemNotAnalysis 
)
protected

Calculate the set of categories associated with an Analysis Attribute's Item.

itemNotAnalysis indicates if the item does not represent an analysis itself. This occurs only when processing the top level item and m_topLevelExclusive is true.

◆ setAnalysisParent()

bool Analyses::setAnalysisParent ( const std::string &  analysis,
const std::string &  parent 
)

Convience method that set's an Analysis' Parent by using their names.

If neither name corresponds to an existing Analysis then the method returns false.

◆ setTopLevelExclusive()

void smtk::attribute::Analyses::setTopLevelExclusive ( bool  mode)
inline

Methods to set and retrieve the exclusivity property pertaining the top level Analysis Instances.

This property behaves similarly to an Analysis's Exclusive property. If true, then only one of the top level Analysis Instances can be choosen. Else any combination of top level analysis instances are allowed.

Member Data Documentation

◆ m_topLevelExclusive

bool smtk::attribute::Analyses::m_topLevelExclusive
protected
Initial value:
{
false
}

Indicates if the top level Analysis Instances are exclusive.


The documentation for this class was generated from the following files: