3ds Max C++ API Reference
Spline3D Class Reference

General-purpose 3D spline class. More...

#include <spline3d.h>

+ 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 (const Spline3D &fromSpline)
 
virtual CoreExport ~Spline3D ()
 Destructor. More...
 
CoreExport Spline3Doperator= (const Spline3D &fromSpline)
 Assignment operator. More...
 
CoreExport Spline3Doperator= (const PolyLine &fromLine)
 Assignment operator. More...
 
CoreExport void NewSpline ()
 Clears out the spline. More...
 
int ParmType () const
 
int KnotCount () const
 Returns the Knot (point) count. More...
 
int Flags () const
 Returns the private spline flags. More...
 
CoreExport int Segments () const
 Returns the number of line segments in the spline. More...
 
int Closed () const
 Returns the closed status. More...
 
CoreExport int ShiftKnot (int where, int direction)
 
CoreExport int AddKnot (const SplineKnot &k, int where=-1)
 Add a knot to the spline at the specified location. More...
 
CoreExport void SetKnot (int i, const 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) const
 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) const
 
int GetKnotType (int index) const
 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) const
 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 InterpBezier3DNormalized (int segment, float t, float &normParam)
 Returns a point interpolated on a segment between two knots using the SPLINE_INTERP_NORMALIZED method. 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) const
 Returns nonzero if the knot type is KTYPE_AUTO. More...
 
CoreExport int IsBezierPt (int i) const
 Returns nonzero if the knot type is KTYPE_BEZIER. More...
 
CoreExport int IsCorner (int i) const
 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 () const
 
CoreExport int GetiCur () const
 
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) const
 
CoreExport Point3 UnProjectPoint (ViewExp *vpt, IPoint2 p, Matrix3 *mat) const
 
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) const
 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 BOOL GetKnotUserFlag (int i, DWORD fl) const
 Get the user flags for a specified knot. More...
 
CoreExport void SetKnotUserFlag (int i, DWORD fl, BOOL val=TRUE)
 Set the user flags for a specified knot. More...
 
CoreExport void ClearKnotUserFlag (int i, DWORD fl)
 Clear the user flags for a specified knot. More...
 
CoreExport Point3 GetVert (int i) const
 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 () const
 Returns the number of vertices. More...
 
CoreExport int GetAux (int knot) const
 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) const
 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) const
 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) const
 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) const
 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) const
 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) const
 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) const
 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
 
class Spline3DLeakDetector
 

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

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

Constructor & Destructor Documentation

◆ Spline3D() [1/2]

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

◆ Spline3D() [2/2]

CoreExport Spline3D ( const Spline3D fromSpline)

◆ ~Spline3D()

virtual CoreExport ~Spline3D ( )
virtual

Destructor.

Member Function Documentation

◆ Allocate()

CoreExport void Allocate ( int  count)
protected

◆ ChordParams()

CoreExport void ChordParams ( )
protected

◆ UniformParams()

CoreExport void UniformParams ( )
protected

◆ CentripetalParams()

CoreExport void CentripetalParams ( )
protected

◆ LinearFwd()

CoreExport void LinearFwd ( int  i)
protected

◆ LinearBack()

CoreExport void LinearBack ( int  i)
protected

◆ ContinFwd()

CoreExport void ContinFwd ( int  i)
protected

◆ ContinBack()

CoreExport void ContinBack ( int  i)
protected

◆ HybridPoint()

CoreExport void HybridPoint ( int  i)
protected

◆ CompCornerBezPoints()

CoreExport void CompCornerBezPoints ( int  n)
protected

◆ CompAdjBesselBezPoints()

CoreExport void CompAdjBesselBezPoints ( int  i)
protected

◆ BesselStart()

CoreExport void BesselStart ( int  i)
protected

◆ BesselEnd()

CoreExport void BesselEnd ( int  i)
protected

◆ NaturalFwd()

CoreExport void NaturalFwd ( int  i)
protected

◆ NaturalBack()

CoreExport void NaturalBack ( int  i)
protected

◆ operator=() [1/2]

CoreExport Spline3D& operator= ( const Spline3D fromSpline)

Assignment operator.

◆ operator=() [2/2]

