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

#include <meshTopologyValidation.h>

Classes

struct  Invalidation
 

Public Types

enum  Code {
  Code::InvalidScheme, Code::InvalidOrientation, Code::InvalidTriangleSubdivision, Code::InvalidVertexInterpolationRule,
  Code::InvalidFaceVaryingInterpolationRule, Code::InvalidCreaseMethod, Code::InvalidCreaseLengthElement, Code::InvalidCreaseIndicesSize,
  Code::InvalidCreaseIndicesElement, Code::InvalidCreaseWeightsSize, Code::NegativeCreaseWeights, Code::InvalidCornerIndicesElement,
  Code::NegativeCornerWeights, Code::InvalidCornerWeightsSize, Code::InvalidHoleIndicesElement, Code::InvalidFaceVertexCountsElement,
  Code::InvalidFaceVertexIndicesElement, Code::InvalidFaceVertexIndicesSize
}
 Codes for various invalid states for PxOsdMeshTopology. More...
 
using iterator = std::vector< Invalidation >::const_iterator
 
using const_iterator = std::vector< Invalidation >::const_iterator
 

Public Member Functions

 PxOsdMeshTopologyValidation ()=default
 
 PxOsdMeshTopologyValidation (PxOsdMeshTopologyValidation &&)=default
 
PxOsdMeshTopologyValidationoperator= (PxOsdMeshTopologyValidation &&)=default
 
 PxOsdMeshTopologyValidation (PxOsdMeshTopologyValidation const &other)=default
 
PxOsdMeshTopologyValidationoperator= (PxOsdMeshTopologyValidation const &other)=default
 
 operator bool () const
 Return true if the topology is valid. More...
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 

Friends

class PxOsdMeshTopology
 

Detailed Description

Utility to help validate an OpenSubdiv Mesh topology.

This class is created by PxOsdMeshTopology's Validate method.

Internally, this will avoid dynamic allocations as long as the topology is valid (currently using std::unique_ptr but targeting std::optional for C++17).

This class does a set of basic validation tests on the topology of a mesh. This set of tests isn't necessarily complete. There are other cases like invalid primvar size that this will not check for.

Topology is considered valid if it passes a series of checks enumerated by the Code class enum.

This doesn't currently validate that the topology of crease indices match valid edges.

Note
This class is convertable to bool and converts to true if the the topology is valid and false if any invalidations were found. That is to say, a conversion to true implies an empty invalidation vector and false implies a non-empty invalidation vector.

Definition at line 61 of file meshTopologyValidation.h.

Member Typedef Documentation

Member Enumeration Documentation

Codes for various invalid states for PxOsdMeshTopology.

Enumerator
InvalidScheme 

Encodes invalid scheme token value.

InvalidOrientation 

Encodes invalid orientation token value.

InvalidTriangleSubdivision 

Encodes invalid triangle subdivision token value.

InvalidVertexInterpolationRule 

Encodes invalid vertex interpolation rule token value.

InvalidFaceVaryingInterpolationRule 

Encodes invalid face varying interpolation rule token value.

InvalidCreaseMethod 

Encodes invalid crease method token value.

InvalidCreaseLengthElement 

Encodes crease lengths element less than 2.

InvalidCreaseIndicesSize 

Encodes crease indices size not matching the sum of the lengths array

InvalidCreaseIndicesElement 

Encodes crease indices element is not in the face vertex indices vector

InvalidCreaseWeightsSize 

Encodes if crease weights is the size of the number of creases or the number of crease edges

NegativeCreaseWeights 

Encodes if crease weights are negative.

InvalidCornerIndicesElement 

Encodes corner indices element is not in the face vertex indices vector

NegativeCornerWeights 

Encodes if corner weights are negative.

InvalidCornerWeightsSize 

Encodes if corner weights is not the size of the number of corner indices

InvalidHoleIndicesElement 

Encodes if the hole indices are negative or greater than the maximum face index (face count - 1)

InvalidFaceVertexCountsElement 

Encodes if a vertex count is less than 3.

InvalidFaceVertexIndicesElement 

Encodes if the element is negative.

InvalidFaceVertexIndicesSize 

Encodes if the indices size does not match the sum of the face vertex counts array

Definition at line 65 of file meshTopologyValidation.h.

Constructor & Destructor Documentation

PxOsdMeshTopologyValidation::PxOsdMeshTopologyValidation ( )
default
PxOsdMeshTopologyValidation::PxOsdMeshTopologyValidation ( PxOsdMeshTopologyValidation &&  )
default
PxOsdMeshTopologyValidation::PxOsdMeshTopologyValidation ( PxOsdMeshTopologyValidation const &  other)
default

Member Function Documentation

const_iterator PxOsdMeshTopologyValidation::begin ( void  ) const
inline

Returns an iterator for the beginning of the invalidation vector if it has been initialized. Otherwise, returns an empty iterator.

Definition at line 187 of file meshTopologyValidation.h.

const_iterator PxOsdMeshTopologyValidation::cbegin ( ) const
inline

Returns an iterator for the beginning of the invalidation vector if it has been initialized. Otherwise, returns an empty iterator.

Definition at line 200 of file meshTopologyValidation.h.

const_iterator PxOsdMeshTopologyValidation::cend ( ) const
inline

Returns an iterator for the end of the invalidation vector if it has been initialized. Otherwise, returns an empty iterator.

Definition at line 206 of file meshTopologyValidation.h.

const_iterator PxOsdMeshTopologyValidation::end ( void  ) const
inline

Returns an iterator for the end of the invalidation vector if it has been initialized. Otherwise, returns an empty iterator.

Definition at line 193 of file meshTopologyValidation.h.

PxOsdMeshTopologyValidation::operator bool ( ) const
inlineexplicit

Return true if the topology is valid.

Definition at line 178 of file meshTopologyValidation.h.

PxOsdMeshTopologyValidation& PxOsdMeshTopologyValidation::operator= ( PxOsdMeshTopologyValidation &&  )
default
PxOsdMeshTopologyValidation& PxOsdMeshTopologyValidation::operator= ( PxOsdMeshTopologyValidation const &  other)
default

Friends And Related Function Documentation

friend class PxOsdMeshTopology
friend

Definition at line 63 of file meshTopologyValidation.h.


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