3ds Max C++ API Reference
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. More...
 
CoreExport SplineKnot (const SplineKnotAssy &k)
 
int Ktype () const
 Returns the knot type. More...
 
void SetKtype (int t)
 Sets the knot type. More...
 
int Ltype () const
 Returns the line type. More...
 
void SetLtype (int t)
 Sets the line type. More...
 
int Aux () const
 Provides access to the first integer chunk of auxiliary data for the knot. More...
 
void SetAux (int a)
 Sets the first integer of auxiliary data for the knot. More...
 
int Aux2 () const
 Provides access to the second integer of auxiliary data for the knot. More...
 
void SetAux2 (int a)
 Sets the second integer of auxiliary data for the knot. More...
 
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. More...
 
void SetKnot (Point3 p)
 Sets the point location for the knot. More...
 
Point3 InVec () const
 Returns the in vector for the knot. More...
 
void SetInVec (Point3 p)
 Sets the in vector for the knot. More...
 
Point3 OutVec () const
 Returns the out vector for the knot. More...
 
void SetOutVec (Point3 p)
 Sets the out vector for the knot. More...
 
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. 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...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

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
288 { return ktype; }

◆ SetKtype()

void SetKtype ( int  t)
inline

Sets the knot type.

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

◆ Ltype()

int Ltype ( ) const
inline

Returns the line type.

See also
Line types
297 { return ltype; }

◆ SetLtype()

void SetLtype ( int  t)
inline

Sets the line type.

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

◆ Aux()

int Aux ( ) const
inline

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

306 { 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.
310 { aux=a; }

◆ Aux2()

int Aux2 ( ) const
inline

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

313 { 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.
317 { aux2=a; }

◆ Aux3()

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

◆ SetAux3()

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

◆ InAux()

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

◆ SetInAux()

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

◆ InAux2()

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

◆ SetInAux2()

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

◆ InAux3()

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

◆ SetInAux3()

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

◆ OutAux()

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

◆ SetOutAux()

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

◆ OutAux2()

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

◆ SetOutAux2()

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

◆ OutAux3()

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

◆ SetOutAux3()

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

◆ Knot()

Point3 Knot ( ) const
inline

Returns the point location for the knot.

335 { return point; }

◆ SetKnot()

void SetKnot ( Point3  p)
inline

Sets the point location for the knot.

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

◆ InVec()

Point3 InVec ( ) const
inline

Returns the in vector for the knot.

342 { return inVec; }

◆ SetInVec()

void SetInVec ( Point3  p)
inline

Sets the in vector for the knot.

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

◆ OutVec()

Point3 OutVec ( ) const
inline

Returns the out vector for the knot.

349 { return outVec; }

◆ SetOutVec()

void SetOutVec ( Point3  p)
inline

Sets the out vector for the knot.

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

◆ GetMatID()

MtlID GetMatID ( ) const
inline
355 {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:115
#define SPLINE_MATID_MASK
The mat ID is stored in the HIWORD of the knot flags.
Definition: spline3d.h:116

◆ SetMatID()

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

◆ GetFlags()

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

◆ IsHidden()

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

◆ Hide()

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

◆ Unhide()

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

◆ IsNoSnap()

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

◆ SetNoSnap()

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

◆ ClearNoSnap()

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

◆ GetFlag()

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

◆ SetFlag()

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

◆ ClearFlag()

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

Friends And Related Function Documentation

◆ Spline3D

friend class Spline3D
friend

◆ SplineKnotAssy

friend class SplineKnotAssy
friend