24#ifndef PXR_IMAGING_PX_OSD_MESH_TOPOLOGY_H
25#define PXR_IMAGING_PX_OSD_MESH_TOPOLOGY_H
30#include "pxr/imaging/pxOsd/api.h"
32#include "pxr/imaging/pxOsd/meshTopologyValidation.h"
35#include "pxr/base/vt/value.h"
39PXR_NAMESPACE_OPEN_SCOPE
89 VtIntArray
const& faceVertexCounts,
90 VtIntArray
const& faceVertexIndices);
97 VtIntArray
const& faceVertexCounts,
98 VtIntArray
const& faceVertexIndices,
99 VtIntArray
const& holeIndices);
106 VtIntArray
const& faceVertexCounts,
107 VtIntArray
const& faceVertexIndices,
108 VtIntArray
const& holeIndices,
116 VtIntArray
const& faceVertexCounts,
117 VtIntArray
const& faceVertexIndices,
129 return _faceVertexCounts;
134 return _faceVertexIndices;
147 VtIntArray
const &GetHoleIndices()
const {
179 GetHoleIndices(), tags);
229 VtIntArray _faceVertexCounts;
230 VtIntArray _faceVertexIndices;
231 VtIntArray _holeIndices;
236 std::atomic<bool> value;
238 _Validated() : value(false) {}
239 _Validated(
const _Validated& other) : value(other.value.load()) {}
240 _Validated(_Validated&& other) : value(other.value.load()) {
243 _Validated& operator=(
const _Validated& other) {
244 value.store(other.value.load());
247 _Validated& operator=(_Validated&& other) {
248 value.store(other.value.load());
258 mutable _Validated _validated;
267PXR_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 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...