HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Look Class Reference

#include <Look.h>

+ Inheritance diagram for Look:

Public Member Functions

 Look (ElementPtr parent, const string &name)
 
virtual ~Look ()
 
MaterialAssign Elements
MaterialAssignPtr addMaterialAssign (const string &name=EMPTY_STRING, const string &material=EMPTY_STRING)
 
MaterialAssignPtr getMaterialAssign (const string &name) const
 Return the MaterialAssign, if any, with the given name. More...
 
vector< MaterialAssignPtrgetMaterialAssigns () const
 Return a vector of all MaterialAssign elements in the look. More...
 
vector< MaterialAssignPtrgetActiveMaterialAssigns () const
 
void removeMaterialAssign (const string &name)
 Remove the MaterialAssign, if any, with the given name. More...
 
PropertyAssign Elements
PropertyAssignPtr addPropertyAssign (const string &name=EMPTY_STRING)
 
PropertyAssignPtr getPropertyAssign (const string &name) const
 Return the PropertyAssign, if any, with the given name. More...
 
vector< PropertyAssignPtrgetPropertyAssigns () const
 Return a vector of all PropertyAssign elements in the look. More...
 
vector< PropertyAssignPtrgetActivePropertyAssigns () const
 
void removePropertyAssign (const string &name)
 Remove the PropertyAssign, if any, with the given name. More...
 
PropertySetAssign Elements
PropertySetAssignPtr addPropertySetAssign (const string &name=EMPTY_STRING)
 
PropertySetAssignPtr getPropertySetAssign (const string &name) const
 Return the PropertySetAssign, if any, with the given name. More...
 
vector< PropertySetAssignPtrgetPropertySetAssigns () const
 Return a vector of all PropertySetAssign elements in the look. More...
 
vector< PropertySetAssignPtrgetActivePropertySetAssigns () const
 
void removePropertySetAssign (const string &name)
 Remove the PropertySetAssign, if any, with the given name. More...
 
VariantAssign Elements
VariantAssignPtr addVariantAssign (const string &name=EMPTY_STRING)
 
VariantAssignPtr getVariantAssign (const string &name) const
 Return the VariantAssign, if any, with the given name. More...
 
vector< VariantAssignPtrgetVariantAssigns () const
 Return a vector of all VariantAssign elements in the look. More...
 
vector< VariantAssignPtrgetActiveVariantAssigns () const
 
void removeVariantAssign (const string &name)
 Remove the VariantAssign, if any, with the given name. More...
 
Visibility Elements
VisibilityPtr addVisibility (const string &name=EMPTY_STRING)
 
VisibilityPtr getVisibility (const string &name) const
 Return the Visibility, if any, with the given name. More...
 
vector< VisibilityPtrgetVisibilities () const
 Return a vector of all Visibility elements in the look. More...
 
vector< VisibilityPtrgetActiveVisibilities () const
 
void removeVisibility (const string &name)
 Remove the Visibility, if any, with the given name. More...
 
- Public Member Functions inherited from Element
virtual ~Element ()
 
 Element (const Element &)=delete
 
Elementoperator= (const Element &)=delete
 
bool operator== (const Element &rhs) const
 
bool operator!= (const Element &rhs) const
 
void setCategory (const string &category)
 Set the element's category string. More...
 
const stringgetCategory () const
 
void setName (const string &name)
 
const stringgetName () const
 Return the element's name string. More...
 
string getNamePath (ConstElementPtr relativeTo=nullptr) const
 
ElementPtr getDescendant (const string &namePath) const
 
void setFilePrefix (const string &prefix)
 Set the element's file prefix string. More...
 
bool hasFilePrefix () const
 Return true if the given element has a file prefix string. More...
 
const stringgetFilePrefix () const
 Return the element's file prefix string. More...
 
const stringgetActiveFilePrefix () const
 
void setGeomPrefix (const string &prefix)
 Set the element's geom prefix string. More...
 
