7#ifndef PXR_IMAGING_PX_OSD_MESH_TOPOLOGY_H
8#define PXR_IMAGING_PX_OSD_MESH_TOPOLOGY_H
13#include "pxr/imaging/pxOsd/api.h"
15#include "pxr/imaging/pxOsd/meshTopologyValidation.h"
18#include "pxr/base/vt/value.h"
22PXR_NAMESPACE_OPEN_SCOPE
72 VtIntArray
const& faceVertexCounts,
73 VtIntArray
const& faceVertexIndices);
80 VtIntArray
const& faceVertexCounts,
81 VtIntArray
const& faceVertexIndices,
82 VtIntArray
const& holeIndices);
89 VtIntArray
const& faceVertexCounts,
90 VtIntArray
const& faceVertexIndices,
91 VtIntArray
const& holeIndices,
99 VtIntArray
const& faceVertexCounts,
100 VtIntArray
const& faceVertexIndices,
112 return _faceVertexCounts;
117 return _faceVertexIndices;
130 VtIntArray
const &GetHoleIndices()
const {
169 GetHoleIndices(), tags);
219 VtIntArray _faceVertexCounts;
220 VtIntArray _faceVertexIndices;
221 VtIntArray _holeIndices;
226 std::atomic<bool> value;
228 _Validated() : value(false) {}
229 _Validated(
const _Validated& other) : value(other.value.load()) {}
230 _Validated(_Validated&& other) : value(other.value.load()) {
233 _Validated& operator=(
const _Validated& other) {
234 value.store(other.value.load());
237 _Validated& operator=(_Validated&& other) {
238 value.store(other.value.load());
248 mutable _Validated _validated;
257PXR_NAMESPACE_CLOSE_SCOPE
Topology data for meshes.
PXOSD_API PxOsdMeshTopology(TfToken const &scheme, TfToken const &orientation, VtIntArray const &faceVertexCounts, VtIntArray const &faceVertexIndices, PxOsdSubdivTags const &subdivTags)
Construct a topology with subdiv tags.
TfToken const & GetOrientation() const
Returns orientation.
PXOSD_API PxOsdMeshTopology WithHoleIndices(VtIntArray const &holeIndices) const
Return a copy of the topology, changing only the hole indices.
PXOSD_API PxOsdMeshTopology(TfToken const &scheme, TfToken const &orientation, VtIntArray const &faceVertexCounts, VtIntArray const &faceVertexIndices, VtIntArray const &holeIndices)
Construct a topology with holes.
PXOSD_API PxOsdMeshTopologyValidation Validate() const
Returns a validation object which is empty if the topology is valid.
PXOSD_API PxOsdMeshTopology WithScheme(TfToken const &scheme) const
Return a copy of the topology, changing only the scheme.
PXOSD_API PxOsdMeshTopology(TfToken const &scheme, TfToken const &orientation, VtIntArray const &faceVertexCounts, VtIntArray const &faceVertexIndices)
Construct a topology without holes or subdiv tags.
PXOSD_API PxOsdMeshTopology WithOrientation(TfToken const &orient) const
Return a copy of the topology, changing only the orientation.
PXOSD_API bool operator==(PxOsdMeshTopology const &other) const
Equality check between two mesh topologies.
PXOSD_API PxOsdMeshTopology(TfToken const &scheme, TfToken const &orientation, VtIntArray const &faceVertexCounts, VtIntArray const &faceVertexIndices, VtIntArray const &holeIndices, PxOsdSubdivTags const &subdivTags)
Construct a topology with holes and subdiv tags.
PXOSD_API PxOsdMeshTopology WithSubdivTags(PxOsdSubdivTags const &tags) const
Return a copy of the topology, changing only the subdiv tags.
PXOSD_API ID ComputeHash() const
Returns the hash value of this topology to be used for instancing.
PxOsdSubdivTags const & GetSubdivTags() const
Returns subdivision tags.
TfToken const GetScheme() const
Returns the subdivision scheme.
VtIntArray const & GetFaceVertexCounts() const
Returns face vertex counts.
VtIntArray const & GetFaceVertexIndices() const
Returns face vertex indices.
Utility to help validate an OpenSubdiv Mesh topology.
Token for efficient comparison, assignment, and hashing of known strings.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...