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 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_XFORM_SCHEMA_H
32 #define PXR_IMAGING_HD_XFORM_SCHEMA_H
33 
34 #include "pxr/imaging/hd/api.h"
35 
36 #include "pxr/imaging/hd/schema.h"
37 
39 
40 //-----------------------------------------------------------------------------
41 
42 #define HDXFORM_SCHEMA_TOKENS \
43  (xform) \
44  (matrix) \
45  (resetXformStack) \
46 
47 TF_DECLARE_PUBLIC_TOKENS(HdXformSchemaTokens, HD_API,
49 
50 //-----------------------------------------------------------------------------
51 
52 class HdXformSchema : public HdSchema
53 {
54 public:
55  HdXformSchema(HdContainerDataSourceHandle container)
56  : HdSchema(container) {}
57 
58  //ACCESSORS
59 
60  HD_API
62 
63  // The "resetXformStack" flag tells consumers that this transform doesn't
64  // inherit from the parent prim's transform.
65  HD_API
67 
68  // RETRIEVING AND CONSTRUCTING
69 
70  /// Builds a container data source which includes the provided child data
71  /// sources. Parameters with nullptr values are excluded. This is a
72  /// low-level interface. For cases in which it's desired to define
73  /// the container with a sparse set of child fields, the Builder class
74  /// is often more convenient and readable.
75  HD_API
76  static HdContainerDataSourceHandle
78  const HdMatrixDataSourceHandle &matrix,
79  const HdBoolDataSourceHandle &resetXformStack
80  );
81 
82  /// \class HdXformSchema::Builder
83  ///
84  /// Utility class for setting sparse sets of child data source fields to be
85  /// filled as arguments into BuildRetained. Because all setter methods
86  /// return a reference to the instance, this can be used in the "builder
87  /// pattern" form.
88  class Builder
89  {
90  public:
91  HD_API
93  const HdMatrixDataSourceHandle &matrix);
94  HD_API
96  const HdBoolDataSourceHandle &resetXformStack);
97 
98  /// Returns a container data source containing the members set thus far.
99  HD_API
100  HdContainerDataSourceHandle Build();
101 
102  private:
103  HdMatrixDataSourceHandle _matrix;
104  HdBoolDataSourceHandle _resetXformStack;
105  };
106 
107  /// Retrieves a container data source with the schema's default name token
108  /// "xform" from the parent container and constructs a
109  /// HdXformSchema instance.
110  /// Because the requested container data source may not exist, the result
111  /// should be checked with IsDefined() or a bool comparison before use.
112  HD_API
114  const HdContainerDataSourceHandle &fromParentContainer);
115 
116  /// Returns a token where the container representing this schema is found in
117  /// a container by default.
118  HD_API
119  static const TfToken &GetSchemaToken();
120 
121  /// Returns an HdDataSourceLocator (relative to the prim-level data source)
122  /// where the container representing this schema is found by default.
123  HD_API
124  static const HdDataSourceLocator &GetDefaultLocator();
125 
126 };
127 
129 
130 #endif
static HD_API const TfToken & GetSchemaToken()
#define HD_API
Definition: api.h:40
#define HDXFORM_SCHEMA_TOKENS
Definition: xformSchema.h:42
static HD_API HdContainerDataSourceHandle BuildRetained(const HdMatrixDataSourceHandle &matrix, const HdBoolDataSourceHandle &resetXformStack)
HdXformSchema(HdContainerDataSourceHandle container)
Definition: xformSchema.h:55
HD_API HdMatrixDataSourceHandle GetMatrix()
Definition: token.h:87
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.
TF_DECLARE_PUBLIC_TOKENS(HdXformSchemaTokens, HD_API, HDXFORM_SCHEMA_TOKENS)
HdMatrixDataSource::Handle HdMatrixDataSourceHandle
HD_API HdBoolDataSourceHandle GetResetXformStack()
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
HD_API Builder & SetResetXformStack(const HdBoolDataSourceHandle &resetXformStack)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
HD_API Builder & SetMatrix(const HdMatrixDataSourceHandle &matrix)