Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
None.
Inherited By:
TGCurve
TGCurve3D
Purpose:
Base templatized class for TGCurve.
Instantiation:
This class should never be instantiated. Only the derived classes should be instantiated.
Deriving Classes:
Developers should not derive from this class.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Other Considerations:
See TGCurve and TGLoop for more information.
- TBaseCurve ()
- TBaseCurve (unsigned long order, unsigned long numberPoints)
- TBaseCurve (unsigned long order, unsigned long numberPoints, const TRawArray < GParametric > & knots)
- TBaseCurve (unsigned long order, const TRawArray < RPointType > & points)
- TBaseCurve (unsigned long order, const TRawArray < RPointType > & points, const TRawArray < GParametric > & knots)
- TBaseCurve (const PointType & p0, const PointType & p1, const PointType & p2)
- TBaseCurve (const PointType & p0, const PointType & p1, const PointType & p2, const PointType & p3)
- TBaseCurve (const TBaseCurve < RPointType, PointType >& curve)
Interface Category:
API.
Purpose:
- Default constructor.
- Constructs a curve with a given order and the number of points. The points are set later.
- Constructs a curve/loop with the given order, number of points and the knot vector.
- Constructs a curve/loop with the given order and the points.
- Constructs a curve/loop with the given order, points and the knot vector.
- Constructs a three-point quadratic bezier curve.
- Constructs a four-point quadratic bezier curve.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- Called by the derived classes.
- Called by the derived classes.
- Called by the derived classes.
- Called by the derived classes.
- Called by the derived classes.
- Called by the derived classes.
- Called by the derived classes.
Parameters:
- Takes no parameters.
- unsigned long order -The order of the loop.
- unsigned long numberPoints -The number of control points.
- unsigned long order -The order of the loop.
- unsigned long numberPoints -The number of control points.
- const TRawArray < GParametric > & knots -The knot vector.
- unsigned long order -The order of the loop.
- const TRawArray < RPointType > & points -The array of control points.
- unsigned long order -The order of the loop.
- const TRawArray < RPointType > & points -The number of control points.
- const TRawArray < GParametric > & knots -The knot vector.
- const PointType & p0 -The first control point.
- const PointType & p1 -The second control point.
- const PointType & p2 -The third control point.
- const PointType & p0 -The first control point.
- const PointType & p1 -The second control point.
- const PointType & p2 -The third control point.
- const PointType & p3 -The fourth control point.
- const TBaseCurve < RPointType PointType >& curve -The curve to be copied.
Return Value:
None.
Exceptions:
Assertions when incorrect parameters are passed.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TBaseCurve ()
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: TBaseCurve::Evaluate
- PointType Evaluate (GParametric u) const
- PointType Evaluate (GParametric u, PointType & tangent) const
- PointType Evaluate (GParametric u, PointType & tangent, PointType & deriv2) const
- PointType Evaluate (GParametric u, unsigned long delta) const
Interface Category:
API.
Purpose:
- Returns the point on the TGCurve at the specified parametric value.
- Returns the point on the TGCurve at the specified parametric value; also computes the tangent at this point.
- Returns the point on the TGCurve at the specified parametric value; also computes the tangent and second derivative at this point.
- Returns the point on the TGCurve at the specified parametric value; also computes the tangent, second derivative, and curvature at this point.
Calling Context:
- Call this function directly.
- Call this function directly.
- Call this function directly.
- Call this function directly.
Parameters:
- GParametric u -The parametric value at which to evaluate the curve. The value passed in should not be outside the range defined by GetMinParameter and GetMaxParameter.
- GParametric u -The parametric value at which to evaluate the curve. The value passed in should not be outside the range defined by GetMinParameter and GetMaxParameter.
- TGPoint & tangent -A vector representing the tangent of the curve at this point; computed by this function.
- GParametric u -The parametric value at which to evaluate the curve. The value passed in should not be outside the range defined by GetMinParameter and GetMaxParameter.
- TGPoint & tangent -A vector representing the tangent of the curve at this point; computed by this function.
- TGPoint & deriv2 -The second derivative of the curve at this point; computed by this function.
- GParametric u -The parametric value at which to evaluate the curve. The value passed in should not be outside the range defined by GetMinParameter and GetMaxParameter.
- unsigned long delta -
Return Value:
The point on the curve that corresponds to the specified parametric value.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::EvaluateW
RPointType EvaluateW (GParametric u) const
Interface Category:
API.
Purpose:
Returns the point (as a TGRPoint) on the TGCurve at the specified parametric value.
Calling Context:
Call this function directly.
Parameters:
- GParametric u -The parametric value at which to evaluate the curve. The value passed in should not be outside the range defined by GetMinParameter and GetMaxParameter.
Return Value:
The RPoint on the curve at the parametric location.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::ArcLength
- GCoordinate ArcLength (GParametric uFrom, GParametric uTo) const
- GCoordinate ArcLength () const
Interface Category:
API.
Purpose:
Returns arc length of (optionally specified) section of the loop.
Calling Context:
- Call this function directly.
- Call this function directly.
Parameters:
- GParametric uFrom -Start of section.
- GParametric uTo -End of section.
- Takes no parameters.
Return Value:
Arc length along curve.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::ApproximateParameterFromArcLength
GParametric ApproximateParameterFromArcLength (GCoordinate length, GCoordinate tolerance =1.0e-5) const
Interface Category:
API.
Purpose:
Same as TGCurve::ApproximateParameterFromArcLength, but works with loops.
Calling Context:
Call this function directly.
Parameters:
- GCoordinate length -Arc length along curve.
- GCoordinate tolerance =0.1.0e-5 -Accuracy tolerance for computation.
Return Value:
Parameter.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::IsEmpty
bool IsEmpty () const
Interface Category:
API.
Purpose:
Returns true if the curve or loop has no points or is an empty loop.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true/false depending upon the state of the curve.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::GetOrder
unsigned long GetOrder () const
unsigned long GetOrder () const
Interface Category:
API.
Purpose:
Returns the order of this TGCurve (for example, 4 for cubic curves).
Calling Context:
Call this function directly.
Parameters:
Return Value:
The order of the curve.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::GetNumberOfPoints
unsigned long GetNumberOfPoints () const
Interface Category:
API.
Purpose:
Returns the number of control points in this TGCurve.
Calling Context:
Call this function directly.
Parameters:
Return Value:
The number of control points in this curve.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::GetPoint
RPointType GetPoint (unsigned long i) const
Interface Category:
API.
Purpose:
Returns the control point specified by the index.
Calling Context:
Call this function directly.
Parameters:
- unsigned long i -The index (into the array of control points) of the desired point.
Return Value:
The control point.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::GetPoints
void GetPoints (TRawArray < RPointType > & pts) const
Interface Category:
API.
Purpose:
Returns, in its argument, the complete array of control points.
Calling Context:
Call this function directly.
Parameters:
- TGRPointArray & pts -The curve's control points, returned by reference.
Return Value:
None.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::GetMinParameter
GParametric GetMinParameter () const
Interface Category:
API.
Purpose:
Returns the parametric value that has been associated with the curve's beginning point. (This is not necessarily 0; it can be any value.)
Calling Context:
Call this function directly.
Parameters:
Return Value:
The minimum parametric value of this curve.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::GetMaxParameter
GParametric GetMaxParameter () const
Interface Category:
API.
Purpose:
Returns the parametric value that has been associated with the curve's end point.
Calling Context:
Call this function directly.
Parameters:
Return Value:
The maximum parametric value of this curve.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::GetNumberOfKnots
unsigned long GetNumberOfKnots () const
Interface Category:
API.
Purpose:
Returns the number of knots in the 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:
The number of knots in the knot vector.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::GetKnot
GParametric GetKnot (unsigned long i) const
Interface Category:
API.
Purpose:
Gets the parametric value of 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:
The parametric value of the specified knot.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::GetKnots
void GetKnots (TRawArray < GParametric > & knots) const
Interface Category:
API.
Purpose:
Returns, by reference in its argument, the knot vector of this TGCurve.
Calling Context:
Call this function directly.
Parameters:
- TRawArray < GParametric > & knots -The knot vector.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::IsPinned
bool IsPinned () const
Interface Category:
API.
Purpose:
Determines whether this TGCurve passes through the first and last control points (that is, whether the knot vector is pinned).
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if this curve passes through the first and last control points.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::IsBezier
bool IsBezier () const
Interface Category:
API.
Purpose:
Determines whether this TGCurve's knot vector defines 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: TBaseCurve::NearestParametric
GParametric NearestParametric (const PointType & test) const
Interface Category:
API.
Purpose:
Returns the parametric value of the point on This TGCurve that is nearest to the specified point.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint & test -The point (on or off the curve) whose corresponding parameter is to be determined by the function.
Return Value:
The parametric value closest to the specified point.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::GetNextDiscontinuity
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:
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:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::GetSectionOfCurve
void GetSectionOfCurve (GParametric from, GParametric to, TBaseCurve < RPointType, PointType >& section) const
Interface Category:
API.
Purpose:
Returns the section of the TGCurve between the two specified parametric values.
Calling Context:
Call this function directly.
Parameters:
- GParametric from -The parametric value of the initial point of the section.
- GParametric to -The parametric value of the end point of the section.
- TGCurve & 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: TBaseCurve::Concatenate
void Concatenate (const TBaseCurve < RPointType, PointType >& p, bool glue =true)
Interface Category:
API.
Purpose:
Appends the given TGCurve to this curve. The beginning control point of the added curve is joined to the end control point of the original curve. The same is done for their knot vectors. If the beginning point of the added curve is at the same location as the end point of the original curve, you have the option of specifying whether there should be only one control point and knot there, or two.
Calling Context:
Call this function directly.
Parameters:
- const TGCurve & p -The curve to be joined to this one.
- bool glue =true -Determines whether to delete one of the connected points, if the appended curve's begin point is the same as the original curve's end point. This parameter is ignored if these two control points differ. True (the default) means to delete one of the identical points; false means to leave both points even though they are redundant. Note that this affects the knot vector as well: if glue is true, the appended curve's first knot replaces the original curve's last knot.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::DragPosition
void DragPosition (GParametric u, const PointType & toPoint, GParametric segmentMinimum =0.2, GParametric segmentMaximum =0.8)
Interface Category:
API.
Purpose:
Changes the TGCurve shape so that at the specified parameter, it passes through the given point. Parts of the curve that lie outside the parametric range defined by the specified minimumSegment and maximumSegment are not affected.
Calling Context:
Call this function directly.
Parameters:
- GParametric u -The parametric position to be dragged to the new location.
- const TGPoint & toPoint -The new location.
- GParametric segmentMinimum =0.2 -The parametric value below which a point on the curve will not be moved. Non-expert users are advised to use the default unless it is greater than u.
- GParametric segmentMaximum =0.8 -The parametric value above which a point on the curve will not be moved. Non-expert users are advised to use the default unless it is less than u.
Return Value:
None.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::DragTangent
void DragTangent (GParametric u, const PointType & toTangent, GParametric segmentMinimum =0.2, GParametric segmentMaximum =0.8)
Interface Category:
API.
Purpose:
Changes this TGCurve's shape so that at the specified parameter, the curve has the specified tangent. This function can simulate the rocker arm curve adjuster used in a well-known illustration application, 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 which should be dragged so that the curve has the specified tangent at this point.
- const TGPoint & toTangent -The new tangent at the specified parametric position.
- GParametric segmentMinimum =0.2 -The parametric value below which a point on the curve will not be moved. Non-expert users are advised to use the default unless it is greater than the parametric value u.
- GParametric segmentMaximum =0.8 -The parametric value above which a point on the curve will not be moved. Non-expert users are advised to use the default unless it is less than the parametric value u.
Return Value:
None.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::ReverseDirection
void ReverseDirection ()
Interface Category:
API.
Purpose:
Flips the orientation of this TGCurve'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: TBaseCurve::SetOrder
void SetOrder (unsigned long order)
Interface Category:
API.
Purpose:
Sets the order of this TGCurve (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:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::RaiseOrder
void RaiseOrder (unsigned long newOrder)
Interface Category:
API.
Purpose:
Raises the degree of this TGCurve 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, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::ApproximateLowerOrder
void ApproximateLowerOrder (unsigned long newOrder, GCoordinate tolerance =0.2)
Interface Category:
API.
Purpose:
Approximate this TGCurve with a lower-order one. Control points are added to the lower-order curve until the approximation falls within the specified tolerance. The curve in question is first made a Bezier curve.
Calling Context:
Call this function directly.
Parameters:
- unsigned long newOrder -The order of the new curve; must be greater than 2, but not greater than the current order.
- GCoordinate tolerance =0.2 -The tolerance, specified in absolute coordinates (not relative to the size of the curve).
Return Value:
None.
Exceptions:
A parameter assertion fails if the new order is less than or equal to the curve's current order, or greater than 2.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::SetPoint
void SetPoint (unsigned long i, const RPointType & p)
Interface Category:
API.
Purpose:
Replaces this TGCurve's control point at the specified index with the specified point.
Calling Context:
Call this function directly.
Parameters:
- unsigned long i -The index (into the array of control points) of the point to be replaced.
- const TGRPoint & p -The new control point.
Return Value:
None.
Exceptions:
An assertion fails if the curve is empty (uninitialized).
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::SetPoints
void SetPoints (const TRawArray < RPointType > & controlPoints)
Interface Category:
API.
Purpose:
Replaces this TGCurve's control points with the specified ones. If the passed-in 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 TGRPointArray & controlPoints -The new set of control points. There must be at least two points in the array.
Return Value:
None.
Exceptions:
An assertion fails if the number of points passed in is less than or equal to 2.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::SetKnotScheme
void SetKnotScheme (EndConditions theType =kPinned)
Interface Category:
API.
Purpose:
Sets this TGCurve's knot vector to one of three standard schemes (pinned, floating, or Bezier), without doing any refinement. This function usually changes the shape of the curve.
Calling Context:
Called by many curve operations. You can also call this function directly.
Parameters:
- EndConditions theType =TGCurve :: 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: TBaseCurve::SetKnots
void SetKnots (const TRawArray < GParametric > & knots)
Interface Category:
API.
Purpose:
Resets this TGCurve's knot vector to the specified array. The data is 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: TBaseCurve::MoveKnot
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 is moved.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::MakeCompatible
static void MakeCompatible (TBaseCurve < RPointType, PointType >& curve1, TBaseCurve < RPointType, PointType >& curve2)
Interface Category:
API.
Purpose: |Modifies both curves to have the same order, the same number of points, and the same knot vector, without changing the shape of either curve. This is accomplished by raising the order and refining the knot vectors as necessary.
Calling Context:
Call this function directly
Parameters:
- TBaseCurve < RPointType PointType >& curve1 -The first curve to be made compatible.
- TBaseCurve < RPointType PointType >& curve2 -The second curve to be made compatible to.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::InsertKnot
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 start point and less than the parametric value of the end point.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::MakeDiscontinuity
void MakeDiscontinuity (GParametric u, 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.
- 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:
Calls a parameter assertion that fails if the specified parametric location is less than the first knot in the knot vector or greater than the last knot in the curve's knot vector.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::RefineUniform
void RefineUniform ()
Interface Category:
API.
Purpose:
Adds a new knot midway between every 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: TBaseCurve::RefineToBeziers
void RefineToBeziers ()
Interface Category:
API.
Purpose:
Inserts additional knots so that all interior knots have a multiplicity equal to the order minus one. This turns this TGCurve 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: TBaseCurve::Refine
void Refine (const TRawArray < GParametric > & newKnots)
Category:
API.
Purpose:
Insert the given knots into this TGCurve, 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 > & newKnots -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: TBaseCurve::RefineToPinned
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 the curve (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: TBaseCurve::operator=
TBaseCurve < RPointType , PointType >& operator =(const TBaseCurve < RPointType, PointType >& Crv)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
- const TGCurve & Crv -The object to be copied.
Return Value:
A non-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: TBaseCurve::operator==
bool operator ==(const TBaseCurve < RPointType, PointType >&) const
Interface Category:
API.
Purpose:
Tests two TGCurves for equality.
Calling Context:
Call this function by using the operator in an expression.
Parameters:
- const TGCurve & -The curve to be compared with this one.
Return Value:
Returns true if this TGCurve and the argument have the same order, the same number of control points, and identical knot vectors. Note: empty curves are identical.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::operator!=
bool operator != (const TBaseCurve < RPointType, PointType >&) const
Interface Category:
API.
Purpose:
Tests two TGCurves for inequality.
Calling Context:
Call this function by using the operator in an expression.
Parameters:
- const TGCurve & -The curve to be compared with this one.
Return Value:
Returns true if this TGCurve and the argument have different orders, different numbers of control points, and their knot vectors are not equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::operator<<=
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.
Member Function: TBaseCurve::operator>>=
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: TBaseCurve::IsConsistent
bool IsConsistent ()
Interface Category:
API.
Purpose:
Checks this TGCurve for invalid knot vectors, nonpositive values of w, excessive values for the order of the curve, and too many or too few control points. If any offending condition is encountered, an error message is printed and the function returns false. Duplicate successive points cause a warning to be printed, but do not cause the function to return false.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns true if no offending condition is found.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::IncrementOrder
void IncrementOrder ()
Interface Category:
API.
Purpose:
Converts a k order spline to a k+1 order spline. Note: This procedure generates spurious control points splines with other than closed end conditions (k-fold knots at each end).
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: TBaseCurve::ReduceOneDegree
static void ReduceOneDegree (TRawArray < RPointType > & pts, unsigned long order, unsigned long numPts, GCoordinate tolerance, long * discons, unsigned long numDiscons, unsigned long * newPts)
Interface Category:
API.
Purpose:
Reduce the curve degree by one.
Calling Context:
Should never be called.
Parameters:
- TRawArray < RPointType > & pts -Array of points.
- unsigned long order -The order of the curve.
- unsigned long numPts -Number of points in the curve.
- GCoordinate tolerance -The tolerance with which to reduce the curve degree.
- long * discons -
- unsigned long numDiscons -nNumber of discontinuities.
- unsigned long * newPts -The list of new points once the degree is reduced.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TBaseCurve::prAppendCurve
void prAppendCurve (TBaseCurve < RPointType, PointType >& crv, bool glue)
Interface Category:
API.
Purpose:
Appends the curve crv to the base curve.
Calling Context:
Called only by derived classes.
Parameters:
- TBaseCurve < RPointType -PointType >& crv -Curve to be glued.
- bool glue -to be joined smoothly or with a kink.
Return Value:
None.
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.