All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
imageable.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 USDGEOM_GENERATED_IMAGEABLE_H
8#define USDGEOM_GENERATED_IMAGEABLE_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdGeom/api.h"
14#include "pxr/usd/usd/typed.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
19#include "pxr/base/gf/bbox3d.h"
20#include "pxr/usd/usdGeom/primvar.h"
21
22#include "pxr/base/vt/value.h"
23
24#include "pxr/base/gf/vec3d.h"
25#include "pxr/base/gf/vec3f.h"
27
28#include "pxr/base/tf/token.h"
29#include "pxr/base/tf/type.h"
30
31PXR_NAMESPACE_OPEN_SCOPE
32
33class SdfAssetPath;
34
35// -------------------------------------------------------------------------- //
36// IMAGEABLE //
37// -------------------------------------------------------------------------- //
38
58{
59public:
63 static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractTyped;
64
69 explicit UsdGeomImageable(const UsdPrim& prim=UsdPrim())
70 : UsdTyped(prim)
71 {
72 }
73
77 explicit UsdGeomImageable(const UsdSchemaBase& schemaObj)
78 : UsdTyped(schemaObj)
79 {
80 }
81
83 USDGEOM_API
85
89 USDGEOM_API
90 static const TfTokenVector &
91 GetSchemaAttributeNames(bool includeInherited=true);
92
102 USDGEOM_API
103 static UsdGeomImageable
104 Get(const UsdStagePtr &stage, const SdfPath &path);
105
106
107protected:
111 USDGEOM_API
113
114private:
115 // needs to invoke _GetStaticTfType.
116 friend class UsdSchemaRegistry;
117 USDGEOM_API
118 static const TfType &_GetStaticTfType();
119
120 static bool _IsTypedSchema();
121
122 // override SchemaBase virtuals.
123 USDGEOM_API
124 const TfType &_GetTfType() const override;
125
126public:
127 // --------------------------------------------------------------------- //
128 // VISIBILITY
129 // --------------------------------------------------------------------- //
143 USDGEOM_API
145
151 USDGEOM_API
152 UsdAttribute CreateVisibilityAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
153
154public:
155 // --------------------------------------------------------------------- //
156 // PURPOSE
157 // --------------------------------------------------------------------- //
172 USDGEOM_API
174
180 USDGEOM_API
181 UsdAttribute CreatePurposeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
182
183public:
184 // --------------------------------------------------------------------- //
185 // PROXYPRIM
186 // --------------------------------------------------------------------- //
208 USDGEOM_API
210
213 USDGEOM_API
215
216public:
217 // ===================================================================== //
218 // Feel free to add custom code below this line, it will be preserved by
219 // the code generator.
220 //
221 // Just remember to:
222 // - Close the class declaration with };
223 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
224 // - Close the include guard with #endif
225 // ===================================================================== //
226 // --(BEGIN CUSTOM CODE)--
227
239 USDGEOM_API
241
242 // --------------------------------------------------------------------- //
247 // --------------------------------------------------------------------- //
248
275 USDGEOM_API
277
291 USDGEOM_API
293
295
296 // --------------------------------------------------------------------- //
307 // --------------------------------------------------------------------- //
308
326 USDGEOM_API
328
340 USDGEOM_API
342 const TfToken &purpose = UsdGeomTokens->default_) const;
343
372 USDGEOM_API
374 const TfToken &purpose = UsdGeomTokens->default_,
375 const UsdTimeCode &time = UsdTimeCode::Default()) const;
376
383 struct PurposeInfo {
384 constexpr PurposeInfo() = default;
385
386 PurposeInfo(const TfToken &purpose_, bool isInheritable_) :
387 purpose(purpose_), isInheritable(isInheritable_) {}
388
392
395 bool isInheritable = false;
396
398 explicit operator bool() const { return !purpose.IsEmpty(); }
399
400 bool operator==(const PurposeInfo &rhs) {
401 return purpose == rhs.purpose && isInheritable == rhs.isInheritable;
402 }
403
404 bool operator!=(const PurposeInfo &rhs) {
405 return !(*this == rhs);
406 }
407
410 static const TfToken empty;
411 return isInheritable ? purpose : empty;
412 }
413 };
414
429 USDGEOM_API
431
440 USDGEOM_API
441 PurposeInfo ComputePurposeInfo(const PurposeInfo &parentPurposeInfo) const;
442
456 USDGEOM_API
458
487 USDGEOM_API
488 UsdPrim ComputeProxyPrim(UsdPrim *renderPrim=NULL) const;
489
498 USDGEOM_API
499 bool SetProxyPrim(const UsdPrim &proxy) const;
500
502 USDGEOM_API
503 bool SetProxyPrim(const UsdSchemaBase &proxy) const;
504
518 USDGEOM_API
520 TfToken const &purpose1=TfToken(),
521 TfToken const &purpose2=TfToken(),
522 TfToken const &purpose3=TfToken(),
523 TfToken const &purpose4=TfToken()) const;
524
525
539 USDGEOM_API
541 TfToken const &purpose1=TfToken(),
542 TfToken const &purpose2=TfToken(),
543 TfToken const &purpose3=TfToken(),
544 TfToken const &purpose4=TfToken()) const;
545
559 USDGEOM_API
561 TfToken const &purpose1=TfToken(),
562 TfToken const &purpose2=TfToken(),
563 TfToken const &purpose3=TfToken(),
564 TfToken const &purpose4=TfToken()) const;
565
573 USDGEOM_API
575
583 USDGEOM_API
585
587
588};
589
590PXR_NAMESPACE_CLOSE_SCOPE
591
592#endif
Basic type: arbitrarily oriented 3D bounding box.
Definition: bbox3d.h:67
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
Contains an asset path and an optional resolved path.
Definition: assetPath.h:30
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:274
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
bool IsEmpty() const
Returns true iff this token contains the empty string "".
Definition: token.h:288
TfType represents a dynamic runtime type.
Definition: type.h:48
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:160
Base class for all prims that may require rendering or visualization of some sort.
Definition: imageable.h:58
USDGEOM_API PurposeInfo ComputePurposeInfo(const PurposeInfo &parentPurposeInfo) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
UsdGeomImageable(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomImageable on UsdPrim prim .
Definition: imageable.h:69
static USDGEOM_API UsdGeomImageable Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomImageable holding the prim adhering to this schema at path on stage.
USDGEOM_API TfToken ComputeEffectiveVisibility(const TfToken &purpose=UsdGeomTokens->default_, const UsdTimeCode &time=UsdTimeCode::Default()) const
Calculate the effective purpose visibility of this prim for the given purpose, taking into account op...
USDGEOM_API TfToken ComputePurpose() const
Calculate the effective purpose information about this prim.
USDGEOM_API PurposeInfo ComputePurposeInfo() const
Calculate the effective purpose information about this prim which includes final computed purpose val...
USDGEOM_API UsdAttribute GetPurposeVisibilityAttr(const TfToken &purpose=UsdGeomTokens->default_) const
Return the attribute that is used for expressing visibility opinions for the given purpose.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: imageable.h:63
USDGEOM_API UsdAttribute CreatePurposeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetPurposeAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API void MakeVisible(const UsdTimeCode &time=UsdTimeCode::Default()) const
Make the imageable visible if it is invisible at the given time.
USDGEOM_API GfMatrix4d ComputeParentToWorldTransform(UsdTimeCode const &time) const
Compute the transformation matrix for this prim at the given time, NOT including the transform author...
USDGEOM_API GfBBox3d ComputeLocalBound(UsdTimeCode const &time, TfToken const &purpose1=TfToken(), TfToken const &purpose2=TfToken(), TfToken const &purpose3=TfToken(), TfToken const &purpose4=TfToken()) const
Compute the bound of this prim in local space, at the specified time, and for the specified purposes.
static USDGEOM_API const TfTokenVector & GetOrderedPurposeTokens()
Returns an ordered list of allowed values of the purpose attribute.
USDGEOM_API GfBBox3d ComputeUntransformedBound(UsdTimeCode const &time, TfToken const &purpose1=TfToken(), TfToken const &purpose2=TfToken(), TfToken const &purpose3=TfToken(), TfToken const &purpose4=TfToken()) const
Compute the untransformed bound of this prim, at the specified time, and for the specified purposes.
USDGEOM_API UsdRelationship GetProxyPrimRel() const
The proxyPrim relationship allows us to link a prim whose purpose is "render" to its (single target) ...
USDGEOM_API bool SetProxyPrim(const UsdPrim &proxy) const
Convenience function for authoring the renderProxy rel on this prim to target the given proxy prim.
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDGEOM_API const TfTokenVector & GetSchemaAttributeNames(bool includeInherited=true)
Return a vector of names of all pre-declared attributes for this schema class and all its ancestor cl...
USDGEOM_API GfMatrix4d ComputeLocalToWorldTransform(UsdTimeCode const &time) const
Compute the transformation matrix for this prim at the given time, including the transform authored o...
UsdGeomImageable(const UsdSchemaBase &schemaObj)
Construct a UsdGeomImageable on the prim held by schemaObj .
Definition: imageable.h:77
USDGEOM_API void MakeInvisible(const UsdTimeCode &time=UsdTimeCode::Default()) const
Makes the imageable invisible if it is visible at the given time.
USDGEOM_API UsdAttribute GetVisibilityAttr() const
Visibility is meant to be the simplest form of "pruning" visibility that is supported by most DCC app...
USDGEOM_API UsdAttribute CreateVisibilityAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetVisibilityAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdRelationship CreateProxyPrimRel() const
See GetProxyPrimRel(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API TfToken ComputeVisibility(UsdTimeCode const &time=UsdTimeCode::Default()) const
Calculate the effective visibility of this prim, as defined by its most ancestral authored "invisible...
virtual USDGEOM_API ~UsdGeomImageable()
Destructor.
USDGEOM_API UsdAttribute GetPurposeAttr() const
Purpose is a classification of geometry into categories that can each be independently included or ex...
USDGEOM_API UsdPrim ComputeProxyPrim(UsdPrim *renderPrim=NULL) const
Find the prim whose purpose is proxy that serves as the proxy for this prim, as established by the Ge...
USDGEOM_API GfBBox3d ComputeWorldBound(UsdTimeCode const &time, TfToken const &purpose1=TfToken(), TfToken const &purpose2=TfToken(), TfToken const &purpose3=TfToken(), TfToken const &purpose4=TfToken()) const
Compute the bound of this prim in world space, at the specified time, and for the specified purposes.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
A UsdRelationship creates dependencies between scenegraph objects by allowing a prim to target other ...
Definition: relationship.h:111
The base class for all schema types in Usd.
Definition: schemaBase.h:39
Singleton registry that provides access to schema type information and the prim definitions for regis...
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:67
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition: timeCode.h:95
The base class for all typed schemas (those that can impart a typeName to a UsdPrim),...
Definition: typed.h:45
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:147
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:112
Value type containing information about a prim's computed effective purpose as well as storing whethe...
Definition: imageable.h:383
const TfToken & GetInheritablePurpose() const
Returns the purpose if it's inheritable, returns empty if it is not.
Definition: imageable.h:409
bool isInheritable
Whether this purpose should be inherited by namespace children that do not have their own authored pu...
Definition: imageable.h:395
TfToken purpose
The computed purpose.
Definition: imageable.h:391
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
USDGEOM_API TfStaticData< UsdGeomTokensType > UsdGeomTokens
A global variable with static, efficient TfTokens for use in all public USD API.