HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
xformSchema.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_IMAGING_HD_XFORM_SCHEMA_H
19 #define PXR_IMAGING_HD_XFORM_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
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 HD_XFORM_SCHEMA_TOKENS \
36  (xform) \
37  (matrix) \
38  (resetXformStack) \
39 
40 TF_DECLARE_PUBLIC_TOKENS(HdXformSchemaTokens, HD_API,
42 
43 //-----------------------------------------------------------------------------
44 
45 
46 class HdXformSchema : public HdSchema
47 {
48 public:
49  /// \name Schema retrieval
50  /// @{
51 
52  HdXformSchema(HdContainerDataSourceHandle container)
53  : HdSchema(container) {}
54 
55  /// Retrieves a container data source with the schema's default name token
56  /// "xform" from the parent container and constructs a
57  /// HdXformSchema instance.
58  /// Because the requested container data source may not exist, the result
59  /// should be checked with IsDefined() or a bool comparison before use.
60  HD_API
62  const HdContainerDataSourceHandle &fromParentContainer);
63 
64  /// @}
65 
66 // --(BEGIN CUSTOM CODE: Schema Methods)--
67 // --(END CUSTOM CODE: Schema Methods)--
68 
69  /// \name Member accessor
70  /// @{
71 
72  HD_API
74 
75  /// The "resetXformStack" flag tells consumers that this transform doesn't
76  /// inherit from the parent prim's transform.
77  HD_API
79 
80  /// @}
81 
82  /// \name Schema location
83  /// @{
84 
85  /// Returns a token where the container representing this schema is found in
86  /// a container by default.
87  HD_API
88  static const TfToken &GetSchemaToken();
89 
90  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
91  /// where the container representing this schema is found by default.
92  HD_API
93  static const HdDataSourceLocator &GetDefaultLocator();
94 
95  /// @}
96 
97  /// \name Schema construction
98  /// @{
99 
100  /// \deprecated Use Builder instead.
101  ///
102  /// Builds a container data source which includes the provided child data
103  /// sources. Parameters with nullptr values are excluded. This is a
104  /// low-level interface. For cases in which it's desired to define
105  /// the container with a sparse set of child fields, the Builder class
106  /// is often more convenient and readable.
107  HD_API
108  static HdContainerDataSourceHandle
110  const HdMatrixDataSourceHandle &matrix,
111  const HdBoolDataSourceHandle &resetXformStack
112  );
113 
114  /// \class HdXformSchema::Builder
115  ///
116  /// Utility class for setting sparse sets of child data source fields to be
117  /// filled as arguments into BuildRetained. Because all setter methods
118  /// return a reference to the instance, this can be used in the "builder
119  /// pattern" form.
120  class Builder
121  {
122  public:
123  HD_API
125  const HdMatrixDataSourceHandle &matrix);
126  HD_API
128  const HdBoolDataSourceHandle &resetXformStack);
129 
130  /// Returns a container data source containing the members set thus far.
131  HD_API
132  HdContainerDataSourceHandle Build();
133 
134  private:
135  HdMatrixDataSourceHandle _matrix;
136  HdBoolDataSourceHandle _resetXformStack;
137 
138  };
139 
140  /// @}
141 };
142 
144 
145 #endif
HD_API HdBoolDataSourceHandle GetResetXformStack() const
static HD_API const TfToken & GetSchemaToken()
#define HD_XFORM_SCHEMA_TOKENS
Definition: xformSchema.h:35
#define HD_API
Definition: api.h:23
static HD_API HdContainerDataSourceHandle BuildRetained(const HdMatrixDataSourceHandle &matrix, const HdBoolDataSourceHandle &resetXformStack)
HdXformSchema(HdContainerDataSourceHandle container)
Definition: xformSchema.h:52
Definition: token.h:70
static HD_API HdXformSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HdBoolDataSource::Handle HdBoolDataSourceHandle
static HD_API const HdDataSourceLocator & GetDefaultLocator()
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HdMatrixDataSource::Handle HdMatrixDataSourceHandle
TF_DECLARE_PUBLIC_TOKENS(HdXformSchemaTokens, HD_API, HD_XFORM_SCHEMA_TOKENS)
HD_API HdMatrixDataSourceHandle GetMatrix() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
HD_API Builder & SetResetXformStack(const HdBoolDataSourceHandle &resetXformStack)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_API Builder & SetMatrix(const HdMatrixDataSourceHandle &matrix)