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 
55 {
56 public:
57  /// \name Schema retrieval
58  /// @{
59 
60  HdLegacyDisplayStyleSchema(HdContainerDataSourceHandle container)
61  : HdSchema(container) {}
62 
63  /// Retrieves a container data source with the schema's default name token
64  /// "displayStyle" from the parent container and constructs a
65  /// HdLegacyDisplayStyleSchema instance.
66  /// Because the requested container data source may not exist, the result
67  /// should be checked with IsDefined() or a bool comparison before use.
68  HD_API
70  const HdContainerDataSourceHandle &fromParentContainer);
71 
72  /// @}
73 
74 // --(BEGIN CUSTOM CODE: Schema Methods)--
75 // --(END CUSTOM CODE: Schema Methods)--
76 
77  /// \name Member accessor
78  /// @{
79 
80  HD_API
82 
83  HD_API
85 
86  HD_API
88 
89  HD_API
91 
92  HD_API
94 
95  HD_API
97 
98  HD_API
100 
101  HD_API
103 
104  HD_API
106 
107  HD_API
109 
110  /// @}
111 
112  /// \name Schema location
113  /// @{
114 
115  /// Returns a token where the container representing this schema is found in
116  /// a container by default.
117  HD_API
118  static const TfToken &GetSchemaToken();
119 
120  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
121  /// where the container representing this schema is found by default.
122  HD_API
123  static const HdDataSourceLocator &GetDefaultLocator();
124 
125  /// @}
126 
127  /// \name Data source locators for members
128  ///
129  /// The following methods return an HdDataSourceLocator (relative to the
130  /// prim-level data source) where the data source for a member can be found.
131  ///
132  /// This is often useful for checking intersection against the
133  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
134  /// @{
135 
136  /// Prim-level relative data source locator to locate refineLevel.
137  HD_API
139 
140  /// Prim-level relative data source locator to locate flatShadingEnabled.
141  HD_API
143 
144  /// Prim-level relative data source locator to locate displacementEnabled.
145  HD_API
147 
148  /// Prim-level relative data source locator to locate displayInOverlay.
149  HD_API
151 
152  /// Prim-level relative data source locator to locate occludedSelectionShowsThrough.
153  HD_API
155 
156  /// Prim-level relative data source locator to locate pointsShadingEnabled.
157  HD_API
159 
160  /// Prim-level relative data source locator to locate materialIsFinal.
161  HD_API
163 
164  /// Prim-level relative data source locator to locate shadingStyle.
165  HD_API
167 
168  /// Prim-level relative data source locator to locate reprSelector.
169  HD_API
171 
172  /// Prim-level relative data source locator to locate cullStyle.
173  HD_API
175  /// @}
176 
177  /// \name Schema construction
178  /// @{
179 
180  /// \deprecated Use Builder instead.
181  ///
182  /// Builds a container data source which includes the provided child data
183  /// sources. Parameters with nullptr values are excluded. This is a
184  /// low-level interface. For cases in which it's desired to define
185  /// the container with a sparse set of child fields, the Builder class
186  /// is often more convenient and readable.
187  HD_API
188  static HdContainerDataSourceHandle
190  const HdIntDataSourceHandle &refineLevel,
191  const HdBoolDataSourceHandle &flatShadingEnabled,
192  const HdBoolDataSourceHandle &displacementEnabled,
193  const HdBoolDataSourceHandle &displayInOverlay,
194  const HdBoolDataSourceHandle &occludedSelectionShowsThrough,
195  const HdBoolDataSourceHandle &pointsShadingEnabled,
196  const HdBoolDataSourceHandle &materialIsFinal,
197  const HdTokenDataSourceHandle &shadingStyle,
198  const HdTokenArrayDataSourceHandle &reprSelector,
199  const HdTokenDataSourceHandle &cullStyle
200  );
201 
202  /// \class HdLegacyDisplayStyleSchema::Builder
203  ///
204  /// Utility class for setting sparse sets of child data source fields to be
205  /// filled as arguments into BuildRetained. Because all setter methods
206  /// return a reference to the instance, this can be used in the "builder
207  /// pattern" form.
208  class Builder
209  {
210  public:
211  HD_API
213  const HdIntDataSourceHandle &refineLevel);
214  HD_API
216  const HdBoolDataSourceHandle &flatShadingEnabled);
217  HD_API
219  const HdBoolDataSourceHandle &displacementEnabled);
220  HD_API
222  const HdBoolDataSourceHandle &displayInOverlay);
223  HD_API
225  const HdBoolDataSourceHandle &occludedSelectionShowsThrough);
226  HD_API
228  const HdBoolDataSourceHandle &pointsShadingEnabled);
229  HD_API
231  const HdBoolDataSourceHandle &materialIsFinal);
232  HD_API
234  const HdTokenDataSourceHandle &shadingStyle);
235  HD_API
237  const HdTokenArrayDataSourceHandle &reprSelector);
238  HD_API
240  const HdTokenDataSourceHandle &cullStyle);
241 
242  /// Returns a container data source containing the members set thus far.
243  HD_API
244  HdContainerDataSourceHandle Build();
245 
246  private:
247  HdIntDataSourceHandle _refineLevel;
248  HdBoolDataSourceHandle _flatShadingEnabled;
249  HdBoolDataSourceHandle _displacementEnabled;
250  HdBoolDataSourceHandle _displayInOverlay;
251  HdBoolDataSourceHandle _occludedSelectionShowsThrough;
252  HdBoolDataSourceHandle _pointsShadingEnabled;
253  HdBoolDataSourceHandle _materialIsFinal;
254  HdTokenDataSourceHandle _shadingStyle;
255  HdTokenArrayDataSourceHandle _reprSelector;
256  HdTokenDataSourceHandle _cullStyle;
257 
258  };
259 
260  /// @}
261 };
262 
264 
265 #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.
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()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
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)