Spline3D Class Reference

#include <spline3d.h>

Class Description

General-purpose 3D spline class.

The BezierShape class has a list of these splines that make up the bezier shape. Methods of this class are used to access the properties of the spline. All methods of this class are implemented by the system.

See also
SplineKnot, PolyLine
+ Inheritance diagram for Spline3D:

Public Member Functions

CoreExport Spline3D (int itype=KTYPE_CORNER, int dtype=KTYPE_BEZIER, int ptype=PARM_UNIFORM)
 Constructor. More...
 
CoreExport Spline3D (Spline3D &fromSpline)
 
virtual CoreExport ~Spline3D ()
 Destructor. More...
 
CoreExport Spline3Doperator= (Spline3D &fromSpline)
 Assignment operator. More...
 
CoreExport Spline3Doperator= (PolyLine &fromLine)
 Assignment operator. More...
 
CoreExport void NewSpline ()
 Clears out the spline. More...
 
int ParmType ()
 
int KnotCount ()
 Returns the Knot (point) count. More...
 
int Flags ()
 Returns the private spline flags. More...
 
CoreExport int Segments ()
 Returns the number of line segments in the spline. More...
 
int Closed ()
 Returns the closed status. More...
 
CoreExport int ShiftKnot (int where, int direction)
 
CoreExport int AddKnot (SplineKnot &k, int where=-1)
 Add a knot to the spline at the specified location. More...
 
CoreExport void SetKnot (int i, SplineKnot &k)
 Sets the 'i-th' knot object which contain the knot point, in and out vectors, knot and line types and auxiliary values. More...
 
CoreExport SplineKnot GetKnot (int i)
 Returns the 'i-th' knot object which contain the knot point, in and out vectors, knot and line types and auxiliary values. More...
 
CoreExport int DeleteKnot (int where)
 Delete the specified knot. More...
 
CoreExport int Create (ViewExp *vpt, int msg, int point, int vflags, IPoint2 m, Matrix3 *mat, IObjParam *ip=NULL)
 Used internally by the free form line object SPLINE.CPP. More...
 
CoreExport int StartInsert (ViewExp *vpt, int msg, int point, int vflags, IPoint2 theP, Matrix3 *mat, int where)
 Used internally by the free form line object SPLINE.CPP. More...
 
CoreExport int SetParam (int index, float param)
 
CoreExport float GetParam (int index)
 
int GetKnotType (int index)
 Returns the knot type from the specified knot. More...
 
CoreExport int SetKnotType (int index, int type)
 Sets the knot type of the specified knot. More...
 
int GetLineType (int index)
 Returns the type of line segment between knots for the specified segment. More...
 
CoreExport int SetLineType (int index, int type)
 Sets the line type of the specified segment. More...
 
virtual void CustomParams ()
 
CoreExport void CompParams ()
 
CoreExport void ComputeBezPoints ()
 This method should be called whenever you finish changing points on the spline. More...
 
CoreExport void FindSegAndParam (float u, int ptype, int &seg, float &param)
 Finds segment and parameter for whole-curve parameter. More...
 
CoreExport void RefineCurve (float u, int ptype=SPLINE_INTERP_SIMPLE)
 
CoreExport void RefineSegment (int segment, float t, int ptype=SPLINE_INTERP_SIMPLE)
 
CoreExport Point3 InterpBezier3D (int segment, float t, int ptype=SPLINE_INTERP_SIMPLE)
 Returns a point interpolated on a segment between two knots. More...
 
CoreExport Point3 InterpCurve3D (float u, int ptype=SPLINE_INTERP_SIMPLE)
 Returns a point interpolated on the entire curve. More...
 
CoreExport Point3 TangentBezier3D (int segment, float t, int ptype=SPLINE_INTERP_SIMPLE)
 Returns a tangent vector interpolated on a segment between two knots. More...
 
CoreExport Point3 TangentCurve3D (float u, int ptype=SPLINE_INTERP_SIMPLE)
 Returns a tangent vector interpolated on the entire curve. More...
 
