Classes | Namespaces | Defines | Functions | Variables

patch.h File Reference

#include "maxheap.h"
#include "coreexp.h"
#include "meshlib.h"
#include "hitdata.h"
#include "maxtess.h"
#include "PatchTypeConstants.h"

Go to the source code of this file.

Classes

class   HookPoint
class   ExtrudeData
class   PRVertex
class   PatchVec
class   PatchVert
class   PatchTVert
class   PatchEdge
class   Patch
class   TVPatch
class   PatchSubHitRec
class   SubPatchHitList
class   PatchHitData
class   PatchMesh

Namespaces

namespace   MaxGraphics

Defines

#define  PATCH_UNDEFINED   -1
#define  NEWPATCH
#define  PVEC_INTERIOR   (1<<0)
#define  PVEC_INTERIOR_MASK   0xfffffffe
#define  NUM_PATCH_VEC_FLAGS   1
#define  PVERT_COPLANAR   (1<<0)
#define  PVERT_CORNER   (0)
#define  PVERT_TYPE_MASK   0xfffffffe
#define  PVERT_HIDDEN   (1<<1)
#define  PVERT_HIDDEN_MASK   0xfffffffd
#define  PVERT_RESET   (1<<2)
#define  NUM_PATCH_VERT_FLAGS   2
#define  PATCH_AUTO   (1<<0)
#define  PATCH_MANUAL   (0)
#define  PATCH_INTERIOR_MASK   0xfffffffe
#define  PATCH_HIDDEN   (1<<1)
#define  PATCH_LINEARMAPPING   (1<<2)
#define  PATCH_USE_CURVED_MAPPING_ON_VERTEX_COLOR   (1<<3)
#define  PATCH_MATID_SHIFT   16
#define  PATCH_MATID_MASK   0xFFFF
#define  NUM_PATCH_PATCH_FLAGS   5
#define  PATCH_HIT_PATCH   0
#define  PATCH_HIT_EDGE   1
#define  PATCH_HIT_VERTEX   2
#define  PATCH_HIT_VECTOR   3
#define  PATCH_HIT_INTERIOR   4
#define  SUBHIT_PATCH_SELONLY   (1<<0)
#define  SUBHIT_PATCH_UNSELONLY   (1<<2)
#define  SUBHIT_PATCH_ABORTONHIT   (1<<3)
#define  SUBHIT_PATCH_SELSOLID   (1<<4)
#define  SUBHIT_PATCH_VERTS   (1<<24)
#define  SUBHIT_PATCH_VECS   (1<<25)
#define  SUBHIT_PATCH_PATCHES   (1<<26)
#define  SUBHIT_PATCH_EDGES   (1<<27)
#define  SUBHIT_PATCH_TYPEMASK   (SUBHIT_PATCH_VERTS|SUBHIT_PATCH_VECS|SUBHIT_PATCH_EDGES|SUBHIT_PATCH_PATCHES)
#define  SUBHIT_PATCH_IGNORE_BACKFACING   (1<<28)
#define  PATCH_OBJECT   (1<<0)
#define  PATCH_VERTEX   (1<<1)
#define  PATCH_PATCH   (1<<2)
#define  PATCH_EDGE   (1<<3)
#define  PATCH_HANDLE   (1<<4)
#define  SUBDIV_EDGES   0
#define  SUBDIV_PATCHES   1
#define  DEF_PM_RELAX   FALSE
#define  DEF_PM_RELAX_VIEWPORTS   TRUE
#define  DEF_PM_RELAX_VALUE   0.0f
#define  DEF_PM_ITER   1
#define  DEF_PM_BOUNDARY   TRUE
#define  DEF_PM_SADDLE   FALSE
#define  PM_HITTEST_REQUIRE_ALL   (1<<0)
Conversion flags

These are used in conversion methods in core\converters.cpp and in poly\converters.cpp.

#define  CONVERT_KEEPSEL   0x0001
#define  CONVERT_USESOFTSEL   0x0002
#define  CONVERT_SEL_LEVEL   0x0004
#define  CONVERT_PATCH_USEQUADS   0x0010
#define  CONVERT_NO_RELAX   0x0020

Functions

