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.
#include <spline3d.h>
Public Member Functions |
|
CoreExport | Spline3D (int itype=KTYPE_CORNER, int dtype=KTYPE_BEZIER, int ptype=PARM_UNIFORM) |
Constructor. |
|
CoreExport | Spline3D (Spline3D &fromSpline) |
virtual CoreExport | ~Spline3D () |
Destructor. |
|
CoreExport Spline3D & | operator= (Spline3D &fromSpline) |
Assignment operator. |
|
CoreExport Spline3D & | operator= (PolyLine &fromLine) |
Assignment operator. |
|
CoreExport void | NewSpline () |
Clears out the spline. |
|
int | ParmType () |
int | KnotCount () |
Returns the Knot (point) count. |
|
int | Flags () |
Returns the private spline flags. |
|
CoreExport int | Segments () |
Returns the number of line segments in the
spline. |
|
int | Closed () |
Returns the closed status. |
|
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. |
|
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. |
|
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. |
|
CoreExport int | DeleteKnot (int where) |
Delete the specified knot. |
|
CoreExport int | Create (ViewExp *vpt, int msg, int point, int flags, IPoint2 m, Matrix3 *mat, IObjParam *ip=NULL) |
Used internally by the free form line object
SPLINE.CPP. |
|
CoreExport int | StartInsert (ViewExp *vpt, int msg, int point, int flags, IPoint2 theP, Matrix3 *mat, int where) |
Used internally by the free form line object
SPLINE.CPP. |
|
CoreExport int | SetParam (int index, float param) |
CoreExport float | GetParam (int index) |
int | GetKnotType (int index) |
Returns the knot type from the specified
knot. |
|
CoreExport int | SetKnotType (int index, int type) |
Sets the knot type of the specified knot.
|
|
int | GetLineType (int index) |
Returns the type of line segment between
knots for the specified segment. |
|
CoreExport int | SetLineType (int index, int type) |
Sets the line type of the specified segment.
|
|
virtual void | CustomParams () |
CoreExport void | CompParams () |
CoreExport void | ComputeBezPoints () |
This method should be called whenever you
finish changing points on the spline. |
|
CoreExport void | FindSegAndParam (float u, int ptype, int &seg, float ¶m) |
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 Point2 | InterpBezier (IPoint2 *bez, float t) |
CoreExport Point3 | InterpBezier3D (int segment, float t, int ptype=SPLINE_INTERP_SIMPLE) |
Returns a point interpolated on a segment
between two knots. |
|
CoreExport Point3 | InterpCurve3D (float u, int ptype=SPLINE_INTERP_SIMPLE) |
Returns a point interpolated on the entire
curve. |
|
CoreExport Point3 | TangentBezier3D (int segment, float t, int ptype=SPLINE_INTERP_SIMPLE) |
Returns a tangent vector interpolated on a
segment between two knots. |
|
CoreExport Point3 | TangentCurve3D (float u, int ptype=SPLINE_INTERP_SIMPLE) |
Returns a tangent vector interpolated on the
entire curve. |
|
CoreExport Point3 | AverageTangent (int i) |
CoreExport void | MakeBezCont (int i) |
CoreExport void | RedistTangents (int i, Point3 d) |
CoreExport void | FixAdjBezTangents (int i) |
deprecated This method should not be used.
|
|
CoreExport void | DrawCurve (GraphicsWindow *gw, Material *mtl) |
void | SetEditMode (int mode) |
CoreExport int | IsAuto (int i) |
Returns nonzero if the knot type is
KTYPE_AUTO. |
|
CoreExport int | IsBezierPt (int i) |
Returns nonzero if the knot type is
KTYPE_BEZIER. |
|
CoreExport int | IsCorner (int i) |
Returns nonzero if the knot type is
KTYPE_CORNER, zero otherwise. |
|
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. |
|
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. |
|
CoreExport int | SetOpen () |
Sets the spline to open. |
|
CoreExport void | Dump (int where) |
Displays data about the specified knot using
DebugPrints(). |
|
CoreExport Point3 | GetInVec (int i) |
Returns the 'i-th' in vector position in
absolute coordinates. |
|
CoreExport void | SetInVec (int i, const Point3 &p) |
Sets the 'i-th' in vector position in
absolute coordinates. |
|
CoreExport Point3 | GetRelInVec (int i) |
Returns the 'i-th' in vector position
relative to the knot point. |
|
CoreExport void | SetRelInVec (int i, const Point3 &p) |
Sets the 'i-th' bezier in vector position
relative to the knot point. |
|
CoreExport Point3 | GetKnotPoint (int i) |
Returns the 'i-th' knot point. |
|
CoreExport void | SetKnotPoint (int i, const Point3 &p) |
Sets the 'i-th' knot point to the specified
value. |
|
CoreExport Point3 | GetOutVec (int i) |
Returns the 'i-th' out vector position in
absolute coordinates. |
|
CoreExport void | SetOutVec (int i, const Point3 &p) |
Sets the 'i-th' out vector position in
absolute coordinates. |
|
CoreExport Point3 | GetRelOutVec (int i) |
Returns the 'i-th' out vector position
relative to the knot point. |
|
CoreExport void | SetRelOutVec (int i, const Point3 &p) |
Sets the 'i-th' out vector position relative
to the knot point. |
|
CoreExport Point3 | GetVert (int i) |
Returns an item in the in vector. |
|
CoreExport void | SetVert (int i, const Point3 &p) |
int | Verts () |
Returns the number of vertices. |
|
CoreExport int | GetAux (int knot) |
Returns the auxiliary data associated with
the specified knot. |
|
CoreExport void | SetAux (int knot, int value) |
Sets the first integer auxiliary data
associated with the specified knot. |
|
CoreExport int | GetAux2 (int knot) |
Returns the second integer auxiliary data
associated with the specified knot. |
|
CoreExport void | SetAux2 (int knot, int value) |
Sets the second integer auxiliary data
associated with the specified knot. |
|
CoreExport int | GetAux3 (int knot) |
Returns the third integer auxiliary data
associated with the specified knot. |
|
CoreExport void | SetAux3 (int knot, int value) |
Sets the third integer auxiliary data
associated with the specified knot. |
|
CoreExport int | GetKnotAux (int knot, int which) |
Returns the specified integer auxiliary data
associated with the specified knot. |
|
CoreExport void | SetKnotAux (int knot, int which, int value) |
Sets the specified integer auxiliary data
associated with the specified knot. |
|
CoreExport int | GetInAux (int knot, int which) |
Returns the specified integer auxiliary data
associated with the specified in vector. |
|
CoreExport void | SetInAux (int knot, int which, int value) |
Sets the specified integer auxiliary data
associated with the specified in vector. |
|
CoreExport int | GetOutAux (int knot, int which) |
Returns the specified integer auxiliary data
associated with the specified out vector. |
|
CoreExport void | SetOutAux (int knot, int which, int value) |
Sets the specified integer auxiliary data
associated with the specified out vector. |
|
CoreExport int | GetVertAux (int i, int which) |
Returns the specified integer auxiliary data
associated with the specified bezier vertex. |
|
CoreExport void | SetVertAux (int i, int which, int value) |
Sets the specified integer auxilliary data
associated with the specified bezier vertex. |
|
CoreExport MtlID | GetMatID (int seg) |
Returns the material ID for the specified
spline segment. |
|
CoreExport void | SetMatID (int seg, MtlID id) |
Sets the material ID for the specified
spline segment. |
|
CoreExport float | SplineLength () |
Returns the length of the spline. |
|
CoreExport float | SegmentLength (int seg) |
Returns the length of the specified segment
of this spline. |
|
CoreExport void | Transform (Matrix3 *tm) |
Transforms the points of the spline into
another space defined by the specified transformation matrix.
|
|
CoreExport void | Reverse (BOOL keepZero=FALSE) |
Reverses all the points of the spline.
|
|
CoreExport BOOL | Append (Spline3D *spline, BOOL weldCoincidentFirstVertex=TRUE) |
Appends the specified spline onto the end of
this one. |
|
CoreExport BOOL | Prepend (Spline3D *spline, BOOL weldCoincidentLastVertex=TRUE) |
Takes the specified spline and puts it on
the front of this spline. |
|
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. |
|
CoreExport BOOL | SurroundsPoint (Point2 p) |
Tells if the specified 2-D point is
surrounded (contained within) this spline or not. |
|
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.
|
|
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. |
|
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 |
CoreExport Spline3D | ( | int | itype =
KTYPE_CORNER , |
int | dtype =
KTYPE_BEZIER , |
||
int | ptype =
PARM_UNIFORM |
||
) |
Constructor.
itype | Knot type at initial click. |
dtype | Knot type at drag. |
ptype | Interpolation parameter type |
virtual CoreExport ~Spline3D | ( | ) | [virtual] |
Destructor.
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] |
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] |
int KnotCount | ( | ) | [inline] |
int Flags | ( | ) | [inline] |
Returns the private spline flags.
SPLINE_CLOSED This indicates if the spline is closed or not.
{ 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.
{ return (flags & SPLINE_CLOSED) ? 1:0; }
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.
k | The knot to be added. |
where | = -1, The location to add the knot. a negative value indicates the end of the spline. |
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.
i | Specifies the value to be set to. |
k | The 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.
i | Specifies the knot to be retrieved. |
CoreExport int DeleteKnot | ( | int | where | ) |
Delete the specified knot.
where | The location of the knot to be deleted. |
CoreExport int Create | ( | ViewExp * | vpt, |
int | msg, | ||
int | point, | ||
int | flags, | ||
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 | flags, | ||
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.
index | The index of the knot type to return. |
{ return knots[index].ktype; }
CoreExport int SetKnotType | ( | int | index, |
int | type | ||
) |
Sets the knot type of the specified knot.
index | The knot to be set. |
type | The Spline knot type |
int GetLineType | ( | int | index | ) | [inline] |
Returns the type of line segment between knots for the specified segment.
index | The index of the segment whose line type will be returned. |
{ return knots[index].ltype; }
CoreExport int SetLineType | ( | int | index, |
int | type | ||
) |
Sets the line type of the specified segment.
index | The index of the segment. |
type | The Spline line type |
virtual void CustomParams | ( | ) | [inline, virtual] |
This method is used internally.
{ UniformParams(); } // Replace this as needed
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.
segment | The index of the segment to interpolate. |
t | A 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. |
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.
u | A value in the range of 0.0 to 1.0 for the entire curve. |
ptype | = SPLINE_INTERP_SIMPLE; The spline type to use. |
CoreExport Point3 TangentBezier3D | ( | int | segment, |
float | t, | ||
int | ptype =
SPLINE_INTERP_SIMPLE |
||
) |
Returns a tangent vector interpolated on a segment between two knots.
segment | The index of the segment. |
t | A 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. |
CoreExport Point3 TangentCurve3D | ( | float | u, |
int | ptype =
SPLINE_INTERP_SIMPLE |
||
) |
Returns a tangent vector interpolated on the entire curve.
u | A value in the range of 0.0 to 1.0 for the entire curve. |
ptype | = SPLINE_INTERP_SIMPLE; The spline type to use. |
CoreExport Point3 AverageTangent | ( | int | i | ) |
CoreExport void MakeBezCont | ( | int | i | ) |
CoreExport void RedistTangents | ( | int | i, |
Point3 | d | ||
) |
CoreExport void FixAdjBezTangents | ( | int | i | ) |
deprecated This method should not be used.
CoreExport void DrawCurve | ( | GraphicsWindow * | gw, |
Material * | mtl | ||
) |
void SetEditMode | ( | int | mode | ) | [inline] |
CoreExport int IsAuto | ( | int | i | ) |
Returns nonzero if the knot type is KTYPE_AUTO.
Zero otherwise.
i | The index of the knot. |
CoreExport int IsBezierPt | ( | int | i | ) |
Returns nonzero if the knot type is KTYPE_BEZIER.
Zero otherwise.
i | The index of the knot. |
CoreExport int IsCorner | ( | int | i | ) |
Returns nonzero if the knot type is KTYPE_CORNER, zero otherwise.
i | The index of the knot. |
This method is used internally.
This method is used internally.
CoreExport int DrawPhase | ( | ) | [inline] |
CoreExport int GetiCur | ( | ) | [inline] |
Returns the bounding box of the curve in the space specified by the tm in the input parameters.
t | This parameter is not used. |
tm | The tm to transform the points by prior to computing the bounding box. |
box | The bounding box |
This method is used internally.
This method is used internally.
CoreExport void Snap | ( | GraphicsWindow * | gw, |
SnapInfo * | snap, | ||
IPoint2 * | p, | ||
Matrix3 & | tm | ||
) |
This method is used internally.
This method is used internally to save the class data from disk.
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.
flag | = 1. Nonzero to close; zero to open. |
CoreExport int SetOpen | ( | ) |
Sets the spline to open.
CoreExport void Dump | ( | int | where | ) |
Displays data about the specified knot using DebugPrints().
See Debugging.
where | The index of the knot. |
CoreExport Point3 GetInVec | ( | int | i | ) |
Returns the 'i-th' in vector position in absolute coordinates.
i | The vector position to be retrieved. |
CoreExport void SetInVec | ( | int | i, |
const Point3 & | p | ||
) |
Sets the 'i-th' in vector position in absolute coordinates.
i | The position to be altered. |
p | The value to be set in absolute coordinates. |
CoreExport Point3 GetRelInVec | ( | int | i | ) |
Returns the 'i-th' in vector position relative to the knot point.
i | The 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.
i | The vector to be set. |
p | The vector data to set, relative to the knot point. |
CoreExport Point3 GetKnotPoint | ( | int | i | ) |
Returns the 'i-th' knot point.
i | The knot point to be returned. |
CoreExport void SetKnotPoint | ( | int | i, |
const Point3 & | p | ||
) |
Sets the 'i-th' knot point to the specified value.
i | The knot point to be set. |
p | The value to be set to. |
CoreExport Point3 GetOutVec | ( | int | i | ) |
Returns the 'i-th' out vector position in absolute coordinates.
i | The out vector point to be returned. |
CoreExport void SetOutVec | ( | int | i, |
const Point3 & | p | ||
) |
Sets the 'i-th' out vector position in absolute coordinates.
i | The out vector point to get. |
p | The out vector to set in absolute coordinates. |
CoreExport Point3 GetRelOutVec | ( | int | i | ) |
Returns the 'i-th' out vector position relative to the knot point.
i | Specifies the point to get. |
CoreExport void SetRelOutVec | ( | int | i, |
const Point3 & | p | ||
) |
Sets the 'i-th' out vector position relative to the knot point.
i | Specifies the point to be set. |
p | The 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.
i | The index into the vertex list. |
CoreExport void SetVert | ( | int | i, |
const Point3 & | p | ||
) |
int Verts | ( | ) | [inline] |
Returns the number of vertices.
This is always the number of knots times 3.
{ 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.
knot | The 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.
knot | The knot whose auxiliary will be set. |
value | The value to be set to. |
CoreExport int GetAux2 | ( | int | knot | ) |
Returns the second integer auxiliary data associated with the specified knot.
knot | The 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.
knot | The knot whose auxiliary data will be set. |
value | The 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.
knot | The 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.
knot | The knot whose auxiliary data will be set. |
value | The value to set to. |
CoreExport int GetKnotAux | ( | int | knot, |
int | which | ||
) |
Returns the specified integer auxiliary data associated with the specified knot.
knot | The knot whose auxiliary data is returned. |
which | The 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.
knot | Specifies the knot whose auxiliary data will be set. |
which | The auxiliary field. 0=aux1, 1=aux2 and 2=aux3 . |
value | The value to set to. |
CoreExport int GetInAux | ( | int | knot, |
int | which | ||
) |
Returns the specified integer auxiliary data associated with the specified in vector.
knot | Specifies the knot whose auxiliary data will be returned. |
which | The 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.
knot | The knot whose auxiliary data will be set. |
which | The auxiliary field. The auxiliary field. 0=aux1, 1=aux2 and 2=aux3. |
value | The value to set to. |
CoreExport int GetOutAux | ( | int | knot, |
int | which | ||
) |
Returns the specified integer auxiliary data associated with the specified out vector.
knot | The knot whose auxiliary data will be returned. |
which | The 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.
knot | The knot whose auxiliary data will be set. |
which | The auxiliary field. 0=aux1, 1=aux2 and 2=aux3. |
value | The value to be set to. |
CoreExport int GetVertAux | ( | int | i, |
int | which | ||
) |
Returns the specified integer auxiliary data associated with the specified bezier vertex.
i | The zero based bezier vertex index. |
which | The 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.
i | The zero based bezier vertex index. |
which | The auxiliary field. 0=aux1, 1=aux2 and 2=aux3. |
value | The value to be set to. |
CoreExport MtlID GetMatID | ( | int | seg | ) |
Returns the material ID for the specified spline segment.
seg | The zero based index of the segment. |
CoreExport void SetMatID | ( | int | seg, |
MtlID | id | ||
) |
Sets the material ID for the specified spline segment.
seg | The zero based index of the segment. |
id | The 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.
seg | The 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.
tm | The pointer to the transformation matrix. |
CoreExport void Reverse | ( | BOOL | keepZero = FALSE |
) |
Reverses all the points of the spline.
keepZero | Defaults 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.
spline | The spline to append. |
weldCoincidentFirstVertex | Defaults 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.
spline | The spline to perpend. |
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.
spline | The pointer to the spline to check. |
CoreExport BOOL SurroundsPoint | ( | Point2 | p | ) |
Tells if the specified 2-D point is surrounded (contained within) this spline or not.
p | The point to check. |
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.
line | The result is stored here. |
steps | Defaults to -1. The number of steps between knots in the spline. |
optimize | Defaults 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.
friend class BezierShape
[friend] |
friend class SplineShape
[friend] |
friend class Railing [friend] |