PatchParam Struct Reference

Local patch parameterization descriptor. More...

#include <patchParam.h>

Inheritance diagram for PatchParam:
PatchParam

Public Member Functions

void Set (Index faceid, short u, short v, unsigned short depth, bool nonquad, unsigned short boundary, unsigned short transition)
 Sets the values of the bit fields. More...
 
void Clear ()
 Resets everything to 0. More...
 
Index GetFaceId () const
 Retuns the faceid. More...
 
unsigned short GetU () const
 Returns the log2 value of the u parameter at the top left corner of the patch. More...
 
unsigned short GetV () const
 Returns the log2 value of the v parameter at the top left corner of the patch. More...
 
unsigned short GetTransition () const
 Returns the transition edge encoding for the patch. More...
 
unsigned short GetBoundary () const
 Returns the boundary edge encoding for the patch. More...
 
bool NonQuadRoot () const
 True if the parent coarse face is a non-quad. More...
 
float GetParamFraction () const
 Returns the fraction of normalized parametric space covered by the sub-patch. More...
 
unsigned short GetDepth () const
 Returns the level of subdivision of the patch. More...
 
void Normalize (float &u, float &v) const
 

Public Attributes

unsigned int field0:32
 
unsigned int field1:32
 

Detailed Description

Local patch parameterization descriptor.

Coarse mesh faces are split into sets of patches in both uniform and feature adaptive modes. In order to maintain local patch parameterization, it is necessary to retain some information, such as level of subdivision, face- winding status... This parameterization is directly applicable to ptex textures, but has to be remapped to a specific layout for uv textures.

Bitfield layout :

Field0 Bits Content
faceId 28 the faceId of the patch
transition 4 transition edge mask encoding
Field1 Bits Content
level 4 the subdivision level of the patch
nonquad 1 whether the patch is the child of a non-quad face
unused 3 transition edge mask encoding
boundary 4 boundary edge mask encoding
v 10 log2 value of u parameter at first patch corner
u 10 log2 value of v parameter at first patch corner

Note : the bitfield is not expanded in the struct due to differences in how GPU & CPU compilers pack bit-fields and endian-ness.

Definition at line 64 of file patchParam.h.

Member Function Documentation

void Clear ( )
inline

Resets everything to 0.

Definition at line 83 of file patchParam.h.

unsigned short GetBoundary ( ) const
inline

Returns the boundary edge encoding for the patch.

Definition at line 100 of file patchParam.h.

unsigned short GetDepth ( ) const
inline

Returns the level of subdivision of the patch.

Definition at line 110 of file patchParam.h.

Index GetFaceId ( ) const
inline

Retuns the faceid.

Definition at line 86 of file patchParam.h.

float GetParamFraction ( ) const
inline

Returns the fraction of normalized parametric space covered by the sub-patch.

Definition at line 142 of file patchParam.h.

unsigned short GetTransition ( ) const
inline

Returns the transition edge encoding for the patch.

Definition at line 97 of file patchParam.h.

unsigned short GetU ( ) const
inline

Returns the log2 value of the u parameter at the top left corner of the patch.

Definition at line 90 of file patchParam.h.

unsigned short GetV ( ) const
inline

Returns the log2 value of the v parameter at the top left corner of the patch.

Definition at line 94 of file patchParam.h.

bool NonQuadRoot ( ) const
inline

True if the parent coarse face is a non-quad.

Definition at line 103 of file patchParam.h.

void Normalize ( float &  u,
float &  v 
) const
inline

The (u,v) pair is normalized to this sub-parametric space.

Parameters
uu parameter
vv parameter

Definition at line 151 of file patchParam.h.

void Set ( Index  faceid,
short  u,
short  v,
unsigned short  depth,
bool  nonquad,
unsigned short  boundary,
unsigned short  transition 
)
inline

Sets the values of the bit fields.

Parameters
faceidface index
uvalue of the u parameter for the first corner of the face
vvalue of the v parameter for the first corner of the face
depthsubdivision level of the patch
nonquadtrue if the root face is not a quad
boundary4-bits identifying boundary edges
transition4-bits identifying transition edges

Definition at line 129 of file patchParam.h.

Member Data Documentation

unsigned int field0

Definition at line 119 of file patchParam.h.

unsigned int field1

Definition at line 120 of file patchParam.h.


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