CoreExport void  setPatchIntrFunc (INTRFUNC fn)
CoreExport void  ConvertMeshToPatch (Mesh &m, PatchMesh &pm, DWORD flags=0)
CoreExport void  ConvertPatchToMesh (PatchMesh &pm, Mesh &m, DWORD flags=0)
CoreExport void  ConvertPatchToMeshWithMapping (PatchMesh &pm, Mesh &m, Tab< int > *mapping, DWORD flags=0)
  This method converts a Patch to Trimesh, similarly to the method ConvertPatchToMesh().
CoreExport void  RelaxMesh (Mesh &mesh, float value, int iter, BOOL boundary, BOOL saddle)

Variables

const DWORD  PatchVecFlagMasks [] = {1}
const int  PatchVecFlagShifts [] = {0}
const DWORD  PatchVertFlagMasks [] = {1, 1}
const int  PatchVertFlagShifts [] = {0, 1}
const DWORD  PatchPatchFlagMasks [] = {1, 1, 1, 1, 0xffff}
const int  PatchPatchFlagShifts [] = {0, 1, 2, 3, 16}

Define Documentation

#define PATCH_UNDEFINED   -1

Definition at line 33 of file patch.h.

#define NEWPATCH

Definition at line 63 of file patch.h.

#define PVEC_INTERIOR   (1<<0)

Definition at line 75 of file patch.h.

#define PVEC_INTERIOR_MASK   0xfffffffe

Definition at line 76 of file patch.h.

#define NUM_PATCH_VEC_FLAGS   1

Definition at line 79 of file patch.h.

#define PVERT_COPLANAR   (1<<0)

Definition at line 163 of file patch.h.

#define PVERT_CORNER   (0)

Definition at line 164 of file patch.h.

#define PVERT_TYPE_MASK   0xfffffffe

Definition at line 165 of file patch.h.

#define PVERT_HIDDEN   (1<<1)

Definition at line 167 of file patch.h.

#define PVERT_HIDDEN_MASK   0xfffffffd

Definition at line 168 of file patch.h.

#define PVERT_RESET   (1<<2)

Definition at line 170 of file patch.h.

#define NUM_PATCH_VERT_FLAGS   2

Definition at line 173 of file patch.h.

#define PATCH_AUTO   (1<<0)

Definition at line 435 of file patch.h.

#define PATCH_MANUAL   (0)

Definition at line 436 of file patch.h.

#define PATCH_INTERIOR_MASK   0xfffffffe

Definition at line 437 of file patch.h.

#define PATCH_HIDDEN   (1<<1)

Definition at line 439 of file patch.h.

#define PATCH_LINEARMAPPING   (1<<2)

Definition at line 442 of file patch.h.

#define PATCH_USE_CURVED_MAPPING_ON_VERTEX_COLOR   (1<<3)

Definition at line 444 of file patch.h.

#define PATCH_MATID_SHIFT   16

Definition at line 447 of file patch.h.

#define PATCH_MATID_MASK   0xFFFF

Definition at line 448 of file patch.h.

#define NUM_PATCH_PATCH_FLAGS   5

Definition at line 451 of file patch.h.

#define PATCH_HIT_PATCH   0

Definition at line 853 of file patch.h.

#define PATCH_HIT_EDGE   1

Definition at line 854 of file patch.h.

#define PATCH_HIT_VERTEX   2

Definition at line 855 of file patch.h.

#define PATCH_HIT_VECTOR   3

Definition at line 856 of file patch.h.

#define PATCH_HIT_INTERIOR   4

Definition at line 857 of file patch.h.

#define SUBHIT_PATCH_SELONLY   (1<<0)

Definition at line 970 of file patch.h.

#define SUBHIT_PATCH_UNSELONLY   (1<<2)

Definition at line 971 of file patch.h.

#define SUBHIT_PATCH_ABORTONHIT   (1<<3)

Definition at line 972 of file patch.h.

#define SUBHIT_PATCH_SELSOLID   (1<<4)

Definition at line 973 of file patch.h.

#define SUBHIT_PATCH_VERTS   (1<<24)

Definition at line 975 of file patch.h.

#define SUBHIT_PATCH_VECS   (1<<25)

Definition at line 976 of file patch.h.

