3ds Max C++ API Reference
Loading...
Searching...
No Matches
MNChamferData Class Reference

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

#include <mnmesh.h>

+ Inheritance diagram for MNChamferData:

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< Point3vdir
 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.
 

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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator.
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator.
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary.
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary.
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc.
 

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

Constructor & Destructor Documentation

◆ MNChamferData() [1/2]

MNChamferData ( )
inline

Constructor.

6003{ mdir=NULL;}
#define NULL
Definition: autoptr.h:18
Tab< UVVert > * mdir
The related direction vectors for mapping vertices in all active mapping channels.
Definition: mnmesh.h:6000

◆ MNChamferData() [2/2]

MNChamferData ( const MNMesh m)
inline

Constructor.

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

Parameters:
const MNMesh & m

The specified mesh.
6011{ mdir=NULL; InitToMesh(m);}
DllExport void InitToMesh(const MNMesh &m)
This method sets up the MNChamferData based on a given mesh, allocating the vertex and mapping vertex...

◆ ~MNChamferData()

Destructor.

Member Function Documentation

◆ InitToMesh()

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.

◆ setNumVerts()

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.)

◆ ClearLimits()

DllExport void ClearLimits ( )

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

◆ GetDelta()

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.

◆ GetMapDelta()

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.

◆ MDir()

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).

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

Member Data Documentation

◆ vdir

Tab<Point3> vdir

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

◆ vmax

Tab<float> vmax

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

◆ mdir

Tab<UVVert>* mdir

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