bool hasGeomPrefix () const
 Return true if the given element has a geom prefix string. More...
 
const stringgetGeomPrefix () const
 Return the element's geom prefix string. More...
 
const stringgetActiveGeomPrefix () const
 
void setColorSpace (const string &colorSpace)
 Set the element's color space string. More...
 
bool hasColorSpace () const
 Return true if the given element has a color space string. More...
 
const stringgetColorSpace () const
 Return the element's color space string. More...
 
const stringgetActiveColorSpace () const
 
void setInheritString (const string &inherit)
 Set the inherit string of this element. More...
 
bool hasInheritString () const
 Return true if this element has an inherit string. More...
 
const stringgetInheritString () const
 Return the inherit string of this element. More...
 
void setInheritsFrom (ConstElementPtr super)
 Set the element that this one directly inherits from. More...
 
ElementPtr getInheritsFrom () const
 Return the element, if any, that this one directly inherits from. More...
 
bool hasInheritedBase (ConstElementPtr base) const
 
bool hasInheritanceCycle () const
 Return true if the inheritance chain for this element contains a cycle. More...
 
void setNamespace (const string &space)
 Set the namespace string of this element. More...
 
bool hasNamespace () const
 Return true if this element has a namespace string. More...
 
const stringgetNamespace () const
 Return the namespace string of this element. More...
 
string getQualifiedName (const string &name) const
 
void setDocString (const string &doc)
 Set the documentation string of this element. More...
 
string getDocString () const
 Return the documentation string of this element. More...
 
template<class T >
bool isA (const string &category=EMPTY_STRING) const
 
template<class T >
shared_ptr< TasA ()
 Dynamic cast to an instance of the given subclass. More...
 
template<class T >
shared_ptr< const TasA () const
 Dynamic cast to a const instance of the given subclass. More...
 
template<class T >
shared_ptr< TaddChild (const string &name=EMPTY_STRING)
 
ElementPtr addChildOfCategory (const string &category, string name=EMPTY_STRING)
 
ElementPtr changeChildCategory (ElementPtr child, const string &category)
 
ElementPtr getChild (const string &name) const
 Return the child element, if any, with the given name. More...
 
template<class T >
shared_ptr< TgetChildOfType (const string &name) const
 
const vector< ElementPtr > & getChildren () const
 
template<class T >
vector< shared_ptr< T > > getChildrenOfType (const string &category=EMPTY_STRING) const
 
void setChildIndex (const string &name, int index)
 
int getChildIndex (const string &name) const
 
void removeChild (const string &name)
 Remove the child element, if any, with the given name. More...
 
template<class T >
void removeChildOfType (const string &name)
 
void setAttribute (const string &attrib, const string &value)
 Set the value string of the given attribute. More...
 
bool hasAttribute (const string &attrib) const
 Return true if the given attribute is present. More...
 
const stringgetAttribute (const string &attrib) const
 
const StringVecgetAttributeNames () const
 Return a vector of stored attribute names, in the order they were set. More...
 
template<class T >
void setTypedAttribute (const string &attrib, const T &data)
 
template<class T >
T getTypedAttribute (const string &attrib) const
 
void removeAttribute (const string &attrib)
 Remove the given attribute, if present. More...
 
ElementPtr getSelf ()
 Return our self pointer. More...
 
ConstElementPtr getSelf () const
 Return our self pointer. More...
 
ElementPtr getParent ()
 Return our parent element. More...
 
ConstElementPtr getParent () const
 Return our parent element. More...
 
ElementPtr getRoot ()
 Return the root element of our tree. More...
 
ConstElementPtr getRoot () const
 Return the root element of our tree. More...
 
DocumentPtr getDocument ()
 Return the root document of our tree. More...
 
ConstDocumentPtr getDocument () const
 Return the root document of our tree. More...
 
template<class T >
shared_ptr< const TgetAncestorOfType () const
 
TreeIterator traverseTree () const
 
