HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
houdiniImageFilter.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef USDHOUDINI_GENERATED_HOUDINIIMAGEFILTER_H
8 #define USDHOUDINI_GENERATED_HOUDINIIMAGEFILTER_H
9 
10 /// \file usdHoudini/houdiniImageFilter.h
11 
12 #include "pxr/pxr.h"
13 #include "./api.h"
14 #include "pxr/usd/usd/typed.h"
15 #include "pxr/usd/usd/prim.h"
16 #include "pxr/usd/usd/stage.h"
17 #include "./tokens.h"
18 
19 #include "pxr/base/vt/value.h"
20 
21 #include "pxr/base/gf/vec3d.h"
22 #include "pxr/base/gf/vec3f.h"
23 #include "pxr/base/gf/matrix4d.h"
24 
25 #include "pxr/base/tf/token.h"
26 #include "pxr/base/tf/type.h"
27 
29 
30 class SdfAssetPath;
31 
32 // -------------------------------------------------------------------------- //
33 // HOUDINIIMAGEFILTER //
34 // -------------------------------------------------------------------------- //
35 
36 /// \class UsdHoudiniHoudiniImageFilter
37 ///
38 /// Implementation of an individual filter used in a
39 /// HoudiniImageFilterList filter list. Each indivdual filter will
40 /// add its own primvars.
41 ///
42 class
45 {
46 public:
47  /// Compile time constant representing what kind of schema this class is.
48  ///
49  /// \sa UsdSchemaKind
50  static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
51 
52  /// Construct a UsdHoudiniHoudiniImageFilter on UsdPrim \p prim .
53  /// Equivalent to UsdHoudiniHoudiniImageFilter::Get(prim.GetStage(), prim.GetPath())
54  /// for a \em valid \p prim, but will not immediately throw an error for
55  /// an invalid \p prim
57  : UsdTyped(prim)
58  {
59  }
60 
61  /// Construct a UsdHoudiniHoudiniImageFilter on the prim held by \p schemaObj .
62  /// Should be preferred over UsdHoudiniHoudiniImageFilter(schemaObj.GetPrim()),
63  /// as it preserves SchemaBase state.
64  explicit UsdHoudiniHoudiniImageFilter(const UsdSchemaBase& schemaObj)
65  : UsdTyped(schemaObj)
66  {
67  }
68 
69  /// Destructor.
70  virtual ~UsdHoudiniHoudiniImageFilter() override;
71 
72  /// Return a vector of names of all pre-declared attributes for this schema
73  /// class and all its ancestor classes. Does not include attributes that
74  /// may be authored by custom/extended methods of the schemas involved.
75  static const TfTokenVector &
76  GetSchemaAttributeNames(bool includeInherited=true);
77 
78  /// Return a UsdHoudiniHoudiniImageFilter holding the prim adhering to this
79  /// schema at \p path on \p stage. If no prim exists at \p path on
80  /// \p stage, or if the prim at that path does not adhere to this schema,
81  /// return an invalid schema object. This is shorthand for the following:
82  ///
83  /// \code
84  /// UsdHoudiniHoudiniImageFilter(stage->GetPrimAtPath(path));
85  /// \endcode
86  ///
88  Get(const UsdStagePtr &stage, const SdfPath &path);
89 
90  /// Attempt to ensure a \a UsdPrim adhering to this schema at \p path
91  /// is defined (according to UsdPrim::IsDefined()) on this stage.
92  ///
93  /// If a prim adhering to this schema at \p path is already defined on this
94  /// stage, return that prim. Otherwise author an \a SdfPrimSpec with
95  /// \a specifier == \a SdfSpecifierDef and this schema's prim type name for
96  /// the prim at \p path at the current EditTarget. Author \a SdfPrimSpec s
97  /// with \p specifier == \a SdfSpecifierDef and empty typeName at the
98  /// current EditTarget for any nonexistent, or existing but not \a Defined
99  /// ancestors.
100  ///
101  /// The given \a path must be an absolute prim path that does not contain
102  /// any variant selections.
103  ///
104  /// If it is impossible to author any of the necessary PrimSpecs, (for
105  /// example, in case \a path cannot map to the current UsdEditTarget's
106  /// namespace) issue an error and return an invalid \a UsdPrim.
107  ///
108  /// Note that this method may return a defined prim whose typeName does not
109  /// specify this schema class, in case a stronger typeName opinion overrides
110  /// the opinion at the current EditTarget.
111  ///
113  Define(const UsdStagePtr &stage, const SdfPath &path);
114 
115 protected:
116  /// Returns the kind of schema this class belongs to.
117  ///
118  /// \sa UsdSchemaKind
119  UsdSchemaKind _GetSchemaKind() const override;
120 
121 private:
122  // needs to invoke _GetStaticTfType.
123  friend class UsdSchemaRegistry;
124  static const TfType &_GetStaticTfType();
125 
126  static bool _IsTypedSchema();
127 
128  // override SchemaBase virtuals.
129  const TfType &_GetTfType() const override;
130 
131 public:
132  // --------------------------------------------------------------------- //
133  // TYPE
134  // --------------------------------------------------------------------- //
135  /// The filter type.
136  ///
137  /// | ||
138  /// | -- | -- |
139  /// | Declaration | `uniform string type` |
140  /// | C++ Type | std::string |
141  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->String |
142  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
143  UsdAttribute GetTypeAttr() const;
144 
145  /// See GetTypeAttr(), and also
146  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
147  /// If specified, author \p defaultValue as the attribute's default,
148  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
149  /// the default for \p writeSparsely is \c false.
150  UsdAttribute CreateTypeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
151 
152 public:
153  // --------------------------------------------------------------------- //
154  // BYPASS
155  // --------------------------------------------------------------------- //
156  /// Bypass this filter and pass through AOVs unchanged.
157  ///
158  /// | ||
159  /// | -- | -- |
160  /// | Declaration | `uniform bool bypass = 0` |
161  /// | C++ Type | bool |
162  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
163  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
164  UsdAttribute GetBypassAttr() const;
165 
166  /// See GetBypassAttr(), and also
167  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
168  /// If specified, author \p defaultValue as the attribute's default,
169  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
170  /// the default for \p writeSparsely is \c false.
171  UsdAttribute CreateBypassAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
172 
173 public:
174  // ===================================================================== //
175  // Feel free to add custom code below this line, it will be preserved by
176  // the code generator.
177  //
178  // Just remember to:
179  // - Close the class declaration with };
180  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
181  // - Close the include guard with #endif
182  // ===================================================================== //
183  // --(BEGIN CUSTOM CODE)--
184 };
185 
187 
188 #endif
#define USDHOUDINI_API
Definition: api.h:23
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
UsdHoudiniHoudiniImageFilter(const UsdSchemaBase &schemaObj)
Represents a concrete typed schema.
Definition: prim.h:116
Definition: typed.h:44
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
Definition: path.h:280
UsdSchemaKind
Definition: common.h:112
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
Definition: type.h:47
UsdHoudiniHoudiniImageFilter(const UsdPrim &prim=UsdPrim())
Definition: value.h:89