CoreExport int IsAuto (int i)
 Returns nonzero if the knot type is KTYPE_AUTO. More...
 
CoreExport int IsBezierPt (int i)
 Returns nonzero if the knot type is KTYPE_BEZIER. More...
 
CoreExport int IsCorner (int i)
 Returns nonzero if the knot type is KTYPE_CORNER, zero otherwise. More...
 
CoreExport Point3 GetDragVector (ViewExp *vpt, IPoint2 p, int i, Matrix3 *mat)
 
CoreExport int AppendPoint (ViewExp *vpt, const Point3 &p, int where=-1)
 
CoreExport int DrawPhase ()
 
CoreExport int GetiCur ()
 
CoreExport void GetBBox (TimeValue t, Matrix3 &tm, Box3 &box)
 Returns the bounding box of the curve in the space specified by the tm in the input parameters. More...
 
CoreExport IPoint2 ProjectPoint (ViewExp *vpt, Point3 fp, Matrix3 *mat)
 
CoreExport Point3 UnProjectPoint (ViewExp *vpt, IPoint2 p, Matrix3 *mat)
 
CoreExport void Snap (GraphicsWindow *gw, SnapInfo *snap, IPoint2 *p, Matrix3 &tm)
 
CoreExport IOResult Save (ISave *isave)
 
CoreExport IOResult Load (ILoad *iload)
 
CoreExport int SetClosed (int flag=1)
 Opens or closes the spline. More...
 
CoreExport int SetOpen ()
 Sets the spline to open. More...
 
CoreExport void Dump (int where)
 Displays data about the specified knot using DebugPrints(). More...
 
CoreExport Point3 GetInVec (int i)
 Returns the 'i-th' in vector position in absolute coordinates. More...
 
CoreExport void SetInVec (int i, const Point3 &p)
 Sets the 'i-th' in vector position in absolute coordinates. More...
 
CoreExport Point3 GetRelInVec (int i)
 Returns the 'i-th' in vector position relative to the knot point. More...
 
CoreExport void SetRelInVec (int i, const Point3 &p)
 Sets the 'i-th' bezier in vector position relative to the knot point. More...
 
CoreExport Point3 GetKnotPoint (int i)
 Returns the 'i-th' knot point. More...
 
CoreExport void SetKnotPoint (int i, const Point3 &p)
 Sets the 'i-th' knot point to the specified value. More...
 
CoreExport Point3 GetOutVec (int i)
 Returns the 'i-th' out vector position in absolute coordinates. More...
 
CoreExport void SetOutVec (int i, const Point3 &p)
 Sets the 'i-th' out vector position in absolute coordinates. More...
 
CoreExport Point3 GetRelOutVec (int i)
 Returns the 'i-th' out vector position relative to the knot point. More...
 
CoreExport void SetRelOutVec (int i, const Point3 &p)
 Sets the 'i-th' out vector position relative to the knot point. More...
 
CoreExport Point3 GetVert (int i)
 Returns an item in the in vector. More...
 
CoreExport void SetVert (int i, const Point3 &p)
 Sets the the position of the given Vertex. More...
 
int Verts ()
 Returns the number of vertices. More...
 
CoreExport int GetAux (int knot)
 Returns the auxiliary data associated with the specified knot. More...
 
CoreExport void SetAux (int knot, int value)
 Sets the first integer auxiliary data associated with the specified knot. More...
 
CoreExport int GetAux2 (int knot)
 Returns the second integer auxiliary data associated with the specified knot. More...
 
CoreExport void SetAux2 (int knot, int value)
 Sets the second integer auxiliary data associated with the specified knot. More...
 
CoreExport int GetAux3 (int knot)
 Returns the third integer auxiliary data associated with the specified knot. More...
 
CoreExport void SetAux3 (int knot, int value)
 Sets the third integer auxiliary data associated with the specified knot. More...
 
CoreExport int GetKnotAux (int knot, int which)
 Returns the specified integer auxiliary data associated with the specified knot. More...
 
CoreExport void SetKnotAux (int knot, int which, int value)
 Sets the specified integer auxiliary data associated with the specified knot. More...
 
