HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
houdiniViewportGuideAPI.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 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 #ifndef USDHOUDINI_GENERATED_HOUDINIVIEWPORTGUIDEAPI_H
25 #define USDHOUDINI_GENERATED_HOUDINIVIEWPORTGUIDEAPI_H
26 
27 /// \file usdHoudini/houdiniViewportGuideAPI.h
28 
29 #include "pxr/pxr.h"
30 #include "./api.h"
32 #include "pxr/usd/usd/prim.h"
33 #include "pxr/usd/usd/stage.h"
34 #include "./tokens.h"
35 
36 #include "pxr/base/vt/value.h"
37 
38 #include "pxr/base/gf/vec3d.h"
39 #include "pxr/base/gf/vec3f.h"
40 #include "pxr/base/gf/matrix4d.h"
41 
42 #include "pxr/base/tf/token.h"
43 #include "pxr/base/tf/type.h"
44 
46 
47 class SdfAssetPath;
48 
49 // -------------------------------------------------------------------------- //
50 // HOUDINIVIEWPORTGUIDEAPI //
51 // -------------------------------------------------------------------------- //
52 
53 /// \class UsdHoudiniHoudiniViewportGuideAPI
54 ///
55 /// Houdini API schema for controlling light and camera guides
56 /// in the LOP viewport.
57 ///
58 class
59 USDHOUDINI_API
61 {
62 public:
63  /// Compile time constant representing what kind of schema this class is.
64  ///
65  /// \sa UsdSchemaKind
66  static const UsdSchemaKind schemaKind = UsdSchemaKind::SingleApplyAPI;
67 
68  /// \deprecated
69  /// Same as schemaKind, provided to maintain temporary backward
70  /// compatibility with older generated schemas.
71  static const UsdSchemaKind schemaType = UsdSchemaKind::SingleApplyAPI;
72 
73  /// Construct a UsdHoudiniHoudiniViewportGuideAPI on UsdPrim \p prim .
74  /// Equivalent to UsdHoudiniHoudiniViewportGuideAPI::Get(prim.GetStage(), prim.GetPath())
75  /// for a \em valid \p prim, but will not immediately throw an error for
76  /// an invalid \p prim
78  : UsdAPISchemaBase(prim)
79  {
80  }
81 
82  /// Construct a UsdHoudiniHoudiniViewportGuideAPI on the prim held by \p schemaObj .
83  /// Should be preferred over UsdHoudiniHoudiniViewportGuideAPI(schemaObj.GetPrim()),
84  /// as it preserves SchemaBase state.
86  : UsdAPISchemaBase(schemaObj)
87  {
88  }
89 
90  /// Destructor.
91  virtual ~UsdHoudiniHoudiniViewportGuideAPI() override;
92 
93  /// Return a vector of names of all pre-declared attributes for this schema
94  /// class and all its ancestor classes. Does not include attributes that
95  /// may be authored by custom/extended methods of the schemas involved.
96  static const TfTokenVector &
97  GetSchemaAttributeNames(bool includeInherited=true);
98 
99  /// Return a UsdHoudiniHoudiniViewportGuideAPI holding the prim adhering to this
100  /// schema at \p path on \p stage. If no prim exists at \p path on
101  /// \p stage, or if the prim at that path does not adhere to this schema,
102  /// return an invalid schema object. This is shorthand for the following:
103  ///
104  /// \code
105  /// UsdHoudiniHoudiniViewportGuideAPI(stage->GetPrimAtPath(path));
106  /// \endcode
107  ///
109  Get(const UsdStagePtr &stage, const SdfPath &path);
110 
111 
112  /// Applies this <b>single-apply</b> API schema to the given \p prim.
113  /// This information is stored by adding "HoudiniViewportGuideAPI" to the
114  /// token-valued, listOp metadata \em apiSchemas on the prim.
115  ///
116  /// \return A valid UsdHoudiniHoudiniViewportGuideAPI object is returned upon success.
117  /// An invalid (or empty) UsdHoudiniHoudiniViewportGuideAPI object is returned upon
118  /// failure. See \ref UsdPrim::ApplyAPI() for conditions
119  /// resulting in failure.
120  ///
121  /// \sa UsdPrim::GetAppliedSchemas()
122  /// \sa UsdPrim::HasAPI()
123  /// \sa UsdPrim::ApplyAPI()
124  /// \sa UsdPrim::RemoveAPI()
125  ///
127  Apply(const UsdPrim &prim);
128 
129 protected:
130  /// Returns the kind of schema this class belongs to.
131  ///
132  /// \sa UsdSchemaKind
133  UsdSchemaKind _GetSchemaKind() const override;
134 
135  /// \deprecated
136  /// Same as _GetSchemaKind, provided to maintain temporary backward
137  /// compatibility with older generated schemas.
138  UsdSchemaKind _GetSchemaType() const override;
139 
140 private:
141  // needs to invoke _GetStaticTfType.
142  friend class UsdSchemaRegistry;
143  static const TfType &_GetStaticTfType();
144 
145  static bool _IsTypedSchema();
146 
147  // override SchemaBase virtuals.
148  const TfType &_GetTfType() const override;
149 
150 public:
151  // --------------------------------------------------------------------- //
152  // HOUDINIGUIDESCALE
153  // --------------------------------------------------------------------- //
154  /// Scales the guide geometry drawn in the Houdini viewport
155  /// for this primitive.
156  ///
157  /// | ||
158  /// | -- | -- |
159  /// | Declaration | `float houdini:guidescale = 1` |
160  /// | C++ Type | float |
161  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Float |
162  UsdAttribute GetHoudiniGuidescaleAttr() const;
163 
164  /// See GetHoudiniGuidescaleAttr(), and also
165  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
166  /// If specified, author \p defaultValue as the attribute's default,
167  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
168  /// the default for \p writeSparsely is \c false.
169  UsdAttribute CreateHoudiniGuidescaleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
170 
171 public:
172  // --------------------------------------------------------------------- //
173  // HOUDINIINVIEWERMENU
174  // --------------------------------------------------------------------- //
175  /// If true, then this light or camera will appear in the
176  /// viewport's Look Through Camera menu.
177  ///
178  /// | ||
179  /// | -- | -- |
180  /// | Declaration | `uniform bool houdini:inviewermenu = 1` |
181  /// | C++ Type | bool |
182  /// | \ref Usd_Datatypes "Usd Type" | SdfValueTypeNames->Bool |
183  /// | \ref SdfVariability "Variability" | SdfVariabilityUniform |
184  UsdAttribute GetHoudiniInviewermenuAttr() const;
185 
186  /// See GetHoudiniInviewermenuAttr(), and also
187  /// \ref Usd_Create_Or_Get_Property for when to use Get vs Create.
188  /// If specified, author \p defaultValue as the attribute's default,
189  /// sparsely (when it makes sense to do so) if \p writeSparsely is \c true -
190  /// the default for \p writeSparsely is \c false.
191  UsdAttribute CreateHoudiniInviewermenuAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
192 
193 public:
194  // ===================================================================== //
195  // Feel free to add custom code below this line, it will be preserved by
196  // the code generator.
197  //
198  // Just remember to:
199  // - Close the class declaration with };
200  // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
201  // - Close the include guard with #endif
202  // ===================================================================== //
203  // --(BEGIN CUSTOM CODE)--
204 };
205 
207 
208 #endif
UsdHoudiniHoudiniViewportGuideAPI(const UsdPrim &prim=UsdPrim())
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
UsdHoudiniHoudiniViewportGuideAPI(const UsdSchemaBase &schemaObj)
UsdSchemaKind
Definition: common.h:127
Single Apply API schema.
Definition: prim.h:132
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:442
Definition: path.h:288
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1375
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
Definition: type.h:64
Definition: value.h:168