Enzo
Loading...
Searching...
No Matches
enzo::prm::Template Class Reference

Public Member Functions

 Template (enzo::prm::Type type, prm::Name name)
 
 Template (enzo::prm::Type type, prm::Name name, unsigned int vectorSize)
 
 Template (enzo::prm::Type type, prm::Name name, std::vector< prm::Default > defaults, unsigned int vectorSize=1, std::vector< prm::Range > ranges=std::vector< prm::Range >())
 
 Template (enzo::prm::Type type, prm::Name name, prm::Default theDefault, unsigned int vectorSize=1, Range range=Range())
 
enzo::String getName () const
 
enzo::String getToken () const
 
enzo::String getLabel () const
 
const prm::Default getDefault (unsigned int index=0) const
 
const prm::RangegetRange (unsigned int index=0) const
 
const std::vector< prm::Name > & getOptions () const
 The set of named values this parameter can be set to.
 
bool hasOptions () const
 
intT getNumOptions () const
 The number of available options.
 
const prm::Type getType () const
 
const unsigned int getSize () const
 
const unsigned int getNumDefaults () const
 
Direction getDirection () const
 
const std::vector< Template > & getChildren () const
 
const TemplategetChild (const enzo::String &token) const
 Returns the child template with the given token.
 
const bool isContainer () const
 
bool isMultiParm () const
 
enzo::String getTooltip () const
 
enzo::String getDocumentation () const
 
enzo::String getDisableCondition () const
 A condition that greys the parameter out, such as "applyscale == 0".
 
enzo::String getHideCondition () const
 A condition that hides the parameter, such as "profileshape != 1".
 
bool isLabelHidden () const
 
bool isBackgroundEnabled () const
 
TemplatesetTooltip (String tooltip)
 
TemplatesetDocumentation (String documentation)
 
TemplatesetDisableCondition (String condition)
 
TemplatesetHideCondition (String condition)
 
TemplatesetDirection (Direction direction)
 
TemplatesetOptions (std::vector< prm::Name > options)
 
TemplateaddParm (Template child)
 
TemplatesetInstanceDefault (std::string fieldToken, std::vector< Default > defaults)
 
std::optional< DefaultgetInstanceDefault (const std::string &fieldToken, unsigned int instanceIndex) const
 The default for a multiparm field at a given instance.
 
TemplatesetLabelHidden (bool hidden)
 
TemplatesetBackgroundEnabled (bool enabled)
 
template<typename T >
TemplatesetStyle (T style)
 
const std::any & getStyle () const
 

Member Function Documentation

◆ getChild()

const prm::Template & enzo::prm::Template::getChild ( const enzo::String & token) const

Returns the child template with the given token.

Note
Throws std::out_of_range when no child carries the token.

◆ getDisableCondition()

String enzo::prm::Template::getDisableCondition ( ) const

A condition that greys the parameter out, such as "applyscale == 0".

Returns
The condition, empty when the parameter is always enabled.

◆ getHideCondition()

String enzo::prm::Template::getHideCondition ( ) const

A condition that hides the parameter, such as "profileshape != 1".

Returns
The condition, empty when the parameter is always shown.

◆ getInstanceDefault()

std::optional< prm::Default > enzo::prm::Template::getInstanceDefault ( const std::string & fieldToken,
unsigned int instanceIndex ) const

The default for a multiparm field at a given instance.

Returns
The Default when one is set in range, otherwise nullopt.

◆ getOptions()

const std::vector< prm::Name > & enzo::prm::Template::getOptions ( ) const

The set of named values this parameter can be set to.

These are the available entries to pick from, not the value the user has picked. Each entry is a prm::Name carrying a token (the stored value) and a label (the displayed text). A dropdown renders these as a menu. Other enumerated parameters such as radio groups or button strips draw from the same set.

Returns
The available options, empty when the parameter is not enumerated.

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