CoreExport int GetInAux (int knot, int which)
 Returns the specified integer auxiliary data associated with the specified in vector. More...
 
CoreExport void SetInAux (int knot, int which, int value)
 Sets the specified integer auxiliary data associated with the specified in vector. More...
 
CoreExport int GetOutAux (int knot, int which)
 Returns the specified integer auxiliary data associated with the specified out vector. More...
 
CoreExport void SetOutAux (int knot, int which, int value)
 Sets the specified integer auxiliary data associated with the specified out vector. More...
 
CoreExport int GetVertAux (int i, int which)
 Returns the specified integer auxiliary data associated with the specified bezier vertex. More...
 
CoreExport void SetVertAux (int i, int which, int value)
 Sets the specified integer auxilliary data associated with the specified bezier vertex. More...
 
CoreExport MtlID GetMatID (int seg)
 Returns the material ID for the specified spline segment. More...
 
CoreExport void SetMatID (int seg, MtlID id)
 Sets the material ID for the specified spline segment. More...
 
CoreExport float SplineLength ()
 Returns the length of the spline. More...
 
CoreExport float SegmentLength (int seg)
 Returns the length of the specified segment of this spline. More...
 
CoreExport void Transform (Matrix3 *tm)
 Transforms the points of the spline into another space defined by the specified transformation matrix. More...
 
CoreExport void Reverse (BOOL keepZero=FALSE)
 Reverses all the points of the spline. More...
 
CoreExport BOOL Append (Spline3D *spline, BOOL weldCoincidentFirstVertex=TRUE)
 Appends the specified spline onto the end of this one. More...
 
CoreExport BOOL Prepend (Spline3D *spline, BOOL weldCoincidentLastVertex=TRUE)
 Takes the specified spline and puts it on the front of this spline. More...
 
CoreExport BOOL IsClockWise ()
 
CoreExport BOOL SelfIntersects ()
 
CoreExport BOOL IntersectsSpline (Spline3D *spline)
 Tells if the input spline intersects the specified spline in the XY plane (ignoring Z) or not. More...
 
CoreExport BOOL SurroundsPoint (Point2 p)
 Tells if the specified 2-D point is surrounded (contained within) this spline or not. More...
 
CoreExport void MakePolyLine (PolyLine &line, int steps=-1, BOOL optimize=FALSE)
 Creates a PolyLine from this spline given a steps setting and an optimize parameter. More...
 
CoreExport void InvalidateGeomCache ()
 This method makes sure the shape has flushed out any cached data it may have had. More...
 
CoreExport void GetSmoothingMap (IntTab &map)
 This method allows this Spline3D to create a map of smoothing groups that eases the creation of meshes. More...
 

Protected Member Functions

CoreExport void Allocate (int count)
 
CoreExport void ChordParams ()
 
CoreExport void UniformParams ()
 
CoreExport void CentripetalParams ()
 
CoreExport void LinearFwd (int i)
 
CoreExport void LinearBack (int i)
 
CoreExport void ContinFwd (int i)
 
CoreExport void ContinBack (int i)
 
CoreExport void HybridPoint (int i)
 
CoreExport void CompCornerBezPoints (int n)
 
CoreExport void CompAdjBesselBezPoints (int i)
 
CoreExport void BesselStart (int i)
 
CoreExport void BesselEnd (int i)
 
CoreExport void NaturalFwd (int i)
 
CoreExport void NaturalBack (int i)
 

Friends

class BezierShape
 
class SplineShape
 
class Railing
 

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 Spline3D ( int  itype = KTYPE_CORNER,
int  dtype = KTYPE_BEZIER,
int  ptype = PARM_UNIFORM 
)

Constructor.

Parameters
itypeKnot type at initial click.
dtypeKnot type at drag.
ptypeInterpolation parameter type
CoreExport Spline3D ( Spline3D fromSpline)
virtual CoreExport ~Spline3D ( )
virtual

Destructor.

Member Function Documentation

