Loading...
Searching...
No Matches
constraintTarget.h
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 PXR_USD_USD_GEOM_CONSTRAINT_TARGET_H
8#define PXR_USD_USD_GEOM_CONSTRAINT_TARGET_H
9
10#include "pxr/pxr.h"
11#include "pxr/usd/usdGeom/api.h"
12#include "pxr/usd/usd/attribute.h"
13
14#include <string>
15
16PXR_NAMESPACE_OPEN_SCOPE
17
18
19class GfMatrix4d;
21
53{
54public:
55
56 // Default constructor returns an invalid ConstraintTarget. Exists for
57 // container classes
59 {
60 /* NOTHING */
61 }
62
73 USDGEOM_API
75
81 USDGEOM_API
82 static bool IsValid(const UsdAttribute &attr);
83
84 // ---------------------------------------------------------------
86 // ---------------------------------------------------------------
87
91 operator UsdAttribute const& () const { return _attr; }
92
94 UsdAttribute const &GetAttr() const { return _attr; }
95
98 bool IsDefined() const { return IsValid(_attr); }
99
100
106 explicit operator bool() const {
107 return IsDefined();
108 }
109
111 USDGEOM_API
113 const;
114
116 USDGEOM_API
117 bool Set(const GfMatrix4d& value, UsdTimeCode time = UsdTimeCode::Default())
118 const;
119
123 USDGEOM_API
125
129 USDGEOM_API
130 void SetIdentifier(const TfToken &identifier);
131
134 USDGEOM_API
135 static TfToken GetConstraintAttrName(const std::string &constraintName);
136
147 USDGEOM_API
149 UsdGeomXformCache *xfCache=NULL) const;
150
151private:
152
153 UsdAttribute _attr;
154};
155
156
157PXR_NAMESPACE_CLOSE_SCOPE
158
159#endif // USD_CONSTRAINT_TARGET_H
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:183
Schema wrapper for UsdAttribute for authoring and introspecting attributes that are constraint target...
static USDGEOM_API bool IsValid(const UsdAttribute &attr)
Test whether a given UsdAttribute represents valid ConstraintTarget, which implies that creating a Us...
USDGEOM_API GfMatrix4d ComputeInWorldSpace(UsdTimeCode time=UsdTimeCode::Default(), UsdGeomXformCache *xfCache=NULL) const
Computes the value of the constraint target in world space.
USDGEOM_API bool Get(GfMatrix4d *value, UsdTimeCode time=UsdTimeCode::Default()) const
Get the attribute value of the ConstraintTarget at time.
USDGEOM_API UsdGeomConstraintTarget(const UsdAttribute &attr)
Speculative constructor that will produce a valid UsdGeomConstraintTarget when attr already represent...
USDGEOM_API bool Set(const GfMatrix4d &value, UsdTimeCode time=UsdTimeCode::Default()) const
Set the attribute value of the ConstraintTarget at time.
bool IsDefined() const
Return true if the wrapped UsdAttribute::IsDefined(), and in addition the attribute is identified as ...
USDGEOM_API void SetIdentifier(const TfToken &identifier)
Explicitly sets the stored identifier to the given string.
USDGEOM_API TfToken GetIdentifier() const
Get the stored identifier unique to the enclosing model's namespace for this constraint target.
UsdAttribute const & GetAttr() const
Explicit UsdAttribute extractor.
static USDGEOM_API TfToken GetConstraintAttrName(const std::string &constraintName)
Returns the fully namespaced constraint attribute name, given the constraint name.
A caching mechanism for transform matrices.
Definition: xformCache.h:41
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:72
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition: timeCode.h:113