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

Describes a single knot in a spline. More...

#include <spline3d.h>

+ Inheritance diagram for SplineKnot:

Public Member Functions

CoreExport SplineKnot ()
 
CoreExport SplineKnot (int k, int l, const Point3 &p, const Point3 &in, const Point3 &out, int a1=-1, int a2=-1, int a3=-1, int Ia1=-1, int Ia2=-1, int Ia3=-1, int Oa1=-1, int Oa2=-1, int Oa3=-1, DWORD f=0)
 Constructor.
 
CoreExport SplineKnot (const SplineKnotAssy &k)
 
int Ktype () const
 Returns the knot type.
 
void SetKtype (int t)
 Sets the knot type.
 
int Ltype () const
 Returns the line type.
 
void SetLtype (int t)
 Sets the line type.
 
int Aux () const
 Provides access to the first integer chunk of auxiliary data for the knot.
 
void SetAux (int a)
 Sets the first integer of auxiliary data for the knot.
 
int Aux2 () const
 Provides access to the second integer of auxiliary data for the knot.
 
void SetAux2 (int a)
 Sets the second integer of auxiliary data for the knot.
 
int Aux3 () const
 
void SetAux3 (int a)
 
int InAux () const
 
void SetInAux (int a)
 
int InAux2 () const
 
void SetInAux2 (int a)
 
int InAux3 () const
 
void SetInAux3 (int a)
 
int OutAux () const
 
void SetOutAux (int a)
 
int OutAux2 () const
 
void SetOutAux2 (int a)
 
int OutAux3 () const
 
void SetOutAux3 (int a)
 
Point3 Knot () const
 Returns the point location for the knot.
 
void SetKnot (Point3 p)
 Sets the point location for the knot.
 
Point3 InVec () const
 Returns the in vector for the knot.
 
void SetInVec (Point3 p)
 Sets the in vector for the knot.
 
Point3 OutVec () const
 Returns the out vector for the knot.
 
void SetOutVec (Point3 p)
 Sets the out vector for the knot.
 
MtlID GetMatID () const
 
void SetMatID (MtlID id)
 
DWORD GetFlags () const
 
BOOL IsHidden () const
 
void Hide ()
 
void Unhide ()
 
BOOL IsNoSnap () const
 
void SetNoSnap ()
 
void ClearNoSnap ()
 
BOOL GetFlag (DWORD fl) const
 
void SetFlag (DWORD fl, BOOL val=TRUE)
 
void ClearFlag (DWORD fl)
 

Friends

class Spline3D
 
class SplineKnotAssy
 

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

Describes a single knot in a spline.

It is used by plug-ins to get and set knot information in the Spline3D class. This is primarily here for backward-compatibility with versions prior to MAXr3. In 3ds Max 2.0 and later there are methods which provide full access to the private data members of the class. All methods of this class are implemented by the system. To understand this class better, picture a bezier spline with three knots, going from left to right:
A—>AB-—BA<—B—>BC-—CB<—C The knot points are A, B and C. The vectors are labeled the same as patch vectors (AB is the vector from A going toward B, the vector from B to A is labeled BA, and so on). In this diagram, AB is the OUT vector for knot A. BA is the IN vector for knot B. BC is the OUT vector for knot B, and CB is the IN vector for knot C. Because this is an open spline, knot A doesn't use its IN vector, and knot C doesn't use its OUT vector. The IN and OUT terminology is based on the way a spline flows from the first knot to the last. If the spline is reversed, the IN and OUT sense is reversed, as well. Regarding the vectors, the only difference between a circle and a square is that the square has vectors that are at the same location as the knot point (in other words, zero length vectors) causing sharp corners. The circle uses vectors which cause each segment to bulge to form a quarter-circle. Take a look at the /MAXSDK/SAMPLES/OBJECTS/NGON.CPP source file for an example of how the vectors are generated to form a linear NGON versus a circular one.

See also
Spline3D

Constructor & Destructor Documentation

◆ SplineKnot() [1/3]

◆ SplineKnot() [2/3]

CoreExport SplineKnot ( int  k,
int  l,
const Point3 p,
const Point3 in,
const Point3 out,
int  a1 = -1,
int  a2 = -1,
int  a3 = -1,
int  Ia1 = -1,
int  Ia2 = -1,
int  Ia3 = -1,
int  Oa1 = -1,
int  Oa2 = -1,
int  Oa3 = -1,
DWORD  f = 0 
)

Constructor.

The data members are initialized to the values passed.

Parameters
kKnot type
lLine type
pPoint Location
inIn vector
outOut vector
a1Used for capping. An integer value which may be used for temporary storage of data associated with the knot. This data will be overwritten by the internal EditSpline code.
a2Used to track topo changes in spline editing.
a3User aux field.
Ia1,Ia2,Ia3,Oa1,Oa2,Oa3,f

◆ SplineKnot() [3/3]

Member Function Documentation

◆ Ktype()

int Ktype ( ) const
inline

Returns the knot type.

See also
Knot types
289{ return ktype; }

◆ SetKtype()

void SetKtype ( int  t)
inline

Sets the knot type.

Parameters
tThe type to set.
See also
Knot types
294{ ktype=t; }

◆ Ltype()

int Ltype ( ) const
inline

Returns the line type.

See also
Line types
298{ return ltype; }

◆ SetLtype()