CoreExport void Allocate ( int  count)
protected
CoreExport void ChordParams ( )
protected
CoreExport void UniformParams ( )
protected
CoreExport void CentripetalParams ( )
protected
CoreExport void LinearFwd ( int  i)
protected
CoreExport void LinearBack ( int  i)
protected
CoreExport void ContinFwd ( int  i)
protected
CoreExport void ContinBack ( int  i)
protected
CoreExport void HybridPoint ( int  i)
protected
CoreExport void CompCornerBezPoints ( int  n)
protected
CoreExport void CompAdjBesselBezPoints ( int  i)
protected
CoreExport void BesselStart ( int  i)
protected
CoreExport void BesselEnd ( int  i)
protected
CoreExport void NaturalFwd ( int  i)
protected
CoreExport void NaturalBack ( int  i)
protected
CoreExport Spline3D& operator= ( Spline3D fromSpline)

Assignment operator.

CoreExport Spline3D& operator= ( PolyLine fromLine)

Assignment operator.

This generates a PolyLine from the spline, where points are added in between the knots on the spline. For example if the steps value was 5, it will interpolate 5 points in between each knot on the spline.

CoreExport void NewSpline ( )

Clears out the spline.

It frees the knots attributes array and the bezier points array.

int ParmType ( )
inline

This method is used internally.

448 { return parmType; };
int KnotCount ( )
inline

Returns the Knot (point) count.

451 { return knotCount; }
int Flags ( )
inline

Returns the private spline flags.

SPLINE_CLOSED This indicates if the spline is closed or not.

456 { return flags; }
CoreExport int Segments ( )

Returns the number of line segments in the spline.

For example if you have a 4 knot spline that is open you'll get 3 segments.

int Closed ( )
inline

Returns the closed status.

Nonzero if closed, zero if not closed.

463 { return (flags & SPLINE_CLOSED) ? 1:0; }
#define SPLINE_CLOSED
Definition: spline3d.h:361
CoreExport int ShiftKnot ( int  where,
int  direction 
)

This method is used internally.

CoreExport int AddKnot ( SplineKnot k,
int  where = -1 
)

Add a knot to the spline at the specified location.

Parameters
kThe knot to be added.
where= -1, The location to add the knot. a negative value indicates the end of the spline.
Returns
Nonzero on success, zero otherwise.
CoreExport void SetKnot ( int  i,
SplineKnot k 
)

Sets the 'i-th' knot object which contain the knot point, in and out vectors, knot and line types and auxiliary values.

Parameters
iSpecifies the value to be set to.
kThe knot to be set.
CoreExport SplineKnot GetKnot ( int  i)

Returns the 'i-th' knot object which contain the knot point, in and out vectors, knot and line types and auxiliary values.

Parameters
iSpecifies the knot to be retrieved.
CoreExport int DeleteKnot ( int  where)

Delete the specified knot.

Parameters
whereThe location of the knot to be deleted.
Returns
Nonzero if the knot was deleted, zero otherwise.
CoreExport int Create ( ViewExp vpt,
int  msg,
int  point,
int  vflags,
IPoint2  m,
Matrix3 mat,
IObjParam ip = NULL 
)

Used internally by the free form line object SPLINE.CPP.

This method allows the user to use the mouse to create a line. See the sample code in /MAXSDK/SAMPLES/OBJECTS/SPLINE.CPP for an example of this method in use.

New for 3ds Max 2.0 is an additional parameter is a pointer to an IObjParam object, which is used to access the DisplayTempPrompt() mechanism. The parameter is optional; omitting it allows the spline operation to work as in 3ds Max 1.x. Adding the parameter causes the spline to display the delta, distance and angle of the current segment being edited.

CoreExport int StartInsert ( ViewExp vpt,
int  msg,
int  point,
int  vflags,
IPoint2  theP,
Matrix3 mat,
int  where 
)

Used internally by the free form line object SPLINE.CPP.

See the sample code in /MAXSDK/SAMPLES/OBJECTS/SPLINE.CPP for an example of this method in use.

CoreExport int SetParam ( int  index,
float  param 
)

This method is used internally.

CoreExport float GetParam ( int  index)

