All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
pointBased.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_POINTBASED_H
8#define USDGEOM_GENERATED_POINTBASED_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// POINTBASED //
34// -------------------------------------------------------------------------- //
35
42{
43public:
47 static const UsdSchemaKind schemaKind = UsdSchemaKind::AbstractTyped;
48
53 explicit UsdGeomPointBased(const UsdPrim& prim=UsdPrim())
54 : UsdGeomGprim(prim)
55 {
56 }
57
61 explicit UsdGeomPointBased(const UsdSchemaBase& schemaObj)
62 : UsdGeomGprim(schemaObj)
63 {
64 }
65
67 USDGEOM_API
69
73 USDGEOM_API
74 static const TfTokenVector &
75 GetSchemaAttributeNames(bool includeInherited=true);
76
86 USDGEOM_API
88 Get(const UsdStagePtr &stage, const SdfPath &path);
89
90
91protected:
95 USDGEOM_API
96 UsdSchemaKind _GetSchemaKind() const override;
97
98private:
99 // needs to invoke _GetStaticTfType.
100 friend class UsdSchemaRegistry;
101 USDGEOM_API
102 static const TfType &_GetStaticTfType();
103
104 static bool _IsTypedSchema();
105
106 // override SchemaBase virtuals.
107 USDGEOM_API
108 const TfType &_GetTfType() const override;
109
110public:
111 // --------------------------------------------------------------------- //
112 // POINTS
113 // --------------------------------------------------------------------- //
122 USDGEOM_API
124
130 USDGEOM_API
131 UsdAttribute CreatePointsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
132
133public:
134 // --------------------------------------------------------------------- //
135 // VELOCITIES
136 // --------------------------------------------------------------------- //
155 USDGEOM_API
157
163 USDGEOM_API
164 UsdAttribute CreateVelocitiesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
165
166public:
167 // --------------------------------------------------------------------- //
168 // ACCELERATIONS
169 // --------------------------------------------------------------------- //
182 USDGEOM_API
184
190 USDGEOM_API
191 UsdAttribute CreateAccelerationsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
192
193public:
194 // --------------------------------------------------------------------- //
195 // NORMALS
196 // --------------------------------------------------------------------- //
211 USDGEOM_API
213
219 USDGEOM_API
220 UsdAttribute CreateNormalsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
221
222public:
223 // ===================================================================== //
224 // Feel free to add custom code below this line, it will be preserved by
225 // the code generator.
226 //
227 // Just remember to:
228 // - Close the class declaration with };
229 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
230 // - Close the include guard with #endif
231 // ===================================================================== //
232 // --(BEGIN CUSTOM CODE)--
233
245 USDGEOM_API
247
258 USDGEOM_API
259 bool SetNormalsInterpolation(TfToken const &interpolation);
260
271 USDGEOM_API
272 static bool ComputeExtent(const VtVec3fArray& points, VtVec3fArray* extent);
273
276 USDGEOM_API
277 static bool ComputeExtent(const VtVec3fArray& points,
278 const GfMatrix4d& transform, VtVec3fArray* extent);
279
280public:
318 USDGEOM_API
319 bool
321 VtArray<GfVec3f>* points,
322 const UsdTimeCode time,
323 const UsdTimeCode baseTime) const;
324
331 USDGEOM_API
332 bool
334 std::vector<VtArray<GfVec3f>>* pointsArray,
335 const std::vector<UsdTimeCode>& times,
336 const UsdTimeCode baseTime) const;
337
360 USDGEOM_API
361 static bool
363 VtArray<GfVec3f>* points,
364 UsdStageWeakPtr& stage,
365 UsdTimeCode time,
366 const VtVec3fArray& positions,
367 const VtVec3fArray& velocities,
368 UsdTimeCode velocitiesSampleTime,
369 const VtVec3fArray& accelerations,
370 float velocityScale=1.0);
371
372};
373
374PXR_NAMESPACE_CLOSE_SCOPE
375
376#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 all geometric primitives.
Definition: gprim.h:50
Base class for all UsdGeomGprims that possess points, providing common attributes such as normals and...
Definition: pointBased.h:42
USDGEOM_API bool ComputePointsAtTime(VtArray< GfVec3f > *points, const UsdTimeCode time, const UsdTimeCode baseTime) const
Compute points given the positions, velocities and accelerations at time.
USDGEOM_API UsdAttribute CreateNormalsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetNormalsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute GetVelocitiesAttr() const
If provided, 'velocities' should be used by renderers to.
USDGEOM_API UsdAttribute CreatePointsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetPointsAttr(), 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: pointBased.h:47
static USDGEOM_API bool ComputeExtent(const VtVec3fArray &points, const GfMatrix4d &transform, VtVec3fArray *extent)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USDGEOM_API bool SetNormalsInterpolation(TfToken const &interpolation)
Set the interpolation for the normals attribute.
static USDGEOM_API bool ComputeExtent(const VtVec3fArray &points, VtVec3fArray *extent)
Compute the extent for the point cloud defined by points.
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
USDGEOM_API bool ComputePointsAtTimes(std::vector< VtArray< GfVec3f > > *pointsArray, const std::vector< UsdTimeCode > &times, const UsdTimeCode baseTime) const
Compute points as in ComputePointsAtTime, but using multiple sample times.
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...
UsdGeomPointBased(const UsdSchemaBase &schemaObj)
Construct a UsdGeomPointBased on the prim held by schemaObj .
Definition: pointBased.h:61
UsdGeomPointBased(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomPointBased on UsdPrim prim .
Definition: pointBased.h:53
static USDGEOM_API UsdGeomPointBased Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomPointBased holding the prim adhering to this schema at path on stage.
static USDGEOM_API bool ComputePointsAtTime(VtArray< GfVec3f > *points, UsdStageWeakPtr &stage, UsdTimeCode time, const VtVec3fArray &positions, const VtVec3fArray &velocities, UsdTimeCode velocitiesSampleTime, const VtVec3fArray &accelerations, float velocityScale=1.0)
This is an overloaded member function, provided for convenience. It differs from the above function o...
USDGEOM_API UsdAttribute CreateVelocitiesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetVelocitiesAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute GetAccelerationsAttr() const
If provided, 'accelerations' should be used with velocities to compute positions between samples for ...
virtual USDGEOM_API ~UsdGeomPointBased()
Destructor.
USDGEOM_API UsdAttribute GetNormalsAttr() const
Provide an object-space orientation for individual points, which, depending on subclass,...
USDGEOM_API UsdAttribute GetPointsAttr() const
The primary geometry attribute for all PointBased primitives, describes points in (local) space.
USDGEOM_API TfToken GetNormalsInterpolation() const
Get the interpolation for the normals attribute.
USDGEOM_API UsdAttribute CreateAccelerationsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetAccelerationsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
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
Represents an arbitrary dimensional rectangular container class.
Definition: array.h:211
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