HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdStBasisCurves Class Referencefinal

#include <basisCurves.h>

+ Inheritance diagram for HdStBasisCurves:

Public Member Functions

 HF_MALLOC_TAG_NEW ("new HdStBasisCurves")
 
HDST_API HdStBasisCurves (SdfPath const &id)
 
HDST_API ~HdStBasisCurves () override
 
HDST_API void UpdateRenderTag (HdSceneDelegate *delegate, HdRenderParam *renderParam) override
 
HDST_API void Sync (HdSceneDelegate *delegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits, TfToken const &reprToken) override
 
HDST_API void Finalize (HdRenderParam *renderParam) override
 
HDST_API HdDirtyBits GetInitialDirtyBitsMask () const override
 
HDST_API TfTokenVector const & GetBuiltinPrimvarNames () const override
 
- Public Member Functions inherited from HdBasisCurves
HD_API ~HdBasisCurves () override
 
HdBasisCurvesTopology GetBasisCurvesTopology (HdSceneDelegate *delegate) const
 
HdDisplayStyle GetDisplayStyle (HdSceneDelegate *delegate) const
 
- Public Member Functions inherited from HdRprim
HD_API HdRprim (SdfPath const &id)
 
virtual HD_API ~HdRprim ()
 
HD_API const
HdRepr::DrawItemUniquePtrVector
GetDrawItems (TfToken const &reprToken) const
 
SdfPath const & GetId () const
 
int32_t GetPrimId () const
 Return the unique instance id. More...
 
HD_API void SetPrimId (int32_t primId)
 Set the unique instance id. More...
 
SdfPath const & GetInstancerId () const
 
SdfPath const & GetMaterialId () const
 
HD_API void SetMaterialId (SdfPath const &materialId)
 Sets a new material binding to be used by this rprim. More...
 
HdReprSelector const & GetReprSelector () const
 
TfToken const & GetRenderTag () const
 
TfToken GetRenderTag (HdSceneDelegate *delegate) const
 Returns the render tag associated to this rprim. More...
 
GfRange3d GetExtent (HdSceneDelegate *delegate) const
 Returns the bounds of the rprim in local, untransformed space. More...
 
HdPrimvarDescriptorVector GetPrimvarDescriptors (HdSceneDelegate *delegate, HdInterpolation interpolation) const
 Primvar Query. More...
 
VtValue GetPrimvar (HdSceneDelegate *delegate, const TfToken &name) const
 
VtValue GetIndexedPrimvar (HdSceneDelegate *delegate, const TfToken &name, VtIntArray *indices) const
 
HD_API VtMatrix4dArray GetInstancerTransforms (HdSceneDelegate *delegate)
 
HD_API bool IsDirty (HdChangeTracker &changeTracker) const
 Returns true if any dirty flags are set for this rprim. More...
 
bool IsVisible () const
 Is the prim itself visible. More...
 
HD_API void UpdateReprSelector (HdSceneDelegate *delegate, HdDirtyBits *dirtyBits)
 
HD_API bool CanSkipDirtyBitPropagationAndSync (HdDirtyBits bits) const
 
HD_API HdDirtyBits PropagateRprimDirtyBits (HdDirtyBits bits)
 
HD_API void InitRepr (HdSceneDelegate *delegate, TfToken const &reprToken, HdDirtyBits *dirtyBits)
 

Protected Member Functions

HDST_API void _InitRepr (TfToken const &reprToken, HdDirtyBits *dirtyBits) override
 
HDST_API HdDirtyBits _PropagateDirtyBits (HdDirtyBits bits) const override
 
void _UpdateRepr (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, TfToken const &reprToken, HdDirtyBits *dirtyBitsState)
 
void _PopulateTopology (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdStDrawItem *drawItem, HdDirtyBits *dirtyBits, const HdBasisCurvesReprDesc &desc)
 
void _PopulateVertexPrimvars (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdStDrawItem *drawItem, HdDirtyBits *dirtyBits)
 