This method is used internally.

int GetKnotType ( int  index)
inline

Returns the knot type from the specified knot.

Parameters
indexThe index of the knot type to return.
See also
Knot types
518 { return knots[index].ktype; }
CoreExport int SetKnotType ( int  index,
int  type 
)

Sets the knot type of the specified knot.

Parameters
indexThe knot to be set.
typeThe Spline knot type
Returns
Nonzero if set, zero otherwise.
See also
Knot types
int GetLineType ( int  index)
inline

Returns the type of line segment between knots for the specified segment.

Parameters
indexThe index of the segment whose line type will be returned.
Returns
Spline line types
See also
Line types
532 { return knots[index].ltype; }
CoreExport int SetLineType ( int  index,
int  type 
)

Sets the line type of the specified segment.

Parameters
indexThe index of the segment.
typeThe Spline line type
Returns
Nonzero if set, zero otherwise.
See also
Line types
virtual void CustomParams ( )
inlinevirtual

This method is used internally.

542 { UniformParams(); } // Replace this as needed
CoreExport void UniformParams()
CoreExport void CompParams ( )

This method is used internally.

CoreExport void ComputeBezPoints ( )

This method should be called whenever you finish changing points on the spline.

This updates all the information internal to the spline needed to calculate all the bezier handles.

CoreExport void FindSegAndParam ( float  u,
int  ptype,
int seg,
float &  param 
)

Finds segment and parameter for whole-curve parameter.

CoreExport void RefineCurve ( float  u,
int  ptype = SPLINE_INTERP_SIMPLE 
)
CoreExport void RefineSegment ( int  segment,
float  t,
int  ptype = SPLINE_INTERP_SIMPLE 
)
CoreExport Point3 InterpBezier3D ( int  segment,
float  t,
int  ptype = SPLINE_INTERP_SIMPLE 
)

Returns a point interpolated on a segment between two knots.

Parameters
segmentThe index of the segment to interpolate.
tA value in the range of 0.0 to 1.0. 0 is the first knot and 1 is the second knot.
ptype= SPLINE_INTERP_SIMPLE; The spline type to use.
Returns
The interpolated point.
CoreExport Point3 InterpCurve3D ( float  u,
int  ptype = SPLINE_INTERP_SIMPLE 
)

Returns a point interpolated on the entire curve.

However, does not tell which segment the point falls on. Typically the method InterpBezier3D() will give better control of the curve as it interpolates a bezier segment.

Parameters
uA value in the range of 0.0 to 1.0 for the entire curve.
ptype= SPLINE_INTERP_SIMPLE; The spline type to use.
Returns
The interpolated point.
CoreExport Point3 TangentBezier3D ( int  segment,
float  t,
int  ptype = SPLINE_INTERP_SIMPLE 
)

Returns a tangent vector interpolated on a segment between two knots.

Parameters
segmentThe index of the segment.
tA value in the range of 0.0 to 1.0. 0 is the first knot and 1 is the second knot.
ptype= SPLINE_INTERP_SIMPLE; The spline type to use.
Returns
The tangent vector.
CoreExport Point3 TangentCurve3D ( float  u,
int  ptype = SPLINE_INTERP_SIMPLE 
)

Returns a tangent vector interpolated on the entire curve.

Parameters
uA value in the range of 0.0 to 1.0 for the entire curve.
ptype= SPLINE_INTERP_SIMPLE; The spline type to use.
Returns
The tangent vector.
CoreExport int IsAuto ( int  i)

Returns nonzero if the knot type is KTYPE_AUTO.

Zero otherwise.

Parameters
iThe index of the knot.
CoreExport int IsBezierPt ( int  i)

Returns nonzero if the knot type is KTYPE_BEZIER.

Zero otherwise.

Parameters
iThe index of the knot.
CoreExport int IsCorner ( int  i)

Returns nonzero if the knot type is KTYPE_CORNER, zero otherwise.

Parameters
iThe index of the knot.
CoreExport Point3 GetDragVector ( ViewExp vpt,
IPoint2  p,
int  i,
Matrix3 mat 
)

