Loading...
Searching...
No Matches
HdReprSelector Class Reference

Describes one or more authored display representations for an rprim. More...

#include <repr.h>

Public Member Functions

 HdReprSelector (TfToken const &token)
 
 HdReprSelector (TfToken const &refined, TfToken const &unrefined)
 
 HdReprSelector (TfToken const &refined, TfToken const &unrefined, TfToken const &points)
 
HD_API bool Contains (const TfToken &reprToken) const
 Returns true if the passed in reprToken is in the set of tokens for any topology index.
 
HD_API bool IsActiveRepr (size_t topologyIndex) const
 Returns true if the topology token at an index is active, i.e., neither empty nor disabled.
 
HD_API bool AnyActiveRepr () const
 Returns true if any of the topology tokens is valid, i.e., neither empty nor disabled.
 
HD_API HdReprSelector CompositeOver (const HdReprSelector &under) const
 Returns a selector that is the composite of this selector 'over' the passed in selector.
 
HD_API bool operator== (const HdReprSelector &rhs) const
 
HD_API bool operator!= (const HdReprSelector &rhs) const
 
HD_API bool operator< (const HdReprSelector &rhs) const
 
HD_API size_t Hash () const
 
HD_API char const * GetText () const
 
HD_API TfToken const & operator[] (size_t topologyIndex) const
 

Static Public Attributes

static const size_t MAX_TOPOLOGY_REPRS = 3
 Currenly support upto 3 topology tokens.
 

Friends

HD_API friend std::ostream & operator<< (std::ostream &stream, HdReprSelector const &t)
 
template<class HashState >
void TfHashAppend (HashState &h, HdReprSelector const &rs)
 

Detailed Description

Describes one or more authored display representations for an rprim.

Display opinions are separated by the topology index they represent. This allows the application to specify one or more topological representations for a given HdRprim. For some visualizations, an application may choose to provide an opinion for the display of the refined surface, the unrefined hull and the points separately from the rprim's authored opinions. HdReprSelector allows these opinions to compose/merge into a final composite representation to be used for rendering.

Definition at line 48 of file repr.h.

Constructor & Destructor Documentation

◆ HdReprSelector() [1/4]

HdReprSelector ( )
inlineexplicit

Definition at line 51 of file repr.h.

◆ HdReprSelector() [2/4]

HdReprSelector ( TfToken const &  token)
inlineexplicit

Definition at line 56 of file repr.h.

◆ HdReprSelector() [3/4]

HdReprSelector ( TfToken const &  refined,
TfToken const &  unrefined 
)
inlineexplicit

Definition at line 61 of file repr.h.

◆ HdReprSelector() [4/4]

HdReprSelector ( TfToken const &  refined,
TfToken const &  unrefined,
TfToken const &  points 
)
inlineexplicit

Definition at line 68 of file repr.h.

Member Function Documentation

◆ AnyActiveRepr()

HD_API bool AnyActiveRepr ( ) const

Returns true if any of the topology tokens is valid, i.e., neither empty nor disabled.

◆ CompositeOver()

HD_API HdReprSelector CompositeOver ( const HdReprSelector under) const

Returns a selector that is the composite of this selector 'over' the passed in selector.

For each token that IsEmpty in this selector return the corresponding token in the passed in selector. Effectively this performs a merge operation where this selector wins for each topological index it has an opinion on.

◆ Contains()

HD_API bool Contains ( const TfToken reprToken) const

Returns true if the passed in reprToken is in the set of tokens for any topology index.

◆ IsActiveRepr()

HD_API bool IsActiveRepr ( size_t  topologyIndex) const

Returns true if the topology token at an index is active, i.e., neither empty nor disabled.

Friends And Related Function Documentation

◆ TfHashAppend

void TfHashAppend ( HashState &  h,
HdReprSelector const &  rs 
)
friend

Definition at line 130 of file repr.h.

Member Data Documentation

◆ MAX_TOPOLOGY_REPRS

const size_t MAX_TOPOLOGY_REPRS = 3
static

Currenly support upto 3 topology tokens.

Definition at line 77 of file repr.h.


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