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 /* ** This file is generated by a script. Do not edit directly. Edit ** */
28 /* ** defs.py or the (*)Schema.template.h files to make changes. ** */
29 /* ************************************************************************** */
30 
31 #ifndef PXR_IMAGING_HD_LEGACY_DISPLAY_STYLE_SCHEMA_H
32 #define PXR_IMAGING_HD_LEGACY_DISPLAY_STYLE_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDLEGACYDISPLAYSTYLE_SCHEMA_TOKENS \
43  (displayStyle) \
44  (refineLevel) \
45  (flatShadingEnabled) \
46  (displacementEnabled) \
47  (occludedSelectionShowsThrough) \
48  (pointsShadingEnabled) \
49  (materialIsFinal) \
50  (shadingStyle) \
51  (reprSelector) \
52  (cullStyle) \
53 
54 TF_DECLARE_PUBLIC_TOKENS(HdLegacyDisplayStyleSchemaTokens, HD_API,
56 
57 //-----------------------------------------------------------------------------
58 
60 {
61 public:
62  HdLegacyDisplayStyleSchema(HdContainerDataSourceHandle container)
63  : HdSchema(container) {}
64 
65  //ACCESSORS
66 
67  HD_API
69  HD_API
71  HD_API
73  HD_API
75  HD_API
77  HD_API
79  HD_API
81  HD_API
83  HD_API
85 
86  // RETRIEVING AND CONSTRUCTING
87 
88  /// Builds a container data source which includes the provided child data
89  /// sources. Parameters with nullptr values are excluded. This is a
90  /// low-level interface. For cases in which it's desired to define
91  /// the container with a sparse set of child fields, the Builder class
92  /// is often more convenient and readable.
93  HD_API
94  static HdContainerDataSourceHandle
96  const HdIntDataSourceHandle &refineLevel,
97  const HdBoolDataSourceHandle &flatShadingEnabled,
98  const HdBoolDataSourceHandle &displacementEnabled,
99  const HdBoolDataSourceHandle &occludedSelectionShowsThrough,
100  const HdBoolDataSourceHandle &pointsShadingEnabled,
101  const HdBoolDataSourceHandle &materialIsFinal,
102  const HdTokenDataSourceHandle &shadingStyle,
103  const HdTokenArrayDataSourceHandle &reprSelector,
104  const HdTokenDataSourceHandle &cullStyle
105  );
106 
107  /// \class HdLegacyDisplayStyleSchema::Builder
108  ///
109  /// Utility class for setting sparse sets of child data source fields to be
110  /// filled as arguments into BuildRetained. Because all setter methods
111  /// return a reference to the instance, this can be used in the "builder
112  /// pattern" form.
113  class Builder
114  {
115  public:
116  HD_API
118  const HdIntDataSourceHandle &refineLevel);
119  HD_API
121  const HdBoolDataSourceHandle &flatShadingEnabled);
122  HD_API
124  const HdBoolDataSourceHandle &displacementEnabled);
125  HD_API
127  const HdBoolDataSourceHandle &occludedSelectionShowsThrough);
128  HD_API
130  const HdBoolDataSourceHandle &pointsShadingEnabled);
131  HD_API
133  const HdBoolDataSourceHandle &materialIsFinal);
134  HD_API
136  const HdTokenDataSourceHandle &shadingStyle);
137  HD_API
139  const HdTokenArrayDataSourceHandle &reprSelector);
140  HD_API
142  const HdTokenDataSourceHandle &cullStyle);
143 
144  /// Returns a container data source containing the members set thus far.
145  HD_API
146  HdContainerDataSourceHandle Build();
147 
148  private:
149  HdIntDataSourceHandle _refineLevel;
150  HdBoolDataSourceHandle _flatShadingEnabled;
151  HdBoolDataSourceHandle _displacementEnabled;
152  HdBoolDataSourceHandle _occludedSelectionShowsThrough;
153  HdBoolDataSourceHandle _pointsShadingEnabled;
154  HdBoolDataSourceHandle _materialIsFinal;
155  HdTokenDataSourceHandle _shadingStyle;
156  HdTokenArrayDataSourceHandle _reprSelector;
157  HdTokenDataSourceHandle _cullStyle;
158  };
159 
160  /// Retrieves a container data source with the schema's default name token
161  /// "displayStyle" from the parent container and constructs a
162  /// HdLegacyDisplayStyleSchema instance.
163  /// Because the requested container data source may not exist, the result
164  /// should be checked with IsDefined() or a bool comparison before use.
165  HD_API
167  const HdContainerDataSourceHandle &fromParentContainer);
168 
169  /// Returns a token where the container representing this schema is found in
170  /// a container by default.
171  HD_API
172  static const TfToken &GetSchemaToken();
173 
174  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
175  /// where the container representing this schema is found by default.
176  HD_API
177  static const HdDataSourceLocator &GetDefaultLocator();
178 
179 
180  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
181  /// where the reprselector data source can be found.
182  /// This is often useful for checking intersection against the
183  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
184  HD_API
186 
187  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
188  /// where the cullstyle data source can be found.
189  /// This is often useful for checking intersection against the
190  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
191  HD_API
193 
194 };
195 
197 
198 #endif
HD_API HdBoolDataSourceHandle GetFlatShadingEnabled()
HD_API Builder & SetShadingStyle(const HdTokenDataSourceHandle &shadingStyle)
static HD_API const HdDataSourceLocator & GetReprSelectorLocator()
#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()
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)
HdBoolDataSource::Handle HdBoolDataSourceHandle
HD_API HdIntDataSourceHandle GetRefineLevel()
TF_DECLARE_PUBLIC_TOKENS(HdLegacyDisplayStyleSchemaTokens, HD_API, HDLEGACYDISPLAYSTYLE_SCHEMA_TOKENS)
HD_API HdTokenArrayDataSourceHandle GetReprSelector()
#define HDLEGACYDISPLAYSTYLE_SCHEMA_TOKENS
HD_API HdTokenDataSourceHandle GetCullStyle()
static HD_API const HdDataSourceLocator & GetDefaultLocator()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
#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()