Loading...
Searching...
No Matches
points.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_POINTS_H
8#define USDGEOM_GENERATED_POINTS_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// POINTS //
34// -------------------------------------------------------------------------- //
35
50{
51public:
55 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
56
61 explicit UsdGeomPoints(const UsdPrim& prim=UsdPrim())
62 : UsdGeomPointBased(prim)
63 {
64 }
65
69 explicit UsdGeomPoints(const UsdSchemaBase& schemaObj)
70 : UsdGeomPointBased(schemaObj)
71 {
72 }
73
75 USDGEOM_API
76 virtual ~UsdGeomPoints();
77
81 USDGEOM_API
82 static const TfTokenVector &
83 GetSchemaAttributeNames(bool includeInherited=true);
84
94 USDGEOM_API
95 static UsdGeomPoints
96 Get(const UsdStagePtr &stage, const SdfPath &path);
97
120 USDGEOM_API
121 static UsdGeomPoints
122 Define(const UsdStagePtr &stage, const SdfPath &path);
123
124protected:
128 USDGEOM_API
130
131private:
132 // needs to invoke _GetStaticTfType.
133 friend class UsdSchemaRegistry;
134 USDGEOM_API
135 static const TfType &_GetStaticTfType();
136
137 static bool _IsTypedSchema();
138
139 // override SchemaBase virtuals.
140 USDGEOM_API
141 const TfType &_GetTfType() const override;
142
143public:
144 // --------------------------------------------------------------------- //
145 // WIDTHS
146 // --------------------------------------------------------------------- //
159 USDGEOM_API
161
167 USDGEOM_API
168 UsdAttribute CreateWidthsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
169
170public:
171 // --------------------------------------------------------------------- //
172 // IDS
173 // --------------------------------------------------------------------- //
186 USDGEOM_API
188
194 USDGEOM_API
195 UsdAttribute CreateIdsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
196
197public:
198 // ===================================================================== //
199 // Feel free to add custom code below this line, it will be preserved by
200 // the code generator.
201 //
202 // Just remember to:
203 // - Close the class declaration with };
204 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
205 // - Close the include guard with #endif
206 // ===================================================================== //
207 // --(BEGIN CUSTOM CODE)--
208
217 USDGEOM_API
219
230 USDGEOM_API
231 bool SetWidthsInterpolation(TfToken const &interpolation);
232
244 USDGEOM_API
245 static bool ComputeExtent(const VtVec3fArray& points,
246 const VtFloatArray& widths, VtVec3fArray* extent);
247
250 USDGEOM_API
251 static bool ComputeExtent(const VtVec3fArray& points,
252 const VtFloatArray& widths, const GfMatrix4d& transform,
253 VtVec3fArray* extent);
254
260 USDGEOM_API
262
263};
264
265PXR_NAMESPACE_CLOSE_SCOPE
266
267#endif
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
Contains an asset path and optional evaluated and resolved paths.
Definition: assetPath.h:78
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:183
Base class for all UsdGeomGprims that possess points, providing common attributes such as normals and...
Definition: pointBased.h:42
Points are analogous to the RiPoints spec.
Definition: points.h:50
static USDGEOM_API UsdGeomPoints Define(const UsdStagePtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefin...
static USDGEOM_API UsdGeomPoints Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomPoints 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: points.h:55
virtual USDGEOM_API ~UsdGeomPoints()
Destructor.
USDGEOM_API UsdAttribute GetWidthsAttr() const
Widths are defined as the diameter of the points, in object space.
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
UsdGeomPoints(const UsdSchemaBase &schemaObj)
Construct a UsdGeomPoints on the prim held by schemaObj .
Definition: points.h:69
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 UsdAttribute CreateIdsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetIdsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API TfToken GetWidthsInterpolation() const
Get the interpolation for the widths attribute.
UsdGeomPoints(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomPoints on UsdPrim prim .
Definition: points.h:61
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 UsdAttribute GetIdsAttr() const
Ids are optional; if authored, the ids array should be the same length as the points array,...
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 point cloud defined by points and widths.
USDGEOM_API size_t GetPointCount(UsdTimeCode timeCode=UsdTimeCode::Default()) const
Returns the number of points as defined by the size of the points array at timeCode.
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:72
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition: timeCode.h:113
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:90
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