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

#include <smoothNormals.h>

+ Inheritance diagram for HdSt_SmoothNormalsComputationCPU:

Public Member Functions

HDST_API HdSt_SmoothNormalsComputationCPU (Hd_VertexAdjacency const *adjacency, HdBufferSourceSharedPtr const &points, TfToken const &dstName, HdBufferSourceSharedPtr const &adjacencyBuilder, bool packed)
 
HDST_API void GetBufferSpecs (HdBufferSpecVector *specs) const override
 
HDST_API bool Resolve () override
 
HDST_API TfToken constGetName () const override
 Return the name of this buffer source. More...
 
- Public Member Functions inherited from HdComputedBufferSource
virtual HD_API size_t ComputeHash () const override
 Computes and returns a hash value for the underlying data. More...
 
virtual HD_API void constGetData () const override
 Following interfaces will be called after Resolve. More...
 
virtual HD_API HdTupleType GetTupleType () const override
 Returns the data type and count (array size) for this buffer source. More...
 
virtual HD_API size_t GetNumElements () const override
 
- Public Member Functions inherited from HdBufferSource
 HdBufferSource ()
 
virtual HD_API ~HdBufferSource ()
 
bool IsResolved () const
 Returns true it this computation has already been resolved. More...
 
bool HasResolveError () const
 Returns true if an error occurred during resolve. More...
 
HD_API bool IsValid () const
 
virtual HD_API bool HasPreChainedBuffer () const
 Returns true if this buffer has a pre-chained buffer. More...
 
virtual HD_API
HdBufferSourceSharedPtr 
GetPreChainedBuffer () const
 Returns the pre-chained buffer. More...
 
virtual HD_API bool HasChainedBuffer () const
 Returns true if this buffer has any chained buffer(s) More...
 
virtual HD_API
HdBufferSourceSharedPtrVector 
GetChainedBuffers () const
 Returns the vector of chained buffers. More...
 

Protected Member Functions

HDST_API bool _CheckValid () const override
 
- Protected Member Functions inherited from HdComputedBufferSource
void _SetResult (HdBufferSourceSharedPtr const &result)
 
- Protected Member Functions inherited from HdBufferSource
void _SetResolved ()
 
void _SetResolveError ()
 
bool _TryLock ()
 

Detailed Description

Smooth normal computation CPU.

Definition at line 45 of file smoothNormals.h.

Constructor & Destructor Documentation

HDST_API HdSt_SmoothNormalsComputationCPU::HdSt_SmoothNormalsComputationCPU ( Hd_VertexAdjacency const adjacency,
HdBufferSourceSharedPtr const points,
TfToken const dstName,
HdBufferSourceSharedPtr const adjacencyBuilder,
bool  packed 
)

Member Function Documentation

HDST_API bool HdSt_SmoothNormalsComputationCPU::_CheckValid ( ) const
overrideprotectedvirtual

Checks the validity of the source buffer. This function is called by IsValid() to do the real checking.

Should only be implemented in classes at leafs of the class hierarchy (Please place common validation code in a new non-virtual method)

This code should return false:

  • If the buffer would produce an invalid BufferSpec
  • If a required dependent buffer is invalid For example, return false when: The data type is invalid, causing an invalid BufferSpec.

The resolve step requires a 'source' buffer and that buffer is invalid.

If returning false, the buffer will not be registered with the resource registry. AddBufferSpec and Resolve will not be called

Implements HdBufferSource.

HDST_API void HdSt_SmoothNormalsComputationCPU::GetBufferSpecs ( HdBufferSpecVector specs) const
overridevirtual

Add the buffer spec for this buffer source into given bufferspec vector. note: buffer specs has to be determined before the source resolution.

Implements HdBufferSource.

HDST_API TfToken const& HdSt_SmoothNormalsComputationCPU::GetName ( ) const
overridevirtual

Return the name of this buffer source.

Reimplemented from HdComputedBufferSource.

HDST_API bool HdSt_SmoothNormalsComputationCPU::Resolve ( )
overridevirtual

Prepare the access of GetData(). This process may include some computations (e.g. cpu smooth normals). Note: Resolve may be called in parallel from multiple threads across buffer sources, so be careful if it uses static/shared states among objects. Returns true if it resolved. If the buffer source has to wait some results of other buffer sources, or the buffer source is being resolved by other threads, it returns false.

Implements HdBufferSource.


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