This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
curves.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_CURVES_H
8#define USDGEOM_GENERATED_CURVES_H
9
11
12#include "pxr/pxr.h"
13#include "pxr/usd/usdGeom/api.h"
15#include "pxr/usd/usd/prim.h"
16#include "pxr/usd/usd/stage.h"
18
19#include "pxr/base/vt/value.h"
20
21#include "pxr/base/gf/vec3d.h"
22#include "pxr/base/gf/vec3f.h"
24
25#include "pxr/base/tf/token.h"
26#include "pxr/base/tf/type.h"
27
28PXR_NAMESPACE_OPEN_SCOPE
29
30class SdfAssetPath;
31
32// -------------------------------------------------------------------------- //
33// CURVES //
34// -------------------------------------------------------------------------- //
35
59{
60public:
64 static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractTyped;
65
70 explicit UsdGeomCurves(const UsdPrim& prim=UsdPrim())
71 : UsdGeomPointBased(prim)
72 {
73 }
74
78 explicit UsdGeomCurves(const UsdSchemaBase& schemaObj)
79 : UsdGeomPointBased(schemaObj)
80 {
81 }
82
84 USDGEOM_API
85 virtual ~UsdGeomCurves();
86
90 USDGEOM_API
91 static const TfTokenVector &
92 GetSchemaAttributeNames(bool includeInherited=true);
93
103 USDGEOM_API
104 static UsdGeomCurves
105 Get(const UsdStagePtr &stage, const SdfPath &path);
106
107
108protected:
112 USDGEOM_API
114
115private:
116 // needs to invoke _GetStaticTfType.
117 friend class UsdSchemaRegistry;
118 USDGEOM_API
119 static const TfType &_GetStaticTfType();
120
121 static bool _IsTypedSchema();
122
123 // override SchemaBase virtuals.
124 USDGEOM_API
125 const TfType &_GetTfType() const override;
126
127public:
128 // --------------------------------------------------------------------- //
129 // CURVEVERTEXCOUNTS
130 // --------------------------------------------------------------------- //
141 USDGEOM_API
143
149 USDGEOM_API
150 UsdAttribute CreateCurveVertexCountsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
151
152public:
153 // --------------------------------------------------------------------- //
154 // WIDTHS
155 // --------------------------------------------------------------------- //
169 USDGEOM_API
171
177 USDGEOM_API
178 UsdAttribute CreateWidthsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
179
180public:
181 // ===================================================================== //
182 // Feel free to add custom code below this line, it will be preserved by
183 // the code generator.
184 //
185 // Just remember to:
186 // - Close the class declaration with };
187 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
188 // - Close the include guard with #endif
189 // ===================================================================== //
190 // --(BEGIN CUSTOM CODE)--
191
200 USDGEOM_API
202
213 USDGEOM_API
214 bool SetWidthsInterpolation(TfToken const &interpolation);
215
226 USDGEOM_API
227 static bool ComputeExtent(const VtVec3fArray& points,
228 const VtFloatArray& widths, VtVec3fArray* extent);
229
232 USDGEOM_API
233 static bool ComputeExtent(const VtVec3fArray& points,
234 const VtFloatArray& widths, const GfMatrix4d& transform,
235 VtVec3fArray* extent);
236
242 USDGEOM_API
244};
245
246PXR_NAMESPACE_CLOSE_SCOPE
247
248#endif
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
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 UsdGeomBasisCurves, UsdGeomNurbsCurves, and UsdGeomHermiteCurves.
Definition: curves.h:59
virtual USDGEOM_API ~UsdGeomCurves()
Destructor.
UsdGeomCurves(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomCurves on UsdPrim prim .
Definition: curves.h:70
USDGEOM_API UsdAttribute CreateCurveVertexCountsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetCurveVertexCountsAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
static USDGEOM_API UsdGeomCurves Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomCurves holding the prim adhering to this schema at path on stage.
USDGEOM_API UsdAttribute CreateWidthsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetWidthsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: curves.h:64
USDGEOM_API UsdAttribute GetWidthsAttr() const
Provides width specification for the curves, whose application will depend on whether the curve is or...
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 size_t GetCurveCount(UsdTimeCode timeCode=UsdTimeCode::Default()) const
Returns the number of curves as defined by the size of the curveVertexCounts array at timeCode.
USDGEOM_API TfToken GetWidthsInterpolation() const
Get the interpolation for the widths attribute.
static USDGEOM_API bool ComputeExtent(const VtVec3fArray &points, const VtFloatArray &widths, const GfMatrix4d &transform, VtVec3fArray *extent)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USDGEOM_API bool SetWidthsInterpolation(TfToken const &interpolation)
Set the interpolation for the widths attribute.
static USDGEOM_API bool ComputeExtent(const VtVec3fArray &points, const VtFloatArray &widths, VtVec3fArray *extent)
Compute the extent for the curves defined by points and widths.
UsdGeomCurves(const UsdSchemaBase &schemaObj)
Construct a UsdGeomCurves on the prim held by schemaObj .
Definition: curves.h:78
USDGEOM_API UsdAttribute GetCurveVertexCountsAttr() const
Curves-derived primitives can represent multiple distinct, potentially disconnected curves.
Base class for all UsdGeomGprims that possess points, providing common attributes such as normals and...
Definition: pointBased.h:42
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
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
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
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