Class: TGPolyline3D

Declaration: Polyline3D.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

A TGPolyline3D is a collection of points in 3-D space that are connected with straight line segments. The line segments form a single path through all the points, so each point, except the first and last, is connected to two other points. A TGPolyline3D is a collection of TGPoint3Ds, just as TGPolyline is a collection of TGPoints (2-D points). Polylines are parameterized much like linear curves. The points are numbered with successive integers, starting with 0. The integer part of a parameter specifies one of these points, and the fractional part determines a location on the subsequent line segment. For example, a polyline with three points is parameterized from 0 to 2, and a parameter value of 1.75 refers to a location on the second line segment, three-quarters of the way from point 1 to point 2.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None. Do not create derived classes.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TGPolyline3D::TGPolyline3D

  1. TGPolyline3D ()
  2. TGPolyline3D (const TGPoint3DArray & points)
  3. TGPolyline3D (unsigned long numPoints)
  4. TGPolyline3D (const TGPolyline3D & polyLine3D)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a TGPolyline3D using the specified points as control points.
  3. Creates a TGPolyline3D with the specified number of control points.
  4. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and directly.
  2. Call this function directly.
  3. Call this function directly.
  4. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::~TGPolyline3D

virtual ~ TGPolyline3D ()

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: TGPolyline3D::AddBefore

void AddBefore (unsigned long index, const TGPoint3D & p)

Interface Category:

API.

Purpose:

Inserts the specified point at the specified index.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Calls a parameter assertion that fails if the index is out of range.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::Append

void Append (const TGPoint3D & point)

Interface Category:

API.

Purpose:

Appends the specified point to the end of this TGPolyline3D.

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

void DragPosition (GParametric u, const TGPoint3D & toPt)

Interface Category:

API.

Purpose:

Changes the TGPolyline3D so that it passes through the specified TGPoint3D at the specified parametric value. The two control points nearest to the parametric are moved so that the line segment passes through the specified point.

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: TGPolyline3D::Evaluate

TGPoint3D Evaluate (GParametric u) const

Interface Category:

API.

Purpose:

Returns a point corresponding to the specified parametric value on this TGPolyline3D. A value of 0 corresponds to the start point and N to the end point (where N is one less than the number of control points in the polyline). Values outside this range return an extrapolated point.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a point corresponding to the specified parametric value.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::GetBounds

TGBox3D GetBounds () const

Interface Category:

API.

Purpose:

Gets the TGBox3D that bounds this TGPolyline3D.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the box that bounds this polyline.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::NearestParametric

GParametric NearestParametric (const TGPoint3D & p) const

Interface Category:

API.

Purpose:

Gets the parametric value on this TGPolyline3D that is closest to the specified point.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the parametric value closest to the point.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::GetPoint

TGPoint3D GetPoint (unsigned long index) const

Interface Category:

API.

Purpose:

Gets this TGPolyline3D's control point at the specified index.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the point at the specified index.

Exceptions:

Throws no exceptions, but GetPoint calls a parameter assertion that fails if the index is out of range.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::SetPoint

void SetPoint (unsigned long index, const TGPoint3D & point)

Interface Category:

API.

Purpose:

Resets this TGPolyline3D's control point at the specified index, to the specified point.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Calls a parameter assertion that fails if the index is out of range.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::GetPoints

void GetPoints (TGPoint3DArray & points) const

Interface Category:

API.

Purpose:

Copies the TGPolyline3D's control points into the parameter.

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: TGPolyline3D::SetPoints

void SetPoints (const TGPoint3DArray & pts)

Interface Category:

API.

Purpose:

Resets the control point at the specified index, to the specified point.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Calls a parameter assertion that fails if the index is out of range.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::GetNumberOfPoints

unsigned long GetNumberOfPoints () const

Interface Category:

API.

Purpose:

Gets the number of control points in this TGPolyline3D.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the number of control points.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::Intersects

bool Intersects (const TGBox3D & box) const

Interface Category:

API.

Purpose:

Determines if this TGPolyline3D intersects the specified box.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the polyline intersects the box.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::RemovePoint

void RemovePoint (unsigned long index)

Interface Category:

API.

Purpose:

Removes this TPolyline3D's control point at the specified index.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Calls a parameter assertion that fails if the index is out of range.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::ReverseDirection

void ReverseDirection ()

Interface Category:

API.

Purpose:

Reverses the direction of the TGPolyline3D (that is, the order of the control points).

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: TGPolyline3D::TransformBy

void TransformBy (const TGrafMatrix3D & xform)

Interface Category:

API.

Purpose:

Transforms this TGPolyline3D's shape and position by applying the specified transformation matrix.

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

TStream & operator <<= (TStream & fromwhere)

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

TStream & operator >>=(TStream & towhere) 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: TGPolyline3D::operator=

TGPolyline3D & operator =(const TGPolyline3D & Src)

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

bool operator ==(const TGPolyline3D & Src) const

Interface Category:

API.

Purpose:

Tests two TPolyline3Ds for equality.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if all the control points equal to the corresponding points of the source polyline are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGPolyline3D::operator!=

bool operator != (const TGPolyline3D & Src) const

Interface Category:

API.

Purpose:

Tests two TPolyline3Ds for inequality.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if all the control points equal to the corresponding points of the source polyline are not equal.

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.