TessApprox Class Reference

TessApprox Class Reference

#include <maxtess.h>

Class Description

See also
Class NURBSSet.

Description:
This class describes the properties of a tesselation approximation to the mathematical surface.

All methods of this class are implemented by the system.
Data Members:
TessType type;

These are the types of tesselation (one of which is obsolete). One of the following values:

TESS_SET

This is the old form of tesselation for Bezier Patches. This is also the default for these patches. For instance, if you create a Quad Patch and apply an Edit Patch modifier, then exit sub-object mode, you'll see a panel in the rollup for 'Tesselation'. The top choice is 'Fixed (original)'. This is the same type of tesselation done in 3ds Max 1.x.

TESS_PARAM

Specifies parametric tesselation. This provides for a fixed number of u by v tesselations. There are u times v quadrilaterals and each one is split up into two triangles.

TESS_SPATIAL

Specifies spatial tesselation. This uses edge as its parameter. This specifies that the size of the tesselation will be the edge length (see below). In view dependent tesselation edge is specified in pixels.

TESS_CURVE

Specifies view dependent tesselation. This uses the ang and dist data members described below.

TESS_LDA

This option is available in release 3.0 and later only.

Specifies a method which combines the spatial (edge-length) method and the curvature (distance and angle) methods. This uses the ang, dist and edge data members below.

TESS_REGULAR

This option is available in release 3.0 and later only.

Generates a fixed, regular tessellation across the surface. There are no additional parameters.

TESS_ISO

Obsolete – Do Not Use.

ViewConfig vpt_cfg;

This determines what is displayed in the interactive renderer. These correspond to the controls in the user interface (under Surface/Approximation/Viewports). This is not available for bezier patches. One of the following values:

ISO_ONLY

Only Iso lines. Iso(parametric) lines are similar to contour lines. The lines show where the NURBS surface has a constant U value or V value or both. Iso line representations can be less crowded and easier to visualize than wire mesh representations..

ISO_AND_MESH

Iso lines and the mesh. When chosen, wireframe viewports display iso line representations of the surface, and shaded viewports display the shaded surface.

MESH_ONLY

Just the mesh. When chosen, wireframe viewports display the surface as a wire mesh, and shaded viewports display the shaded surface. In wireframe viewports, this option lets you see the curve approximation used for viewports.

TessSubdivStyle subdiv;

This data member is available in release 3.0 and later only.

The type of subdivision. One of the following values:

SUBDIV_TREE

Subdivides the surface using a binary tree.

SUBDIV_GRID

Subdivides the surface using a regular grid.

SUBDIV_DELAUNAY

Subdivides the surface using nearly equilateral triangles.

BOOL view;

Specifies if this is view dependent tesselation. If TRUE this will tesselate less finely the farther away from the camera the object is. If FALSE the tesselation does not change based on distance from the camera.

int u;

This is used for parametric tesselation. This is the number of tesselations in u. This is the number of sub-divisions for a knot span for the surface.

int v;

This is used for parametric tesselation. This is the number of tesselations in v.

int u_iso;

This is used with the ISO line display. This is the number of additional interior iso lines in u (there are always lines along the outter edges).

int v_iso;

This is used with the ISO line display. This is the number of additional interior iso lines in v (there are always lines along the outter edges).

float ang;

This is used in curvature dependent tesselation (TESS_CURVE). If 0.0 is specified this is ignored. If specified this ensure that no two adjacent face normals exceed this angle between them. This value is specified in radians.

float dist;

This is used in curvature dependent tesselation (TESS_CURVE). If 0.0 is specified this is ignored. This specifies a distance that cannot be exceeded between a vertex on the mesh and the mathematical surface. This is defined as a percentage of the diagonal of the bounding box of the individual surface in object space. For instance if this was set to 1.0, the allowable error in generating a tesselation would be 1% of the bounding box diagonal distance of the surface. This would be 1/100 (1 %) of the diagonal distance of the bounding box. In this way if an object is scaled the tesselation remains the same. Additionally, if you have an object with a big surface and a little surface, the smaller surface will get tesselated more finely because its own bounding box is used. This prevents the smaller surface from just becoming a single triangle for example.

float edge;

This is the length of an edge to use in spatial (TESS_SPATIAL) tesselation. In view dependent tesselation this is specified in pixels. If not in view dependent tesselation this is a percentage of the bounding box diagonal length.

int minSub;

This data member is available in release 3.0 and later only.

For Grid or Tree subdivisions, this limit controls the number of recursive decompositions that are performed during tessellation. This is the minimum number of recursions.

int maxSub;

This data member is available in release 3.0 and later only.

For Grid or Tree subdivisions, this limit controls the number of recursive decompositions that are performed during tessellation. This is the maximum number of recursions.

int maxTris;

This data member is available in release 3.0 and later only.

For Delaunay subdivision, this specifies the maximum mumber of triangles into which the surface will be divided.
+ Inheritance diagram for TessApprox:

Public Member Functions

UtilExport TessApprox ()
 
UtilExport TessApprox (TessType type, float distance, float edge, float angle, TessSubdivStyle subdivStyle, int minSub, int maxSub, float m=0.0f)
 
UtilExport TessApprox (const TessApprox &tess)
 
UtilExport TessApproxoperator= (const TessApprox &tess)
 
UtilExport int operator== (const TessApprox &tess) const
 
UtilExport IOResult Load (ILoad *iload)
 
UtilExport IOResult Save (ISave *isave)
 

Public Attributes

TessType type
 
ViewConfig vpt_cfg
 
TessSubdivStyle subdiv
 
BOOL view
 
float merge
 
int u
 
int v
 
int u_iso
 
int v_iso
 
float ang
 
float dist
 
float edge
 
int minSub
 
int maxSub
 
int maxTris
 
BOOL showInteriorFaces
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 

Constructor & Destructor Documentation

Remarks
Constructor. The data members are initialized as follows:

type = TESS_SET;

u = v = 2;

u_iso = 2;

v_iso = 3;

view = FALSE;

ang = 20.0f;

dist = 10.0f;

edge = 10.0f;

vpt_cfg = ISO_AND_MESH;

merge = 0.0f;

minSub = 0;

maxSub = 5;

maxTris = 20000;

subdiv = SUBDIV_TREE;

showInteriorFaces = FALSE;
UtilExport TessApprox ( TessType  type,
float  distance,
float  edge,
float  angle,
TessSubdivStyle  subdivStyle,
int  minSub,
int  maxSub,
float  m = 0.0f 
)
Remarks
Constructor. The data members are initialized to the values passed.
UtilExport TessApprox ( const TessApprox tess)
Remarks
Constructor. The data members are initialized from the object passed.
Operators:

Member Function Documentation

UtilExport TessApprox& operator= ( const TessApprox tess)
Remarks
Assignment operator.
Parameters:
const TessApprox &tess

The object to assign.
UtilExport int operator== ( const TessApprox tess) const
Remarks
Equality operator. Returns nonzero if they are equal; otherwise zero.
Parameters:
const TessApprox &tess

The object to compare.
UtilExport IOResult Load ( ILoad iload)
UtilExport IOResult Save ( ISave isave)

Member Data Documentation

TessType type
ViewConfig vpt_cfg
BOOL view
float merge
int u
int v
int u_iso
int v_iso
float ang
float dist
float edge
int minSub
int maxSub
int maxTris
BOOL showInteriorFaces