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.
- TGPolyline3D ()
- TGPolyline3D (const TGPoint3DArray & points)
- TGPolyline3D (unsigned long numPoints)
- TGPolyline3D (const TGPolyline3D & polyLine3D)
Interface Category:
API.
Purpose:
- Default constructor.
- Creates a TGPolyline3D using the specified points as control points.
- Creates a TGPolyline3D with the specified number of control points.
- Copy constructor.
Calling Context:
- Called by the stream-in operators and directly.
- Call this function directly.
- Call this function directly.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const TGPoint3DArray & points -The control points for the new polyline.
- unsigned long numPoints -The number of control for the new polyline.
- const TGPolyline3D & polyLine3D -The polyline to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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:
- unsigned long index -The index (whose value must be less than the number of control points).
- const TGPoint3D & p -The point to be added.
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:
- const TGPoint3D & point -The new control point.
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:
- GParametric u -The parametric value.
- const TGPoint3D & toPt -The new point that this polyline passes through.
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:
- GParametric u -The parametric position on the polyline.
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:
- unsigned long index -The index (whose value must be less than the number of control points in the polyline).
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:
- unsigned long index -The index (whose value must be less than the number of control points in the polyline).
- const TGPoint3D & point -The new value for the control point.
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:
- TGPoint3DArray & points -The point array that the polyline's control points are copied into.
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:
- const TGPoint3DArray & pts -The index (whose value must be less than the number of control points).
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:
- unsigned long index -The index (whose value must be less than the number of control points).
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:
- const TGrafMatrix3D & xform -The transformation matrix by which the graphic's points are multiplied.
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:
- TStream & fromwhere -The stream that the object's data 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: TGPolyline3D::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's data 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: 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:
- const TGPolyline3D & Src -The polyline to be compared to this polyline.
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:
- const TGPolyline3D & Src -The polyline to be compared to this polyline.
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.