HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
legacyDisplayStyleSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 ////////////////////////////////////////////////////////////////////////
8 
9 /* ************************************************************************** */
10 /* ** ** */
11 /* ** This file is generated by a script. ** */
12 /* ** ** */
13 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14 /* ** Edit hdSchemaDefs.py instead to make changes. ** */
15 /* ** ** */
16 /* ************************************************************************** */
17 
18 #ifndef PXR_IMAGING_HD_LEGACY_DISPLAY_STYLE_SCHEMA_H
19 #define PXR_IMAGING_HD_LEGACY_DISPLAY_STYLE_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
24 
25 #include "pxr/imaging/hd/schema.h"
26 
27 // --(BEGIN CUSTOM CODE: Includes)--
28 // --(END CUSTOM CODE: Includes)--
29 
31 
32 // --(BEGIN CUSTOM CODE: Declares)--
33 // --(END CUSTOM CODE: Declares)--
34 
35 #define HD_LEGACY_DISPLAY_STYLE_SCHEMA_TOKENS \
36  (displayStyle) \
37  (refineLevel) \
38  (flatShadingEnabled) \
39  (displacementEnabled) \
40  (displayInOverlay) \
41  (occludedSelectionShowsThrough) \
42  (pointsShadingEnabled) \
43  (materialIsFinal) \
44  (shadingStyle) \
45  (reprSelector) \
46  (cullStyle) \
47 
48 TF_DECLARE_PUBLIC_TOKENS(HdLegacyDisplayStyleSchemaTokens, HD_API,
50 
51 //-----------------------------------------------------------------------------
52 
53 
54 /// \class HdLegacyDisplayStyleSchema
55 ///
57 {
58 public:
59  /// \name Schema retrieval
60  /// @{
61 
62  HdLegacyDisplayStyleSchema(HdContainerDataSourceHandle container)
63  : HdSchema(container) {}
64 
65  /// Retrieves a container data source with the schema's default name token
66  /// "displayStyle" from the parent container and constructs a
67  /// HdLegacyDisplayStyleSchema instance.
68  /// Because the requested container data source may not exist, the result
69  /// should be checked with IsDefined() or a bool comparison before use.
70  HD_API
72  const HdContainerDataSourceHandle &fromParentContainer);
73 
74  /// @}
75 
76 // --(BEGIN CUSTOM CODE: Schema Methods)--
77 // --(END CUSTOM CODE: Schema Methods)--
78 
79  /// \name Member accessor
80  /// @{
81 
82  HD_API
84 
85  HD_API
87 
88  HD_API
90 
91  HD_API
93 
94  HD_API
96 
97  HD_API
99 
100  HD_API
102 
103  HD_API
105 
106  HD_API
108 
109  HD_API
111 
112  /// @}
113 
114  /// \name Schema location
115  /// @{
116 
117  /// Returns a token where the container representing this schema is found in
118  /// a container by default.
119  HD_API
120  static const TfToken &GetSchemaToken();
121 
122  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
123  /// where the container representing this schema is found by default.
124  HD_API
125  static const HdDataSourceLocator &GetDefaultLocator();
126 
127  /// @}
128 
129  /// \name Data source locators for members
130  ///
131  /// The following methods return an HdDataSourceLocator (relative to the
132  /// prim-level data source) where the data source for a member can be found.
133  ///
134  /// This is often useful for checking intersection against the
135  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
136  /// @{
137 
138  /// Prim-level relative data source locator to locate refineLevel.
139  HD_API
141 
142  /// Prim-level relative data source locator to locate flatShadingEnabled.
143  HD_API
145 
146  /// Prim-level relative data source locator to locate displacementEnabled.
147  HD_API
149 
150  /// Prim-level relative data source locator to locate displayInOverlay.
151  HD_API
153 
154  /// Prim-level relative data source locator to locate occludedSelectionShowsThrough.
155  HD_API
157 
158  /// Prim-level relative data source locator to locate pointsShadingEnabled.
159  HD_API
161 
162  /// Prim-level relative data source locator to locate materialIsFinal.
163  HD_API
165 
166  /// Prim-level relative data source locator to locate shadingStyle.
167  HD_API
169 
170  /// Prim-level relative data source locator to locate reprSelector.
171  HD_API
173 
174  /// Prim-level relative data source locator to locate cullStyle.
175  HD_API
177  /// @}
178 
179  /// \name Schema construction
180  /// @{
181 
182  /// \deprecated Use Builder instead.
183  ///
184  /// Builds a container data source which includes the provided child data
185  /// sources. Parameters with nullptr values are excluded. This is a
186  /// low-level interface. For cases in which it's desired to define
187  /// the container with a sparse set of child fields, the Builder class
188  /// is often more convenient and readable.
189  HD_API
190  static HdContainerDataSourceHandle
192  const HdIntDataSourceHandle &refineLevel,
193  const HdBoolDataSourceHandle &flatShadingEnabled,
194  const HdBoolDataSourceHandle &displacementEnabled,
195  const HdBoolDataSourceHandle &displayInOverlay,
196  const HdBoolDataSourceHandle &occludedSelectionShowsThrough,
197  const HdBoolDataSourceHandle &pointsShadingEnabled,
198  const HdBoolDataSourceHandle &materialIsFinal,
199  const HdTokenDataSourceHandle &shadingStyle,
200  const HdTokenArrayDataSourceHandle &reprSelector,
201  const HdTokenDataSourceHandle &cullStyle
202  );
203 
204  /// \class HdLegacyDisplayStyleSchema::Builder
205  ///
206  /// Utility class for setting sparse sets of child data source fields to be
207  /// filled as arguments into BuildRetained. Because all setter methods
208  /// return a reference to the instance, this can be used in the "builder
209  /// pattern" form.
210  class Builder
211  {
212  public:
213  HD_API
215  const HdIntDataSourceHandle &refineLevel);
216  HD_API
218  const HdBoolDataSourceHandle &flatShadingEnabled);
219  HD_API
221  const HdBoolDataSourceHandle &displacementEnabled);
222  HD_API
224  const HdBoolDataSourceHandle &displayInOverlay);
225  HD_API
227  const HdBoolDataSourceHandle &occludedSelectionShowsThrough);
228  HD_API
230  const HdBoolDataSourceHandle &pointsShadingEnabled);
231  HD_API
233  const HdBoolDataSourceHandle &materialIsFinal);
234  HD_API
236  const HdTokenDataSourceHandle &shadingStyle);
237  HD_API
239  const HdTokenArrayDataSourceHandle &reprSelector);
240  HD_API
242  const HdTokenDataSourceHandle &cullStyle);
243 
244  /// Returns a container data source containing the members set thus far.
245  HD_API
246  HdContainerDataSourceHandle Build();
247 
248  private:
249  HdIntDataSourceHandle _refineLevel;
250  HdBoolDataSourceHandle _flatShadingEnabled;
251  HdBoolDataSourceHandle _displacementEnabled;
252  HdBoolDataSourceHandle _displayInOverlay;
253  HdBoolDataSourceHandle _occludedSelectionShowsThrough;
254  HdBoolDataSourceHandle _pointsShadingEnabled;
255  HdBoolDataSourceHandle _materialIsFinal;
256  HdTokenDataSourceHandle _shadingStyle;
257  HdTokenArrayDataSourceHandle _reprSelector;
258  HdTokenDataSourceHandle _cullStyle;
259 
260  };
261 
262  /// @}
263 };
264 
266 
267 #endif
HD_API HdBoolDataSourceHandle GetOccludedSelectionShowsThrough() const
static HD_API const HdDataSourceLocator & GetFlatShadingEnabledLocator()
Prim-level relative data source locator to locate flatShadingEnabled.
HD_API Builder & SetShadingStyle(const HdTokenDataSourceHandle &shadingStyle)
static HD_API const HdDataSourceLocator & GetPointsShadingEnabledLocator()
Prim-level relative data source locator to locate pointsShadingEnabled.
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
static HD_API const HdDataSourceLocator & GetRefineLevelLocator()
Prim-level relative data source locator to locate refineLevel.
HD_API HdBoolDataSourceHandle GetFlatShadingEnabled() const
HD_API HdTokenArrayDataSourceHandle GetReprSelector() const
HD_API HdBoolDataSourceHandle GetDisplacementEnabled() const
static HD_API const HdDataSourceLocator & GetReprSelectorLocator()
Prim-level relative data source locator to locate reprSelector.
#define HD_API
Definition: api.h:23
HD_API Builder & SetMaterialIsFinal(const HdBoolDataSourceHandle &materialIsFinal)
HD_API Builder & SetDisplacementEnabled(const HdBoolDataSourceHandle &displacementEnabled)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdIntDataSourceHandle &refineLevel, const HdBoolDataSourceHandle &flatShadingEnabled, const HdBoolDataSourceHandle &displacementEnabled, const HdBoolDataSourceHandle &displayInOverlay, const HdBoolDataSourceHandle &occludedSelectionShowsThrough, const HdBoolDataSourceHandle &pointsShadingEnabled, const HdBoolDataSourceHandle &materialIsFinal, const HdTokenDataSourceHandle &shadingStyle, const HdTokenArrayDataSourceHandle &reprSelector, const HdTokenDataSourceHandle &cullStyle)
HD_API Builder & SetFlatShadingEnabled(const HdBoolDataSourceHandle &flatShadingEnabled)
static HD_API HdLegacyDisplayStyleSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API HdBoolDataSourceHandle GetPointsShadingEnabled() const
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static HD_API const HdDataSourceLocator & GetDisplayInOverlayLocator()
Prim-level relative data source locator to locate displayInOverlay.
static HD_API const HdDataSourceLocator & GetCullStyleLocator()
Prim-level relative data source locator to locate cullStyle.
HdTokenArrayDataSource::Handle HdTokenArrayDataSourceHandle
Definition: token.h:70
HD_API Builder & SetOccludedSelectionShowsThrough(const HdBoolDataSourceHandle &occludedSelectionShowsThrough)
HD_API HdBoolDataSourceHandle GetDisplayInOverlay() const
HD_API Builder & SetReprSelector(const HdTokenArrayDataSourceHandle &reprSelector)
HD_API Builder & SetDisplayInOverlay(const HdBoolDataSourceHandle &displayInOverlay)
HD_API Builder & SetPointsShadingEnabled(const HdBoolDataSourceHandle &pointsShadingEnabled)
#define HD_LEGACY_DISPLAY_STYLE_SCHEMA_TOKENS
static HD_API const HdDataSourceLocator & GetOccludedSelectionShowsThroughLocator()
Prim-level relative data source locator to locate occludedSelectionShowsThrough.
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API HdIntDataSourceHandle GetRefineLevel() const
static HD_API const HdDataSourceLocator & GetDisplacementEnabledLocator()
Prim-level relative data source locator to locate displacementEnabled.
static HD_API const HdDataSourceLocator & GetMaterialIsFinalLocator()
Prim-level relative data source locator to locate materialIsFinal.
static HD_API const HdDataSourceLocator & GetShadingStyleLocator()
Prim-level relative data source locator to locate shadingStyle.
static HD_API const HdDataSourceLocator & GetDefaultLocator()
TF_DECLARE_PUBLIC_TOKENS(HdLegacyDisplayStyleSchemaTokens, HD_API, HD_LEGACY_DISPLAY_STYLE_SCHEMA_TOKENS)
HD_API HdTokenDataSourceHandle GetCullStyle() const
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API HdBoolDataSourceHandle GetMaterialIsFinal() const
HD_API Builder & SetCullStyle(const HdTokenDataSourceHandle &cullStyle)
HdIntDataSource::Handle HdIntDataSourceHandle
HdLegacyDisplayStyleSchema(HdContainerDataSourceHandle container)
HD_API HdTokenDataSourceHandle GetShadingStyle() const
static HD_API const TfToken & GetSchemaToken()
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API Builder & SetRefineLevel(const HdIntDataSourceHandle &refineLevel)