HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
modelSchema.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_MODEL_SCHEMA_H
32 #define PXR_IMAGING_HD_MODEL_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDMODEL_SCHEMA_TOKENS \
43  (model) \
44  (drawMode) \
45  (applyDrawMode) \
46  (drawModeColor) \
47  (cardGeometry) \
48  (cardTextureXPos) \
49  (cardTextureYPos) \
50  (cardTextureZPos) \
51  (cardTextureXNeg) \
52  (cardTextureYNeg) \
53  (cardTextureZNeg) \
54  (inherited) \
55  (origin) \
56  (bounds) \
57  (cards) \
58  ((default_, "default")) \
59  (cross) \
60  (box) \
61  (fromTexture) \
62 
63 TF_DECLARE_PUBLIC_TOKENS(HdModelSchemaTokens, HD_API,
65 
66 //-----------------------------------------------------------------------------
67 
68 class HdModelSchema : public HdSchema
69 {
70 public:
71  HdModelSchema(HdContainerDataSourceHandle container)
72  : HdSchema(container) {}
73 
74  //ACCESSORS
75 
76  HD_API
78  HD_API
80  HD_API
82  HD_API
84  HD_API
86  HD_API
88  HD_API
90  HD_API
92  HD_API
94  HD_API
96 
97  // RETRIEVING AND CONSTRUCTING
98 
99  /// Builds a container data source which includes the provided child data
100  /// sources. Parameters with nullptr values are excluded. This is a
101  /// low-level interface. For cases in which it's desired to define
102  /// the container with a sparse set of child fields, the Builder class
103  /// is often more convenient and readable.
104  HD_API
105  static HdContainerDataSourceHandle
107  const HdTokenDataSourceHandle &drawMode,
108  const HdBoolDataSourceHandle &applyDrawMode,
109  const HdVec3fDataSourceHandle &drawModeColor,
110  const HdTokenDataSourceHandle &cardGeometry,
111  const HdAssetPathDataSourceHandle &cardTextureXPos,
112  const HdAssetPathDataSourceHandle &cardTextureYPos,
113  const HdAssetPathDataSourceHandle &cardTextureZPos,
114  const HdAssetPathDataSourceHandle &cardTextureXNeg,
115  const HdAssetPathDataSourceHandle &cardTextureYNeg,
116  const HdAssetPathDataSourceHandle &cardTextureZNeg
117  );
118 
119  /// \class HdModelSchema::Builder
120  ///
121  /// Utility class for setting sparse sets of child data source fields to be
122  /// filled as arguments into BuildRetained. Because all setter methods
123  /// return a reference to the instance, this can be used in the "builder
124  /// pattern" form.
125  class Builder
126  {
127  public:
128  HD_API
130  const HdTokenDataSourceHandle &drawMode);
131  HD_API
133  const HdBoolDataSourceHandle &applyDrawMode);
134  HD_API
136  const HdVec3fDataSourceHandle &drawModeColor);
137  HD_API
139  const HdTokenDataSourceHandle &cardGeometry);
140  HD_API
142  const HdAssetPathDataSourceHandle &cardTextureXPos);
143  HD_API
145  const HdAssetPathDataSourceHandle &cardTextureYPos);
146  HD_API
148  const HdAssetPathDataSourceHandle &cardTextureZPos);
149  HD_API
151  const HdAssetPathDataSourceHandle &cardTextureXNeg);
152  HD_API
154  const HdAssetPathDataSourceHandle &cardTextureYNeg);
155  HD_API
157  const HdAssetPathDataSourceHandle &cardTextureZNeg);
158 
159  /// Returns a container data source containing the members set thus far.
160  HD_API
161  HdContainerDataSourceHandle Build();
162 
163  private:
164  HdTokenDataSourceHandle _drawMode;
165  HdBoolDataSourceHandle _applyDrawMode;
166  HdVec3fDataSourceHandle _drawModeColor;
167  HdTokenDataSourceHandle _cardGeometry;
168  HdAssetPathDataSourceHandle _cardTextureXPos;
169  HdAssetPathDataSourceHandle _cardTextureYPos;
170  HdAssetPathDataSourceHandle _cardTextureZPos;
171  HdAssetPathDataSourceHandle _cardTextureXNeg;
172  HdAssetPathDataSourceHandle _cardTextureYNeg;
173  HdAssetPathDataSourceHandle _cardTextureZNeg;
174  };
175 
176  /// Retrieves a container data source with the schema's default name token
177  /// "model" from the parent container and constructs a
178  /// HdModelSchema instance.
179  /// Because the requested container data source may not exist, the result
180  /// should be checked with IsDefined() or a bool comparison before use.
181  HD_API
183  const HdContainerDataSourceHandle &fromParentContainer);
184 
185  /// Returns a token where the container representing this schema is found in
186  /// a container by default.
187  HD_API
188  static const TfToken &GetSchemaToken();
189 
190  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
191  /// where the container representing this schema is found by default.
192  HD_API
193  static const HdDataSourceLocator &GetDefaultLocator();
194 
195 
196  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
197  /// where the drawmode data source can be found.
198  /// This is often useful for checking intersection against the
199  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
200  HD_API
201  static const HdDataSourceLocator &GetDrawModeLocator();
202 
203 };
204 
206 
207 #endif
HD_API HdVec3fDataSourceHandle GetDrawModeColor()
HD_API Builder & SetCardTextureZNeg(const HdAssetPathDataSourceHandle &cardTextureZNeg)
static HD_API const HdDataSourceLocator & GetDrawModeLocator()
HD_API HdAssetPathDataSourceHandle GetCardTextureYNeg()
HD_API Builder & SetApplyDrawMode(const HdBoolDataSourceHandle &applyDrawMode)
HD_API HdAssetPathDataSourceHandle GetCardTextureXPos()
HD_API HdAssetPathDataSourceHandle GetCardTextureZNeg()
HD_API Builder & SetDrawMode(const HdTokenDataSourceHandle &drawMode)
HD_API HdTokenDataSourceHandle GetDrawMode()
HD_API Builder & SetCardTextureZPos(const HdAssetPathDataSourceHandle &cardTextureZPos)
#define HD_API
Definition: api.h:40
HD_API Builder & SetCardTextureYNeg(const HdAssetPathDataSourceHandle &cardTextureYNeg)
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API HdAssetPathDataSourceHandle GetCardTextureXNeg()
HdAssetPathDataSource::Handle HdAssetPathDataSourceHandle
HdModelSchema(HdContainerDataSourceHandle container)
Definition: modelSchema.h:71
TF_DECLARE_PUBLIC_TOKENS(HdModelSchemaTokens, HD_API, HDMODEL_SCHEMA_TOKENS)
Definition: token.h:87
HD_API HdTokenDataSourceHandle GetCardGeometry()
static HD_API HdModelSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HdBoolDataSource::Handle HdBoolDataSourceHandle
HdVec3fDataSource::Handle HdVec3fDataSourceHandle
HD_API HdAssetPathDataSourceHandle GetCardTextureZPos()
HD_API Builder & SetCardTextureXPos(const HdAssetPathDataSourceHandle &cardTextureXPos)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdTokenDataSourceHandle &drawMode, const HdBoolDataSourceHandle &applyDrawMode, const HdVec3fDataSourceHandle &drawModeColor, const HdTokenDataSourceHandle &cardGeometry, const HdAssetPathDataSourceHandle &cardTextureXPos, const HdAssetPathDataSourceHandle &cardTextureYPos, const HdAssetPathDataSourceHandle &cardTextureZPos, const HdAssetPathDataSourceHandle &cardTextureXNeg, const HdAssetPathDataSourceHandle &cardTextureYNeg, const HdAssetPathDataSourceHandle &cardTextureZNeg)
HD_API Builder & SetDrawModeColor(const HdVec3fDataSourceHandle &drawModeColor)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
static HD_API const TfToken & GetSchemaToken()
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API HdAssetPathDataSourceHandle GetCardTextureYPos()
#define HDMODEL_SCHEMA_TOKENS
Definition: modelSchema.h:42
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API Builder & SetCardTextureYPos(const HdAssetPathDataSourceHandle &cardTextureYPos)
HD_API Builder & SetCardGeometry(const HdTokenDataSourceHandle &cardGeometry)
HD_API Builder & SetCardTextureXNeg(const HdAssetPathDataSourceHandle &cardTextureXNeg)
HdTokenDataSource::Handle HdTokenDataSourceHandle
HD_API HdBoolDataSourceHandle GetApplyDrawMode()