6#ifndef MATERIALX_ELEMENT_H
7#define MATERIALX_ELEMENT_H
18MATERIALX_NAMESPACE_BEGIN
72using ElementMap = std::unordered_map<string, ElementPtr>;
84class MX_CORE_API Element :
public std::enable_shared_from_this<Element>
87 Element(
ElementPtr parent,
const string& category,
const string& name) :
91 _root(parent ? parent->getRoot() :
nullptr)
96 virtual ~Element() { }
97 Element(
const Element&) =
delete;
98 Element& operator=(
const Element&) =
delete;
101 using DocumentPtr = shared_ptr<Document>;
102 using ConstDocumentPtr = shared_ptr<const Document>;
104 template <
class T>
friend class ElementRegistry;
121 _category = category;
190 if (elem->hasFilePrefix())
192 return elem->getFilePrefix();
226 if (elem->hasGeomPrefix())
228 return elem->getGeomPrefix();
262 if (elem->hasColorSpace())
264 return elem->getColorSpace();
346 const string& namespaceStr = elem->getNamespace();
347 if (!namespaceStr.empty())
350 const size_t i = name.find_first_of(NAME_PREFIX_SEPARATOR);
351 if (i != string::npos && name.substr(0, i) == namespaceStr)
357 return namespaceStr + NAME_PREFIX_SEPARATOR + name;
386 template <
class T>
bool isA(
const string& category = EMPTY_STRING)
const
390 if (!category.empty() &&
getCategory() != category)
396 template <
class T> shared_ptr<T>
asA();
399 template <
class T> shared_ptr<const T>
asA()
const;
412 template <
class T> shared_ptr<T>
addChild(
const string& name = EMPTY_STRING);
436 ElementMap::const_iterator it = _childMap.find(name);
437 return (it != _childMap.end()) ? it->second :
ElementPtr();
455 template <
class T> vector<shared_ptr<T>>
getChildrenOfType(
const string& category = EMPTY_STRING)
const;
487 return _attributeMap.count(attrib) != 0;
494 StringMap::const_iterator it = _attributeMap.find(attrib);
495 return (it != _attributeMap.end()) ? it->second : EMPTY_STRING;
501 return _attributeOrder;
540 return shared_from_this();
546 return shared_from_this();
552 return _parent.lock();
558 return _parent.lock();
579 shared_ptr<T> typedElem = elem->asA<T>();
594 shared_ptr<const T> typedElem = elem->asA<T>();
615 string* message =
nullptr)
const;
626 string* message =
nullptr)
const;
724 _sourceUri = sourceUri;
730 return !_sourceUri.empty();
745 if (elem->hasSourceUri())
747 return elem->getSourceUri();
759 virtual bool validate(
string* message =
nullptr)
const;
777 while (_childMap.count(name))
804 template <
class T> shared_ptr<T> resolveNameReference(
const string& name,
ConstElementPtr parent =
nullptr)
const
808 return child ? child : scope->getChildOfType<T>(name);
813 void validateRequire(
bool expression,
bool& res,
string* message,
const string& errorDesc)
const;
816 static const string NAME_ATTRIBUTE;
817 static const string FILE_PREFIX_ATTRIBUTE;
818 static const string GEOM_PREFIX_ATTRIBUTE;
819 static const string COLOR_SPACE_ATTRIBUTE;
820 static const string INHERIT_ATTRIBUTE;
821 static const string NAMESPACE_ATTRIBUTE;
822 static const string DOC_ATTRIBUTE;
823 static const string XPOS_ATTRIBUTE;
824 static const string YPOS_ATTRIBUTE;
827 virtual void registerChildElement(
ElementPtr child);
828 virtual void unregisterChildElement(
ElementPtr child);
834 return std::const_pointer_cast<Element>(shared_from_this());
848 weak_ptr<Element> _parent;
849 weak_ptr<Element> _root;
854 return std::make_shared<T>(parent, name);
859 using CreatorMap = std::unordered_map<string, CreatorFunction>;
861 static CreatorMap _creatorMap;
866class MX_CORE_API TypedElement :
public Element
869 TypedElement(
ElementPtr parent,
const string& category,
const string& name) :
870 Element(parent, category, name)
875 virtual ~TypedElement() { }
878 using TypeDefPtr = shared_ptr<class TypeDef>;
911 return getType() == MULTI_OUTPUT_TYPE_STRING;
925 static const string TYPE_ATTRIBUTE;
930class MX_CORE_API ValueElement :
public TypedElement
933 ValueElement(
ElementPtr parent,
const string& category,
const string& name) :
934 TypedElement(parent, category, name)
939 virtual ~ValueElement() { }
1018 template <
class T>
void setValue(
const T& value,
const string& type = EMPTY_STRING)
1025 void setValue(
const char* value,
const string& type = EMPTY_STRING)
1027 setValue(value ?
string(value) : EMPTY_STRING, type);
1133 string* message =
nullptr)
const override;
1141 bool validate(
string* message =
nullptr)
const override;
1146 static const string VALUE_ATTRIBUTE;
1147 static const string INTERFACE_NAME_ATTRIBUTE;
1148 static const string IMPLEMENTATION_NAME_ATTRIBUTE;
1149 static const string IMPLEMENTATION_TYPE_ATTRIBUTE;
1150 static const string ENUM_ATTRIBUTE;
1151 static const string ENUM_VALUES_ATTRIBUTE;
1152 static const string UI_NAME_ATTRIBUTE;
1153 static const string UI_FOLDER_ATTRIBUTE;
1154 static const string UI_MIN_ATTRIBUTE;
1155 static const string UI_MAX_ATTRIBUTE;
1156 static const string UI_SOFT_MIN_ATTRIBUTE;
1157 static const string UI_SOFT_MAX_ATTRIBUTE;
1158 static const string UI_STEP_ATTRIBUTE;
1159 static const string UI_ADVANCED_ATTRIBUTE;
1160 static const string UNIT_ATTRIBUTE;
1161 static const string UNITTYPE_ATTRIBUTE;
1162 static const string UNIFORM_ATTRIBUTE;
1170class MX_CORE_API Token :
public ValueElement
1173 Token(
ElementPtr parent,
const string& name) :
1174 ValueElement(parent, CATEGORY, name)
1177 virtual ~Token() { }
1180 static const string CATEGORY;
1190class MX_CORE_API CommentElement :
public Element
1193 CommentElement(
ElementPtr parent,
const string& name) :
1194 Element(parent, CATEGORY, name)
1197 virtual ~CommentElement() { }
1200 static const string CATEGORY;
1205class MX_CORE_API NewlineElement :
public Element
1208 NewlineElement(
ElementPtr parent,
const string& name) :
1209 Element(parent, CATEGORY, name)
1212 virtual ~NewlineElement() { }
1215 static const string CATEGORY;
1220class MX_CORE_API GenericElement :
public Element
1223 GenericElement(
ElementPtr parent,
const string& name) :
1224 Element(parent, CATEGORY, name)
1227 virtual ~GenericElement() { }
1230 static const string CATEGORY;
1246class MX_CORE_API StringResolver
1263 _filePrefix = filePrefix;
1279 _geomPrefix = geomPrefix;
1303 _filenameMap[key] = value;
1312 return _filenameMap;
1322 _geomNameMap[key] = value;
1328 return _geomNameMap;
1337 virtual string resolve(
const string& str,
const string& type)
const;
1342 return type == FILENAME_TYPE_STRING || type == GEOMNAME_TYPE_STRING;
1359class MX_CORE_API ElementEquivalenceOptions
1362 ElementEquivalenceOptions()
1369 ~ElementEquivalenceOptions() { }
1399 using Exception::Exception;
1404 string childName = name;
1405 if (childName.empty())
1410 if (_childMap.count(childName))
1411 throw Exception(
"Child name is not unique: " + childName);
1413 shared_ptr<T> child = std::make_shared<T>(
getSelf(), childName);
1414 registerChildElement(child);
1428MATERIALX_NAMESPACE_END
shared_ptr< Token > TokenPtr
A shared pointer to a Token.
Definition Element.h:46
shared_ptr< const GenericElement > ConstGenericElementPtr
A shared pointer to a const GenericElement.
Definition Element.h:63
shared_ptr< TypedElement > TypedElementPtr
A shared pointer to a TypedElement.
Definition Element.h:36
shared_ptr< StringResolver > StringResolverPtr
A shared pointer to a StringResolver.
Definition Element.h:66
shared_ptr< const CommentElement > ConstCommentElementPtr
A shared pointer to a const CommentElement.
Definition Element.h:53
std::unordered_map< string, ElementPtr > ElementMap
A hash map from strings to elements.
Definition Element.h:72
shared_ptr< NewlineElement > NewlineElementPtr
A shared pointer to a NewlineElement.
Definition Element.h:56
shared_ptr< const Token > ConstTokenPtr
A shared pointer to a const Token.
Definition Element.h:48
shared_ptr< GenericElement > GenericElementPtr
A shared pointer to a GenericElement.
Definition Element.h:61
shared_ptr< const Element > ConstElementPtr
A shared pointer to a const Element.
Definition Element.h:33
shared_ptr< Element > ElementPtr
A shared pointer to an Element.
Definition Element.h:31
shared_ptr< ValueElement > ValueElementPtr
A shared pointer to a ValueElement.
Definition Element.h:41
shared_ptr< const ValueElement > ConstValueElementPtr
A shared pointer to a const ValueElement.
Definition Element.h:43
shared_ptr< CommentElement > CommentElementPtr
A shared pointer to a CommentElement.
Definition Element.h:51
shared_ptr< const TypedElement > ConstTypedElementPtr
A shared pointer to a const TypedElement.
Definition Element.h:38
std::function< bool(ConstElementPtr)> ElementPredicate
A standard function taking an ElementPtr and returning a boolean.
Definition Element.h:75
shared_ptr< const NewlineElement > ConstNewlineElementPtr
A shared pointer to a const NewlineElement.
Definition Element.h:58
MX_CORE_API string prettyPrint(ConstElementPtr elem)
Pretty print the given element tree, calling asString recursively on each element in depth-first orde...
vector< ElementPtr > ElementVec
A vector of elements.
Definition Element.h:69
MX_CORE_API bool targetStringsMatch(const string &target1, const string &target2)
Given two target strings, each containing a string array of target names, return true if they have an...
Import and export declarations for the Core library.
std::set< string > StringSet
A set of strings.
Definition Library.h:64
vector< string > StringVec
A vector of strings.
Definition Library.h:60
std::unordered_map< string, string > StringMap
An unordered map with strings as both keys and values.
Definition Library.h:62
MX_CORE_API string incrementName(const string &name)
Increment the numeric suffix of a name.
MX_CORE_API string createValidName(string name, char replaceChar='_')
Create a valid MaterialX name from the given string.
MX_CORE_API T fromValueString(const string &value)
Convert the given value string to a data value of the given type.
shared_ptr< Value > ValuePtr
A shared pointer to a Value.
Definition Value.h:30
MX_CORE_API string toValueString(const T &data)
Convert the given data value to a value string.
MX_CORE_API const string & getTypeString()
Return the type string associated with the given data type.
A MaterialX document, which represents the top-level element in the MaterialX ownership hierarchy.
Definition Document.h:32
An edge between two connected Elements, returned during graph traversal.
Definition Traversal.h:30
A set of options for comparing the functional equivalence of elements.
Definition Element.h:1360
StringSet attributeExclusionList
Specifies the set of attributes that should be excluded when performing a comparison.
Definition Element.h:1390
bool performValueComparisons
Perform value comparisons as opposed to literal string comparisons.
Definition Element.h:1373
int floatPrecision
Floating point precision to use for floating point value comparisons.
Definition Element.h:1379
Value::FloatFormat floatFormat
Floating point format to use for floating point value comparisons.
Definition Element.h:1376
The base class for MaterialX elements.
Definition Element.h:85
const string & getActiveSourceUri() const
Return the source URI that is active at the scope of this element, taking all ancestor elements into ...
Definition Element.h:741
bool hasNamespace() const
Return true if this element has a namespace string.
Definition Element.h:329
const string & getAttribute(const string &attrib) const
Return the value string of the given attribute.
Definition Element.h:492
ConstElementPtr getSelf() const
Return our self pointer.
Definition Element.h:544
const string & getActiveGeomPrefix() const
Return the geom prefix string that is active at the scope of this element, taking all ancestor elemen...
Definition Element.h:222
string asString() const
Return a single-line description of this element, including its category, name, and attributes.
bool isA(const string &category=EMPTY_STRING) const
Return true if this element belongs to the given subclass.
Definition Element.h:386
void setDocString(const string &doc)
Set the documentation string of this element.
Definition Element.h:368
shared_ptr< T > getAncestorOfType()
Return the first ancestor of the given subclass, or an empty shared pointer if no ancestor of this su...
Definition Element.h:575
bool hasGeomPrefix() const
Return true if the given element has a geom prefix string.
Definition Element.h:209
shared_ptr< const T > getAncestorOfType() const
Return the first ancestor of the given subclass, or an empty shared pointer if no ancestor of this su...
Definition Element.h:590
void setChildIndex(const string &name, int index)
Set the index of the child, if any, with the given name.
const string & getInheritString() const
Return the inherit string of this element.
Definition Element.h:287
TreeIterator traverseTree() const
Traverse the tree from the given element to each of its descendants in depth-first order,...
GraphIterator traverseGraph() const
Traverse the dataflow graph from the given element to each of its upstream sources in depth-first ord...
bool hasSourceUri() const
Return true if this element has a source URI.
Definition Element.h:728
void removeChild(const string &name)
Remove the child element, if any, with the given name.
ElementPtr changeChildCategory(ElementPtr child, const string &category)
Change the category of the given child element.
const string & getColorSpace() const
Return the element's color space string.
Definition Element.h:251
shared_ptr< T > addChild(const string &name=EMPTY_STRING)
Add a child element of the given subclass and name.
Definition Element.h:1402
const string & getName() const
Return the element's name string.
Definition Element.h:143
void setColorSpace(const string &colorSpace)
Set the element's color space string.
Definition Element.h:239
string getQualifiedName(const string &name) const
Return a qualified version of the given name, taking the namespace at the scope of this element into ...
Definition Element.h:342
string createValidChildName(string name) const
Using the input name as a starting point, modify it to create a valid, unique name for a child elemen...
Definition Element.h:774
shared_ptr< const T > asA() const
Dynamic cast to a const instance of the given subclass.
const string & getGeomPrefix() const
Return the element's geom prefix string.
Definition Element.h:215
void setFilePrefix(const string &prefix)
Set the element's file prefix string.
Definition Element.h:167
bool hasInheritedBase(ConstElementPtr base) const
Return true if this element has the given element as an inherited base, taking the full inheritance c...
bool hasInheritanceCycle() const
Return true if the inheritance chain for this element contains a cycle.
void setAttribute(const string &attrib, const string &value)
Set the value string of the given attribute.
const StringVec & getAttributeNames() const
Return a vector of stored attribute names, in the order they were set.
Definition Element.h:499
void setName(const string &name)
Set the element's name string.
virtual void clearContent()
Clear all attributes and descendants from this element.
int getChildIndex(const string &name) const
Return the index of the child, if any, with the given name.
ElementPtr getChild(const string &name) const
Return the child element, if any, with the given name.
Definition Element.h:434
const string & getSourceUri() const
Return the element's source URI.
Definition Element.h:734
virtual bool validate(string *message=nullptr) const
Validate that the given element tree, including all descendants, is consistent with the MaterialX spe...
bool hasColorSpace() const
Return true if the given element has a color space string.
Definition Element.h:245
InheritanceIterator traverseInheritance() const
Traverse the inheritance chain from the given element to each element from which it inherits.
ElementPtr getRoot()
Return the root element of our tree.
const string & getFilePrefix() const
Return the element's file prefix string.
Definition Element.h:179
void copyContentFrom(const ConstElementPtr &source)
Copy all attributes and descendants from the given element to this one.
void setTypedAttribute(const string &attrib, const T &data)
Set the value of an implicitly typed attribute.
Definition Element.h:507
bool operator!=(const Element &rhs) const
Return true if the given element tree, including all descendants, differs from this one.
DocumentPtr getDocument()
Return the root document of our tree.
virtual size_t getUpstreamEdgeCount() const
Return the number of queryable upstream edges for this element.
Definition Element.h:685
StringResolverPtr createStringResolver(const string &geom=EMPTY_STRING) const
Construct a StringResolver at the scope of this element.
bool hasInheritString() const
Return true if this element has an inherit string.
Definition Element.h:281
const string & getActiveColorSpace() const
Return the color space string that is active at the scope of this element, taking all ancestor elemen...
Definition Element.h:258
shared_ptr< T > asA()
Dynamic cast to an instance of the given subclass.
ElementPtr getInheritsFrom() const
Return the element, if any, that this one directly inherits from.
Definition Element.h:306
ElementPtr getUpstreamElement(size_t index=0) const
Return the Element with the given index that lies directly upstream from this one in the dataflow gra...
T getTypedAttribute(const string &attrib) const
Return the value of an implicitly typed attribute.
Definition Element.h:515
void setCategory(const string &category)
Set the element's category string.
Definition Element.h:119
void removeAttribute(const string &attrib)
Remove the given attribute, if present.
bool isEquivalent(ConstElementPtr rhs, const ElementEquivalenceOptions &options, string *message=nullptr) const
Return true if the given element tree, including all descendents, is considered to be equivalent to t...
bool operator==(const Element &rhs) const
Return true if the given element tree, including all descendants, is identical to this one.
shared_ptr< T > getChildOfType(const string &name) const
Return the child element, if any, with the given name and subclass.
ElementPtr getDescendant(const string &namePath) const
Return the element specified by the given hierarchical name path, relative to the current element.
string getNamePath(ConstElementPtr relativeTo=nullptr) const
Return the element's hierarchical name path, relative to the root document.
ConstElementPtr getRoot() const
Return the root element of our tree.
void setGeomPrefix(const string &prefix)
Set the element's geom prefix string.
Definition Element.h:203
void setNamespace(const string &space)
Set the namespace string of this element.
Definition Element.h:323
ElementPtr getSelf()
Return our self pointer.
Definition Element.h:538
ConstElementPtr getParent() const
Return our parent element.
Definition Element.h:556
const ElementVec & getChildren() const
Return a constant vector of all child elements.
Definition Element.h:447
const string & getActiveFilePrefix() const
Return the file prefix string that is active at the scope of this element, taking all ancestor elemen...
Definition Element.h:186
void setInheritString(const string &inherit)
Set the inherit string of this element.
Definition Element.h:275
const string & getNamespace() const
Return the namespace string of this element.
Definition Element.h:335
ConstDocumentPtr getDocument() const
Return the root document of our tree.
bool hasAttribute(const string &attrib) const
Return true if the given attribute is present.
Definition Element.h:485
void removeChildOfType(const string &name)
Remove the child element, if any, with the given name and subclass.
Definition Element.h:471
void setSourceUri(const string &sourceUri)
Set the element's source URI.
Definition Element.h:722
virtual bool isAttributeEquivalent(ConstElementPtr rhs, const string &attributeName, const ElementEquivalenceOptions &options, string *message=nullptr) const
Return true if the attribute on a given element is equivalent based on the equivalence criteria provi...
string getDocString() const
Return the documentation string of this element.
Definition Element.h:374
void setInheritsFrom(ConstElementPtr super)
Set the element that this one directly inherits from.
Definition Element.h:293
ElementPtr getParent()
Return our parent element.
Definition Element.h:550
bool hasFilePrefix() const
Return true if the given element has a file prefix string.
Definition Element.h:173
ElementPtr addChildOfCategory(const string &category, string name=EMPTY_STRING)
Add a child element of the given category and name.
const string & getCategory() const
Return the element's category string.
Definition Element.h:127
vector< shared_ptr< T > > getChildrenOfType(const string &category=EMPTY_STRING) const
Return a vector of all child elements that are instances of the given subclass, optionally filtered b...
virtual Edge getUpstreamEdge(size_t index=0) const
Return the Edge with the given index that lies directly upstream from this element in the dataflow gr...
The base class for exceptions that are propagated from the MaterialX library to the client applicatio...
Definition Exception.h:22
An exception that is thrown when an ElementPtr is used after its owning Document has gone out of scop...
Definition Element.h:1397
An exception that is thrown when a type mismatch is encountered.
Definition Exception.h:56
A generic element subclass, for instantiating elements with unrecognized categories.
Definition Element.h:1221
An iterator object representing the state of an upstream graph traversal.
Definition Traversal.h:192
An iterator object representing the current state of an inheritance traversal.
Definition Traversal.h:336
An element representing a newline within a document.
Definition Element.h:1206
A helper object for applying string modifiers to data values in the context of a specific element and...
Definition Element.h:1247
void setFilenameSubstitution(const string &key, const string &value)
Set an arbitrary substring substitution for filename data values.
Definition Element.h:1301
static bool isResolvedType(const string &type)
Return true if the given type may be resolved by this class.
Definition Element.h:1340
const string & getGeomPrefix() const
Return the geom prefix for this context.
Definition Element.h:1283
void setUvTileString(const string &uvTile)
Set the UV-tile substring substitution for filename data values.
const string & getFilePrefix() const
Return the file prefix for this context.
Definition Element.h:1267
const StringMap & getGeomNameSubstitutions() const
Return the map of geometry name substring substitutions.
Definition Element.h:1326
void addTokenSubstitutions(ConstElementPtr element)
Add filename token substitutions for a given element.
void setFilePrefix(const string &filePrefix)
Set the file prefix for this context.
Definition Element.h:1261
virtual string resolve(const string &str, const string &type) const
Given an input string and type, apply all appropriate modifiers and return the resulting string.
void setUdimString(const string &udim)
Set the UDIM substring substitution for filename data values.
void setGeomPrefix(const string &geomPrefix)
Set the geom prefix for this context.
Definition Element.h:1277
const StringMap & getFilenameSubstitutions() const
Return the map of filename substring substitutions.
Definition Element.h:1310
void setGeomNameSubstitution(const string &key, const string &value)
Set an arbitrary substring substitution for geometry name data values.
Definition Element.h:1320
static StringResolverPtr create()
Create a new string resolver.
Definition Element.h:1250
A token element representing a string value.
Definition Element.h:1171
An iterator object representing the state of a tree traversal.
Definition Traversal.h:89
The base class for typed elements.
Definition Element.h:867
virtual const string & getType() const
Return the element's type string.
Definition Element.h:897
bool isColorType() const
Return true if the element is of color type.
Definition Element.h:903
void setType(const string &type)
Set the element's type string.
Definition Element.h:885
bool isMultiOutputType() const
Return true if the element is of multi-output type.
Definition Element.h:909
TypeDefPtr getTypeDef() const
Return the TypeDef declaring the type string of this element.
bool hasType() const
Return true if the given element has a type string.
Definition Element.h:891
The base class for elements that support typed values.
Definition Element.h:931
ValuePtr getValue() const
Return the typed value of an element as a generic value object, which may be queried to access its da...
bool isAttributeEquivalent(ConstElementPtr rhs, const string &attributeName, const ElementEquivalenceOptions &options, string *message=nullptr) const override
Return true if the attribute on a given element is equivalent based on the equivalence criteria provi...
void setUnit(const string &unit)
Set the unit string of an element.
Definition Element.h:1065
const string & getValueString() const
Get the value string of a element.
Definition Element.h:957
void setInterfaceName(const string &name)
Set the interface name of an element.
Definition Element.h:974
ValuePtr getDefaultValue() const
Return the default value for this element as a generic value object, which may be queried to access i...
string getResolvedValueString(StringResolverPtr resolver=nullptr) const
Return the resolved value string of an element, applying any string substitutions that are defined at...
bool validate(string *message=nullptr) const override
Validate that the given element tree, including all descendants, is consistent with the MaterialX spe...
ValuePtr getResolvedValue(StringResolverPtr resolver=nullptr) const
Return the resolved value of an element as a generic value object, which may be queried to access its...
const string & getImplementationName() const
Return the implementation name of an element.
Definition Element.h:1008
void setValue(const char *value, const string &type=EMPTY_STRING)
Set the typed value of an element from a C-style string.
Definition Element.h:1025
bool hasUnitType() const
Return true if the given element has a unit type.
Definition Element.h:1093
void setIsUniform(bool value)
Set the uniform attribute flag on this element.
Definition Element.h:1109
const string & getUnit() const
Return the unit string of an element.
Definition Element.h:1077
bool getIsUniform() const
The the uniform attribute flag for this element.
Definition Element.h:1115
void setValueString(const string &value)
Set the value string of an element.
Definition Element.h:945
void setValue(const T &value, const string &type=EMPTY_STRING)
Set the typed value of an element.
Definition Element.h:1018
bool hasUnit() const
Return true if the given element has a unit string.
Definition Element.h:1071
bool hasInterfaceName() const
Return true if the given element has an interface name.
Definition Element.h:980
void setUnitType(const string &unit)
Set the unit type of an element.
Definition Element.h:1087
bool hasImplementationName() const
Return true if the given element has an implementation name.
Definition Element.h:1002
void setImplementationName(const string &name)
Set the implementation name of an element.
Definition Element.h:996
const string & getActiveUnit() const
Return the unit defined by the associated NodeDef if this element is a child of a Node.
const string & getInterfaceName() const
Return the interface name of an element.
Definition Element.h:986
bool hasValueString() const
Return true if the given element has a value string.
Definition Element.h:951
const string & getUnitType() const
Return the unit type of an element.
Definition Element.h:1099
bool hasValue() const
Return true if the element possesses a typed value.
Definition Element.h:1031
static FloatFormat getFloatFormat()
Return the current float format.
Definition Value.h:114
FloatFormat
Float formats to use when converting values to strings.
Definition Value.h:50
static int getFloatPrecision()
Return the current float precision.
Definition Value.h:120