Loading...
Searching...
No Matches
PxOsdMeshTopologyValidation Class Reference

Utility to help validate an OpenSubdiv Mesh topology. More...

#include <meshTopologyValidation.h>

Classes

struct  Invalidation
 A tuple containing a code describing an invalidation and a descriptive message. More...
 

Public Types

enum class  Code {
  InvalidScheme , InvalidOrientation , InvalidTriangleSubdivision , InvalidVertexInterpolationRule ,
  InvalidFaceVaryingInterpolationRule , InvalidCreaseMethod , InvalidCreaseLengthElement , InvalidCreaseIndicesSize ,
  InvalidCreaseIndicesElement , InvalidCreaseWeightsSize , NegativeCreaseWeights , InvalidCornerIndicesElement ,
  NegativeCornerWeights , InvalidCornerWeightsSize , InvalidHoleIndicesElement , InvalidFaceVertexCountsElement ,
  InvalidFaceVertexIndicesElement , 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 (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.
 
const_iterator begin () const
 Returns an iterator for the beginning of the invalidation vector if it has been initialized.
 
const_iterator end () const
 Returns an iterator for the end of the invalidation vector if it has been initialized.
 
const_iterator cbegin () const
 Returns an iterator for the beginning of the invalidation vector if it has been initialized.
 
const_iterator cend () const
 Returns an iterator for the end of the invalidation vector if it has been initialized.
 

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.

\warn 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.


Class Documentation

◆ PxOsdMeshTopologyValidation::Invalidation

struct PxOsdMeshTopologyValidation::Invalidation

A tuple containing a code describing an invalidation and a descriptive message.

Definition at line 112 of file meshTopologyValidation.h.

Class Members
Code code
string message

Member Typedef Documentation

◆ const_iterator

using const_iterator = std::vector<Invalidation>::const_iterator

Definition at line 183 of file meshTopologyValidation.h.

◆ iterator

using iterator = std::vector<Invalidation>::const_iterator

Definition at line 182 of file meshTopologyValidation.h.

Member Enumeration Documentation

◆ Code

enum class Code
strong

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.

Member Function Documentation

◆ begin()

const_iterator begin ( ) 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.

◆ cbegin()

const_iterator 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.

◆ cend()

const_iterator 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.

◆ end()

const_iterator end ( ) 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.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Return true if the topology is valid.

Definition at line 178 of file meshTopologyValidation.h.

Friends And Related Function Documentation

◆ PxOsdMeshTopology

friend class PxOsdMeshTopology
friend

Definition at line 63 of file meshTopologyValidation.h.


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