HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
geomModelSchema.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_USD_IMAGING_USD_IMAGING_GEOM_MODEL_SCHEMA_H
19 #define PXR_USD_IMAGING_USD_IMAGING_GEOM_MODEL_SCHEMA_H
20 
21 /// \file
22 
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 USD_IMAGING_GEOM_MODEL_SCHEMA_TOKENS \
36  (geomModel) \
37  (drawMode) \
38  (applyDrawMode) \
39  (drawModeColor) \
40  (cardGeometry) \
41  (cardTextureXPos) \
42  (cardTextureYPos) \
43  (cardTextureZPos) \
44  (cardTextureXNeg) \
45  (cardTextureYNeg) \
46  (cardTextureZNeg) \
47  ((default_, "default")) \
48  (origin) \
49  (bounds) \
50  (cards) \
51  (inherited) \
52  (cross) \
53  (box) \
54  (fromTexture) \
55 
56 TF_DECLARE_PUBLIC_TOKENS(UsdImagingGeomModelSchemaTokens, USDIMAGING_API,
58 
59 //-----------------------------------------------------------------------------
60 
61 
63 {
64 public:
65  /// \name Schema retrieval
66  /// @{
67 
68  UsdImagingGeomModelSchema(HdContainerDataSourceHandle container)
69  : HdSchema(container) {}
70 
71  /// Retrieves a container data source with the schema's default name token
72  /// "geomModel" from the parent container and constructs a
73  /// UsdImagingGeomModelSchema instance.
74  /// Because the requested container data source may not exist, the result
75  /// should be checked with IsDefined() or a bool comparison before use.
78  const HdContainerDataSourceHandle &fromParentContainer);
79 
80  /// @}
81 
82 // --(BEGIN CUSTOM CODE: Schema Methods)--
83 // --(END CUSTOM CODE: Schema Methods)--
84 
85  /// \name Member accessor
86  /// @{
87 
90 
93 
96 
99 
102 
105 
108 
111 
114 
117 
118  /// @}
119 
120  /// \name Schema location
121  /// @{
122 
123  /// Returns a token where the container representing this schema is found in
124  /// a container by default.
126  static const TfToken &GetSchemaToken();
127 
128  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
129  /// where the container representing this schema is found by default.
131  static const HdDataSourceLocator &GetDefaultLocator();
132 
133  /// @}
134 
135  /// \name Data source locators for members
136  ///
137  /// The following methods return an HdDataSourceLocator (relative to the
138  /// prim-level data source) where the data source for a member can be found.
139  ///
140  /// This is often useful for checking intersection against the
141  /// HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
142  /// @{
143 
144  /// Prim-level relative data source locator to locate drawMode.
146  static const HdDataSourceLocator &GetDrawModeLocator();
147  /// @}
148 
149  /// \name Schema construction
150  /// @{
151 
152  /// \deprecated Use Builder instead.
153  ///
154  /// Builds a container data source which includes the provided child data
155  /// sources. Parameters with nullptr values are excluded. This is a
156  /// low-level interface. For cases in which it's desired to define
157  /// the container with a sparse set of child fields, the Builder class
158  /// is often more convenient and readable.
160  static HdContainerDataSourceHandle
162  const HdTokenDataSourceHandle &drawMode,
163  const HdBoolDataSourceHandle &applyDrawMode,
164  const HdVec3fDataSourceHandle &drawModeColor,
165  const HdTokenDataSourceHandle &cardGeometry,
166  const HdAssetPathDataSourceHandle &cardTextureXPos,
167  const HdAssetPathDataSourceHandle &cardTextureYPos,
168  const HdAssetPathDataSourceHandle &cardTextureZPos,
169  const HdAssetPathDataSourceHandle &cardTextureXNeg,
170  const HdAssetPathDataSourceHandle &cardTextureYNeg,
171  const HdAssetPathDataSourceHandle &cardTextureZNeg
172  );
173 
174  /// \class UsdImagingGeomModelSchema::Builder
175  ///
176  /// Utility class for setting sparse sets of child data source fields to be
177  /// filled as arguments into BuildRetained. Because all setter methods
178  /// return a reference to the instance, this can be used in the "builder
179  /// pattern" form.
180  class Builder
181  {
182  public:
185  const HdTokenDataSourceHandle &drawMode);
188  const HdBoolDataSourceHandle &applyDrawMode);
191  const HdVec3fDataSourceHandle &drawModeColor);
194  const HdTokenDataSourceHandle &cardGeometry);
197  const HdAssetPathDataSourceHandle &cardTextureXPos);
200  const HdAssetPathDataSourceHandle &cardTextureYPos);
203  const HdAssetPathDataSourceHandle &cardTextureZPos);
206  const HdAssetPathDataSourceHandle &cardTextureXNeg);
209  const HdAssetPathDataSourceHandle &cardTextureYNeg);
212  const HdAssetPathDataSourceHandle &cardTextureZNeg);
213 
214  /// Returns a container data source containing the members set thus far.
216  HdContainerDataSourceHandle Build();
217 
218  private:
219  HdTokenDataSourceHandle _drawMode;
220  HdBoolDataSourceHandle _applyDrawMode;
221  HdVec3fDataSourceHandle _drawModeColor;
222  HdTokenDataSourceHandle _cardGeometry;
223  HdAssetPathDataSourceHandle _cardTextureXPos;
224  HdAssetPathDataSourceHandle _cardTextureYPos;
225  HdAssetPathDataSourceHandle _cardTextureZPos;
226  HdAssetPathDataSourceHandle _cardTextureXNeg;
227  HdAssetPathDataSourceHandle _cardTextureYNeg;
228  HdAssetPathDataSourceHandle _cardTextureZNeg;
229 
230  };
231 
232  /// Returns token data source for use as drawMode value.
233  ///
234  /// The following values will be stored statically and reused for future
235  /// calls:
236  /// - UsdImagingGeomModelSchemaTokens->default_
237  /// - UsdImagingGeomModelSchemaTokens->origin
238  /// - UsdImagingGeomModelSchemaTokens->bounds
239  /// - UsdImagingGeomModelSchemaTokens->cards
240  /// - UsdImagingGeomModelSchemaTokens->inherited
243  const TfToken &drawMode);
244 
245  /// Returns token data source for use as cardGeometry value.
246  ///
247  /// The following values will be stored statically and reused for future
248  /// calls:
249  /// - UsdImagingGeomModelSchemaTokens->cross
250  /// - UsdImagingGeomModelSchemaTokens->box
251  /// - UsdImagingGeomModelSchemaTokens->fromTexture
254  const TfToken &cardGeometry);
255 
256  /// @}
257 };
258 
260 
261 #endif
static USDIMAGING_API const HdDataSourceLocator & GetDrawModeLocator()
Prim-level relative data source locator to locate drawMode.
#define USDIMAGING_API
Definition: api.h:23
USDIMAGING_API Builder & SetCardTextureXPos(const HdAssetPathDataSourceHandle &cardTextureXPos)
USDIMAGING_API Builder & SetDrawModeColor(const HdVec3fDataSourceHandle &drawModeColor)
static USDIMAGING_API const TfToken & GetSchemaToken()
static USDIMAGING_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)
USDIMAGING_API Builder & SetCardGeometry(const HdTokenDataSourceHandle &cardGeometry)
HdAssetPathDataSource::Handle HdAssetPathDataSourceHandle
static USDIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
Definition: token.h:70
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureYNeg() const
USDIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdBoolDataSource::Handle HdBoolDataSourceHandle
UsdImagingGeomModelSchema(HdContainerDataSourceHandle container)
HdVec3fDataSource::Handle HdVec3fDataSourceHandle
USDIMAGING_API HdBoolDataSourceHandle GetApplyDrawMode() const
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureXNeg() const
static USDIMAGING_API HdTokenDataSourceHandle BuildDrawModeDataSource(const TfToken &drawMode)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
static USDIMAGING_API UsdImagingGeomModelSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
USDIMAGING_API Builder & SetCardTextureZNeg(const HdAssetPathDataSourceHandle &cardTextureZNeg)
USDIMAGING_API HdTokenDataSourceHandle GetCardGeometry() const
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureZNeg() const
USDIMAGING_API Builder & SetCardTextureYPos(const HdAssetPathDataSourceHandle &cardTextureYPos)
USDIMAGING_API HdTokenDataSourceHandle GetDrawMode() const
USDIMAGING_API HdVec3fDataSourceHandle GetDrawModeColor() const
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureXPos() const
USDIMAGING_API Builder & SetApplyDrawMode(const HdBoolDataSourceHandle &applyDrawMode)
USDIMAGING_API Builder & SetCardTextureYNeg(const HdAssetPathDataSourceHandle &cardTextureYNeg)
USDIMAGING_API Builder & SetCardTextureXNeg(const HdAssetPathDataSourceHandle &cardTextureXNeg)
USDIMAGING_API Builder & SetDrawMode(const HdTokenDataSourceHandle &drawMode)
static USDIMAGING_API HdTokenDataSourceHandle BuildCardGeometryDataSource(const TfToken &cardGeometry)
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureZPos() const
TF_DECLARE_PUBLIC_TOKENS(UsdImagingGeomModelSchemaTokens, USDIMAGING_API, USD_IMAGING_GEOM_MODEL_SCHEMA_TOKENS)
USDIMAGING_API Builder & SetCardTextureZPos(const HdAssetPathDataSourceHandle &cardTextureZPos)
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureYPos() const
HdTokenDataSource::Handle HdTokenDataSourceHandle
#define USD_IMAGING_GEOM_MODEL_SCHEMA_TOKENS