Class SplineKnot

3DS Max Plug-In SDK

Class SplineKnot

See Also: Class Spline3D.

class SplineKnot

Description:

This class describes a single knot in a spline.

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.

Description:

private:

int ktype;

The knot type.

int ltype;

The line type.

Point3 point;

The point location.

Point3 inVec;

The in vector.

Point3 outVec;

The out vector.

int aux;

This is simply 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.

int aux2;

Used to track topo changes in spline editing.

Spline Knot Summary:

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.

Friend Classes:

friend class Spline3D;

friend class SplineKnotAssy;

Methods:

Prototype:

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

Remarks:

This method is available in release 2.0 and later only.

Constructor. The data members are initialized to the values passed.

Prototype:

inline int Ktype();

Remarks:

Returns the knot type.

Return Value:

See List of Spline Knot Types.

Prototype:

inline void SetKtype(int t);

Remarks:

This method is available in release 2.0 and later only.

Sets the knot type.

Parameters:

int t

The type to set. See List of Spline Knot Types.

Prototype:

inline int Ltype();

Remarks:

Returns the line type.

Return Value:

See List of Spline Line Types.

Prototype:

inline void SetLtype(int t);

Remarks:

This method is available in release 2.0 and later only.

Sets the line type.

Parameters:

int t

The type to set. See List of Spline Line Types.

Prototype:

inline int Aux();

Remarks:

This method is available in release 2.0 and later only.

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

Prototype:

inline void SetAux(int a);

Remarks:

This method is available in release 2.0 and later only.

Sets the first integer of auxilliary data for the knot.

Parameters:

int a

The value to set.

Prototype:

inline int Aux2();

Remarks:

This method is available in release 2.0 and later only.

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

Prototype:

inline void SetAux2(int a);

Remarks:

This method is available in release 2.0 and later only.

Sets the second integer of auxilliary data for the knot.

Parameters:

int a

The value to set.

Prototype:

inline Point3 Knot();

Remarks:

This method is available in release 2.0 and later only.

Returns the point location for the knot.

Prototype:

inline void SetKnot(Point3 p);

Remarks:

This method is available in release 2.0 and later only.

Sets the point location for the knot.

Parameters:

Point3 p

The point to set.

Prototype:

inline Point3 InVec();

Remarks:

This method is available in release 2.0 and later only.

Returns the in vector for the knot.

Prototype:

inline void SetInVec(Point3 p);

Remarks:

This method is available in release 2.0 and later only.

Sets the in vector for the knot.

Parameters:

Point3 p

The in vector to set.

Prototype:

inline Point3 OutVec();

Remarks:

This method is available in release 2.0 and later only.

Returns the out vector for the knot.

Prototype:

inline void SetOutVec(Point3 p);

Remarks:

This method is available in release 2.0 and later only.

Sets the out vector for the knot.

Parameters:

Point3 p

The out vector to set.