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