PatchParam Struct Reference

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Public Attributes | List of all members
PatchParam Struct Reference

Local patch parameterization descriptor. More...

`#include <patchParam.h>`

Inheritance diagram for 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 | unused
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

  u | u parameter
  v | v 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

  faceid | face index
  u | value of the u parameter for the first corner of the face
  v | value of the v parameter for the first corner of the face
  depth | subdivision level of the patch
  nonquad | true if the root face is not a quad
  boundary | 4-bits identifying boundary edges
  transition | 4-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:

- opensubdiv/far/patchParam.h