void _PopulateVaryingPrimvars (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdStDrawItem *drawItem, HdDirtyBits *dirtyBits)
 
void _PopulateElementPrimvars (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdStDrawItem *drawItem, HdDirtyBits *dirtyBits)
 
- Protected Member Functions inherited from HdBasisCurves
HD_API HdBasisCurves (SdfPath const &id)
 
- Protected Member Functions inherited from HdRprim
HD_API HdReprSharedPtr const & _GetRepr (TfToken const &reprToken) const
 
HD_API void _UpdateVisibility (HdSceneDelegate *sceneDelegate, HdDirtyBits *dirtyBits)
 
HD_API void _UpdateInstancer (HdSceneDelegate *sceneDelegate, HdDirtyBits *dirtyBits)
 

Additional Inherited Members

- Static Public Member Functions inherited from HdBasisCurves
static HD_API void ConfigureRepr (TfToken const &reprName, HdBasisCurvesReprDesc desc)
 Configure geometric style of drawItems for reprName. More...
 
static HD_API bool IsEnabledForceRefinedCurves ()
 Returns whether refinement is always on or not. More...
 
- Protected Types inherited from HdBasisCurves
using _BasisCurvesReprConfig = _ReprDescConfigs< HdBasisCurvesReprDesc >
 
- Protected Types inherited from HdRprim
using _ReprVector = std::vector< std::pair< TfToken, HdReprSharedPtr >>
 
- Static Protected Member Functions inherited from HdBasisCurves
static HD_API
_BasisCurvesReprConfig::DescArray 
_GetReprDesc (TfToken const &reprName)
 
- Protected Attributes inherited from HdRprim
HdRprimSharedData _sharedData
 
HdReprSelector _authoredReprSelector
 
TfToken _renderTag
 
_ReprVector _reprs
 

Detailed Description

A collection of curves using a particular basis.

Render mode is dependent on both the HdBasisCurvesGeomStyle, refinement level, and the authored primvars.

If style is set to HdBasisCurvesGeomStyleWire, the curves will always draw as infinitely thin wires. Cubic curves will be refined if complexity is above 0, otherwise they draw the unrefined control points. (This may provide a misleading representation for Catmull-Rom and Bspline curves.)

If style is set to HdBasisCurvesGeomStylePatch, the curves will draw as patches ONLY if refinement level is above 0. Otherwise, they draw as the unrefined control points (see notes on HdBasisCurvesGeomStyleWire).

Curves rendered as patches may be rendered as ribbons or halftubes. Curves with primvar authored normals will always render as ribbons. Curves without primvar authored normals are assumed to be round and may be rendered in one of three styles:

  • if complexity is 1, a camera facing normal is used
  • if complexity is 2, a fake "bumped" round normal is used
  • if complexity is 3 or above, the patch is displaced into a half tube We plan for future checkins will remove the need for the camera facing normal mode, using the fake "bumped" round normal instead.

Definition at line 71 of file basisCurves.h.

Constructor & Destructor Documentation

HDST_API HdStBasisCurves::HdStBasisCurves ( SdfPath const &  id)
HDST_API HdStBasisCurves::~HdStBasisCurves ( )
override

Member Function Documentation

HDST_API void HdStBasisCurves::_InitRepr ( TfToken const &  reprToken,
HdDirtyBits dirtyBits 
)
overrideprotectedvirtual

Initialize the given representation of this Rprim. This is called prior to syncing the prim, the first time the repr is used.

reprToken is the name of the representation to initalize.

dirtyBits is an in/out value. It is initialized to the dirty bits from the change tracker. InitRepr can then set additional dirty bits if additional data is required from the scene delegate when this repr is synced. InitRepr occurs before dirty bit propagation.

See HdRprim::InitRepr()

Implements HdRprim.

