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 Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 /* ************************************************************************** */
27 /* ** ** */
28 /* ** This file is generated by a script. ** */
29 /* ** ** */
30 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
31 /* ** Edit hdGen/schema.py instead to make changes. ** */
32 /* ** ** */
33 /* ************************************************************************** */
34 
35 #ifndef PXR_IMAGING_HD_LEGACY_DISPLAY_STYLE_SCHEMA_H
36 #define PXR_IMAGING_HD_LEGACY_DISPLAY_STYLE_SCHEMA_H
37 
38 #include "pxr/imaging/hd/api.h"
39 
40 #include "pxr/imaging/hd/schema.h"
41 
42 // --(BEGIN CUSTOM CODE: Includes)--
43 // --(END CUSTOM CODE: Includes)--
44 
46 
47 //-----------------------------------------------------------------------------
48 
49 #define HD_LEGACY_DISPLAY_STYLE_SCHEMA_TOKENS \
50  (displayStyle) \
51  (refineLevel) \
52  (flatShadingEnabled) \
53  (displacementEnabled) \
54  (occludedSelectionShowsThrough) \
55  (pointsShadingEnabled) \
56  (materialIsFinal) \
57  (shadingStyle) \
58  (reprSelector) \
59  (cullStyle) \
60 
61 TF_DECLARE_PUBLIC_TOKENS(HdLegacyDisplayStyleSchemaTokens, HD_API,
63 
64 //-----------------------------------------------------------------------------
65 
67 {
68 public:
69  HdLegacyDisplayStyleSchema(HdContainerDataSourceHandle container)
70  : HdSchema(container) {}
71 
72 // --(BEGIN CUSTOM CODE: Schema Methods)--
73 // --(END CUSTOM CODE: Schema Methods)--
74 
75  //ACCESSORS
76 
77 
78  HD_API
80 
81  HD_API
83 
84  HD_API
86 
87  HD_API
89 
90  HD_API
92 
93  HD_API
95 
96  HD_API
98 
99  HD_API
101 
102  HD_API
104 
105  // RETRIEVING AND CONSTRUCTING
106 
107  /// Builds a container data source which includes the provided child data
108  /// sources. Parameters with nullptr values are excluded. This is a
109  /// low-level interface. For cases in which it's desired to define
110  /// the container with a sparse set of child fields, the Builder class
111  /// is often more convenient and readable.
112  HD_API
113  static HdContainerDataSourceHandle
115  const HdIntDataSourceHandle &refineLevel,
116  const HdBoolDataSourceHandle &flatShadingEnabled,
117  const HdBoolDataSourceHandle &displacementEnabled,
118  const HdBoolDataSourceHandle &occludedSelectionShowsThrough,
119  const HdBoolDataSourceHandle &pointsShadingEnabled,
120  const HdBoolDataSourceHandle &materialIsFinal,
121  const HdTokenDataSourceHandle &shadingStyle,
122  const HdTokenArrayDataSourceHandle &reprSelector,
123  const HdTokenDataSourceHandle &cullStyle
124  );
125 
126  /// \class HdLegacyDisplayStyleSchema::Builder
127  ///
128  /// Utility class for setting sparse sets of child data source fields to be
129  /// filled as arguments into BuildRetained. Because all setter methods
130  /// return a reference to the instance, this can be used in the "builder
131  /// pattern" form.
132  class Builder
133  {
134  public:
135  HD_API
137  const HdIntDataSourceHandle &refineLevel);
138  HD_API
140  const HdBoolDataSourceHandle &flatShadingEnabled);
141  HD_API
143  const HdBoolDataSourceHandle &displacementEnabled);
144  HD_API
146  const HdBoolDataSourceHandle &occludedSelectionShowsThrough);
147  HD_API
149  const HdBoolDataSourceHandle &pointsShadingEnabled);
150  HD_API
152  const HdBoolDataSourceHandle &materialIsFinal);
153  HD_API
155  const HdTokenDataSourceHandle &shadingStyle);
156  HD_API
158  const HdTokenArrayDataSourceHandle &reprSelector);
159  HD_API
161  const HdTokenDataSourceHandle &cullStyle);
162 
163  /// Returns a container data source containing the members set thus far.
164  HD_API
165  HdContainerDataSourceHandle Build();
166 
167  private:
168  HdIntDataSourceHandle _refineLevel;
169  HdBoolDataSourceHandle _flatShadingEnabled;
170  HdBoolDataSourceHandle _displacementEnabled;
171  HdBoolDataSourceHandle _occludedSelectionShowsThrough;
172  HdBoolDataSourceHandle _pointsShadingEnabled;
173  HdBoolDataSourceHandle _materialIsFinal;
174  HdTokenDataSourceHandle _shadingStyle;
175  HdTokenArrayDataSourceHandle _reprSelector;
176  HdTokenDataSourceHandle _cullStyle;
177  };
178 
179  /// Retrieves a container data source with the schema's default name token
180  /// "displayStyle" from the parent container and constructs a
181  /// HdLegacyDisplayStyleSchema instance.
182  /// Because the requested container data source may not exist, the result
183  /// should be checked with IsDefined() or a bool comparison before use.
184  HD_API
186  const HdContainerDataSourceHandle &fromParentContainer);
187 
188  /// Returns a token where the container representing this schema is found in
189  /// a container by default.
190  HD_API
191  static const TfToken &GetSchemaToken();
192 
193  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
194  /// where the container representing this schema is found by default.
195  HD_API
196  static const HdDataSourceLocator &GetDefaultLocator();
197 
198  // DATA SOURCE LOCATORS FOR MEMBERS
199  //
200  // The following methods return an HdDataSourceLocator (relative to the
201  // prim-level data source) where the data source for a member can be found.
202  //
203  // This is often useful for checking intersection against the
204  // HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
205 
206 
207  /// Prim-level relative data source locator to locate reprSelector.
208  HD_API
210 
211  /// Prim-level relative data source locator to locate cullStyle.
212  HD_API
214 
215 
216 };
217 
219 
220 #endif
HD_API HdBoolDataSourceHandle GetFlatShadingEnabled()
HD_API Builder & SetShadingStyle(const HdTokenDataSourceHandle &shadingStyle)
static HD_API const HdDataSourceLocator & GetReprSelectorLocator()
Prim-level relative data source locator to locate reprSelector.
#define HD_API
Definition: api.h:40
HD_API Builder & SetMaterialIsFinal(const HdBoolDataSourceHandle &materialIsFinal)
HD_API Builder & SetDisplacementEnabled(const HdBoolDataSourceHandle &displacementEnabled)
HD_API Builder & SetFlatShadingEnabled(const HdBoolDataSourceHandle &flatShadingEnabled)
static HD_API HdLegacyDisplayStyleSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdIntDataSourceHandle &refineLevel, const HdBoolDataSourceHandle &flatShadingEnabled, const HdBoolDataSourceHandle &displacementEnabled, const HdBoolDataSourceHandle &occludedSelectionShowsThrough, const HdBoolDataSourceHandle &pointsShadingEnabled, const HdBoolDataSourceHandle &materialIsFinal, const HdTokenDataSourceHandle &shadingStyle, const HdTokenArrayDataSourceHandle &reprSelector, const HdTokenDataSourceHandle &cullStyle)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
static HD_API const HdDataSourceLocator & GetCullStyleLocator()
Prim-level relative data source locator to locate cullStyle.
HdTokenArrayDataSource::Handle HdTokenArrayDataSourceHandle
HD_API HdBoolDataSourceHandle GetMaterialIsFinal()
Definition: token.h:87
HD_API Builder & SetOccludedSelectionShowsThrough(const HdBoolDataSourceHandle &occludedSelectionShowsThrough)
HD_API HdBoolDataSourceHandle GetPointsShadingEnabled()
HD_API HdBoolDataSourceHandle GetOccludedSelectionShowsThrough()
HD_API Builder & SetReprSelector(const HdTokenArrayDataSourceHandle &reprSelector)
HD_API Builder & SetPointsShadingEnabled(const HdBoolDataSourceHandle &pointsShadingEnabled)
#define HD_LEGACY_DISPLAY_STYLE_SCHEMA_TOKENS
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API HdIntDataSourceHandle GetRefineLevel()
HD_API HdTokenArrayDataSourceHandle GetReprSelector()
HD_API HdTokenDataSourceHandle GetCullStyle()
static HD_API const HdDataSourceLocator & GetDefaultLocator()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
TF_DECLARE_PUBLIC_TOKENS(HdLegacyDisplayStyleSchemaTokens, HD_API, HD_LEGACY_DISPLAY_STYLE_SCHEMA_TOKENS)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API Builder & SetCullStyle(const HdTokenDataSourceHandle &cullStyle)
HdIntDataSource::Handle HdIntDataSourceHandle
HD_API HdTokenDataSourceHandle GetShadingStyle()
HdLegacyDisplayStyleSchema(HdContainerDataSourceHandle container)
static HD_API const TfToken & GetSchemaToken()
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API Builder & SetRefineLevel(const HdIntDataSourceHandle &refineLevel)
HD_API HdBoolDataSourceHandle GetDisplacementEnabled()