Public Member Functions | Friends

SplineKnot Class Reference

Search for all occurrences

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: --->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

#include <spline3d.h>

Inheritance diagram for SplineKnot:
Inheritance graph
[legend]

List of all members.

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.
CoreExport  SplineKnot (SplineKnotAssy &k)
int  Ktype ()
  Returns the knot type.
void  SetKtype (int t)
  Sets the knot type.
int  Ltype ()
  Returns the line type.
void  SetLtype (int t)
  Sets the line type.
int  Aux ()
  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 ()
  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 ()
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.
void  SetKnot (Point3 p)
  Sets the point location for the knot.
Point3  InVec ()
  Returns the in vector for the knot.
void  SetInVec (Point3 p)
  Sets the in vector for the knot.
Point3  OutVec ()
  Returns the out vector for the knot.
void  SetOutVec (Point3 p)
  Sets the out vector for the knot.
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

Constructor & Destructor Documentation

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.

The data members are initialized to the values passed.

Parameters:
k Knot type
l Line type
p Point Location
in In vector
out Out vector
a1 Used 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.
a2 Used to track topo changes in spline editing.
a3 User aux field.
Ia1,Ia2,Ia3,Oa1,Oa2,Oa3,f
CoreExport SplineKnot ( SplineKnotAssy k )

Member Function Documentation

int Ktype ( ) [inline]

Returns the knot type.

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

Sets the knot type.

Parameters:
t The type to set.
See also:
Knot types
{ ktype=t; }
int Ltype ( ) [inline]

Returns the line type.

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

Sets the line type.

Parameters:
t The type to set.
See also:
Line types
{ ltype=t; }
int Aux ( ) [inline]

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

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

Sets the first integer of auxiliary data for the knot.

Parameters:
a The value to be set to.
{ aux=a; }
int Aux2 ( ) [inline]

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

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

Sets the second integer of auxiliary data for the knot.

Parameters:
a The value to be set to.
{ aux2=a; }
int Aux3 ( ) [inline]
{ return aux3; }
void SetAux3 ( int  a ) [inline]
int InAux ( ) [inline]
{ return inAux; }
void SetInAux ( int  a ) [inline]
int InAux2 ( ) [inline]
{ return inAux2; }
void SetInAux2 ( int  a ) [inline]
int InAux3 ( ) [inline]
{ return inAux3; }
void SetInAux3 ( int  a ) [inline]
int OutAux ( ) [inline]
{ return outAux; }
void SetOutAux ( int  a ) [inline]
int OutAux2 ( ) [inline]
{ return outAux2; }
void SetOutAux2 ( int  a ) [inline]
int OutAux3 ( ) [inline]
{ return outAux3; }
void SetOutAux3 ( int  a ) [inline]
Point3 Knot ( ) [inline]

Returns the point location for the knot.

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

Sets the point location for the knot.

Parameters:
p The point to be set.
{ point=p; }
Point3 InVec ( ) [inline]

Returns the in vector for the knot.

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

Sets the in vector for the knot.

Parameters:
p The in vector to be set.
{ inVec=p; }
Point3 OutVec ( ) [inline]

Returns the out vector for the knot.

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

Sets the out vector for the knot.

Parameters:
p The out vector to set.
{ outVec=p; }
MtlID GetMatID ( ) [inline]
{return (int)((flags>>SPLINE_MATID_SHIFT)&SPLINE_MATID_MASK);}
void SetMatID ( MtlID  id ) [inline]
{flags &= 0xFFFF; flags |= (DWORD)(id<<SPLINE_MATID_SHIFT);}
DWORD GetFlags ( ) [inline]
{ return flags; }
BOOL IsHidden ( ) [inline]
{return (flags&SEGMENT_VISIBLE);}
void Hide ( ) [inline]
{ flags |= (DWORD)(SEGMENT_VISIBLE);}
void Unhide ( ) [inline]
{ flags &= (DWORD)(~SEGMENT_VISIBLE);}
BOOL IsNoSnap ( ) [inline]
{return (flags&SPLINEKNOT_NO_SNAP);}
void SetNoSnap ( ) [inline]
{ flags |= (DWORD)(SPLINEKNOT_NO_SNAP);}
void ClearNoSnap ( ) [inline]
{ flags &= (DWORD)(~SPLINEKNOT_NO_SNAP);}
BOOL GetFlag ( DWORD  fl ) [inline]
{ return (flags & fl) ? TRUE : FALSE; }
void SetFlag ( DWORD  fl,
BOOL  val = TRUE 
) [inline]
{ if (val) flags |= fl; else flags &= ~fl; }
void ClearFlag ( DWORD  fl ) [inline]
{ flags &= ~fl; }

Friends And Related Function Documentation

friend class Spline3D [friend]
friend class SplineKnotAssy [friend]

SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot
SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot SplineKnot