SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
|
Public Member Functions | |
smtkTypeMacro (smtk::attribute::DoubleItemDefinition) | |
Item::Type | type () const override |
bool | setDefaultValue (const std::vector< double > &vals) override |
Set the default value for an attribute. More... | |
bool | setDefaultValue (const double &val, const std::string &units) |
bool | setDefaultValue (const std::vector< double > &vals, const std::string &units) |
Public Member Functions inherited from smtk::attribute::ValueItemDefinitionTemplate< double > | |
const double & | defaultValue () const |
const double & | defaultValue (std::size_t element) const |
const std::vector< double > & | defaultValues () const |
virtual bool | setDefaultValue (const double &val) |
Set the default value for an attribute. | |
const double & | discreteValue (std::size_t element) const |
void | addDiscreteValue (const double &val) |
void | addDiscreteValue (const double &val, const std::string &discreteEnum) |
void | clearDiscreteValues () |
bool | hasRange () const override |
bool | hasMinRange () const |
const double & | minRange () const |
bool | minRangeInclusive () const |
bool | setMinRange (const double &minVal, bool isInclusive) |
bool | hasMaxRange () const |
const double & | maxRange () const |
bool | maxRangeInclusive () const |
bool | setMaxRange (const double &maxVal, bool isInclusive) |
void | clearRange () |
int | findDiscreteIndex (const double &val) const |
bool | isValueValid (const double &val) const |
Public Member Functions inherited from smtk::attribute::ValueItemDefinition | |
smtkTypeMacro (smtk::attribute::ValueItemDefinition) | |
ValueItemDefinition (const std::string &myname) | |
const std::string & | units () const |
bool | isDiscrete () const |
std::size_t | numberOfDiscreteValues () const |
const std::string & | discreteEnum (std::size_t ith) const |
bool | getEnumIndex (const std::string &enumVal, std::size_t &index) const |
int | defaultDiscreteIndex () const |
void | setDefaultDiscreteIndex (int discreteIndex) |
bool | allowsExpressions () const |
bool | isValidExpression (const smtk::attribute::AttributePtr &exp) const |
std::string | expressionType () const |
void | setExpressionType (const std::string &etype) |
void | setExpressionDefinition (const smtk::attribute::DefinitionPtr &exp) |
smtk::attribute::DefinitionPtr | expressionDefinition (const smtk::attribute::ResourcePtr &attResource) const |
void | buildExpressionItem (ValueItem *vitem) const |
void | buildChildrenItems (ValueItem *vitem) const |
bool | hasDefault () const |
virtual bool | hasRange () const =0 |
std::size_t | numberOfRequiredValues () const |
bool | setNumberOfRequiredValues (std::size_t esize) |
std::size_t | maxNumberOfValues () const |
bool | setMaxNumberOfValues (std::size_t esize) |
bool | isExtensible () const |
void | setIsExtensible (bool mode) |
bool | hasValueLabels () const |
bool | usingCommonLabel () const |
void | setValueLabel (std::size_t element, const std::string &elabel) |
void | setCommonValueLabel (const std::string &elabel) |
std::string | valueLabel (std::size_t element) const |
bool | isDiscreteIndexValid (int index) const |
bool | isDiscreteIndexValid (int index, const std::set< std::string > &categories) const |
std::size_t | numberOfChildrenItemDefinitions () const |
For conditional children items based on the item's current discrete value. | |
const std::map< std::string, smtk::attribute::ItemDefinitionPtr > & | childrenItemDefinitions () const |
bool | hasChildItemDefinition (const std::string &itemName) const |
bool | hasChildItemDefinition (const std::string &valueName, const std::string &itemName) |
bool | addChildItemDefinition (smtk::attribute::ItemDefinitionPtr cdef) |
bool | addItemDefinition (smtk::attribute::ItemDefinitionPtr cdef) |
template<typename T > | |
smtk::internal::shared_ptr_type< T >::SharedPointerType | addItemDefinition (const std::string &idName) |
bool | addConditionalItem (const std::string &enumValue, const std::string &itemName) |
std::vector< std::string > | conditionalItems (const std::string &enumValue) const |
std::vector< std::string > | relevantEnums (bool includeCategories, const std::set< std::string > &testCategories, bool includeReadAccess, unsigned int readAccessLevel) const |
Return the enum strings that pass a set of categories and/or specified advance read access level. | |
void | setEnumCategories (const std::string &enumValue, const smtk::attribute::Categories::Set &cats) |
Set/Get the set of categories associated with a value Enum. | |
void | addEnumCategory (const std::string &enumValue, const std::string &cat) |
Set/Get the set of categories associated with a value Enum. | |
const smtk::attribute::Categories::Set & | enumCategories (const std::string &enumValue) const |
Set/Get the set of categories associated with a value Enum. | |
void | setEnumAdvanceLevel (const std::string &enumValue, unsigned int level) |
Set/Get advance level associated with associated with a value Enum. | |
void | unsetEnumAdvanceLevel (const std::string &enumValue) |
Set/Get advance level associated with associated with a value Enum. | |
unsigned int | enumAdvanceLevel (const std::string &enumValue) const |
Set/Get advance level associated with associated with a value Enum. | |
bool | hasEnumAdvanceLevel (const std::string &enumValue) const |
Set/Get advance level associated with associated with a value Enum. | |
const std::map< std::string, unsigned int > | enumAdvanceLevelInfo () const |
Set/Get advance level associated with associated with a value Enum. | |
Public Member Functions inherited from smtk::attribute::ItemDefinition | |
smtkTypeMacroBase (smtk::attribute::ItemDefinition) | |
const std::string & | name () const |
const std::string & | label () const |
void | setLabel (const std::string &newLabel) |
int | version () const |
void | setVersion (int myVersion) |
bool | isOptional () const |
void | setIsOptional (bool isOptionalValue) |
bool | isEnabledByDefault () const |
void | setIsEnabledByDefault (bool isEnabledByDefaultValue) |
const smtk::attribute::Categories & | categories () const |
Returns the categories (both explicitly assigned and inherited) associated to the Item Definition. More... | |
smtk::attribute::Categories::Set & | localCategories () |
Returns the categories::Set explicitly assigned to the Items Definition. | |
const smtk::attribute::Categories::Set & | localCategories () const |
void | setLocalCategories (const smtk::attribute::Categories::Set &catSet) |
Sets the local categories. More... | |
unsigned int | advanceLevel (int mode=0) const |
unsigned int | localAdvanceLevel (int mode=0) const |
void | setLocalAdvanceLevel (int mode, unsigned int level) |
void | setLocalAdvanceLevel (unsigned int level) |
void | unsetLocalAdvanceLevel (int mode=0) |
bool | hasLocalAdvanceLevelInfo (int mode=0) const |
const std::string & | detailedDescription () const |
void | setDetailedDescription (const std::string &text) |
const std::string & | briefDescription () const |
void | setBriefDescription (const std::string &text) |
const Tags & | tags () const |
return the smtk::attribute::Tags associated with the Definition | |
const shared_ptr< units::System > & | unitsSystem () const |
Return the unitsSystem of the Definition. | |
Categories::CombinationMode | categoryInheritanceMode () const |
Determines how the Definition should combine its local category Set with the category constraints being inherited from it's owning Attribute or Item Definition. | |
void | setCategoryInheritanceMode (Categories::CombinationMode mode) |
Determines how the Definition should combine its local category Set with the category constraints being inherited from it's owning Attribute or Item Definition. | |
const Tag * | tag (const std::string &name) const |
Return a pointer to a smtk::attribute::Tag with a given name. If the Tag does not exist, return a null pointer. | |
Tag * | tag (const std::string &name) |
Return a pointer to a smtk::attribute::Tag with a given name. If the Tag does not exist, return a null pointer. | |
bool | addTag (const Tag &tag) |
Add/Remove a smtk::attribute::Tag from a Definition. | |
bool | removeTag (const std::string &name) |
Add/Remove a smtk::attribute::Tag from a Definition. | |
Static Public Member Functions | |
static smtk::attribute::DoubleItemDefinitionPtr | New (const std::string &myName) |
std::vector< std::string > | m_defaultValuesAsStrings |
Sets default value of the definition using a string. More... | |
bool | setDefaultValueAsString (const std::string &val) |
Sets default value of the definition using a string. More... | |
bool | setDefaultValueAsString (const std::vector< std::string > &vals) |
Sets default value of the definition using a string. More... | |
const std::string | defaultValueAsString (std::size_t element=0) const |
}@ | |
const std::vector< std::string > | defaultValuesAsStrings () const |
Sets default value of the definition using a string. More... | |
smtk::attribute::ItemPtr | buildItem (Attribute *owningAttribute, int itemPosition) const override |
Sets default value of the definition using a string. More... | |
smtk::attribute::ItemPtr | buildItem (Item *owningItem, int position, int subGroupPosition) const override |
Sets default value of the definition using a string. More... | |
smtk::attribute::ItemDefinitionPtr | createCopy (smtk::attribute::ItemDefinition::CopyInfo &info) const override |
Sets default value of the definition using a string. More... | |
bool | hasSupportedUnits () const |
Returns true if units and a units system have been specified and that the specified units are supported by the units system. | |
bool | setUnits (const std::string &newUnits) override |
Sets default value of the definition using a string. More... | |
static bool | splitStringStartingDouble (const std::string &, std::string &, std::string &) |
Splits input string into 2 parts with first part representing double value. More... | |
DoubleItemDefinition (const std::string &myName) | |
Sets default value of the definition using a string. More... | |
bool | reevaluateDefaults () |
Sets default value of the definition using a string. More... | |
Additional Inherited Members | |
Public Types inherited from smtk::attribute::ValueItemDefinitionTemplate< double > | |
typedef double | DataType |
Protected Member Functions inherited from smtk::attribute::ValueItemDefinitionTemplate< double > | |
ValueItemDefinitionTemplate (const std::string &myname) | |
void | copyTo (ValueItemDefinitionPtr def, smtk::attribute::ItemDefinition::CopyInfo &info) const |
void | updateDiscreteValue () override |
Protected Member Functions inherited from smtk::attribute::ValueItemDefinition | |
void | copyTo (ValueItemDefinitionPtr def, smtk::attribute::ItemDefinition::CopyInfo &info) const |
void | applyCategories (const smtk::attribute::Categories::Stack &inheritedFromParent, smtk::attribute::Categories &inheritedToParent) override |
void | applyAdvanceLevels (const unsigned int &readLevelFromParent, const unsigned int &writeLevelFromParent) override |
void | setUnitsSystem (const shared_ptr< units::System > &unitsSystem) override |
Set the unitsSystem of the Definition. More... | |
Protected Member Functions inherited from smtk::attribute::ItemDefinition | |
ItemDefinition (const std::string &myname) | |
void | copyTo (ItemDefinitionPtr def) const |
Protected Attributes inherited from smtk::attribute::ValueItemDefinitionTemplate< double > | |
std::vector< double > | m_defaultValue |
double | m_minRange |
bool | m_minRangeSet |
bool | m_minRangeInclusive |
double | m_maxRange |
bool | m_maxRangeSet |
bool | m_maxRangeInclusive |
std::vector< double > | m_discreteValues |
double | m_dummy |
Protected Attributes inherited from smtk::attribute::ValueItemDefinition | |
bool | m_hasDefault |
bool | m_useCommonLabel |
std::vector< std::string > | m_valueLabels |
std::vector< std::string > | m_discreteValueEnums |
int | m_defaultDiscreteIndex |
std::size_t | m_numberOfRequiredValues |
std::size_t | m_maxNumberOfValues |
bool | m_isExtensible |
std::string | m_units |
std::string | m_expressionType |
smtk::attribute::ComponentItemDefinitionPtr | m_expressionDefinition |
std::map< std::string, smtk::attribute::ItemDefinitionPtr > | m_itemDefs |
std::map< std::string, std::set< std::string > > | m_itemToValueAssociations |
std::map< std::string, std::vector< std::string > > | m_valueToItemAssociations |
std::map< std::string, smtk::attribute::Categories::Set > | m_valueToCategoryAssociations |
std::map< std::string, unsigned int > | m_valueToAdvanceLevelAssociations |
Protected Attributes inherited from smtk::attribute::ItemDefinition | |
int | m_version |
bool | m_isOptional |
bool | m_isEnabledByDefault |
std::string | m_label |
attribute::Categories::Set | m_localCategories |
attribute::Categories | m_categories |
std::string | m_detailedDescription |
std::string | m_briefDescription |
bool | m_hasLocalAdvanceLevelInfo [2] |
unsigned int | m_localAdvanceLevel [2] |
unsigned int | m_advanceLevel [2] |
attribute::Tags | m_tags |
Categories::CombinationMode | m_combinationMode |
std::shared_ptr< units::System > | m_unitsSystem |
|
protected |
Sets default value of the definition using a string.
If the definition has been assigned units that are not supported by its units system or has no units system, and the value string contains units that matches the definition's, the string stored in the definition will not include the units.
|
overridevirtual |
Sets default value of the definition using a string.
If the definition has been assigned units that are not supported by its units system or has no units system, and the value string contains units that matches the definition's, the string stored in the definition will not include the units.
Implements smtk::attribute::ItemDefinition.
|
overridevirtual |
Sets default value of the definition using a string.
If the definition has been assigned units that are not supported by its units system or has no units system, and the value string contains units that matches the definition's, the string stored in the definition will not include the units.
Implements smtk::attribute::ItemDefinition.
|
overridevirtual |
Sets default value of the definition using a string.
If the definition has been assigned units that are not supported by its units system or has no units system, and the value string contains units that matches the definition's, the string stored in the definition will not include the units.
Implements smtk::attribute::ItemDefinition.
const std::vector< std::string > DoubleItemDefinition::defaultValuesAsStrings | ( | ) | const |
Sets default value of the definition using a string.
If the definition has been assigned units that are not supported by its units system or has no units system, and the value string contains units that matches the definition's, the string stored in the definition will not include the units.
|
protected |
Sets default value of the definition using a string.
If the definition has been assigned units that are not supported by its units system or has no units system, and the value string contains units that matches the definition's, the string stored in the definition will not include the units.
|
overridevirtual |
Set the default value for an attribute.
This variant takes an array of values so that vector quantities can have a different default for each component. However, a single default can always be specified (even for vector-valued attributes), and **must** be specified for discrete and extensible attributes. When a single default is provided but the attribute is vector-valued, then the default is used for each component.
Reimplemented from smtk::attribute::ValueItemDefinitionTemplate< double >.
bool DoubleItemDefinition::setDefaultValueAsString | ( | const std::string & | val | ) |
Sets default value of the definition using a string.
If the definition has been assigned units that are not supported by its units system or has no units system, and the value string contains units that matches the definition's, the string stored in the definition will not include the units.
bool DoubleItemDefinition::setDefaultValueAsString | ( | const std::vector< std::string > & | vals | ) |
Sets default value of the definition using a string.
If the definition has been assigned units that are not supported by its units system or has no units system, and the value string contains units that matches the definition's, the string stored in the definition will not include the units.
|
overridevirtual |
Sets default value of the definition using a string.
If the definition has been assigned units that are not supported by its units system or has no units system, and the value string contains units that matches the definition's, the string stored in the definition will not include the units.
Reimplemented from smtk::attribute::ValueItemDefinition.
|
static |
Splits input string into 2 parts with first part representing double value.
Returns true if double was found.
|
protected |
Sets default value of the definition using a string.
If the definition has been assigned units that are not supported by its units system or has no units system, and the value string contains units that matches the definition's, the string stored in the definition will not include the units.