Class: TLoop

Declaration: Graphics.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MGraphic

Inherited By:

None.

Purpose:

TLoop provides a wrapper for the TGLoop geometry class, to which it adds the facilities inherited from MGraphic: an attribute bundle, matrix transformations, and hit detection. TLoop has a, not is a, TGLoop. TLoop can be used for such shapes as rounded rectangles, ellipses with control points, and more elaborate closed paths.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TLoop::TLoop

  1. TLoop ()
  2. TLoop (const TLoop &)
  3. TLoop (const TGLoop &, TGrafBundle * adoptedBundle =NIL)
  4. TLoop (const TGCurve &, bool EOFill =true, TGrafBundle * adoptBundle =NIL)
  5. TLoop (unsigned long order, unsigned long numberPoints, bool EOFill =true, TGrafBundle * adoptBundle =NIL)
  6. TLoop (unsigned long order, unsigned long numberPoints, const TRawArray < GParametric > & knots, bool EOFill =true, TGrafBundle * adoptBundle =NIL)
  7. TLoop (unsigned long order, const TGRPointArray & points, bool EOFill =true, TGrafBundle * adoptBundle =NIL)
  8. TLoop (unsigned long order, const TGRPointArray & points, const TRawArray < GParametric > & knots, bool EOFill =true, TGrafBundle * adoptBundle =NIL)
  9. TLoop (const TGEllipse & e, TGrafBundle * adoptBundle =NIL)
  10. TLoop (const TGPolygon & polyline, TGrafBundle * adoptBundle =NIL)
  11. TLoop (const TGRect & rect, TGrafBundle * adoptBundle =NIL)
  12. TLoop (const TGRect & roundRect, const TGPoint & aspect, TGrafBundle * adoptBundle =NIL)
  13. TLoop (const TGGlyphRun &, TGrafBundle * adoptBundle =NIL)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.
  3. Constructs a TLoop that has the given geometry and bundle.
  4. Constructs a TLoop from a curve geometry.
  5. Constructs a TLoop of the given order and number of points.
  6. Constructs a TLoop from a knot vector.
  7. Constructs a TLoop from an array of rational points.
  8. Constructs a TLoop from an array of rational points and a knot vector.
  9. Constructs a TLoop from an elliptical geometry.
  10. Constructs a TLoop from a polygon.
  11. Constructs a TLoop with a rectangular shape.
  12. Constructs a TLoop with a rounded rectangular shape. The rounded rectangle has sixteen control points--four at the corners, four at the midpoints of the sides, and two on either side of each corner. The aspect parameter controls how far the latter points are from each corner.
  13. Constructs a TLoop from a TGGlyphRun.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to copy an object.
  3. Call this function directly.
  4. Call this function directly.
  5. Call this function directly.
  6. Call this function directly.
  7. Call this function directly.
  8. Call this function directly.
  9. Call this function directly.
  10. Call this function directly.
  11. Call this function directly.
  12. Call this function directly.
  13. Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions within TLoop, passes all exceptions through. The constructor parameter called order should be 2 or greater, the parameter called numberPoints should be greater than the order, and the number of knots in the knot vector should equal the number of points, plus the order. Otherwise, a parameter assertion occurs in TGCurve.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::~TLoop

virtual ~ TLoop ()

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: TLoop::Draw

virtual void Draw (TGrafPort & port) const

Interface Category:

API.

Purpose:

Draws the graphic to the specific TGrafPort. 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: TLoop::GetGeometricBounds

virtual TGRect GetGeometricBounds () const

Interface Category:

API.

Purpose:

Gets the bounding rectangle of the geometry, without considering any area added by the bundle. (For example, the pen is a bundled attribute that can increase the area of the graphic by adding a border that extends beyond the bounds of the geometry.)

Calling Context:

Called during hit detection. You can also call this function directly.

Parameters:

Return Value:

Returns the bounding rectangle, which is the smallest axis-aligned rectangle that encloses the geometry.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::GetLooseFitBounds

virtual TGRect GetLooseFitBounds (const TGrafPort* =NIL) const

Interface Category:

API.

Purpose:

Gets the entire graphic's bounding rectangle, taking into account the bundle information. (For example, the pen is a bundled attribute that can increase the area of the graphic by adding a border that extends beyond the bounds of the geometry.)

