MaterialX 1.38.10
Loading...
Searching...
No Matches
Element.h File Reference

Base and generic element classes. More...

Go to the source code of this file.

Classes

class  Element
 The base class for MaterialX elements. More...
 
class  TypedElement
 The base class for typed elements. More...
 
class  ValueElement
 The base class for elements that support typed values. More...
 
class  Token
 A token element representing a string value. More...
 
class  CommentElement
 An element representing a block of descriptive text within a document, which will be stored a comment when the document is written out. More...
 
class  NewlineElement
 An element representing a newline within a document. More...
 
class  GenericElement
 A generic element subclass, for instantiating elements with unrecognized categories. More...
 
class  StringResolver
 A helper object for applying string modifiers to data values in the context of a specific element and geometry. More...
 
class  ExceptionOrphanedElement
 An exception that is thrown when an ElementPtr is used after its owning Document has gone out of scope. More...
 

Typedefs

using ElementPtr = shared_ptr< Element >
 A shared pointer to an Element.
 
using ConstElementPtr = shared_ptr< const Element >
 A shared pointer to a const Element.
 
using TypedElementPtr = shared_ptr< TypedElement >
 A shared pointer to a TypedElement.
 
using ConstTypedElementPtr = shared_ptr< const TypedElement >
 A shared pointer to a const TypedElement.
 
using ValueElementPtr = shared_ptr< ValueElement >
 A shared pointer to a ValueElement.
 
using ConstValueElementPtr = shared_ptr< const ValueElement >
 A shared pointer to a const ValueElement.
 
using TokenPtr = shared_ptr< Token >
 A shared pointer to a Token.
 
using ConstTokenPtr = shared_ptr< const Token >
 A shared pointer to a const Token.
 
using CommentElementPtr = shared_ptr< CommentElement >
 A shared pointer to a CommentElement.
 
using ConstCommentElementPtr = shared_ptr< const CommentElement >
 A shared pointer to a const CommentElement.
 
using NewlineElementPtr = shared_ptr< NewlineElement >
 A shared pointer to a NewlineElement.
 
using ConstNewlineElementPtr = shared_ptr< const NewlineElement >
 A shared pointer to a const NewlineElement.
 
using GenericElementPtr = shared_ptr< GenericElement >
 A shared pointer to a GenericElement.
 
using ConstGenericElementPtr = shared_ptr< const GenericElement >
 A shared pointer to a const GenericElement.
 
using StringResolverPtr = shared_ptr< StringResolver >
 A shared pointer to a StringResolver.
 
using ElementMap = std::unordered_map< string, ElementPtr >
 A hash map from strings to elements.
 
using ElementPredicate = std::function< bool(ConstElementPtr)>
 A standard function taking an ElementPtr and returning a boolean.
 

Functions

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 any targets in common. More...
 
MX_CORE_API string prettyPrint (ConstElementPtr elem)
 Pretty print the given element tree, calling asString recursively on each element in depth-first order.
 

Detailed Description

Base and generic element classes.

Function Documentation

◆ targetStringsMatch()

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 any targets in common.

An empty target string matches all targets.