GraphIterator traverseGraph () const
 
virtual Edge getUpstreamEdge (size_t index=0) const
 
virtual size_t getUpstreamEdgeCount () const
 Return the number of queriable upstream edges for this element. More...
 
ElementPtr getUpstreamElement (size_t index=0) const
 
InheritanceIterator traverseInheritance () const
 
void setSourceUri (const string &sourceUri)
 
bool hasSourceUri () const
 Return true if this element has a source URI. More...
 
const stringgetSourceUri () const
 Return the element's source URI. More...
 
const stringgetActiveSourceUri () const
 
virtual bool validate (string *message=nullptr) const
 
void copyContentFrom (const ConstElementPtr &source)
 
virtual void clearContent ()
 Clear all attributes and descendants from this element. More...
 
string createValidChildName (string name) const
 
StringResolverPtr createStringResolver (const string &geom=EMPTY_STRING) const
 
string asString () const
 

Static Public Attributes

static const string CATEGORY
 
- Static Public Attributes inherited from Element
static const string NAME_ATTRIBUTE
 
static const string FILE_PREFIX_ATTRIBUTE
 
static const string GEOM_PREFIX_ATTRIBUTE
 
static const string COLOR_SPACE_ATTRIBUTE
 
static const string INHERIT_ATTRIBUTE
 
static const string NAMESPACE_ATTRIBUTE
 
static const string DOC_ATTRIBUTE
 

Additional Inherited Members

- Protected Types inherited from Element
using DocumentPtr = shared_ptr< Document >
 
using ConstDocumentPtr = shared_ptr< const Document >
 
- Protected Member Functions inherited from Element
 Element (ElementPtr parent, const string &category, const string &name)
 
template<class T >
shared_ptr< TresolveNameReference (const string &name, ConstElementPtr parent=nullptr) const
 
void validateRequire (bool expression, bool &res, string *message, const string &errorDesc) const
 
virtual void registerChildElement (ElementPtr child)
 
virtual void unregisterChildElement (ElementPtr child)
 
ElementPtr getSelfNonConst () const
 
- Protected Attributes inherited from Element
string _category
 
string _name
 
string _sourceUri
 
ElementMap _childMap
 
vector< ElementPtr_childOrder
 
StringMap _attributeMap
 
StringVec _attributeOrder
 
weak_ptr< Element_parent
 
weak_ptr< Element_root
 

Detailed Description

A look element within a Document.

Definition at line 48 of file Look.h.

Constructor & Destructor Documentation

Look::Look ( ElementPtr  parent,
const string name 
)
inline

Definition at line 51 of file Look.h.

virtual Look::~Look ( )
inlinevirtual

Definition at line 55 of file Look.h.

Member Function Documentation

MaterialAssignPtr Look::addMaterialAssign ( const string name = EMPTY_STRING,
const string material = EMPTY_STRING 
)

Add a MaterialAssign to the look.

Parameters
nameThe name of the new MaterialAssign. If no name is specified, then a unique name will automatically be generated.
materialAn optional material string, which should match the name of the material node to be assigned.
Returns
A shared pointer to the new MaterialAssign.
PropertyAssignPtr Look::addPropertyAssign ( const string name = EMPTY_STRING)
inline

Add a PropertyAssign to the look.

Parameters
nameThe name of the new PropertyAssign. If no name is specified, then a unique name will automatically be generated.
Returns
A shared pointer to the new PropertyAssign.

Definition at line 101 of file Look.h.

PropertySetAssignPtr Look::addPropertySetAssign ( const string name = EMPTY_STRING)
inline

Add a PropertySetAssign to the look.

Parameters
nameThe name of the new PropertySetAssign. If no name is specified, then a unique name will automatically be generated.
Returns
A shared pointer to the new PropertySetAssign.

Definition at line 137 of file Look.h.

VariantAssignPtr Look::addVariantAssign ( const string name = EMPTY_STRING)
inline

Add a VariantAssign to the look.

