All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
mesh.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_MESH_H
8#define USDGEOM_GENERATED_MESH_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/usd/usd/timeCode.h"
20
21#include "pxr/base/vt/value.h"
22
23#include "pxr/base/gf/vec3d.h"
24#include "pxr/base/gf/vec3f.h"
26
27#include "pxr/base/tf/token.h"
28#include "pxr/base/tf/type.h"
29
30PXR_NAMESPACE_OPEN_SCOPE
31
32class SdfAssetPath;
33
34// -------------------------------------------------------------------------- //
35// MESH //
36// -------------------------------------------------------------------------- //
37
117{
118public:
122 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
123
128 explicit UsdGeomMesh(const UsdPrim& prim=UsdPrim())
129 : UsdGeomPointBased(prim)
130 {
131 }
132
136 explicit UsdGeomMesh(const UsdSchemaBase& schemaObj)
137 : UsdGeomPointBased(schemaObj)
138 {
139 }
140
142 USDGEOM_API
143 virtual ~UsdGeomMesh();
144
148 USDGEOM_API
149 static const TfTokenVector &
150 GetSchemaAttributeNames(bool includeInherited=true);
151
161 USDGEOM_API
162 static UsdGeomMesh
163 Get(const UsdStagePtr &stage, const SdfPath &path);
164
187 USDGEOM_API
188 static UsdGeomMesh
189 Define(const UsdStagePtr &stage, const SdfPath &path);
190
191protected:
195 USDGEOM_API
197
198private:
199 // needs to invoke _GetStaticTfType.
200 friend class UsdSchemaRegistry;
201 USDGEOM_API
202 static const TfType &_GetStaticTfType();
203
204 static bool _IsTypedSchema();
205
206 // override SchemaBase virtuals.
207 USDGEOM_API
208 const TfType &_GetTfType() const override;
209
210public:
211 // --------------------------------------------------------------------- //
212 // FACEVERTEXINDICES
213 // --------------------------------------------------------------------- //
223 USDGEOM_API
225
231 USDGEOM_API
232 UsdAttribute CreateFaceVertexIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
233
234public:
235 // --------------------------------------------------------------------- //
236 // FACEVERTEXCOUNTS
237 // --------------------------------------------------------------------- //
249 USDGEOM_API
251
257 USDGEOM_API
258 UsdAttribute CreateFaceVertexCountsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
259
260public:
261 // --------------------------------------------------------------------- //
262 // SUBDIVISIONSCHEME
263 // --------------------------------------------------------------------- //
290 USDGEOM_API
292
298 USDGEOM_API
299 UsdAttribute CreateSubdivisionSchemeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
300
301public:
302 // --------------------------------------------------------------------- //
303 // INTERPOLATEBOUNDARY
304 // --------------------------------------------------------------------- //
326 USDGEOM_API
328
334 USDGEOM_API
335 UsdAttribute CreateInterpolateBoundaryAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
336
337public:
338 // --------------------------------------------------------------------- //
339 // FACEVARYINGLINEARINTERPOLATION
340 // --------------------------------------------------------------------- //
370 USDGEOM_API
372
378 USDGEOM_API
379 UsdAttribute CreateFaceVaryingLinearInterpolationAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
380
381public:
382 // --------------------------------------------------------------------- //
383 // TRIANGLESUBDIVISIONRULE
384 // --------------------------------------------------------------------- //
398 USDGEOM_API
400
406 USDGEOM_API
407 UsdAttribute CreateTriangleSubdivisionRuleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
408
409public:
410 // --------------------------------------------------------------------- //
411 // HOLEINDICES
412 // --------------------------------------------------------------------- //
422 USDGEOM_API
424
430 USDGEOM_API
431 UsdAttribute CreateHoleIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
432
433public:
434 // --------------------------------------------------------------------- //
435 // CORNERINDICES
436 // --------------------------------------------------------------------- //
446 USDGEOM_API
448
454 USDGEOM_API
455 UsdAttribute CreateCornerIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
456
457public:
458 // --------------------------------------------------------------------- //
459 // CORNERSHARPNESSES
460 // --------------------------------------------------------------------- //
471 USDGEOM_API
473
479 USDGEOM_API
480 UsdAttribute CreateCornerSharpnessesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
481
482public:
483 // --------------------------------------------------------------------- //
484 // CREASEINDICES
485 // --------------------------------------------------------------------- //
495 USDGEOM_API
497
503 USDGEOM_API
504 UsdAttribute CreateCreaseIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
505
506public:
507 // --------------------------------------------------------------------- //
508 // CREASELENGTHS
509 // --------------------------------------------------------------------- //
522 USDGEOM_API
524
530 USDGEOM_API
531 UsdAttribute CreateCreaseLengthsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
532
533public:
534 // --------------------------------------------------------------------- //
535 // CREASESHARPNESSES
536 // --------------------------------------------------------------------- //
552 USDGEOM_API
554
560 USDGEOM_API
561 UsdAttribute CreateCreaseSharpnessesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
562
563public:
564 // ===================================================================== //
565 // Feel free to add custom code below this line, it will be preserved by
566 // the code generator.
567 //
568 // Just remember to:
569 // - Close the class declaration with };
570 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
571 // - Close the include guard with #endif
572 // ===================================================================== //
573 // --(BEGIN CUSTOM CODE)--
574
582 USDGEOM_API
583 static bool ValidateTopology(const VtIntArray& faceVertexIndices,
584 const VtIntArray& faceVertexCounts,
585 size_t numPoints,
586 std::string* reason=nullptr);
587
588public:
589
595 USDGEOM_API
596 static bool IsSharpnessInfinite(const float sharpness);
597
601 USDGEOM_API
602 static const float SHARPNESS_INFINITE;
603
609 USDGEOM_API
611
612};
613
614PXR_NAMESPACE_CLOSE_SCOPE
615
616#endif
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
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
Encodes a mesh with optional subdivision properties and features.
Definition: mesh.h:117
USDGEOM_API UsdAttribute GetSubdivisionSchemeAttr() const
The subdivision scheme to be applied to the surface.
USDGEOM_API UsdAttribute CreateCornerSharpnessesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetCornerSharpnessesAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
UsdGeomMesh(const UsdSchemaBase &schemaObj)
Construct a UsdGeomMesh on the prim held by schemaObj .
Definition: mesh.h:136
USDGEOM_API UsdAttribute CreateTriangleSubdivisionRuleAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetTriangleSubdivisionRuleAttr(), and also Create vs Get Property Methods for when to use Get vs ...
static USDGEOM_API UsdGeomMesh Define(const UsdStagePtr &stage, const SdfPath &path)
Attempt to ensure a UsdPrim adhering to this schema at path is defined (according to UsdPrim::IsDefin...
USDGEOM_API UsdAttribute GetCreaseLengthsAttr() const
The length of this array specifies the number of creases (sets of adjacent sharpened edges) on the me...
USDGEOM_API UsdAttribute CreateCornerIndicesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetCornerIndicesAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute CreateFaceVaryingLinearInterpolationAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetFaceVaryingLinearInterpolationAttr(), and also Create vs Get Property Methods for when to use ...
static const UsdSchemaKind schemaKind
Compile time constant representing what kind of schema this class is.
Definition: mesh.h:122
static USDGEOM_API bool ValidateTopology(const VtIntArray &faceVertexIndices, const VtIntArray &faceVertexCounts, size_t numPoints, std::string *reason=nullptr)
Validate the topology of a mesh.
USDGEOM_API UsdAttribute GetFaceVertexIndicesAttr() const
Flat list of the index (into the points attribute) of each vertex of each face in the mesh.
USDGEOM_API UsdAttribute GetCornerSharpnessesAttr() const
The sharpness values associated with a corresponding set of points specified in cornerIndices (so the...
USDGEOM_API UsdAttribute GetHoleIndicesAttr() const
The indices of all faces that should be treated as holes, i.e.
USDGEOM_API UsdAttribute GetFaceVaryingLinearInterpolationAttr() const
Specifies how elements of a primvar of interpolation type "faceVarying" are interpolated for subdivis...
USDGEOM_API UsdSchemaKind _GetSchemaKind() const override
Returns the kind of schema this class belongs to.
static USDGEOM_API UsdGeomMesh Get(const UsdStagePtr &stage, const SdfPath &path)
Return a UsdGeomMesh holding the prim adhering to this schema at path on stage.
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 GetFaceCount(UsdTimeCode timeCode=UsdTimeCode::Default()) const
Returns the number of faces as defined by the size of the faceVertexCounts array at timeCode.
USDGEOM_API UsdAttribute CreateSubdivisionSchemeAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetSubdivisionSchemeAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
USDGEOM_API UsdAttribute GetCornerIndicesAttr() const
The indices of points for which a corresponding sharpness value is specified in cornerSharpnesses (so...
USDGEOM_API UsdAttribute CreateCreaseLengthsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetCreaseLengthsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute CreateHoleIndicesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetHoleIndicesAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute CreateFaceVertexCountsAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetFaceVertexCountsAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute GetCreaseIndicesAttr() const
The indices of points grouped into sets of successive pairs that identify edges to be creased.
USDGEOM_API UsdAttribute GetInterpolateBoundaryAttr() const
Specifies how subdivision is applied for faces adjacent to boundary edges and boundary points.
USDGEOM_API UsdAttribute CreateFaceVertexIndicesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetFaceVertexIndicesAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
USDGEOM_API UsdAttribute GetFaceVertexCountsAttr() const
Provides the number of vertices in each face of the mesh, which is also the number of consecutive ind...
USDGEOM_API UsdAttribute CreateInterpolateBoundaryAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetInterpolateBoundaryAttr(), and also Create vs Get Property Methods for when to use Get vs Crea...
UsdGeomMesh(const UsdPrim &prim=UsdPrim())
Construct a UsdGeomMesh on UsdPrim prim .
Definition: mesh.h:128
static USDGEOM_API bool IsSharpnessInfinite(const float sharpness)
Returns whether or not sharpness is considered infinite.
USDGEOM_API UsdAttribute GetCreaseSharpnessesAttr() const
The per-crease or per-edge sharpness values for all creases.
USDGEOM_API UsdAttribute GetTriangleSubdivisionRuleAttr() const
Specifies an option to the subdivision rules for the Catmull-Clark scheme to try and improve undesira...
static USDGEOM_API const float SHARPNESS_INFINITE
As an element of a 'creaseSharpness' or 'cornerSharpness' array, indicates that the crease or corner ...
Definition: mesh.h:602
virtual USDGEOM_API ~UsdGeomMesh()
Destructor.
USDGEOM_API UsdAttribute CreateCreaseIndicesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetCreaseIndicesAttr(), and also Create vs Get Property Methods for when to use Get vs Create.
USDGEOM_API UsdAttribute CreateCreaseSharpnessesAttr(VtValue const &defaultValue=VtValue(), bool writeSparsely=false) const
See GetCreaseSharpnessesAttr(), and also Create vs Get Property Methods for when to use Get vs Create...
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