void HdStBasisCurves::_PopulateElementPrimvars ( HdSceneDelegate sceneDelegate,
HdRenderParam renderParam,
HdStDrawItem drawItem,
HdDirtyBits dirtyBits 
)
protected
void HdStBasisCurves::_PopulateTopology ( HdSceneDelegate sceneDelegate,
HdRenderParam renderParam,
HdStDrawItem drawItem,
HdDirtyBits dirtyBits,
const HdBasisCurvesReprDesc desc 
)
protected
void HdStBasisCurves::_PopulateVaryingPrimvars ( HdSceneDelegate sceneDelegate,
HdRenderParam renderParam,
HdStDrawItem drawItem,
HdDirtyBits dirtyBits 
)
protected
void HdStBasisCurves::_PopulateVertexPrimvars ( HdSceneDelegate sceneDelegate,
HdRenderParam renderParam,
HdStDrawItem drawItem,
HdDirtyBits dirtyBits 
)
protected
HDST_API HdDirtyBits HdStBasisCurves::_PropagateDirtyBits ( HdDirtyBits  bits) const
overrideprotectedvirtual

This callback from Rprim gives the prim an opportunity to set additional dirty bits based on those already set. This is done before the dirty bits are passed to the scene delegate, so can be used to communicate that extra information is needed by the prim to process the changes.

The return value is the new set of dirty bits, which replaces the bits passed in.

See HdRprim::PropagateRprimDirtyBits()

Implements HdRprim.

void HdStBasisCurves::_UpdateRepr ( HdSceneDelegate sceneDelegate,
HdRenderParam renderParam,
TfToken const &  reprToken,
HdDirtyBits dirtyBitsState 
)
protected
HDST_API void HdStBasisCurves::Finalize ( HdRenderParam renderParam)
overridevirtual

Finalizes object resources. This function might not delete resources, but it should deal with resource ownership so that the rprim is deletable.

Reimplemented from HdRprim.

HDST_API TfTokenVector const& HdStBasisCurves::GetBuiltinPrimvarNames ( ) const
overridevirtual

Returns the names of built-in primvars, i.e. primvars that are part of the core geometric schema for this prim.

Reimplemented from HdBasisCurves.

HDST_API HdDirtyBits HdStBasisCurves::GetInitialDirtyBitsMask ( ) const
overridevirtual

Returns the set of dirty bits that should be added to the change tracker for this prim, when this prim is inserted.

Implements HdRprim.

HdStBasisCurves::HF_MALLOC_TAG_NEW ( "new HdStBasisCurves )
HDST_API void HdStBasisCurves::Sync ( HdSceneDelegate delegate,
HdRenderParam renderParam,
HdDirtyBits dirtyBits,
TfToken const &  reprToken 
)
overridevirtual

Pull invalidated scene data and prepare/update the renderable representation.

This function is told which scene data to pull through the dirtyBits parameter. The first time it's called, dirtyBits comes from _GetInitialDirtyBits(), which provides initial dirty state, but after that it's driven by invalidation tracking in the scene delegate.

The contract for this function is that the prim can only pull on scene delegate buffers that are marked dirty. Scene delegates can and do implement just-in-time data schemes that mean that pulling on clean data will be at best incorrect, and at worst a crash.

This function is called in parallel from worker threads, so it needs to be threadsafe; calls into HdSceneDelegate are ok.

Parameters
sceneDelegateThe data source for this geometry item.
renderParamA render delegate object that holds rendering parameters that scene geometry may use.
dirtyBitsA specifier for which scene data has changed.
reprTokenThe representation that needs to be updated. This is useful for backends that support multiple display representations for an rprim. A given representation may choose to pull on a subset of the dirty state.
dirtyBitsOn input specifies which state is dirty and can be pulled from the scene delegate. On output specifies which bits are still dirty and were not cleaned by the sync.

Implements HdRprim.

HDST_API void HdStBasisCurves::UpdateRenderTag ( HdSceneDelegate delegate,
HdRenderParam renderParam 
)
overridevirtual

Returns the identifier of this Rprim. This is both used in the RenderIndex and the SceneDelegate and acts as the associative key for the Rprim in both contexts.

Reimplemented from HdRprim.


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