HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PxOsdMeshTopology Class Reference

#include <meshTopology.h>

Public Types

typedef uint64_t ID
 

Public Member Functions

PXOSD_API PxOsdMeshTopology ()
 
PxOsdMeshTopologyoperator= (const PxOsdMeshTopology &)=default
 
 PxOsdMeshTopology (const PxOsdMeshTopology &)=default
 
 PxOsdMeshTopology (PxOsdMeshTopology &&)=default
 
PxOsdMeshTopologyoperator= (PxOsdMeshTopology &&)=default
 
 ~PxOsdMeshTopology ()=default
 
PXOSD_API PxOsdMeshTopology (TfToken const &scheme, TfToken const &orientation, VtIntArray const &faceVertexCounts, VtIntArray const &faceVertexIndices)
 Construct a topology without holes or subdiv tags. More...
 
PXOSD_API PxOsdMeshTopology (TfToken const &scheme, TfToken const &orientation, VtIntArray const &faceVertexCounts, VtIntArray const &faceVertexIndices, VtIntArray const &holeIndices)
 Construct a topology with holes. More...
 
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. More...
 
PXOSD_API PxOsdMeshTopology (TfToken const &scheme, TfToken const &orientation, VtIntArray const &faceVertexCounts, VtIntArray const &faceVertexIndices, PxOsdSubdivTags const &subdivTags)
 Construct a topology with subdiv tags. More...
 
TfToken const GetScheme () const
 Returns the subdivision scheme. More...
 
VtIntArray const & GetFaceVertexCounts () const
 Returns face vertex counts. More...
 
VtIntArray const & GetFaceVertexIndices () const
 Returns face vertex indices. More...
 
TfToken const & GetOrientation () const
 Returns orientation. More...
 
PXOSD_API PxOsdMeshTopology WithScheme (TfToken const &scheme) const
 
PXOSD_API PxOsdMeshTopology WithSubdivTags (PxOsdSubdivTags const &tags) const
 Return a copy of the topology, changing only the subdiv tags. More...
 
PXOSD_API PxOsdMeshTopology WithHoleIndices (VtIntArray const &holeIndices) const
 Return a copy of the topology, changing only the hole indices. More...
 
PXOSD_API ID ComputeHash () const
 Returns the hash value of this topology to be used for instancing. More...
 
PXOSD_API bool operator== (PxOsdMeshTopology const &other) const
 Equality check between two mesh topologies. More...
 
PXOSD_API
PxOsdMeshTopologyValidation 
Validate () const
 
Holes

Returns the hole face indices.

VtIntArray const & GetHoleIndices () const
 
Tags
PxOsdSubdivTags const & GetSubdivTags () const
 Returns subdivision tags. More...
 

Detailed Description

Topology data for meshes.

Once constructed, this class is immutable (except when assigned or moved).

To make changing certain properties easier, several methods are provided. WithScheme, WithHoleIndices, and WithSubdivTags will return copies of the object with certain specific properites changed.

PxOsdMeshTopology otherTopology =
originalTopology.WithScheme(PxOsdOpenSubdivTokens->catmullClark);
TF_VERIFY(otherTopology.GetScheme() ==
PxOsdOpenSubdivTokens->catmullClark);
TF_VERIFY(otherTopology.GetOrientation() ==
originalTopology.GetOrientation());
TF_VERIFY(otherTopology.GetSubdivTags() ==
originalTopology.GetSubdivTags());
TF_VERIFY(otherTopology.GetFaceVertexCounts() ==
originalTopology.GetFaceVertexCounts());
TF_VERIFY(otherTopology.GetFaceVertexIndices() ==
originalTopology.GetFaceVertexIndices());

The cost of copying should be mitigated by the copy semantics of VtArray and TfToken.

Definition at line 69 of file meshTopology.h.

Member Typedef Documentation

typedef uint64_t PxOsdMeshTopology::ID

Definition at line 73 of file meshTopology.h.

Constructor & Destructor Documentation

