Blender V5.0
blender::opensubdiv::PatchMap Class Reference

An quadtree-based map connecting coarse faces to their sub-patches. More...

#include <patch_map.h>

Classes

struct  QuadNode

Public Types

using Handle = OpenSubdiv::Far::PatchTable::PatchHandle

Public Member Functions

 PatchMap (OpenSubdiv::Far::PatchTable const &patchTable)
 Constructor.
Handle const * FindPatch (int patchFaceId, double u, double v) const
 Returns a handle to the sub-patch of the face at the given (u,v). Note that the patch face ID corresponds to potentially quadrangulated face indices and not the base face indices (see Far::PtexIndices for more details).
int getMinPatchFace () const
int getMaxPatchFace () const
int getMaxDepth () const
bool getPatchesAreTriangular () const
const std::vector< Handle > & getHandles ()
const std::vector< QuadNode > & nodes ()

Detailed Description

An quadtree-based map connecting coarse faces to their sub-patches.

PatchTable::PatchArrays contain lists of patches that represent the limit surface of a mesh, sorted by their topological type. These arrays break the connection between coarse faces and their sub-patches.

The PatchMap provides a quad-tree based lookup structure that, given a singular parametric location, can efficiently return a handle to the sub-patch that contains this location.

Definition at line 25 of file patch_map.h.

Member Typedef Documentation

◆ Handle

using blender::opensubdiv::PatchMap::Handle = OpenSubdiv::Far::PatchTable::PatchHandle

Definition at line 49 of file patch_map.h.

Constructor & Destructor Documentation

◆ PatchMap()

blender::opensubdiv::PatchMap::PatchMap ( OpenSubdiv::Far::PatchTable const & patchTable)

Constructor.

Parameters
patchTableA valid PatchTable

Definition at line 77 of file patch_map.cc.

Member Function Documentation

◆ FindPatch()

PatchMap::Handle const * blender::opensubdiv::PatchMap::FindPatch ( int patchFaceId,
double u,
double v ) const
inline

Returns a handle to the sub-patch of the face at the given (u,v). Note that the patch face ID corresponds to potentially quadrangulated face indices and not the base face indices (see Far::PtexIndices for more details).

Returns a handle to the sub-patch of the face at the given (u,v).

Parameters
patchFaceIdThe index of the patch (Ptex) face
uLocal u parameter
vLocal v parameter
Returns
A patch handle or 0 if the face is not supported (index out of bounds) or is tagged as a hole

Definition at line 201 of file patch_map.h.

References assert, blender::opensubdiv::PatchMap::QuadNode::children, blender::opensubdiv::PatchMap::QuadNode::Child::index, blender::opensubdiv::PatchMap::QuadNode::Child::isLeaf, blender::opensubdiv::PatchMap::QuadNode::Child::isSet, and v.

Referenced by blender::opensubdiv::convertPatchCoordsToArray().

◆ getHandles()

const std::vector< Handle > & blender::opensubdiv::PatchMap::getHandles ( )
inline

Definition at line 93 of file patch_map.h.

◆ getMaxDepth()

int blender::opensubdiv::PatchMap::getMaxDepth ( ) const
inline

Definition at line 83 of file patch_map.h.

◆ getMaxPatchFace()

int blender::opensubdiv::PatchMap::getMaxPatchFace ( ) const
inline

Definition at line 78 of file patch_map.h.

◆ getMinPatchFace()

int blender::opensubdiv::PatchMap::getMinPatchFace ( ) const
inline

Definition at line 73 of file patch_map.h.

◆ getPatchesAreTriangular()

bool blender::opensubdiv::PatchMap::getPatchesAreTriangular ( ) const
inline

Definition at line 88 of file patch_map.h.

◆ nodes()

const std::vector< QuadNode > & blender::opensubdiv::PatchMap::nodes ( )
inline

Definition at line 98 of file patch_map.h.


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