Calling Context:

Called during hit detection. You can also call this function directly.

Parameters:

Return Value:

Returns the bounding rectangle, which is the smallest axis-aligned rectangle that encloses the entire graphic, including any area added by the pen.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::TransformBy

virtual void TransformBy (const TGrafMatrix &)

Interface Category:

API.

Purpose:

Transforms the graphic'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:

Return Value:

None.

Exceptions:

Determined by derived classes.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::ScaleBy

virtual void ScaleBy (const TGPoint &, const TGPoint & =TGPoint :: kOrigin)

Interface Category:

API.

Purpose:

Changes the graphic's size according to the specified horizontal and vertical scalars (the coordinates of the first parameter). Because there are two independent scalars, the graphic's shape can change. The second parameter defines the center of scale. Every point is mapped to a new position by applying the scalars to the point's horizontal and vertical displacements from the center of scale. Thus, the scaled graphic does not stay centered at the same point unless the second argument is the old center of the graphic.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

TLoop implements scaling by creating a temporary transformation matrix and calling MGraphic::TransformBy. Derived classes can implement more efficient schemes.

Member Function: TLoop::TranslateBy

virtual void TranslateBy (const TGPoint &)

Interface Category:

API.

Purpose:

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

TLoop implements scaling by creating a temporary transformation matrix and calling MGraphic::TransformBy. Derived classes can implement more efficient schemes.

Member Function: TLoop::RotateBy

virtual void RotateBy (GDegrees, const TGPoint & =TGPoint :: kOrigin)

Interface Category:

API.

Purpose:

Rotates the graphic by the given number of degrees, using the specified center of rotation. This does not change the size or shape of the graphic, only its orientation.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

TLoop implements scaling by creating a temporary transformation matrix and calling MGraphic::TransformBy. Derived classes can implement more efficient schemes.

Member Function: TLoop::GetEOFill

bool GetEOFill () const

Interface Category:

API.

Purpose:

Returns a Boolean indicating which one of two possible algorithms is used to fill the curve.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if an even-odd rule is used for determining what area is filled, and false if a nonzero winding rule is used.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::Concatenate

void Concatenate (const TGLoop & p, bool glue =true)

Interface Category:

API.

Purpose:

Appends the given loop to this loop. The beginning control point of the added loop is joined to the end control point of the original loop, and similarly for their knot vectors. If the beginning point of the added loop is at the same location as the endpoint of the original loop, 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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::Evaluate

  1. TGPoint Evaluate (GParametric u) const
  2. TGPoint Evaluate (GParametric u, TGPoint & tangent) const
  3. TGPoint Evaluate (GParametric u, TGPoint & tangent, TGPoint & deriv2) const
  4. TGPoint Evaluate (GParametric u, TGPoint & tangent, TGPoint & deriv2, GCoordinate & curvature) const

Interface Category:

API.

Purpose:

  1. Returns the point on the loop at the specified parametric value.
  2. Returns the point on the loop at the specified parametric value; also computes the tangent at this point.
  3. Returns the point on the loop at the specified parametric value; also computes the tangent and second derivative at this point.
  4. Returns the point on the loop at the specified parametric value; also computes the tangent, second derivative, and curvature at this point.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.
  3. Call this function directly.
  4. Call this function directly.

Parameters:

Return Value:

Returns the point on the loop that corresponds to the specified parametric value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::GetOrder

unsigned long GetOrder () const

Interface Category:

API.

Purpose:

