legacyDisplayStyleSchema.h
1 //
2 // Copyright 2021 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 //
25 // This file is generated by a script. Do not edit directly. Edit the
26 // schema.template.h file to make changes.
27 
28 #ifndef PXR_IMAGING_HD_LEGACY_DISPLAY_STYLE_SCHEMA_H
29 #define PXR_IMAGING_HD_LEGACY_DISPLAY_STYLE_SCHEMA_H
30 
31 #include "pxr/imaging/hd/api.h"
32 
33 #include "pxr/imaging/hd/schema.h"
34 
35 PXR_NAMESPACE_OPEN_SCOPE
36 
37 //-----------------------------------------------------------------------------
38 
39 #define HDLEGACYDISPLAYSTYLE_SCHEMA_TOKENS \
40  (displayStyle) \
41  (refineLevel) \
42  (flatShadingEnabled) \
43  (displacementEnabled) \
44  (occludedSelectionShowsThrough) \
45  (pointsShadingEnabled) \
46  (materialIsFinal) \
47  (shadingStyle) \
48  (reprSelector) \
49  (cullStyle) \
50 
51 TF_DECLARE_PUBLIC_TOKENS(HdLegacyDisplayStyleSchemaTokens, HD_API,
52  HDLEGACYDISPLAYSTYLE_SCHEMA_TOKENS);
53 
54 //-----------------------------------------------------------------------------
55 
56 class HdLegacyDisplayStyleSchema : public HdSchema
57 {
58 public:
59  HdLegacyDisplayStyleSchema(HdContainerDataSourceHandle container)
60  : HdSchema(container) {}
61 
62  //ACCESSORS
63 
64  HD_API
65  HdIntDataSourceHandle GetRefineLevel();
66  HD_API
67  HdBoolDataSourceHandle GetFlatShadingEnabled();
68  HD_API
69  HdBoolDataSourceHandle GetDisplacementEnabled();
70  HD_API
71  HdBoolDataSourceHandle GetOccludedSelectionShowsThrough();
72  HD_API
73  HdBoolDataSourceHandle GetPointsShadingEnabled();
74  HD_API
75  HdBoolDataSourceHandle GetMaterialIsFinal();
76  HD_API
77  HdTokenDataSourceHandle GetShadingStyle();
78  HD_API
79  HdTokenArrayDataSourceHandle GetReprSelector();
80  HD_API
81  HdTokenDataSourceHandle GetCullStyle();
82 
83  // RETRIEVING AND CONSTRUCTING
84 
90  HD_API
91  static HdContainerDataSourceHandle
92  BuildRetained(
93  const HdIntDataSourceHandle &refineLevel,
94  const HdBoolDataSourceHandle &flatShadingEnabled,
95  const HdBoolDataSourceHandle &displacementEnabled,
96  const HdBoolDataSourceHandle &occludedSelectionShowsThrough,
97  const HdBoolDataSourceHandle &pointsShadingEnabled,
98  const HdBoolDataSourceHandle &materialIsFinal,
99  const HdTokenDataSourceHandle &shadingStyle,
100  const HdTokenArrayDataSourceHandle &reprSelector,
101  const HdTokenDataSourceHandle &cullStyle
102  );
103 
110  class Builder
111  {
112  public:
113  HD_API
114  Builder &SetRefineLevel(
115  const HdIntDataSourceHandle &refineLevel);
116  HD_API
117  Builder &SetFlatShadingEnabled(
118  const HdBoolDataSourceHandle &flatShadingEnabled);
119  HD_API
120  Builder &SetDisplacementEnabled(
121  const HdBoolDataSourceHandle &displacementEnabled);
122  HD_API
123  Builder &SetOccludedSelectionShowsThrough(
124  const HdBoolDataSourceHandle &occludedSelectionShowsThrough);
125  HD_API
126  Builder &SetPointsShadingEnabled(
127  const HdBoolDataSourceHandle &pointsShadingEnabled);
128  HD_API
129  Builder &SetMaterialIsFinal(
130  const HdBoolDataSourceHandle &materialIsFinal);
131  HD_API
132  Builder &SetShadingStyle(
133  const HdTokenDataSourceHandle &shadingStyle);
134  HD_API
135  Builder &SetReprSelector(
136  const HdTokenArrayDataSourceHandle &reprSelector);
137  HD_API
138  Builder &SetCullStyle(
139  const HdTokenDataSourceHandle &cullStyle);
140 
142  HD_API
143  HdContainerDataSourceHandle Build();
144 
145  private:
146  HdIntDataSourceHandle _refineLevel;
147  HdBoolDataSourceHandle _flatShadingEnabled;
148  HdBoolDataSourceHandle _displacementEnabled;
149  HdBoolDataSourceHandle _occludedSelectionShowsThrough;
150  HdBoolDataSourceHandle _pointsShadingEnabled;
151  HdBoolDataSourceHandle _materialIsFinal;
152  HdTokenDataSourceHandle _shadingStyle;
153  HdTokenArrayDataSourceHandle _reprSelector;
154  HdTokenDataSourceHandle _cullStyle;
155  };
156 
162  HD_API
163  static HdLegacyDisplayStyleSchema GetFromParent(
164  const HdContainerDataSourceHandle &fromParentContainer);
165 
168  HD_API
169  static const HdDataSourceLocator &GetDefaultLocator();
170 
171 
176  HD_API
177  static const HdDataSourceLocator &GetReprSelectorLocator();
178 
183  HD_API
184  static const HdDataSourceLocator &GetCullStyleLocator();
185 
186 };
187 
188 PXR_NAMESPACE_CLOSE_SCOPE
189 
190 #endif
Represents an object that can identify the location of a data source.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Definition: staticTokens.h:118
Utility class for setting sparse sets of child data source fields to be filled as arguments into Buil...
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
Schema classes represent a structured view of the inherently unstructured container data source passe...
Definition: schema.h:42