This method is used internally.

CoreExport int AppendPoint ( ViewExp vpt,
const Point3 p,
int  where = -1 
)

This method is used internally.

CoreExport int DrawPhase ( )
inline

This method is used internally.

604 { return drawPhase; }
CoreExport int GetiCur ( )
inline

This method is used internally.

607 { return iCur; }
CoreExport void GetBBox ( TimeValue  t,
Matrix3 tm,
Box3 box 
)

Returns the bounding box of the curve in the space specified by the tm in the input parameters.

Parameters
tThis parameter is not used.
tmThe tm to transform the points by prior to computing the bounding box.
boxThe bounding box
CoreExport IPoint2 ProjectPoint ( ViewExp vpt,
Point3  fp,
Matrix3 mat 
)

This method is used internally.

CoreExport Point3 UnProjectPoint ( ViewExp vpt,
IPoint2  p,
Matrix3 mat 
)

This method is used internally.

CoreExport void Snap ( GraphicsWindow gw,
SnapInfo snap,
IPoint2 p,
Matrix3 tm 
)

This method is used internally.

CoreExport IOResult Save ( ISave isave)

This method is used internally to save the class data from disk.

CoreExport IOResult Load ( ILoad iload)

This method is used internally to load the class data from disk.

CoreExport int SetClosed ( int  flag = 1)

Opens or closes the spline.

If the optional parameter is not specified it is closed.

Parameters
flag= 1. Nonzero to close; zero to open.
Returns
Nonzero if changed, zero if not changed.
CoreExport int SetOpen ( )

Sets the spline to open.

Returns
Nonzero if changed, zero if not changed.
CoreExport void Dump ( int  where)

Displays data about the specified knot using DebugPrints().

See Troubleshooting.

Parameters
whereThe index of the knot.
CoreExport Point3 GetInVec ( int  i)

Returns the 'i-th' in vector position in absolute coordinates.

Parameters
iThe vector position to be retrieved.
CoreExport void SetInVec ( int  i,
const Point3 p 
)

Sets the 'i-th' in vector position in absolute coordinates.

Parameters
iThe position to be altered.
pThe value to be set in absolute coordinates.
CoreExport Point3 GetRelInVec ( int  i)

Returns the 'i-th' in vector position relative to the knot point.

Parameters
iThe position to be returned.
CoreExport void SetRelInVec ( int  i,
const Point3 p 
)

Sets the 'i-th' bezier in vector position relative to the knot point.

Parameters
iThe vector to be set.
pThe vector data to set, relative to the knot point.
CoreExport Point3 GetKnotPoint ( int  i)

Returns the 'i-th' knot point.

Parameters
iThe knot point to be returned.
CoreExport void SetKnotPoint ( int  i,
const Point3 p 
)

Sets the 'i-th' knot point to the specified value.

Parameters
iThe knot point to be set.

pThe value to be set to.
CoreExport Point3 GetOutVec ( int  i)

Returns the 'i-th' out vector position in absolute coordinates.

Parameters
iThe out vector point to be returned.
CoreExport void SetOutVec ( int  i,
const Point3 p 
)

Sets the 'i-th' out vector position in absolute coordinates.

Parameters
iThe out vector point to get.
pThe out vector to set in absolute coordinates.
CoreExport Point3 GetRelOutVec ( int  i)

Returns the 'i-th' out vector position relative to the knot point.

Parameters
iSpecifies the point to get.
CoreExport void SetRelOutVec ( int  i,
const Point3 p 
)

Sets the 'i-th' out vector position relative to the knot point.

Parameters
iSpecifies the point to be set.
pThe out vector position to set relative to the knot point.
CoreExport Point3 GetVert ( int  i)

Returns an item in the in vector.

Each control point is made up of three points. The in vector coming off the bezier control point, the knot point itself, and the out vector. There are these three points for every control point. This method will return any item in this list.

Parameters
iThe index into the vertex list.
CoreExport void SetVert ( int  i,
const Point3 p 
)

Sets the the position of the given Vertex.

int Verts ( )
inline

