Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MGraphic3D
Inherited By:
None.
Purpose:
TCurve3D provides a wrapper for the TGCurve3D geometry class, to which it adds the facilities inherited from MGraphic: an attribute bundle, matrix transformations, and hit detection. TCurve3D has a, not is a, TGCurve3D. A TGCurve3D is a Non-Uniform Rational B-Spline (NURB) of arbitrary degree. Each of the TCurve3D member functions is straightforward, either because it overrides the MGraphic3D function of the same name, or because it simply invokes the TGCurve3D function of the same name.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TCurve3D ()
- TCurve3D (const TGPoint3D & p0, const TGPoint3D & p1, const TGPoint3D & p2, TGrafBundle3D * adoptBundle =NIL)
- TCurve3D (const TGPoint3D & p0, const TGPoint3D & p1, const TGPoint3D & p2, const TGPoint3D & p3, TGrafBundle3D * adoptBundle =NIL)
- TCurve3D (unsigned long order, unsigned long numberPoints, TGrafBundle3D * adoptBundle =NIL)
- TCurve3D (unsigned long order, unsigned long numberPoints, const TRawArray < GParametric > & knots, TGrafBundle3D * adoptBundle =NIL)
- TCurve3D (unsigned long order, const TGRPoint3DArray & points, TGrafBundle3D * adoptBundle =NIL)
- TCurve3D (unsigned long order, const TGRPoint3DArray & points, const TRawArray < GParametric > & knots, TGrafBundle3D * adoptBundle =NIL)
- TCurve3D (const TGLine3D & line, TGrafBundle3D * adoptBundle =NIL)
- TCurve3D (const TGPolyline3D & polyline, TGrafBundle3D * adoptBundle =NIL)
- TCurve3D (const TGCurve & curve, TGrafBundle3D * adoptBundle =NIL)
- TCurve3D (const TGCurve3D & curve, TGrafBundle3D * adoptBundle =NIL)
- TCurve3D (const TCurve3D & copy)
Interface Category:
API.
Purpose:
- Default constructor.
- Creates a three-point quadratic Bezier TCurve3D with the specified TGrafBundle.
- Creates a simple four-point cubic Bezier TCurve3D with the specified TGrafBundle.
- Creates a general NURB (Non-Uniform Rational B-Spline) of the specified order and with the specified number of control points. All the points are set to the origin (w=1). The knot vector created is kPinned. The specified TGrafBundle is adopted.
- Creates a general NURB (Non-Uniform Rational B-Spline) of the specified order, with the specified array of control points, and with the knot vector of the specified array of parametric values. The specified TGrafBundle is adopted.
- Creates a general NURB (Non-Uniform Rational B-Spline) with the specified number of control points, all of which are set to the origin (w=1). The specified TGrafBundle is adopted.
- Creates a general NURB (Non-Uniform Rational B-Spline) of the specified order, with the specified array of control points, and with the knot vector of the specified array of parametric values. The specified TGrafBundle is adopted.
- Creates a TCurve3D from the specified TGLine3D with the specified TGrafBundle.
- Creates a TCurve3D from the specified TGPolyline3D with the specified TGrafBundle.
- Creates a TCurve3D from the specified TGCurve with the specified TGrafBundle.
- Creates a TCurve3D from the specified TGCurve3D with the specified TGrafBundle.
- Copy constructor.
Calling Context:
- Called by the stream-in operators and directly.
- Call this function directly.
- Call this function directly.
- Call this function directly.
- Call this function directly.
- Call this function directly.
- Call this function directly.
- Call this function directly.
- Call this function directly.
- Call this function directly.
- Call this function directly.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const TGPoint3D & p0 -The first control point.
- const TGPoint3D & p1 -The second control point.
- const TGPoint3D & p2 -The third control point.
- TGrafBundle3D * adoptBundle =NIL -The attribute bundle to be adopted.
- const TGPoint3D & p0 -The first control point.
- const TGPoint3D & p1 -The second control point.
- const TGPoint3D & p2 -The third control point.
- const TGPoint3D & p3 -The fourth control point.
- TGrafBundle3D * adoptBundle =NIL -The attribute bundle to be adopted.
- unsigned long order -The order for the new curve.
- unsigned long numberPoints -The number of control points for the new curve.
- TGrafBundle3D * adoptBundle =NIL -The attribute bundle to be adopted.
- unsigned long order -The order for the new curve.
- unsigned long numberPoints -The number of control points for the new curve.
- const TRawArray < GParametric > & knots -The knot vector for the new curve.
- TGrafBundle3D * adoptBundle =NIL -The attribute bundle to be adopted.
- unsigned long order -The order for the new curve.
- const TGRPoint3DArray & points -The control points for the new curve.
- TGrafBundle3D * adoptBundle =NIL -The attribute bundle to be adopted.
- unsigned long order -The order for the new curve.
- const TGRPoint3DArray & points -The control points for the new curve.
- const TRawArray < GParametric > & knots -The knot vector for the new curve.
- TGrafBundle3D * adoptBundle =NIL -The attribute bundle to be adopted.
- const TGLine3D & line -The line to be converted into a curve.
- TGrafBundle3D * adoptBundle =NIL -The attribute bundle to be adopted.
- const TGPolyline3D & polyline -The polyline to be converted into a curve.
- TGrafBundle3D * adoptBundle =NIL -The attribute bundle to be adopted.
- const TGCurve & curve -The curve to be converted into a curve.
- TGrafBundle3D * adoptBundle =NIL -The attribute bundle to be adopted.
- const TGCurve3D & curve -The 3-D curve to be converted into a curve.
- TGrafBundle3D * adoptBundle =NIL -The attribute bundle to be adopted.
- const TCurve3D & copy -The curve to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TCurve3D ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::Draw
virtual void Draw (TGrafPort & port) const
Interface Category:
API.
Purpose:
Draws this TCurve3D to the specified grafport. Attributes in the graphic's bundle override those already provided in the port (if any).
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetGeometricBounds
virtual TGBox3D GetGeometricBounds () const
Interface Category:
API.
Purpose:
Gets the bounding box of this TCurve3D's geometry, without considering any volume added by the bundle.
Calling Context:
Called during hit detection. You can also call this function directly.
Parameters:
Return Value:
Returns the bounding box of the graphic's geometry.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::TransformBy
virtual void TransformBy (const TGrafMatrix3D & matrix)
Interface Category:
API.
Purpose:
Transforms this TCurve3D's shape and position by applying the specified transformation matrix.
Calling Context:
Called by the Graphics system. You can also call this function directly.
Parameters:
- const TGrafMatrix3D & matrix -The transformation matrix that the graphic's points are multiplied by.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::TranslateBy
virtual void TranslateBy (const TGPoint3D & delta)
Interface Category:
API.
Purpose:
Moves this TCurve3D's position by the specified vector relative to its current position.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint3D & delta -The vector whose x-, y-, and z-coordinates are to be added to those of each point in the geometry.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::ScaleBy
virtual void ScaleBy (const TGPoint3D & scaleFactor, const TGPoint3D & centerOfScale =TGPoint3D :: kOrigin)
Interface Category:
API.
Purpose:
Changes the size of this TCurve3D by multiplying the coordinates by the specified scaling factor. It scales the graphic about the specified center of scale. The factor parameter is a vector of type TGPoint3D that allows non-uniform scaling using x-, y-, and z-coordinates of different values. For uniform scaling, the x-, y-, and z-coordinates should be the same.
The effect of negative scaling factors is the same as mirroring. (For example, scaling by -1.0 in the x-coordinate is like mirroring about the Y-Z plane.)
Calling Context:
Call this function directly.
Parameters:
- const TGPoint3D & scaleFactor -A vector of three values that determines the amount each coordinate is to be scaled.
- const TGPoint3D & centerOfScale =TGPoint3D :: kOrigin -The center of the scaling.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::RotateBy
- virtual void RotateBy (GDegrees angle, TGrafMatrix3D :: EAxis axis)
- virtual void RotateBy (GDegrees angle, const TGLine3D & ray)
Interface Category:
API.
Purpose:
- Rotates this TCurve3D counterclockwise around the specified axis by the specified angle. The right-handed coordinate system determines the orientation. That is, when you look from the positive axis towards the 3-D origin, a 90 degree counterclockwise rotation transforms one positive axis into the other.
- Rotates this TCurve3D around the specified (arbitrary) axis by the specified angle. The direction of the vector (the axis parameter) determines the orientation of the rotation. The first point of the TGLine3D parameter is the origin; the second point determines the direction of the vector. The orientation of the rotation is counterclockwise around the vector.
Calling Context:
- Call this function directly.
- Call this function directly.
Parameters:
- GDegrees angle -The degree of the specified rotation.
- TGrafMatrix3D :: EAxis axis -Determines which axis the specified rotation is to take place about. There are three enumerated types: kAboutXAxis, kAboutYAxis, or kAboutZAxis.
- GDegrees angle -The specified angle of rotation.
- const TGLine3D & ray -The arbitrary axis of rotation.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::Concatenate
virtual void Concatenate (const TGCurve3D & curve, bool glue =true)
Interface Category:
API.
Purpose:
Adds the specified TCurve3D to the end of this one. If the glue parameter is true, then the endpoint of this curve is merged with the starting point of the parameter curve; otherwise, a double control point is created.
Calling Context:
Call this function directly.
Parameters:
- const TGCurve3D & curve -The curve to be joined to this one.
- bool glue =true -Whether the endpoint of this curve and the starting point of the parameter curve should be merged or preserved.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::Evaluate
- virtual TGPoint3D Evaluate (GParametric u) const
- virtual TGPoint3D Evaluate (GParametric u, TGPoint3D & tangent) const
- virtual TGPoint3D Evaluate (GParametric u, TGPoint3D & tangent, TGPoint3D & deriv2) const
- virtual TGPoint3D Evaluate (GParametric u, TGPoint3D & tangent, TGPoint3D & deriv2, GCoordinate & curvature) const
Interface Category:
API.
Purpose:
- Returns the point on this TCurve3D at the specified parameter.
- Returns the point on this TCurve3D at the specified parameter and also returns (in the specified parameter) the curve's tangent.
- Returns the point on this TCurve3D at the specified parameter and also returns (in the specified parameter) the curve's tangent and the second derivative (that is, the change in speed ).
- Returns the point on this TCurve3D at the specified parameter and also returns (in the specified parameter) the curve's tangent, the second derivative (that is, the change in speed ), and the curvature.
Calling Context:
- Call this function directly.
- Call this function directly.
- Call this function directly.
- Call this function directly.
Parameters:
- GParametric u -The parametric position on the curve.
- GParametric u -The parametric position on the curve.
- TGPoint3D & tangent -The tangent of the curve.
- GParametric u -The parametric position on the curve.
- TGPoint3D & tangent -The tangent of the curve.
- TGPoint3D & deriv2 -The second derivative of the curve.
- GParametric u -The parametric position on the curve.
- TGPoint3D & tangent -The tangent of the curve.
- TGPoint3D & deriv2 -The second derivative of the curve.
- GCoordinate & curvature -The curvature of the curve.
Return Value:
Returns the point on the curve at the specified parametric value.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
The parametric value must be within the parameter range of this curve (found by calling GetMinParameter and GetMaxParameter). If the specified parameter is outside this range, the value returned may not be valid (that is, a NaN, or not a number ).
Member Function: TCurve3D::EvaluateW
virtual TGRPoint3D EvaluateW (GParametric u) const
Interface Category:
API.
Purpose:
Gets the TGRPoint3D on this TCurve3D at the specified parametric value.
Calling Context:
Call this function directly.
Parameters:
- GParametric u -The parametric position on the curve.
Return Value:
Returns the point on the curve at the specified parametric value.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
The parametric value must be within the parameter range of this curve (found by calling GetMinParameter and GetMaxParameter). If the specified parameter is outside this range, the value returned may not be valid (that is, a NaN, or not a number ).
Member Function: TCurve3D::GetOrder
unsigned long GetOrder () const
Interface Category:
API.
Purpose:
Gets the order of this TCurve3D (for example, 4 for cubic curves).
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the order of the curve.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::IsEmpty
bool IsEmpty () const
Interface Category:
API.
Purpose:
Determines whether this TCurve3D's geometry is empty (that is, when the curve is created with the default constructor).
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the order of the curve is zero.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetNumberOfPoints
unsigned long GetNumberOfPoints () const
Interface Category:
API.
Purpose:
Gets the number of control points in this TCurve3D.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the number of control points.
Exceptions:
Throws no exceptions, but TGCurve3D::GetNumberOfPoints calls an assertion that fails if the curve is uninitialized.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetPoint
TGRPoint3D GetPoint (unsigned long i) const
Interface Category:
API.
Purpose:
Gets the control point at the specified index.
Calling Context:
Call this function directly.
Parameters:
- unsigned long i -The index into the array of control points. Zero returns the first point.
Return Value:
Returns the control point.
Exceptions:
Throws no exceptions, but TGCurve3D::GetPoint calls an assertion that fails if the index is out of range.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetPoints
void GetPoints (TGRPoint3DArray & pts) const
Interface Category:
API.
Purpose:
Copies, into its parameter, the complete array of control points.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, but TGCurve3D::GetPoints calls an assertion that fails if the curve is uninitialized.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetControlPolyline
void GetControlPolyline (TGPolyline3D & polyline) const
Interface Category:
API.
Purpose:
Returns, in its parameter, this TCurve3D's set of control points as a polyline.
Calling Context:
Call this function directly.
Parameters:
- TGPolyline3D & polyline -The curve's control points as a polyline.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetMinParameter
GParametric GetMinParameter () const
Interface Category:
API.
Purpose:
Gets the parametric value that has been associated with this TCurve3D's starting point. (This is not necessarily zero; it can be any value.)
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the minimum parametric value of the curve.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetMaxParameter
GParametric GetMaxParameter () const
Interface Category:
API.
Purpose:
Returns the parametric value that has been associated with this TCurve3D's endpoint.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the maximum parametric value of the curve.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetNumberOfKnots
unsigned long GetNumberOfKnots () const
Interface Category:
API.
Purpose:
Gets the number of knots in this TCurve3D's knot vector. This is equal to the number of control points, plus the order of the curve.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the number of the curve's knots.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::IsPinned
virtual bool IsPinned () const
Interface Category:
API.
Purpose:
Determines whether this TCurve3D's knot vector is pinned (that is, that the first and last control points are on the curve).
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the knot vector is pinned.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::IsBezier
virtual bool IsBezier () const
Interface Category:
API.
Purpose:
Determines whether this TCurve3D represents a piecewise Bezier curve.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if the knot vector defines a piecewise Bezier curve.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetNextDiscontinuity
virtual unsigned long GetNextDiscontinuity (unsigned long startIndex, unsigned long discontinuity =0) const
Interface Category:
API.
Purpose:
Returns the knot vector index of the next discontinuity following the specified knot. The default is the next C0 discontinuity (a break in the curve), but you can specify discontinuities of a higher order. GetNextDiscontinuity returns the index of the first knot in a sequence of identical knots. (The order of the discontinuity determines how many identical knots are required.) Call GetKnot on the returned value to find the parameter of the curve at the discontinuity. Note that for a C0 break in the curve, the value returned by GetKnot(GetNextDiscontinuity()) is the start of the section of the curve after the break. Subtracting any amount from that parameter jumps to the section before the break. To find the control point associated with a C1 discontinuity, subtract 1 from the value returned by GetNextDiscontinuity. For a C0 discontinuity, GetNextDiscontinuity()-1 is the point before the break, and the following point is after the break. To skip from one discontinuity to the next, pass the value returned from the last call as the startIndex parameter.
Calling Context:
Call this function directly.
Parameters:
- unsigned long startIndex -The index, into the knot vector, of the knot that precedes the discontinuity to be found.
- unsigned long discontinuity =0 -The order of the discontinuity to be found. The value should be less than the order of the curve.
Return Value:
Returns the index (into the knot vector) of the next discontinuity. If no more discontinuities are found. The return value is the index of the last knot (in other words, GetNumberOfKnots()-1).
Exceptions:
Throws no exceptions, but TGCurve3D::GetNextDiscontinuity calls an assertion that fails if no more discontinuities are found. The return value is the index of the last knot (in other words, GetNumberOfKnots()-1).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetKnot
GParametric GetKnot (unsigned long i) const
Interface Category:
API.
Purpose:
Gets the parametric value corresponding to the specified knot.
Calling Context:
Call this function directly.
Parameters:
- unsigned long i -The index (into the knot vector) of the desired knot.
Return Value:
Returns the parametric value corresponding to the specified knot.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetKnots
void GetKnots (TRawArray < GParametric > & knots) const
Interface Category:
API.
Purpose:
Returns, by reference in its parameter, the knot vector.
Calling Context:
Call this function directly.
Parameters:
- TRawArray < GParametric > & knots -The array in which the the knot vector is returned.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::NearestParametric
virtual GParametric NearestParametric (const TGPoint3D & test) const
Interface Category:
API.
Purpose:
Gets the parametric value of the point on this TCurve3D that is nearest to the specified point.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint3D & test -The point (on or off the curve) whose corresponding parameter is to be determined by the function.
Return Value:
Returns the parametric value closest to the specified point.
Exceptions:
Throws no exceptions, but TGCurve3D::NearestParametric calls an assertion that fails if the curve is uninitialized.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::GetSectionOfCurve
virtual void GetSectionOfCurve (GParametric from, GParametric to, TGCurve3D & section) const
Interface Category:
API.
Purpose:
Returns the section of this TCurve3D between the two specified parametric values.
Calling Context:
Call this function directly.
Parameters:
- GParametric from -The parametric value of the starting point of the section.
- GParametric to -The parametric value of the endpoint of the section.
- TGCurve3D & section -The section of curve to be returned.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::DragPosition
virtual void DragPosition (GParametric u, const TGPoint3D & toPoint, GParametric segmentMinimum =0.2, GParametric segmentMaximum =0.8)
Interface Category:
API.
Purpose:
Changes this TCurve3D's shape so that at the specified parameter, it passes through the given point. Parts of the curve that lie outside the parametric range from segmentMinimum to segmentMaximum are not affected.
Calling Context:
Call this function directly.
Parameters:
- GParametric u -The parametric position which should be dragged to the new location.
- const TGPoint3D & toPoint -The new location.
- GParametric segmentMinimum =0.2 -The parametric value below which a point on the curve is not moved. Non-expert users are advised to use the default unless it is greater than the specified parametric value.
- GParametric segmentMaximum =0.8 -The parametric value above which a point on the curve is not moved. Non-expert users are advised to use the default unless it is less than the specified parametric value.
Return Value:
None.
Exceptions:
Throws no exceptions, but TGCurve3D::DragPosition calls an initialized assertion that fails if the curve is uninitialized.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::DragTangent
virtual void DragTangent (GParametric u, const TGPoint3D & toTangent, GParametric segmentMinimum =0.2, GParametric segmentMaximum =0.8)
Interface Category:
API.
Purpose:
Changes the curve's shape so that at the specified parameter, this TCurve3D has the specified tangent. This function can simulate the rocker arm curve adjuster used in some illustration applications, with the added advantage that the adjustment can be made anywhere along the curve.
Calling Context:
Call this function directly.
Parameters:
- GParametric u -The parametric position that should be dragged so that the curve has the specified tangent at this point.
- const TGPoint3D & toTangent -The new tangent at the specified parametric position.
- GParametric segmentMinimum =0.2 -The parametric value below which a point on the curve is not moved. Non-expert users are advised to use the default unless it is greater than the specified parametric value.
- GParametric segmentMaximum =0.8 -The parametric value above which a point on the curve is not moved. Non-expert users are advised to use the default unless it is less than specified parametric value.
Return Value:
None.
Exceptions:
Throws no exceptions, but TGCurve3D::DragTangent calls an initialized assertion that fails if the curve is uninitialized and a parameter assertion fails if the order is less than 2.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::ReverseDirection
virtual void ReverseDirection ()
Interface Category:
API.
Purpose:
Flips the orientation of this TCurve3D's parameterization, by reversing the numbering of the control points and the intervals in the knot vector. In other words, the minimum parameter becomes the maximum parameter and vice versa.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::SetOrder
virtual void SetOrder (unsigned long order)
Interface Category:
API.
Purpose:
Sets the order of this TCurve3D (for example, 4 for cubic curves). This changes the shape, but leaves the number of points intact.
Calling Context:
Call this function directly.
Parameters:
- unsigned long order -The new order of the curve.
Return Value:
None.
Exceptions:
Throws no exceptions, but TGCurve3D::SetOrder calls an initialization assertion that fails if the curve is empty, and then a parameter assertion if the curve's order is less than 2 and the curve's order is greater than the curve's number of control points.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::RaiseOrder
virtual void RaiseOrder (unsigned long newOrder)
Interface Category:
API.
Purpose:
Raises the degree of this TCurve3D to the specified order. This does not change the shape, but increases the number of control points and knots.
Calling Context:
Call this function directly.
Parameters:
- unsigned long newOrder -The degree to which the curve should be raised. If the value is less than the current order, the function does nothing.
Return Value:
None.
Exceptions:
Throws no exceptions, but TGCurve3D::ApproximateLowerOrder calls a parameter assertion that fails if new order is out of range.
Concurrency:
Not multithread safe.
Other Considerations:
This procedure generates spurious control points for splines that do not have closed end conditions (k-fold knots at each end).
Member Function: TCurve3D::SetPoint
virtual void SetPoint (unsigned long i, const TGRPoint3D & p)
Interface Category:
API.
Purpose:
Replaces the control point i with the specified point.
Calling Context:
Call this function directly.
Parameters:
- unsigned long i -The index into the array of control points.
- const TGRPoint3D & p -The new control point for the curve.
Return Value:
None.
Exceptions:
Throws no exceptions, but TGCurve3D::SetPoint calls an initialization assertion that fails if the curve is empty.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::SetPoints
virtual void SetPoints (const TGRPoint3DArray & controlPoints)
Interface Category:
API.
Purpose:
Replaces this TCurve3D's control points with the specified ones. If the specified array does not have the same number of points as the existing curve, the knot vector is reset. Also, if the new number of points is less than the existing order of the curve, the order is lowered to the new number of points.
Calling Context:
Call this function directly.
Parameters:
- const TGRPoint3DArray & controlPoints -The new set of control points. There must be at least two points in the array.
Return Value:
None.
Exceptions:
Throws no exceptions, but TGCurve3D::SetPoints calls an initialization assertion that fails if the specified array of control points has fewer than two points.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::SetKnotScheme
virtual void SetKnotScheme (TGCurve3D :: EndConditions theType =TGCurve3D :: kPinned)
Interface Category:
API.
Purpose:
Sets the knot vector to one of three standard schemes (pinned, floating, or Bezier), without doing any refinement. This usually changes the shape of this TCurve3D.
Calling Context:
Call this function directly.
Parameters:
- TGCurve3D :: EndConditions theType =TGCurve3D :: kPinned -The knot scheme. The default, kPinned, specifies knots at each end of the parametric range that have a multiplicity equal to the order. This means the first and last control points are on the curve, and it forces the curve to interpolate the first and last control points. The value kFloating causes uniform knot spacing, with the curve not reaching the first and last control points. The third option, kBezier, creates a piecewise Bezier knot vector.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::SetKnots
virtual void SetKnots (const TRawArray < GParametric > & knots)
Interface Category:
API.
Purpose:
Resets this TCurve3D's knot vector to the specified array. The data are copied into the curve, and must have the same number of knots as the curve's existing knot vector. No refinement or consistency checking is performed on this knot vector.
Calling Context:
Call this function directly.
Parameters:
- const TRawArray < GParametric > & knots -The array to be copied into the knot vector.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::MakeDiscontinuity
virtual void MakeDiscontinuity (GParametric u, TGCurve3D :: EDiscontinuity cont)
Interface Category:
API.
Purpose:
Adds a Cn discontinuity at the specified parametric location. The values for n are determined by the EDiscontinuity parameter.
If a discontinuity already exists at the parametric location, it is either left as is (if its n value is already correct) or raised to the desired one. Note: this member function just introduces the discontinuity into the knot vector, it does not change the shape of the curve.
Calling Context:
Call this function directly.
Parameters:
- GParametric u -The parametric location for the discontinuity.
- TGCurve3D :: EDiscontinuity cont -The kind of discontinuity: kBreak (n=0), which adds a break to the curve; kKink (n=1), which adds a kink to the curve; or kJerk (n=2), which changes the parametric speed.
Return Value:
None.
Exceptions:
Throws no exceptions, but TGCurve3D::MakeDiscontinuity calls a parameter assertion that fails if the specified parametric location is less than the knot in the orderth place in the knot vector or if it is greater than the last knot in the curve's knot vector.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::MoveKnot
virtual void MoveKnot (unsigned long index, GParametric u)
Interface Category:
API.
Purpose:
Moves the specified knot to the point that has the specified parametric value. If u < knot[index -1] or u >knot[index + 1], the knot vector is sorted to accommodate the new value. This changes the shape of the curve.
Calling Context:
Call this function directly.
Parameters:
- unsigned long index -The index, into the knot vector, of the knot to be moved.
- GParametric u -The parametric location to which the knot should be moved.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::InsertKnot
virtual void InsertKnot (GParametric u)
Interface Category:
API.
Purpose:
Inserts a single new knot (and the corresponding control point) at the specified parametric location.
Calling Context:
Call this function directly.
Parameters:
- GParametric u -The parametric value of the point at which the knot is inserted. It must be greater than the parametric value of the curve's starting point and less than the parametric value of the endpoint.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::RefineUniform
virtual void RefineUniform ()
Interface Category:
API.
Purpose:
Adds a new knot at the midpoint of each nonzero interval in the knot vector.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::RefineToBeziers
virtual void RefineToBeziers ()
Interface Category:
API.
Purpose:
Inserts additional knots so that all interior knots have a multiplicity equal to the order, minus 1. This turns this TGCurve3D into a piecewise Bezier curve, but the shape of the curve is not changed.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::Refine
virtual void Refine (const TRawArray < GParametric > & knots)
Interface Category:
API.
Purpose:
Insert the given knots into this TCurve3D, adding new control points without modifying the curve's shape. This increases the flexibility of a curve.
Calling Context:
Call this function directly.
Parameters:
- const TRawArray < GParametric > & knots -The parametric values of the locations at which the new knots are to be inserted.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::RefineToPinned
virtual void RefineToPinned ()
Interface Category:
API.
Purpose:
Adds knots to the beginning and end of the knot vector so that the control polygon is pinned to the ends of this TCurve3D (in other words, so that the curve intersects the first and last control points). This function is only applicable to curves with floating end conditions. The shape of the curve is not changed.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::MakeCompatible
static void MakeCompatible (TCurve3D & curve1, TCurve3D & curve2)
Interface Category:
API.
Purpose:
Gives the specified curves the same order, number of points, and knot vectors, without changing their shapes.
Calling Context:
Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::operator==
bool operator ==(const TCurve3D & source) const
Interface Category:
API.
Purpose:
Tests two TCurve3Ds for equality, by seeing whether the geometries are equal and the bundles are equal.
Calling Context:
Call this operator by using it in an expression.
Parameters:
- const TCurve3D & source -The curve to be compared with this one.
Return Value:
Returns true if this curve and the argument have equal geometries and bundles.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::operator!=
bool operator != (const TCurve3D & source) const
Interface Category:
API.
Purpose:
Tests two TCurve3Ds for inequality, by seeing whether their geometries and bundles are unequal.
Calling Context:
Call this operator by using it in an expression.
Parameters:
- const TCurve3D & source -The curve to be compared with this one.
Return Value:
Returns true if the geometries or bundles of this curve and the argument are not equal. geometries or bundles.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::operator=
TCurve3D & operator =(const TCurve3D & source)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
- const TCurve3D & source -The object to be copied.
Return Value:
Returns a const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::operator>>=
virtual TStream & operator >>=(TStream & towhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & towhere -The stream that the object is streamed out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TCurve3D::operator<<=
virtual TStream & operator <<= (TStream & fromwhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromwhere -The stream that the object is streamed in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.