#define SUBHIT_PATCH_PATCHES   (1<<26)

Definition at line 977 of file patch.h.

#define SUBHIT_PATCH_EDGES   (1<<27)

Definition at line 978 of file patch.h.

#define SUBHIT_PATCH_TYPEMASK   (SUBHIT_PATCH_VERTS|SUBHIT_PATCH_VECS|SUBHIT_PATCH_EDGES|SUBHIT_PATCH_PATCHES)

Definition at line 979 of file patch.h.

#define SUBHIT_PATCH_IGNORE_BACKFACING   (1<<28)

Definition at line 980 of file patch.h.

#define PATCH_OBJECT   (1<<0)

Definition at line 985 of file patch.h.

#define PATCH_VERTEX   (1<<1)

Definition at line 986 of file patch.h.

#define PATCH_PATCH   (1<<2)

Definition at line 987 of file patch.h.

#define PATCH_EDGE   (1<<3)

Definition at line 988 of file patch.h.

#define PATCH_HANDLE   (1<<4)

Definition at line 989 of file patch.h.

#define SUBDIV_EDGES   0

Definition at line 992 of file patch.h.

#define SUBDIV_PATCHES   1

Definition at line 993 of file patch.h.

#define DEF_PM_RELAX   FALSE

Definition at line 996 of file patch.h.

#define DEF_PM_RELAX_VIEWPORTS   TRUE

Definition at line 997 of file patch.h.

#define DEF_PM_RELAX_VALUE   0.0f

Definition at line 998 of file patch.h.

#define DEF_PM_ITER   1

Definition at line 999 of file patch.h.

#define DEF_PM_BOUNDARY   TRUE

Definition at line 1000 of file patch.h.

#define DEF_PM_SADDLE   FALSE

Definition at line 1001 of file patch.h.

#define PM_HITTEST_REQUIRE_ALL   (1<<0)

Definition at line 1004 of file patch.h.

#define CONVERT_KEEPSEL   0x0001

Definition at line 2752 of file patch.h.

#define CONVERT_USESOFTSEL   0x0002

Definition at line 2753 of file patch.h.

#define CONVERT_SEL_LEVEL   0x0004

Definition at line 2754 of file patch.h.

#define CONVERT_PATCH_USEQUADS   0x0010

Definition at line 2755 of file patch.h.

#define CONVERT_NO_RELAX   0x0020

Definition at line 2756 of file patch.h.


Function Documentation

CoreExport void setPatchIntrFunc ( INTRFUNC  fn )
CoreExport void ConvertMeshToPatch ( Mesh m,
PatchMesh pm,
DWORD  flags = 0 
)
CoreExport void ConvertPatchToMesh ( PatchMesh pm,
Mesh m,
DWORD  flags = 0 
)
CoreExport void ConvertPatchToMeshWithMapping ( PatchMesh pm,
Mesh m,
Tab< int > *  mapping,
DWORD  flags = 0 
)

This method converts a Patch to Trimesh, similarly to the method ConvertPatchToMesh().

However, the new method also stores the mapping from the Mesh's faces to the PatchMesh's patches in the 'mapping' parameter.

Parameters:
[in] pm - The patch to convert
[in] m - The mesh object we set our converted TriMesh onto.
[out] mapping - After conversion, this array will be filled a mapping from the Mesh's faces to the PatchMeshs faces.
[in] flags - One of the ConversionFlags
CoreExport void RelaxMesh ( Mesh mesh,
float  value,
int  iter,
BOOL  boundary,
BOOL  saddle 
)

Variable Documentation

const DWORD PatchVecFlagMasks[] = {1}

Definition at line 80 of file patch.h.

const int PatchVecFlagShifts[] = {0}

Definition at line 81 of file patch.h.

const DWORD PatchVertFlagMasks[] = {1, 1}

Definition at line 174 of file patch.h.

const int PatchVertFlagShifts[] = {0, 1}

Definition at line 175 of file patch.h.

const DWORD PatchPatchFlagMasks[] = {1, 1, 1, 1, 0xffff}

Definition at line 452 of file patch.h.

const int PatchPatchFlagShifts[] = {0, 1, 2, 3, 16}

Definition at line 453 of file patch.h.