Returns the number of vertices.

This is always the number of knots times 3.

708 { return knotCount*3; }
CoreExport int GetAux ( int  knot)

Returns the auxiliary data associated with the specified knot.

This is used internally for tracking topological changes to the spline during editing. Developers can use it for temporary purposes but it will be altered by the EditableSpline (SplineShape) code.

Parameters
knotThe knot from whom the data is retrieved.
CoreExport void SetAux ( int  knot,
int  value 
)

Sets the first integer auxiliary data associated with the specified knot.

Parameters
knotThe knot whose auxiliary will be set.
valueThe value to be set to.
CoreExport int GetAux2 ( int  knot)

Returns the second integer auxiliary data associated with the specified knot.

Parameters
knotThe knot from whom the data is retrieved.
CoreExport void SetAux2 ( int  knot,
int  value 
)

Sets the second integer auxiliary data associated with the specified knot.

Parameters
knotThe knot whose auxiliary data will be set.
valueThe value to set to.
CoreExport int GetAux3 ( int  knot)

Returns the third integer auxiliary data associated with the specified knot.

This field is available for any use.

Parameters
knotThe knot whose auxiliary data is returned.
CoreExport void SetAux3 ( int  knot,
int  value 
)

Sets the third integer auxiliary data associated with the specified knot.

This field is available for any use.

Parameters
knotThe knot whose auxiliary data will be set.
valueThe value to set to.
CoreExport int GetKnotAux ( int  knot,
int  which 
)

Returns the specified integer auxiliary data associated with the specified knot.

Parameters
knotThe knot whose auxiliary data is returned.
whichThe auxiliary field. 0=aux1, 1=aux2 and 2=aux3.
CoreExport void SetKnotAux ( int  knot,
int  which,
int  value 
)

Sets the specified integer auxiliary data associated with the specified knot.

Parameters
knotSpecifies the knot whose auxiliary data will be set.
whichThe auxiliary field. 0=aux1, 1=aux2 and 2=aux3 .
valueThe value to set to.
CoreExport int GetInAux ( int  knot,
int  which 
)

Returns the specified integer auxiliary data associated with the specified in vector.

Parameters
knotSpecifies the knot whose auxiliary data will be returned.
whichThe auxiliary field. 0=aux1, 1=aux2 and 2=aux3.
CoreExport void SetInAux ( int  knot,
int  which,
int  value 
)

Sets the specified integer auxiliary data associated with the specified in vector.

Parameters
knotThe knot whose auxiliary data will be set.
whichThe auxiliary field. The auxiliary field. 0=aux1, 1=aux2 and 2=aux3.
valueThe value to set to.
CoreExport int GetOutAux ( int  knot,
int  which 
)

Returns the specified integer auxiliary data associated with the specified out vector.

Parameters
knotThe knot whose auxiliary data will be returned.
whichThe auxiliary field. 0=aux1, 1=aux2 and 2=aux3.
CoreExport void SetOutAux ( int  knot,
int  which,
int  value 
)

Sets the specified integer auxiliary data associated with the specified out vector.

Parameters
knotThe knot whose auxiliary data will be set.
whichThe auxiliary field. 0=aux1, 1=aux2 and 2=aux3.
valueThe value to be set to.
CoreExport int GetVertAux ( int  i,
int  which 
)

Returns the specified integer auxiliary data associated with the specified bezier vertex.

Parameters
iThe zero based bezier vertex index.
whichThe auxiliary field. 0=aux1, 1=aux2 and 2=aux3.
CoreExport void SetVertAux ( int  i,
int  which,
int  value 
)

Sets the specified integer auxilliary data associated with the specified bezier vertex.

Parameters
iThe zero based bezier vertex index.
whichThe auxiliary field. 0=aux1, 1=aux2 and 2=aux3.
valueThe value to be set to.
CoreExport MtlID GetMatID ( int  seg)

Returns the material ID for the specified spline segment.

Parameters
segThe zero based index of the segment.
CoreExport void SetMatID ( int  seg,
MtlID  id 
)