void SetLtype ( int  t)
inline

Sets the line type.

Parameters
tThe type to set.
See also
Line types
303{ ltype=t; }

◆ Aux()

int Aux ( ) const
inline

Provides access to the first integer chunk of auxiliary data for the knot.

307{ return aux; }

◆ SetAux()

void SetAux ( int  a)
inline

Sets the first integer of auxiliary data for the knot.

Parameters
aThe value to be set to.
311{ aux=a; }
float a
Definition: texutil.h:51

◆ Aux2()

int Aux2 ( ) const
inline

Provides access to the second integer of auxiliary data for the knot.

314{ return aux2; }

◆ SetAux2()

void SetAux2 ( int  a)
inline

Sets the second integer of auxiliary data for the knot.

Parameters
aThe value to be set to.
318{ aux2=a; }

◆ Aux3()

int Aux3 ( ) const
inline
320{ return aux3; }

◆ SetAux3()

void SetAux3 ( int  a)
inline
321{ aux3=a; }

◆ InAux()

int InAux ( ) const
inline
322{ return inAux; }

◆ SetInAux()

void SetInAux ( int  a)
inline
323{ inAux=a; }

◆ InAux2()

int InAux2 ( ) const
inline
324{ return inAux2; }

◆ SetInAux2()

void SetInAux2 ( int  a)
inline
325{ inAux2=a; }

◆ InAux3()

int InAux3 ( ) const
inline
326{ return inAux3; }

◆ SetInAux3()

void SetInAux3 ( int  a)
inline
327{ inAux3=a; }

◆ OutAux()

int OutAux ( ) const
inline
328{ return outAux; }

◆ SetOutAux()

void SetOutAux ( int  a)
inline
329{ outAux=a; }

◆ OutAux2()

int OutAux2 ( ) const
inline
330{ return outAux2; }

◆ SetOutAux2()

void SetOutAux2 ( int  a)
inline
331{ outAux2=a; }

◆ OutAux3()

int OutAux3 ( ) const
inline
332{ return outAux3; }

◆ SetOutAux3()

void SetOutAux3 ( int  a)
inline
333{ outAux3=a; }

◆ Knot()

Point3 Knot ( ) const
inline

Returns the point location for the knot.

336{ return point; }

◆ SetKnot()

void SetKnot ( Point3  p)
inline

Sets the point location for the knot.

Parameters
pThe point to be set.
340{ point=p; }

◆ InVec()

Point3 InVec ( ) const
inline

Returns the in vector for the knot.

343{ return inVec; }

◆ SetInVec()

void SetInVec ( Point3  p)
inline

Sets the in vector for the knot.

Parameters
pThe in vector to be set.
347{ inVec=p; }

◆ OutVec()

Point3 OutVec ( ) const
inline

Returns the out vector for the knot.

350{ return outVec; }

◆ SetOutVec()

void SetOutVec ( Point3  p)
inline

Sets the out vector for the knot.

Parameters
pThe out vector to set.
354{ outVec=p; }

◆ GetMatID()

MtlID GetMatID ( ) const
inline
356{return (int)((flags>>SPLINE_MATID_SHIFT)&SPLINE_MATID_MASK);}
#define SPLINE_MATID_SHIFT
The mat ID is stored in the HIWORD of the knot flags.
Definition: spline3d.h:116
#define SPLINE_MATID_MASK
The mat ID is stored in the HIWORD of the knot flags.
Definition: spline3d.h:117

◆ SetMatID()

void SetMatID ( MtlID  id)
inline
357{flags &= 0xFFFF; flags |= (DWORD)(id<<SPLINE_MATID_SHIFT);}

◆ GetFlags()

DWORD GetFlags ( ) const
inline
358{ return flags; }

◆ IsHidden()

BOOL IsHidden ( ) const
inline
361{return (flags&SEGMENT_VISIBLE);}
#define SEGMENT_VISIBLE
Definition: spline3d.h:119

◆ Hide()

void Hide ( )
inline
362{ flags |= (DWORD)(SEGMENT_VISIBLE);}

◆ Unhide()

void Unhide ( )
inline
363{ flags &= (DWORD)(~SEGMENT_VISIBLE);}

◆ IsNoSnap()

BOOL IsNoSnap ( ) const
inline
365{return (flags&SPLINEKNOT_NO_SNAP);}
#define SPLINEKNOT_NO_SNAP
Suppresses snapping to knot if set.
Definition: spline3d.h:120

◆ SetNoSnap()

void SetNoSnap ( )
inline
366{ flags |= (DWORD)(SPLINEKNOT_NO_SNAP);}

◆ ClearNoSnap()

void ClearNoSnap ( )
inline
367{ flags &= (DWORD)(~SPLINEKNOT_NO_SNAP);}

◆ GetFlag()

BOOL GetFlag ( DWORD  fl) const
inline
369{ return (flags & fl) ? TRUE : FALSE; }

◆ SetFlag()

void SetFlag ( DWORD  fl,
BOOL  val = TRUE 
)
inline
370{ if (val) flags |= fl; else flags &= ~fl; }

◆ ClearFlag()

void ClearFlag ( DWORD  fl)
inline
371{ flags &= ~fl; }

Friends And Related Function Documentation

◆ Spline3D

friend class Spline3D
friend

◆ SplineKnotAssy

friend class SplineKnotAssy
friend