Gets the order of the curve (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. However, an assertion fails in TGCurve if the order has not yet been set.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::ArcLength

  1. GCoordinate ArcLength (GParametric uFrom, GParametric uTo) const
  2. GCoordinate ArcLength () const

Interface Category:

API.

Purpose:

  1. Returns the length along the loop between two specified parameters.
  2. Returns the length along the entire loop, from its beginning point to its endpoint.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

Returns the length of the curve along the specified portion of the loop.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The current implementation is likely to have accuracy problems with curves whose order is greater than 5.

Member Function: TLoop::ApproximateParameterFromArcLength

GParametric ApproximateParameterFromArcLength (GCoordinate length, GCoordinate tolerance =1.0e-5) const

Interface Category:

API.

Purpose:

Approximates the parameter of the point at a particular arc length along the loop.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the approximate parametric value of the point.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::IsEmpty

bool IsEmpty () const

Interface Category:

API.

Purpose:

Determines whether the loop geometry is empty (which it is when the TLoop 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: TLoop::GetNumberOfPoints

unsigned long GetNumberOfPoints () const

Interface Category:

API.

Purpose:

Gets the number of control points in the loop.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the number of control points.

Exceptions:

Throws no exceptions, passes all exceptions through. However, an assertion fails in TGCurve if the loop is uninitialized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::GetPoint

TGRPoint GetPoint (unsigned long i) const

Interface Category:

API.

Purpose:

Gets a specific control point.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the control point.

Exceptions:

Throws no exceptions, passes all exceptions through. However, an assertion fails in TGCurve if the loop is uninitialized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::GetPoints

void GetPoints (TGRPointArray & pts) const

Interface Category:

API.

Purpose:

Returns, in its argument, the complete array of control points.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through. However, an assertion fails in TGCurve if the loop is uninitialized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::GetControlPolyline

void GetControlPolyline (TGPolyline &) const

Interface Category:

API.

Purpose:

Returns, in its parameter, the set of control points as a polyline.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through. However, an assertion fails in TGCurve if the loop is uninitialized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::GetMinParameter

GParametric GetMinParameter () const

Interface Category:

API.

Purpose:

Gets the parametric value that has been associated with the loop's beginning 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 loop.

Exceptions:

Throws no exceptions, passes all exceptions through. However, an assertion fails in TGCurve if the loop is uninitialized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::GetMaxParameter

GParametric GetMaxParameter () const

Interface Category:

API.

Purpose:

Gets the parametric value that has been associated with the loop's endpoint.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the maximum parametric value of the loop.

Exceptions:

Throws no exceptions, passes all exceptions through. However, an assertion fails in TGCurve if the loop is uninitialized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::GetNumberOfKnots

unsigned long GetNumberOfKnots () const

Interface Category:

API.

Purpose:

Gets 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:

Returns the maximum parametric value of the loop.

Exceptions:

Throws no exceptions, passes all exceptions through. However, an assertion fails in TGCurve if the loop is uninitialized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::IsPinned

bool IsPinned () const

Interface Category:

API.

Purpose:

Returns true if the knot vector is pinned, meaning that the first and last control points are on the loop itself.

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: TLoop::IsBezier

bool IsBezier () const

Interface Category:

API.

Purpose:

Returns true if the loop 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: TLoop::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 loop), 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, you can pass the value returned from the last call as the startIndex parameter.

Calling Context:

Call this function directly.

Parameters:

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, passes all exceptions through. However, an assertion fails in TGCurve if the loop is uninitialized or the second parameter's value is greater than the order of the loop.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::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:

Return Value:

Returns the parametric value corresponding to the specified knot.

Exceptions:

Throws no exceptions, passes all exceptions through. However, an assertion fails in TGCurve if the loop is uninitialized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::NearestParametric

GParametric NearestParametric (const TGPoint & test) const

Interface Category:

API.

Purpose:

Gets the parametric value of the point on the loop that is nearest to the specified point.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the parametric value closest to the specified point.

Exceptions:

Throws no exceptions in TLoop. The order must be initialized or an initialized assert occurs in TGCurve.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::GetSectionOfCurve

void GetSectionOfCurve (GParametric from, GParametric to, TGLoop & section) const

Interface Category:

API.

Purpose:

Gets the section of the loop between the two specified parametric values.

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: TLoop::DragPosition

void DragPosition (GParametric u, const TGPoint & toPoint, GParametric segmentMinimum =0.2, GParametric segmentMaximum =0.8)

Interface Category:

API.

Purpose:

Changes the loop shape so that at the specified parameter, it passes through the given point. Parts of the loop that lie outside the parametric range from segmentMinimum to segmentMaximum are not affected.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

An initialized assertion occurs in TGCurve if the order is uninitialized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::DragTangent

void DragTangent (GParametric u, const TGPoint & toTangent, GParametric segmentMinimum =0.2, GParametric segmentMaximum =0.8)

Interface Category:

API.

Purpose:

Changes the loop shape so that at the specified parameter, the loop 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:

Return Value:

None.

Exceptions:

In TGCurve, an initialized assertion occurs if the order is uninitialized, and a parameter assertion occurs if the order is less than 2.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::ReverseDirection

void ReverseDirection ()

Interface Category:

API.

Purpose:

Flips the orientation of the loop'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: TLoop::SetOrder

void SetOrder (unsigned long order)

Interface Category:

API.

Purpose:

Sets the order of the loop (for example, 4 for cubic curves). This changes the shape, but leaves the number of points intact.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through. The order must be initialized to be between 2 and the number of points, inclusive, or an assertion occurs in TGCurve.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::RaiseOrder

void RaiseOrder (unsigned long newOrder)

Interface Category:

API.

Purpose:

Raises the degree of the curve 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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

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: TLoop::ApproximateLowerOrder

void ApproximateLowerOrder (unsigned long newOrder, GCoordinate tolerance =0.2)

Interface Category:

API.

Purpose:

Approximate the loop 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. It is also called by TModelDeformer::Deform.

Parameters:

Return Value:

None.

Exceptions:

A parameter assertion in TGCurve ensures that newOrder is within range.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::SetPoint

void SetPoint (unsigned long i, const TGRPoint & p)

Interface Category:

API.

Purpose:

Replaces control point number i with the specified point.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

An initialized assertion in TGCurve checks whether the loop's order is initialized.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::SetPoints

void SetPoints (const TGRPointArray & controlPoints)

Interface Category:

API.

Purpose:

Replaces the 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:

Return Value:

None.

Exceptions:

An initialized assertion in TGCurve fails if there are fewer than two control points in the passed-in array.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::SetKnotScheme

void SetKnotScheme (TGCurve :: EndConditions theType =TGCurve :: kPinned)

Interface Category:

API.

Purpose:

Sets the 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:

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: TLoop::SetKnots

void SetKnots (const TRawArray < GParametric > & knots)

Interface Category:

API.

Purpose:

Resets the 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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::RefineUniform

void RefineUniform ()

Interface Category:

API.

Purpose:

Adds a new knot at the midpoint of each nonzero interval in the knot vector. No knots are inserted between the first n or the last n knots in the vector, where n is the order of the curve. This function does not change the shape of the curve, nor does it change the multiplicity of the knots.

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: TLoop::RefineToBeziers

void RefineToBeziers ()

Interface Category:

API.

Purpose:

Inserts additional knots so that all interior knots have a multiplicity equal to the order, minus 1. ( Interior knots exclude the first n and the last n knots in the vector, where n is the order of the curve.) This function turns the curve into a piecewise Bezier curve, but does not change shape of the curve.

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: TLoop::Refine

void Refine (const TRawArray < GParametric > & knots)

Interface Category:

API.

Purpose:

Inserts the given knots into the curve, adding new control points without modifying the curve's shape. This increases the flexibility of a curve.

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: TLoop::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: TLoop::IsConsistent

bool IsConsistent ()

Interface Category:

API.

Purpose:

Checks the curve 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: TLoop::SetEOFill

void SetEOFill (bool EOFill)

Interface Category:

API.

Purpose:

Determines which one of two possible algorithms is used to fill the loop.

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: TLoop::operator=

TLoop & operator =(const TLoop & source)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

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: TLoop::operator==

bool operator ==(const TLoop & source) const

Interface Category:

API.

Purpose:

Tests two TLoops for equality, by seeing whether their geometries and bundles are equal.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if this TLoop 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: TLoop::operator!=

bool operator != (const TLoop &) const

Interface Category:

API.

Purpose:

Tests two TLoops for inequality, by seeing whether their geometries and bundles are different.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if the geometries and bundles of this TLoop and the argument are not equal. or bundles.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLoop::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

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: TLoop::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

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: TLoop::Validate

void Validate ()

Interface Category:

API.

Purpose:

Makes sure that the graphic's bounds are up-to-date.

Calling Context:

Called by the Graphics system before returning bounds to the user. You should not need to call it directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Derived classes should override this function if their bounds behave differently from the base class.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.