Public Member Functions | Public Attributes

MNChamferData Class Reference

Search for all occurrences

Detailed Description

Contains all the data needed to move points (and map vertices) as the user drags a chamfer or extrude.

It's created by the topological change that happens at the start of the chamfer or extrude. The strategy is this: The chamfer/extrude operation is divided into two parts, the topological change and a later geometric change. (This works well for Editable Poly, where the topology change is completed first, then apply a series of geometry changes as the user spins a spinner or drags a mouse. Each geometry change is undone before the next is applied, but the topology change only happens once.)

This class is first initialized to a mesh. Then its data is filled in by the topological change. This data is used to find "directions" for all the geometric and mapping vert changes over the course of the geometric modification.

Note:
For convenient caching, it is recommended that you use this class through the MNTempData class.
See also:
MNTempData, MNMesh

#include <mnmesh.h>

Inheritance diagram for MNChamferData:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  MNChamferData ()
  Constructor.
  MNChamferData (const MNMesh &m)
  Constructor.
DllExport  ~MNChamferData ()
  Destructor.
DllExport void  InitToMesh (const MNMesh &m)
  This method sets up the MNChamferData based on a given mesh, allocating the vertex and mapping vertex tables as appropriate.
DllExport void  setNumVerts (int nv, bool keep=TRUE, int resizer=0)
  This method allocates the vdir and vmax tables, and initializes the new members of vmax to 0.
DllExport void  ClearLimits ()
  Clears all the vmax limits to -1 (no limit).
DllExport void  GetDelta (float amount, Tab< Point3 > &delta)
  Uses vectors and limits to obtain the offsets corresponding to a certain extrude or chamfer amount.
DllExport bool  GetMapDelta (MNMesh &mm, int mapChannel, float amount, Tab< UVVert > &delta)
  Uses map vectors and limits to obtain the mapping offsets corresponding to a certain extrude or chamfer amount.
Tab< UVVert > &  MDir (int mapChannel)
  Data accessor.

Public Attributes

Tab< Point3 vdir
  The related direction vectors for mapping vertices in all active mapping channels.
Tab< float >  vmax
  The maximum amount each vector may be applied (before vertices start crossing over each other.
Tab< UVVert > *  mdir
  The related direction vectors for mapping vertices in all active mapping channels.

Constructor & Destructor Documentation

MNChamferData ( ) [inline]

Constructor.

{ mdir=NULL;}
MNChamferData ( const MNMesh m ) [inline]

Constructor.

This constructor Initializes to the mesh passed (allocates mapping channels, etc.)

Parameters:
const MNMesh & m

The specified mesh.
{ mdir=NULL; InitToMesh(m);}
DllExport ~MNChamferData ( )

Destructor.


Member Function Documentation

DllExport void InitToMesh ( const MNMesh m )

This method sets up the MNChamferData based on a given mesh, allocating the vertex and mapping vertex tables as appropriate.

Parameters:
const MNMesh & m

The Mesh to initialize from.
DllExport void setNumVerts ( int  nv,
bool  keep = TRUE,
int  resizer = 0 
)

This method allocates the vdir and vmax tables, and initializes the new members of vmax to 0.

(Note: this method can be applied to an existing MNChamferData to reflect an increase in vertices in the MNMesh as topological changes occur.)

Parameters:
int nv

The number of vertices.

bool keep=TRUE

TRUE to keep old data if resized; FALSE to discard old data.

int resizer=0

The number of extra elements the vdir and vmax tables are resized beyond their current size. (Extra allocation space to prevent excessive reallocation.)
DllExport void ClearLimits ( )

Clears all the vmax limits to -1 (no limit).

DllExport void GetDelta ( float  amount,
Tab< Point3 > &  delta 
)

Uses vectors and limits to obtain the offsets corresponding to a certain extrude or chamfer amount.

Parameters:
float amount

The amount of the extrude or chamfer.

Tab<Point3> & delta

A table (with size set equal to the number of vertices, aka vdir.Count()) containing the geometric offset for each vertex in the mesh.
DllExport bool GetMapDelta ( MNMesh mm,
int  mapChannel,
float  amount,
Tab< UVVert > &  delta 
)

Uses map vectors and limits to obtain the mapping offsets corresponding to a certain extrude or chamfer amount.

Parameters:
MNMesh & mm

The mesh this MNChamferData is based on.

int mapChannel

The index of the map channel (from -NUM_HIDDENMAPS to mm.MNum()).

float amount

The amount of the extrude or chamfer.

Tab<UVVert> & delta

The offsets for each mapping vertex in this map in the mesh.
Tab<UVVert>& MDir ( int  mapChannel ) [inline]

Data accessor.

This method returns the appropriate map info. If mp >= 0, it returns the member of the mdir array. If mp < 0, it returns the member of the hmdir array (in keeping with "hidden map channel" indexing conventions).

{ return (mapChannel<0) ? hmdir[-1-mapChannel] : mdir[mapChannel]; }

Member Data Documentation

The related direction vectors for mapping vertices in all active mapping channels.

Tab<float> vmax

The maximum amount each vector may be applied (before vertices start crossing over each other.

The related direction vectors for mapping vertices in all active mapping channels.


MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData
MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData MNChamferData