#include <spline3d.h>
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.
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 Spline3D & | operator= (Spline3D &fromSpline) |
Assignment operator. More... | |
CoreExport Spline3D & | operator= (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 ¶m) |
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 void * | operator new (size_t size) |
Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More... | |
static UtilExport void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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 void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. More... | |
static UtilExport void * | operator 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 void * | operator 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 void * | operator 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 void * | operator 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... | |
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 |
CoreExport Spline3D | ( | Spline3D & | fromSpline | ) |
|
virtual |
Destructor.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
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.
|
inline |
|
inline |
|
inline |
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.
|
inline |
Returns the closed status.
Nonzero if closed, zero if not closed.
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 | 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.
Returns the knot type from the specified knot.
index | The index of the knot type to return. |
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 |
Returns the type of line segment between knots for the specified segment.
index | The index of the segment whose line type will be returned. |
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 |
|
inlinevirtual |
This method is used internally.
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 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.
CoreExport int AppendPoint | ( | ViewExp * | vpt, |
const Point3 & | p, | ||
int | where = -1 |
||
) |
This method is used internally.
|
inline |
|
inline |
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.
t | This parameter is not used. |
tm | The tm to transform the points by prior to computing the bounding box. |
box | The 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.
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 Troubleshooting.
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 | ||
) |
Sets the the position of the given Vertex.
|
inline |
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. |
weldCoincidentLastVertex | Defaults 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 |
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 |
|
friend |
|
friend |