Parameters
nameThe name of the new VariantAssign. If no name is specified, then a unique name will automatically be generated.
Returns
A shared pointer to the new VariantAssign.

Definition at line 173 of file Look.h.

VisibilityPtr Look::addVisibility ( const string name = EMPTY_STRING)
inline

Add a Visibility to the look.

Parameters
nameThe name of the new Visibility. If no name is specified, then a unique name will automatically be generated.
Returns
A shared pointer to the new Visibility.

Definition at line 209 of file Look.h.

vector<MaterialAssignPtr> Look::getActiveMaterialAssigns ( ) const

Return a vector of all MaterialAssign elements that belong to this look, taking look inheritance into account.

vector<PropertyAssignPtr> Look::getActivePropertyAssigns ( ) const

Return a vector of all PropertyAssign elements that belong to this look, taking look inheritance into account.

vector<PropertySetAssignPtr> Look::getActivePropertySetAssigns ( ) const

Return a vector of all PropertySetAssign elements that belong to this look, taking look inheritance into account.

vector<VariantAssignPtr> Look::getActiveVariantAssigns ( ) const

Return a vector of all VariantAssign elements that belong to this look, taking look inheritance into account.

vector<VisibilityPtr> Look::getActiveVisibilities ( ) const

Return a vector of all Visibility elements that belong to this look, taking look inheritance into account.

MaterialAssignPtr Look::getMaterialAssign ( const string name) const
inline

Return the MaterialAssign, if any, with the given name.

Definition at line 71 of file Look.h.

vector<MaterialAssignPtr> Look::getMaterialAssigns ( ) const
inline

Return a vector of all MaterialAssign elements in the look.

Definition at line 77 of file Look.h.

PropertyAssignPtr Look::getPropertyAssign ( const string name) const
inline

Return the PropertyAssign, if any, with the given name.

Definition at line 107 of file Look.h.

vector<PropertyAssignPtr> Look::getPropertyAssigns ( ) const
inline

Return a vector of all PropertyAssign elements in the look.

Definition at line 113 of file Look.h.

PropertySetAssignPtr Look::getPropertySetAssign ( const string name) const
inline

Return the PropertySetAssign, if any, with the given name.

Definition at line 143 of file Look.h.

vector<PropertySetAssignPtr> Look::getPropertySetAssigns ( ) const
inline

Return a vector of all PropertySetAssign elements in the look.

Definition at line 149 of file Look.h.

VariantAssignPtr Look::getVariantAssign ( const string name) const
inline

Return the VariantAssign, if any, with the given name.

Definition at line 179 of file Look.h.

vector<VariantAssignPtr> Look::getVariantAssigns ( ) const
inline

Return a vector of all VariantAssign elements in the look.

Definition at line 185 of file Look.h.

vector<VisibilityPtr> Look::getVisibilities ( ) const
inline

Return a vector of all Visibility elements in the look.

Definition at line 221 of file Look.h.

VisibilityPtr Look::getVisibility ( const string name) const
inline

Return the Visibility, if any, with the given name.

Definition at line 215 of file Look.h.

void Look::removeMaterialAssign ( const string name)
inline

Remove the MaterialAssign, if any, with the given name.

Definition at line 87 of file Look.h.

void Look::removePropertyAssign ( const string name)
inline

Remove the PropertyAssign, if any, with the given name.

Definition at line 123 of file Look.h.

void Look::removePropertySetAssign ( const string name)
inline

Remove the PropertySetAssign, if any, with the given name.

Definition at line 159 of file Look.h.

void Look::removeVariantAssign ( const string name)
inline

Remove the VariantAssign, if any, with the given name.

Definition at line 195 of file Look.h.

void Look::removeVisibility ( const string name)
inline

Remove the Visibility, if any, with the given name.

Definition at line 231 of file Look.h.

Member Data Documentation

const string Look::CATEGORY
static

Definition at line 239 of file Look.h.


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