Sets the material ID for the specified spline segment.

Parameters
segThe zero based index of the segment.
idThe material ID to be set to.
CoreExport float SplineLength ( )

Returns the length of the spline.

CoreExport float SegmentLength ( int  seg)

Returns the length of the specified segment of this spline.

Parameters
segThe zero based index of the segment to check.
CoreExport void Transform ( Matrix3 tm)

Transforms the points of the spline into another space defined by the specified transformation matrix.

Parameters
tmThe pointer to the transformation matrix.
CoreExport void Reverse ( BOOL  keepZero = FALSE)

Reverses all the points of the spline.

Parameters
keepZeroDefaults to FALSE in order to retain backwards compatibility. Setting it to TRUE insures that a closed spline will have the same vertex as its first point when it is reversed. The parameter is ignored on open splines.
CoreExport BOOL Append ( Spline3D spline,
BOOL  weldCoincidentFirstVertex = TRUE 
)

Appends the specified spline onto the end of this one.

The splines should both be opened.

Parameters
splineThe spline to append.
weldCoincidentFirstVertexDefaults to TRUE. Set this to TRUE to weld coincident first vertices. Setting it to FALSE will disable welding. Returns TRUE if first point auto-welded
CoreExport BOOL Prepend ( Spline3D spline,
BOOL  weldCoincidentLastVertex = TRUE 
)

Takes the specified spline and puts it on the front of this spline.

Parameters
splineThe spline to perpend.
weldCoincidentLastVertexDefaults to TRUE. Set this to TRUE to weld coincident last vertices. Setting it to FALSE will disable welding. Returns TRUE if first point auto-welded
Returns
true if last point auto-welded, false otherwise.
CoreExport BOOL IsClockWise ( )
Returns
true if the spline is clockwise in the XY plane (it ignores Z), false otherwise. This call is meaningless if the shape self intersects.
CoreExport BOOL SelfIntersects ( )
Returns
true if the spline intersects itself in the XY plane (it ignores Z), false otherwise.
CoreExport BOOL IntersectsSpline ( Spline3D spline)

Tells if the input spline intersects the specified spline in the XY plane (ignoring Z) or not.

Parameters
splineThe pointer to the spline to check.
Returns
true if this spline intersects the specified spline in the XY plane (ignoring Z), false otherwise.
CoreExport BOOL SurroundsPoint ( Point2  p)

Tells if the specified 2-D point is surrounded (contained within) this spline or not.

Parameters
pThe point to check.
Returns
true if the specified point is surrounded (contained within) the current spline, false otherwise.
CoreExport void MakePolyLine ( PolyLine line,
int  steps = -1,
BOOL  optimize = FALSE 
)

Creates a PolyLine from this spline given a steps setting and an optimize parameter.

Note the following constraints on this method. When a ShapeObject is asked to output a PolyShape with a given number of steps and FALSE is specified for optimization, it must output a PolyLine with [steps * pieces + pieces + 1] vertices if it's an open shape and [steps * pieces + pieces] vertices if it's closed.

Parameters
lineThe result is stored here.
stepsDefaults to -1. The number of steps between knots in the spline.
optimizeDefaults to FALSE. If TRUE, linear segments between control points in the spline will not generate steps in between. It will just be one line segment.
CoreExport void InvalidateGeomCache ( )

This method makes sure the shape has flushed out any cached data it may have had.

CoreExport void GetSmoothingMap ( IntTab map)

This method allows this Spline3D to create a map of smoothing groups that eases the creation of meshes.

It fills in a developer supplied IntTab with smoothing groups for each segment of the spline. A spline with 4 segments will cause the IntTab to be set to 4 entries, for example. Five smoothing groups are used for this operation, 1<<0 through 1<<4. Once you have them, you can shift them as needed for your application. The smoothing groups are set up so that segments connected by knots with KTYPE_SMOOTH or KTYPE_BEZIER types are smoothed together.

Parameters
mapA table of integers. See Template Class Tab.

Friends And Related Function Documentation

friend class BezierShape
friend
friend class SplineShape
friend
friend class Railing
friend