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::Range & getRange (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 Template & getChild (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 isLabelInline () const
 Returns whether a group shows its label beside its row instead of above it.
 
bool isBackgroundEnabled () const
 
enzo::String getIcon () const
 Returns the Lucide icon name shown beside a divider's label.
 
Template & setTooltip (String tooltip)
 
Template & setDocumentation (String documentation)
 
Template & setDisableCondition (String condition)
 
Template & setHideCondition (String condition)
 
Template & setDirection (Direction direction)
 
Template & setOptions (std::vector< prm::Name > options)
 
Template & addParm (Template child)
 
Template & setDefaults (std::vector< Default > defaults)
 Replaces the default of every component.
 
Template & setInstanceDefault (std::string fieldToken, std::vector< Default > defaults)
 
std::optional< Default > getInstanceDefault (const std::string &fieldToken, unsigned int instanceIndex) const
 The default for a multiparm field at a given instance.
 
Template & setLabelHidden (bool hidden)
 
Template & setLabelInline (bool isInline)
 
Template & setBackgroundEnabled (bool enabled)
 
Template & setIcon (String icon)
 
template<typename T >
Template & setStyle (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.

Exceptions
std::out_of_rangewhen 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.

◆ getIcon()

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

Returns the Lucide icon name shown beside a divider's label.

Returns
The name, empty when the parameter carries no icon.

◆ 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.

◆ setDefaults()

prm::Template & enzo::prm::Template::setDefaults ( std::vector< Default > defaults)

Replaces the default of every component.

Note
A single default covers every component.

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