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 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_USD_IMAGING_USD_IMAGING_GEOM_MODEL_SCHEMA_H
36 #define PXR_USD_IMAGING_USD_IMAGING_GEOM_MODEL_SCHEMA_H
37 
39 
40 #include "pxr/imaging/hd/schema.h"
41 
42 // --(BEGIN CUSTOM CODE: Includes)--
43 // --(END CUSTOM CODE: Includes)--
44 
46 
47 //-----------------------------------------------------------------------------
48 
49 // --(BEGIN CUSTOM CODE: Declares)--
50 // --(END CUSTOM CODE: Declares)--
51 
52 //-----------------------------------------------------------------------------
53 
54 #define USD_IMAGING_GEOM_MODEL_SCHEMA_TOKENS \
55  (geomModel) \
56  (drawMode) \
57  (applyDrawMode) \
58  (drawModeColor) \
59  (cardGeometry) \
60  (cardTextureXPos) \
61  (cardTextureYPos) \
62  (cardTextureZPos) \
63  (cardTextureXNeg) \
64  (cardTextureYNeg) \
65  (cardTextureZNeg) \
66  ((default_, "default")) \
67  (origin) \
68  (bounds) \
69  (cards) \
70  (inherited) \
71  (cross) \
72  (box) \
73  (fromTexture) \
74 
75 TF_DECLARE_PUBLIC_TOKENS(UsdImagingGeomModelSchemaTokens, USDIMAGING_API,
77 
78 //-----------------------------------------------------------------------------
80 {
81 public:
82  UsdImagingGeomModelSchema(HdContainerDataSourceHandle container)
83  : HdSchema(container) {}
84 
85 // --(BEGIN CUSTOM CODE: Schema Methods)--
86 // --(END CUSTOM CODE: Schema Methods)--
87 
88  //ACCESSORS
89 
90 
93 
96 
99 
102 
105 
108 
111 
114 
117 
120 
121  // RETRIEVING AND CONSTRUCTING
122 
123  /// Builds a container data source which includes the provided child data
124  /// sources. Parameters with nullptr values are excluded. This is a
125  /// low-level interface. For cases in which it's desired to define
126  /// the container with a sparse set of child fields, the Builder class
127  /// is often more convenient and readable.
129  static HdContainerDataSourceHandle
131  const HdTokenDataSourceHandle &drawMode,
132  const HdBoolDataSourceHandle &applyDrawMode,
133  const HdVec3fDataSourceHandle &drawModeColor,
134  const HdTokenDataSourceHandle &cardGeometry,
135  const HdAssetPathDataSourceHandle &cardTextureXPos,
136  const HdAssetPathDataSourceHandle &cardTextureYPos,
137  const HdAssetPathDataSourceHandle &cardTextureZPos,
138  const HdAssetPathDataSourceHandle &cardTextureXNeg,
139  const HdAssetPathDataSourceHandle &cardTextureYNeg,
140  const HdAssetPathDataSourceHandle &cardTextureZNeg
141  );
142 
143  /// \class UsdImagingGeomModelSchema::Builder
144  ///
145  /// Utility class for setting sparse sets of child data source fields to be
146  /// filled as arguments into BuildRetained. Because all setter methods
147  /// return a reference to the instance, this can be used in the "builder
148  /// pattern" form.
149  class Builder
150  {
151  public:
154  const HdTokenDataSourceHandle &drawMode);
157  const HdBoolDataSourceHandle &applyDrawMode);
160  const HdVec3fDataSourceHandle &drawModeColor);
163  const HdTokenDataSourceHandle &cardGeometry);
166  const HdAssetPathDataSourceHandle &cardTextureXPos);
169  const HdAssetPathDataSourceHandle &cardTextureYPos);
172  const HdAssetPathDataSourceHandle &cardTextureZPos);
175  const HdAssetPathDataSourceHandle &cardTextureXNeg);
178  const HdAssetPathDataSourceHandle &cardTextureYNeg);
181  const HdAssetPathDataSourceHandle &cardTextureZNeg);
182 
183  /// Returns a container data source containing the members set thus far.
185  HdContainerDataSourceHandle Build();
186 
187  private:
188  HdTokenDataSourceHandle _drawMode;
189  HdBoolDataSourceHandle _applyDrawMode;
190  HdVec3fDataSourceHandle _drawModeColor;
191  HdTokenDataSourceHandle _cardGeometry;
192  HdAssetPathDataSourceHandle _cardTextureXPos;
193  HdAssetPathDataSourceHandle _cardTextureYPos;
194  HdAssetPathDataSourceHandle _cardTextureZPos;
195  HdAssetPathDataSourceHandle _cardTextureXNeg;
196  HdAssetPathDataSourceHandle _cardTextureYNeg;
197  HdAssetPathDataSourceHandle _cardTextureZNeg;
198  };
199 
200  /// Retrieves a container data source with the schema's default name token
201  /// "geomModel" from the parent container and constructs a
202  /// UsdImagingGeomModelSchema instance.
203  /// Because the requested container data source may not exist, the result
204  /// should be checked with IsDefined() or a bool comparison before use.
207  const HdContainerDataSourceHandle &fromParentContainer);
208 
209  /// Returns a token where the container representing this schema is found in
210  /// a container by default.
212  static const TfToken &GetSchemaToken();
213 
214  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
215  /// where the container representing this schema is found by default.
217  static const HdDataSourceLocator &GetDefaultLocator();
218 
219  // DATA SOURCE LOCATORS FOR MEMBERS
220  //
221  // The following methods return an HdDataSourceLocator (relative to the
222  // prim-level data source) where the data source for a member can be found.
223  //
224  // This is often useful for checking intersection against the
225  // HdDataSourceLocatorSet sent with HdDataSourceObserver::PrimsDirtied.
226 
227 
228  /// Prim-level relative data source locator to locate drawMode.
230  static const HdDataSourceLocator &GetDrawModeLocator();
231 
232 
233  /// Returns token data source for use as drawmode value.
234  /// Values of...
235  /// - UsdImagingGeomModelSchemaTokens->default_
236  /// - UsdImagingGeomModelSchemaTokens->origin
237  /// - UsdImagingGeomModelSchemaTokens->bounds
238  /// - UsdImagingGeomModelSchemaTokens->cards
239  /// - UsdImagingGeomModelSchemaTokens->inherited
240  /// ...will be stored statically and reused for future calls.
243  const TfToken &drawmode);
244  /// Returns token data source for use as cardgeometry value.
245  /// Values of...
246  /// - UsdImagingGeomModelSchemaTokens->cross
247  /// - UsdImagingGeomModelSchemaTokens->box
248  /// - UsdImagingGeomModelSchemaTokens->fromTexture
249  /// ...will be stored statically and reused for future calls.
252  const TfToken &cardgeometry);
253 
254 };
255 
257 
258 #endif
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureZNeg()
static USDIMAGING_API const HdDataSourceLocator & GetDrawModeLocator()
Prim-level relative data source locator to locate drawMode.
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureXNeg()
#define USDIMAGING_API
Definition: api.h:40
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)
static USDIMAGING_API HdTokenDataSourceHandle BuildDrawmodeDataSource(const TfToken &drawmode)
USDIMAGING_API Builder & SetCardGeometry(const HdTokenDataSourceHandle &cardGeometry)
HdAssetPathDataSource::Handle HdAssetPathDataSourceHandle
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureYPos()
static USDIMAGING_API const HdDataSourceLocator & GetDefaultLocator()
Definition: token.h:87
USDIMAGING_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdBoolDataSource::Handle HdBoolDataSourceHandle
UsdImagingGeomModelSchema(HdContainerDataSourceHandle container)
USDIMAGING_API HdVec3fDataSourceHandle GetDrawModeColor()
USDIMAGING_API HdTokenDataSourceHandle GetDrawMode()
USDIMAGING_API HdTokenDataSourceHandle GetCardGeometry()
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureXPos()
HdVec3fDataSource::Handle HdVec3fDataSourceHandle
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1432
static USDIMAGING_API UsdImagingGeomModelSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
USDIMAGING_API Builder & SetCardTextureZNeg(const HdAssetPathDataSourceHandle &cardTextureZNeg)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureZPos()
USDIMAGING_API HdAssetPathDataSourceHandle GetCardTextureYNeg()
USDIMAGING_API Builder & SetCardTextureYPos(const HdAssetPathDataSourceHandle &cardTextureYPos)
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)
TF_DECLARE_PUBLIC_TOKENS(UsdImagingGeomModelSchemaTokens, USDIMAGING_API, USD_IMAGING_GEOM_MODEL_SCHEMA_TOKENS)
USDIMAGING_API Builder & SetCardTextureZPos(const HdAssetPathDataSourceHandle &cardTextureZPos)
HdTokenDataSource::Handle HdTokenDataSourceHandle
USDIMAGING_API HdBoolDataSourceHandle GetApplyDrawMode()
static USDIMAGING_API HdTokenDataSourceHandle BuildCardgeometryDataSource(const TfToken &cardgeometry)
#define USD_IMAGING_GEOM_MODEL_SCHEMA_TOKENS