Loading...
Searching...
No Matches
mesh.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24#ifndef USDGEOM_GENERATED_MESH_H
25#define USDGEOM_GENERATED_MESH_H
26
28
29#include "pxr/pxr.h"
30#include "pxr/usd/usdGeom/api.h"
32#include "pxr/usd/usd/prim.h"
33#include "pxr/usd/usd/stage.h"
35
36#include "pxr/usd/usd/timeCode.h"
37
38#include "pxr/base/vt/value.h"
39
40#include "pxr/base/gf/vec3d.h"
41#include "pxr/base/gf/vec3f.h"
43
44#include "pxr/base/tf/token.h"
45#include "pxr/base/tf/type.h"
46
47PXR_NAMESPACE_OPEN_SCOPE
48
49class SdfAssetPath;
50
51// -------------------------------------------------------------------------- //
52// MESH //
53// -------------------------------------------------------------------------- //
54
134{
135public:
139 static const UsdSchemaKind schemaKind = UsdSchemaKind::ConcreteTyped;
140
145 explicit UsdGeomMesh(const UsdPrim& prim=UsdPrim())
146 : UsdGeomPointBased(prim)
147 {
148 }
149
153 explicit UsdGeomMesh(const UsdSchemaBase& schemaObj)
154 : UsdGeomPointBased(schemaObj)
155 {
156 }
157
159 USDGEOM_API
160 virtual ~UsdGeomMesh();
161
165 USDGEOM_API
166 static const TfTokenVector &
167 GetSchemaAttributeNames(bool includeInherited=true);
168
178 USDGEOM_API
179 static UsdGeomMesh
180 Get(const UsdStagePtr &stage, const SdfPath &path);
181
204 USDGEOM_API
205 static UsdGeomMesh
206 Define(const UsdStagePtr &stage, const SdfPath &path);
207
208protected:
212 USDGEOM_API
214
215private:
216 // needs to invoke _GetStaticTfType.
217 friend class UsdSchemaRegistry;
218 USDGEOM_API
219 static const TfType &_GetStaticTfType();
220
221 static bool _IsTypedSchema();
222
223 // override SchemaBase virtuals.
224 USDGEOM_API
225 const TfType &_GetTfType() const override;
226
227public:
228 // --------------------------------------------------------------------- //
229 // FACEVERTEXINDICES
230 // --------------------------------------------------------------------- //
240 USDGEOM_API
242
248 USDGEOM_API
249 UsdAttribute CreateFaceVertexIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
250
251public:
252 // --------------------------------------------------------------------- //
253 // FACEVERTEXCOUNTS
254 // --------------------------------------------------------------------- //
266 USDGEOM_API
268
274 USDGEOM_API
275 UsdAttribute CreateFaceVertexCountsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
276
277public:
278 // --------------------------------------------------------------------- //
279 // SUBDIVISIONSCHEME
280 // --------------------------------------------------------------------- //
307 USDGEOM_API
309
315 USDGEOM_API
316 UsdAttribute CreateSubdivisionSchemeAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
317
318public:
319 // --------------------------------------------------------------------- //
320 // INTERPOLATEBOUNDARY
321 // --------------------------------------------------------------------- //
343 USDGEOM_API
345
351 USDGEOM_API
352 UsdAttribute CreateInterpolateBoundaryAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
353
354public:
355 // --------------------------------------------------------------------- //
356 // FACEVARYINGLINEARINTERPOLATION
357 // --------------------------------------------------------------------- //
387 USDGEOM_API
389
395 USDGEOM_API
396 UsdAttribute CreateFaceVaryingLinearInterpolationAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
397
398public:
399 // --------------------------------------------------------------------- //
400 // TRIANGLESUBDIVISIONRULE
401 // --------------------------------------------------------------------- //
415 USDGEOM_API
417
423 USDGEOM_API
424 UsdAttribute CreateTriangleSubdivisionRuleAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
425
426public:
427 // --------------------------------------------------------------------- //
428 // HOLEINDICES
429 // --------------------------------------------------------------------- //
439 USDGEOM_API
441
447 USDGEOM_API
448 UsdAttribute CreateHoleIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
449
450public:
451 // --------------------------------------------------------------------- //
452 // CORNERINDICES
453 // --------------------------------------------------------------------- //
463 USDGEOM_API
465
471 USDGEOM_API
472 UsdAttribute CreateCornerIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
473
474public:
475 // --------------------------------------------------------------------- //
476 // CORNERSHARPNESSES
477 // --------------------------------------------------------------------- //
488 USDGEOM_API
490
496 USDGEOM_API
497 UsdAttribute CreateCornerSharpnessesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
498
499public:
500 // --------------------------------------------------------------------- //
501 // CREASEINDICES
502 // --------------------------------------------------------------------- //
512 USDGEOM_API
514
520 USDGEOM_API
521 UsdAttribute CreateCreaseIndicesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
522
523public:
524 // --------------------------------------------------------------------- //
525 // CREASELENGTHS
526 // --------------------------------------------------------------------- //
539 USDGEOM_API
541
547 USDGEOM_API
548 UsdAttribute CreateCreaseLengthsAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
549
550public:
551 // --------------------------------------------------------------------- //
552 // CREASESHARPNESSES
553 // --------------------------------------------------------------------- //
569 USDGEOM_API
571
577 USDGEOM_API
578 UsdAttribute CreateCreaseSharpnessesAttr(VtValue const &defaultValue = VtValue(), bool writeSparsely=false) const;
579
580public:
581 // ===================================================================== //
582 // Feel free to add custom code below this line, it will be preserved by
583 // the code generator.
584 //
585 // Just remember to:
586 // - Close the class declaration with };
587 // - Close the namespace with PXR_NAMESPACE_CLOSE_SCOPE
588 // - Close the include guard with #endif
589 // ===================================================================== //
590 // --(BEGIN CUSTOM CODE)--
591
599 USDGEOM_API
600 static bool ValidateTopology(const VtIntArray& faceVertexIndices,
601 const VtIntArray& faceVertexCounts,
602 size_t numPoints,
603 std::string* reason=nullptr);
604
605public:
606
612 USDGEOM_API
613 static bool IsSharpnessInfinite(const float sharpness);
614
618 USDGEOM_API
619 static const float SHARPNESS_INFINITE;
620
626 USDGEOM_API
628
629};
630
631PXR_NAMESPACE_CLOSE_SCOPE
632
633#endif
Contains an asset path and an optional resolved path.
Definition: assetPath.h:47
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:290
TfType represents a dynamic runtime type.
Definition: type.h:65
Scenegraph object for authoring and retrieving numeric, string, and array valued data,...
Definition: attribute.h:176
Encodes a mesh with optional subdivision properties and features.
Definition: mesh.h:134
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:153
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:139
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:145
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:619
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:59
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:134
The base class for all schema types in Usd.
Definition: schemaBase.h:56
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:84
static constexpr UsdTimeCode Default()
Produce a UsdTimeCode representing the sentinel value for 'default'.
Definition: timeCode.h:112
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:164
UsdSchemaKind
An enum representing which kind of schema a given schema class belongs to.
Definition: common.h:129
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:457