HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
extentSchema.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_EXTENT_SCHEMA_H
19 #define PXR_IMAGING_HD_EXTENT_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_EXTENT_SCHEMA_TOKENS \
36  (extent) \
37  (min) \
38  (max) \
39 
40 TF_DECLARE_PUBLIC_TOKENS(HdExtentSchemaTokens, HD_API,
42 
43 //-----------------------------------------------------------------------------
44 
45 
46 /// \class HdExtentSchema
47 ///
48 class HdExtentSchema : public HdSchema
49 {
50 public:
51  /// \name Schema retrieval
52  /// @{
53 
54  HdExtentSchema(HdContainerDataSourceHandle container)
55  : HdSchema(container) {}
56 
57  /// Retrieves a container data source with the schema's default name token
58  /// "extent" from the parent container and constructs a
59  /// HdExtentSchema 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  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
112  );
113 
114  /// \class HdExtentSchema::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
124  Builder &SetMin(
126  HD_API
127  Builder &SetMax(
129 
130  /// Returns a container data source containing the members set thus far.
131  HD_API
132  HdContainerDataSourceHandle Build();
133 
134  private:
137 
138  };
139 
140  /// @}
141 };
142 
144 
145 #endif
HdVec3dDataSource::Handle HdVec3dDataSourceHandle
static HD_API HdExtentSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HD_API Builder & SetMin(const HdVec3dDataSourceHandle &min)
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
#define HD_API
Definition: api.h:23
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
static HD_API HdContainerDataSourceHandle BuildRetained(const HdVec3dDataSourceHandle &min, const HdVec3dDataSourceHandle &max)
static HD_API const HdDataSourceLocator & GetDefaultLocator()
Definition: token.h:70
#define HD_EXTENT_SCHEMA_TOKENS
Definition: extentSchema.h:35
HD_API HdContainerDataSourceHandle Build()
Returns a container data source containing the members set thus far.
HD_API HdVec3dDataSourceHandle GetMax() const
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
TF_DECLARE_PUBLIC_TOKENS(HdExtentSchemaTokens, HD_API, HD_EXTENT_SCHEMA_TOKENS)
HD_API Builder & SetMax(const HdVec3dDataSourceHandle &max)
HD_API HdVec3dDataSourceHandle GetMin() const
static HD_API const TfToken & GetSchemaToken()
HdExtentSchema(HdContainerDataSourceHandle container)
Definition: extentSchema.h:54