PXOSD_API PxOsdMeshTopology::PxOsdMeshTopology ( )
PxOsdMeshTopology::PxOsdMeshTopology ( const PxOsdMeshTopology )
default
PxOsdMeshTopology::PxOsdMeshTopology ( PxOsdMeshTopology &&  )
default
PxOsdMeshTopology::~PxOsdMeshTopology ( )
default
PXOSD_API PxOsdMeshTopology::PxOsdMeshTopology ( TfToken const &  scheme,
TfToken const &  orientation,
VtIntArray const &  faceVertexCounts,
VtIntArray const &  faceVertexIndices 
)

Construct a topology without holes or subdiv tags.

PXOSD_API PxOsdMeshTopology::PxOsdMeshTopology ( TfToken const &  scheme,
TfToken const &  orientation,
VtIntArray const &  faceVertexCounts,
VtIntArray const &  faceVertexIndices,
VtIntArray const &  holeIndices 
)

Construct a topology with holes.

PXOSD_API PxOsdMeshTopology::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::PxOsdMeshTopology ( TfToken const &  scheme,
TfToken const &  orientation,
VtIntArray const &  faceVertexCounts,
VtIntArray const &  faceVertexIndices,
PxOsdSubdivTags const &  subdivTags 
)

Construct a topology with subdiv tags.

Member Function Documentation

PXOSD_API ID PxOsdMeshTopology::ComputeHash ( ) const

Returns the hash value of this topology to be used for instancing.

VtIntArray const& PxOsdMeshTopology::GetFaceVertexCounts ( ) const
inline

Returns face vertex counts.

Definition at line 128 of file meshTopology.h.

VtIntArray const& PxOsdMeshTopology::GetFaceVertexIndices ( ) const
inline

Returns face vertex indices.

Definition at line 133 of file meshTopology.h.

VtIntArray const& PxOsdMeshTopology::GetHoleIndices ( ) const
inline

Definition at line 147 of file meshTopology.h.

TfToken const& PxOsdMeshTopology::GetOrientation ( ) const
inline

Returns orientation.

Definition at line 138 of file meshTopology.h.

TfToken const PxOsdMeshTopology::GetScheme ( ) const
inline

Returns the subdivision scheme.

Definition at line 123 of file meshTopology.h.

PxOsdSubdivTags const& PxOsdMeshTopology::GetSubdivTags ( ) const
inline

Returns subdivision tags.

Definition at line 158 of file meshTopology.h.

PxOsdMeshTopology& PxOsdMeshTopology::operator= ( const PxOsdMeshTopology )
default
PxOsdMeshTopology& PxOsdMeshTopology::operator= ( PxOsdMeshTopology &&  )
default
PXOSD_API bool PxOsdMeshTopology::operator== ( PxOsdMeshTopology const &  other) const

Equality check between two mesh topologies.

PXOSD_API PxOsdMeshTopologyValidation PxOsdMeshTopology::Validate ( ) const

Returns a validation object which is empty if the topology is valid

// Validation with minimal reporting
if (!topology.Validate()) TF_CODING_ERROR("Invalid topology.");
{
PxOsdMeshTopologyValidation validation = topology.Validate();
if (!validation){
for (auto const& elem: validation){
TF_WARN(elem.message);
}
}
}
Note
Internally caches the result of the validation if the topology is valid
PXOSD_API PxOsdMeshTopology PxOsdMeshTopology::WithHoleIndices ( VtIntArray const &  holeIndices) const
inline

Return a copy of the topology, changing only the hole indices.

Definition at line 183 of file meshTopology.h.

PXOSD_API PxOsdMeshTopology PxOsdMeshTopology::WithScheme ( TfToken const &  scheme) const
inline

Return a copy of the topology, changing only the scheme. Valid values include: catmullClark, loop, bilinear.

Note that the token "catmark" is also supported for backward compatibility, but has been deprecated.

Definition at line 169 of file meshTopology.h.

PXOSD_API PxOsdMeshTopology PxOsdMeshTopology::WithSubdivTags ( PxOsdSubdivTags const &  tags) const
inline

Return a copy of the topology, changing only the subdiv tags.

Definition at line 176 of file meshTopology.h.


The documentation for this class was generated from the following file: