SplineKnot Class Reference

#include <spline3d.h>

Class 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
+ Inheritance diagram for SplineKnot:

Public Member Functions

CoreExport SplineKnot ()
 
CoreExport SplineKnot (int k, int l, Point3 p, Point3 in, 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 (SplineKnotAssy &k)
 
int Ktype ()
 Returns the knot type. More...
 
void SetKtype (int t)
 Sets the knot type. More...
 
int Ltype ()
 Returns the line type. More...
 
void SetLtype (int t)
 Sets the line type. More...
 
int Aux ()
 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 ()
 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 ()
 
void SetAux3 (int a)
 
int InAux ()
 
void SetInAux (int a)
 
int InAux2 ()
 
void SetInAux2 (int a)
 
int InAux3 ()
 
void SetInAux3 (int a)
 
int OutAux ()
 
void SetOutAux (int a)
 
int OutAux2 ()
 
void SetOutAux2 (int a)
 
int OutAux3 ()
 
void SetOutAux3 (int a)
 
Point3 Knot ()
 Returns the point location for the knot. More...
 
void SetKnot (Point3 p)
 Sets the point location for the knot. More...
 
Point3 InVec ()
 Returns the in vector for the knot. More...
 
void SetInVec (Point3 p)
 Sets the in vector for the knot. More...
 
Point3 OutVec ()
 Returns the out vector for the knot. More...
 
void SetOutVec (Point3 p)
 Sets the out vector for the knot. More...
 
MtlID GetMatID ()
 
void SetMatID (MtlID id)
 
DWORD GetFlags ()
 
BOOL IsHidden ()
 
void Hide ()
 
void Unhide ()
 
BOOL IsNoSnap ()
 
void SetNoSnap ()
 
void ClearNoSnap ()
 
BOOL GetFlag (DWORD fl)
 
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...
 

Constructor & Destructor Documentation

CoreExport SplineKnot ( int  k,
int  l,
Point3  p,
Point3  in,
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

Member Function Documentation

int Ktype ( )
inline

Returns the knot type.

See also
Knot types
274 { return ktype; }
void SetKtype ( int  t)
inline

Sets the knot type.

Parameters
tThe type to set.
See also
Knot types
279 { ktype=t; }
int Ltype ( )
inline

Returns the line type.

See also
Line types
283 { return ltype; }
void SetLtype ( int  t)
inline

Sets the line type.

Parameters
tThe type to set.
See also
Line types
288 { ltype=t; }
int Aux ( )
inline

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

292 { return aux; }
void SetAux ( int  a)
inline

Sets the first integer of auxiliary data for the knot.

Parameters
aThe value to be set to.
296 { aux=a; }
int Aux2 ( )
inline

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

299 { return aux2; }
void SetAux2 ( int  a)
inline

Sets the second integer of auxiliary data for the knot.

Parameters
aThe value to be set to.
303 { aux2=a; }
int Aux3 ( )
inline
305 { return aux3; }
void SetAux3 ( int  a)
inline
306 { aux3=a; }
int InAux ( )
inline
307 { return inAux; }
void SetInAux ( int  a)
inline
308 { inAux=a; }
int InAux2 ( )
inline
309 { return inAux2; }
void SetInAux2 ( int  a)
inline
310 { inAux2=a; }
int InAux3 ( )
inline
311 { return inAux3; }
void SetInAux3 ( int  a)
inline
312 { inAux3=a; }
int OutAux ( )
inline
313 { return outAux; }
void SetOutAux ( int  a)
inline
314 { outAux=a; }
int OutAux2 ( )
inline
315 { return outAux2; }
void SetOutAux2 ( int  a)
inline
316 { outAux2=a; }
int OutAux3 ( )
inline
317 { return outAux3; }
void SetOutAux3 ( int  a)
inline
318 { outAux3=a; }
Point3 Knot ( )
inline

Returns the point location for the knot.

321 { return point; }
void SetKnot ( Point3  p)
inline

Sets the point location for the knot.

Parameters
pThe point to be set.
325 { point=p; }
Point3 InVec ( )
inline

Returns the in vector for the knot.

328 { return inVec; }
void SetInVec ( Point3  p)
inline

Sets the in vector for the knot.

Parameters
pThe in vector to be set.
332 { inVec=p; }
Point3 OutVec ( )
inline

Returns the out vector for the knot.

335 { return outVec; }
void SetOutVec ( Point3  p)
inline

Sets the out vector for the knot.

Parameters
pThe out vector to set.
339 { outVec=p; }
MtlID GetMatID ( )
inline
341 {return (int)((flags>>SPLINE_MATID_SHIFT)&SPLINE_MATID_MASK);}
#define SPLINE_MATID_MASK
The mat ID is stored in the HIWORD of the knot flags.
Definition: spline3d.h:116
#define SPLINE_MATID_SHIFT
The mat ID is stored in the HIWORD of the knot flags.
Definition: spline3d.h:115
void SetMatID ( MtlID  id)
inline
342 {flags &= 0xFFFF; flags |= (DWORD)(id<<SPLINE_MATID_SHIFT);}
#define SPLINE_MATID_SHIFT
The mat ID is stored in the HIWORD of the knot flags.
Definition: spline3d.h:115
DWORD GetFlags ( )
inline
343 { return flags; }
BOOL IsHidden ( )
inline
346 {return (flags&SEGMENT_VISIBLE);}
#define SEGMENT_VISIBLE
Definition: spline3d.h:118
void Hide ( )
inline
347 { flags |= (DWORD)(SEGMENT_VISIBLE);}
#define SEGMENT_VISIBLE
Definition: spline3d.h:118
void Unhide ( )
inline
348 { flags &= (DWORD)(~SEGMENT_VISIBLE);}
#define SEGMENT_VISIBLE
Definition: spline3d.h:118
BOOL IsNoSnap ( )
inline
350 {return (flags&SPLINEKNOT_NO_SNAP);}
#define SPLINEKNOT_NO_SNAP
Suppresses snapping to knot if set.
Definition: spline3d.h:119
void SetNoSnap ( )
inline
351 { flags |= (DWORD)(SPLINEKNOT_NO_SNAP);}
#define SPLINEKNOT_NO_SNAP
Suppresses snapping to knot if set.
Definition: spline3d.h:119
void ClearNoSnap ( )
inline
352 { flags &= (DWORD)(~SPLINEKNOT_NO_SNAP);}
#define SPLINEKNOT_NO_SNAP
Suppresses snapping to knot if set.
Definition: spline3d.h:119
BOOL GetFlag ( DWORD  fl)
inline
354 { return (flags & fl) ? TRUE : FALSE; }
void SetFlag ( DWORD  fl,
BOOL  val = TRUE 
)
inline
355 { if (val) flags |= fl; else flags &= ~fl; }
void ClearFlag ( DWORD  fl)
inline
356 { flags &= ~fl; }

Friends And Related Function Documentation

friend class Spline3D
friend
friend class SplineKnotAssy
friend