CoreExport Spline3D& operator= ( const 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.

◆ NewSpline()

CoreExport void NewSpline ( )

Clears out the spline.

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

◆ ParmType()

int ParmType ( ) const
inline

This method is used internally.

465 { return parmType; };

◆ KnotCount()

int KnotCount ( ) const
inline

Returns the Knot (point) count.

468 { return knotCount; }

◆ Flags()

int Flags ( ) const
inline

Returns the private spline flags.

SPLINE_CLOSED This indicates if the spline is closed or not.

473 { return flags; }

◆ Segments()

CoreExport int Segments ( ) const

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.

◆ Closed()

int Closed ( ) const
inline

Returns the closed status.

Nonzero if closed, zero if not closed.

480 { return (flags & SPLINE_CLOSED) ? 1:0; }
#define SPLINE_CLOSED
Definition: spline3d.h:375

◆ ShiftKnot()

CoreExport int ShiftKnot ( int  where,
int  direction 
)

This method is used internally.

◆ AddKnot()

CoreExport int AddKnot ( const 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.

◆ SetKnot()

CoreExport void SetKnot ( int  i,
const 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.

◆ GetKnot()

CoreExport SplineKnot GetKnot ( int  i) const

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.

◆ DeleteKnot()

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.

◆ Create()

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.

◆ StartInsert()

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.

◆ SetParam()

CoreExport int SetParam ( int  index,
float  param 
)

This method is used internally.

◆ GetParam()

CoreExport float GetParam ( int  index) const

This method is used internally.

◆ GetKnotType()

int GetKnotType ( int  index) const
inline

Returns the knot type from the specified knot.

Parameters
indexThe index of the knot type to return.
See also
Knot types
535 { return knots[index].ktype; }

◆ SetKnotType()

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

◆ GetLineType()

int GetLineType ( int  index) const
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
549 { return knots[index].ltype; }

◆ SetLineType()

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

◆ CustomParams()

virtual void CustomParams ( )
inlinevirtual

This method is used internally.

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

◆ CompParams()

CoreExport void CompParams ( )

This method is used internally.

◆ ComputeBezPoints()

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.

◆ FindSegAndParam()

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

Finds segment and parameter for whole-curve parameter.

◆ RefineCurve()

CoreExport void RefineCurve ( float  u,
int  ptype = SPLINE_INTERP_SIMPLE 
)

◆ RefineSegment()

CoreExport void RefineSegment ( int  segment,
float  t,
int  ptype = SPLINE_INTERP_SIMPLE 
)

◆ InterpBezier3D()

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.

◆ InterpBezier3DNormalized()

CoreExport Point3 InterpBezier3DNormalized ( int  segment,
float  t,
float &  normParam 
)

Returns a point interpolated on a segment between two knots using the SPLINE_INTERP_NORMALIZED method.

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.
normParamThe effective parameter value derived by travelling along the segment to value t.
Returns
The interpolated point.

◆ InterpCurve3D()

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.

◆ TangentBezier3D()

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.

◆ TangentCurve3D()

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.

◆ IsAuto()

CoreExport int IsAuto ( int  i) const

Returns nonzero if the knot type is KTYPE_AUTO.

Zero otherwise.

Parameters
iThe index of the knot.

◆ IsBezierPt()

CoreExport int IsBezierPt ( int  i) const

Returns nonzero if the knot type is KTYPE_BEZIER.

Zero otherwise.

Parameters
iThe index of the knot.

◆ IsCorner()

CoreExport int IsCorner ( int  i) const

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

Parameters
iThe index of the knot.

◆ GetDragVector()

CoreExport Point3 GetDragVector ( ViewExp vpt,
IPoint2  p,
int  i,
Matrix3 mat 
)

This method is used internally.

◆ AppendPoint()

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

This method is used internally.

◆ DrawPhase()

CoreExport int DrawPhase ( ) const
inline

This method is used internally.

628 { return drawPhase; }

◆ GetiCur()

CoreExport int GetiCur ( ) const
inline

This method is used internally.

631 { return iCur; }

◆ GetBBox()

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

◆ ProjectPoint()

CoreExport IPoint2 ProjectPoint ( ViewExp vpt,
Point3  fp,
Matrix3 mat 
) const

This method is used internally.

◆ UnProjectPoint()

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

This method is used internally.

◆ Snap()

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

This method is used internally.

◆ Save()

CoreExport IOResult Save ( ISave isave)

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

◆ Load()

CoreExport IOResult Load ( ILoad iload)

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

◆ SetClosed()

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.

◆ SetOpen()

CoreExport int SetOpen ( )

Sets the spline to open.

Returns
Nonzero if changed, zero if not changed.

◆ Dump()

CoreExport void Dump ( int  where)

Displays data about the specified knot using DebugPrints().

See Troubleshooting.

Parameters
whereThe index of the knot.

◆ GetInVec()

CoreExport Point3 GetInVec ( int  i)

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

Parameters
iThe vector position to be retrieved.

◆ SetInVec()

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.

◆ GetRelInVec()

CoreExport Point3 GetRelInVec ( int  i)

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

Parameters
iThe position to be returned.

◆ SetRelInVec()

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.

◆ GetKnotPoint()

CoreExport Point3 GetKnotPoint ( int  i) const

Returns the 'i-th' knot point.

Parameters
iThe knot point to be returned.

◆ SetKnotPoint()

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.

◆ GetOutVec()

CoreExport Point3 GetOutVec ( int  i)

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

Parameters
iThe out vector point to be returned.

◆ SetOutVec()

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.

◆ GetRelOutVec()

CoreExport Point3 GetRelOutVec ( int  i)

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

Parameters
iSpecifies the point to get.

◆ SetRelOutVec()

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.

◆ GetKnotUserFlag()

CoreExport BOOL GetKnotUserFlag ( int  i,
DWORD  fl 
) const

Get the user flags for a specified knot.

SPLINEKNOT_USER1 through SPLINEKNOT_USER8

Parameters
iSpecifies the point to get flags for
flThe DWORD mask of the flag(s) to get

◆ SetKnotUserFlag()

CoreExport void SetKnotUserFlag ( int  i,
DWORD  fl,
BOOL  val = TRUE 
)

Set the user flags for a specified knot.

SPLINEKNOT_USER1 through SPLINEKNOT_USER8

Parameters
iSpecifies the point to set flags for
flThe DWORD mask of the flag(s) to set
valTRUE to set the flag, FALSE to clear the flag

◆ ClearKnotUserFlag()

CoreExport void ClearKnotUserFlag ( int  i,
DWORD  fl 
)

Clear the user flags for a specified knot.

SPLINEKNOT_USER1 through SPLINEKNOT_USER8

Parameters
iSpecifies the point to clear flags for
flThe DWORD mask of the flag(s) to clear

◆ GetVert()

CoreExport Point3 GetVert ( int  i) const

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.

◆ SetVert()

CoreExport void SetVert ( int  i,
const Point3 p 
)

Sets the the position of the given Vertex.

◆ Verts()

int Verts ( ) const
inline

Returns the number of vertices.

This is always the number of knots times 3.

748 { return knotCount*3; }

◆ GetAux()

CoreExport int GetAux ( int  knot) const

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.

◆ SetAux()

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.

◆ GetAux2()

CoreExport int GetAux2 ( int  knot) const

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

Parameters
knotThe knot from whom the data is retrieved.

◆ SetAux2()

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.

◆ GetAux3()

CoreExport int GetAux3 ( int  knot) const

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.

◆ SetAux3()

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.

◆ GetKnotAux()

CoreExport int GetKnotAux ( int  knot,
int  which 
) const

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.

◆ SetKnotAux()

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.

◆ GetInAux()

CoreExport int GetInAux ( int  knot,
int  which 
) const

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.

◆ SetInAux()

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.

◆ GetOutAux()

CoreExport int GetOutAux ( int  knot,
int  which 
) const

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.

◆ SetOutAux()

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.

◆ GetVertAux()

CoreExport int GetVertAux ( int  i,
int  which 
) const

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.

◆ SetVertAux()

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.

◆ GetMatID()

CoreExport MtlID GetMatID ( int  seg) const

Returns the material ID for the specified spline segment.

Parameters
segThe zero based index of the segment.

◆ SetMatID()

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.

◆ SplineLength()

CoreExport float SplineLength ( )

Returns the length of the spline.

◆ SegmentLength()

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.

◆ Transform()

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.

◆ Reverse()

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.

◆ Append()

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

◆ Prepend()

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.

◆ IsClockWise()

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.

◆ SelfIntersects()

CoreExport BOOL SelfIntersects ( )
Returns
true if the spline intersects itself in the XY plane (it ignores Z), false otherwise.

◆ IntersectsSpline()

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.

◆ SurroundsPoint()

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.

◆ MakePolyLine()

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.

◆ InvalidateGeomCache()

CoreExport void InvalidateGeomCache ( )

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

◆ GetSmoothingMap()

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

◆ BezierShape

friend class BezierShape
friend

◆ SplineShape

friend class SplineShape
friend

◆ Railing

friend class Railing
friend

◆ Spline3DLeakDetector

friend class Spline3DLeakDetector
friend