Loading...
Searching...
No Matches
basisCurves.h
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7#ifndef PXR_IMAGING_HD_BASIS_CURVES_H
8#define PXR_IMAGING_HD_BASIS_CURVES_H
9
10#include "pxr/pxr.h"
11#include "pxr/imaging/hd/api.h"
12#include "pxr/imaging/hd/version.h"
13#include "pxr/imaging/hd/rprim.h"
14
15PXR_NAMESPACE_OPEN_SCOPE
16
17#define HD_BASISCURVES_REPR_DESC_TOKENS \
18 (surfaceShader) \
19 (surfaceShaderUnlit) \
20 (hullColor) \
21 (pointColor)
22
23TF_DECLARE_PUBLIC_TOKENS(HdBasisCurvesReprDescTokens, HD_API,
24 HD_BASISCURVES_REPR_DESC_TOKENS);
25
31{
33 HdBasisCurvesGeomStyle geomStyle = HdBasisCurvesGeomStyleInvalid,
34 TfToken shadingTerminal = HdBasisCurvesReprDescTokens->surfaceShader)
35 : geomStyle(geomStyle),
37 {}
38
39 bool IsEmpty() const {
40 return geomStyle == HdBasisCurvesGeomStyleInvalid;
41 }
42
43 HdBasisCurvesGeomStyle geomStyle;
47};
48
51class HdBasisCurves : public HdRprim
52{
53public:
54 HD_API
55 ~HdBasisCurves() override;
56
61 inline HdDisplayStyle GetDisplayStyle(HdSceneDelegate* delegate) const;
62
63 HD_API
64 TfTokenVector const & GetBuiltinPrimvarNames() const override;
65
67 HD_API
68 static void ConfigureRepr(TfToken const &reprName,
70
72 HD_API
74
75protected:
76 HD_API
77 HdBasisCurves(SdfPath const& id);
78
79 using _BasisCurvesReprConfig = _ReprDescConfigs<HdBasisCurvesReprDesc>;
80
81 HD_API
82 static _BasisCurvesReprConfig::DescArray
83 _GetReprDesc(TfToken const &reprName);
84
85private:
86 // Class can not be default constructed or copied.
87 HdBasisCurves() = delete;
88 HdBasisCurves(const HdBasisCurves &) = delete;
89 HdBasisCurves &operator =(const HdBasisCurves &) = delete;
90
91 static _BasisCurvesReprConfig _reprDescConfig;
92};
93
96{
97 return delegate->GetBasisCurvesTopology(GetId());
98}
99
100inline HdDisplayStyle
101HdBasisCurves::GetDisplayStyle(HdSceneDelegate* delegate) const
102{
103 return delegate->GetDisplayStyle(GetId());
104}
105
106
107PXR_NAMESPACE_CLOSE_SCOPE
108
109#endif // PXR_IMAGING_HD_BASIS_CURVES_H
Hydra Schema for a collection of curves using a particular basis.
Definition: basisCurves.h:52
static HD_API bool IsEnabledForceRefinedCurves()
Returns whether refinement is always on or not.
static HD_API void ConfigureRepr(TfToken const &reprName, HdBasisCurvesReprDesc desc)
Configure geometric style of drawItems for reprName.
HdBasisCurvesTopology GetBasisCurvesTopology(HdSceneDelegate *delegate) const
Topology.
Definition: basisCurves.h:95
HD_API TfTokenVector const & GetBuiltinPrimvarNames() const override
Returns the names of built-in primvars, i.e.
Topology data for basisCurves.
The render engine state for a given rprim from the scene graph.
Definition: rprim.h:38
SdfPath const & GetId() const
Returns the identifier of this Rprim.
Definition: rprim.h:146
Adapter class providing data exchange with the client scene graph.
virtual HD_API HdDisplayStyle GetDisplayStyle(SdfPath const &id)
Returns the display style for the given prim.
virtual HD_API HdBasisCurvesTopology GetBasisCurvesTopology(SdfPath const &id)
Gets the topological curve data for a given prim.
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:92
Descriptor to configure a drawItem for a repr.
Definition: basisCurves.h:31
TfToken shadingTerminal
Specifies how the fragment color should be computed from primvar; this can be used to render heatmap ...
Definition: basisCurves.h:46
Describes how the geometry of a prim should be displayed.
Definition: sceneDelegate.h:64
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440