Class: TGLine3D

Declaration: Geometry3D.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

TGLines are line segments in 3-D space, and are defined by two endpoints. Line segments have an implied direction that moves from the starting point to the end point.

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

  1. TGLine3D ()
  2. TGLine3D (const TGPoint3D & point0, const TGPoint3D & point1)
  3. TGLine3D (const TGLine3D & Line)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a line segment connecting the specified points.
  3. Copy constructor.

Calling Context:

  1. Called by the stream-in operators. You can also call this function directly and set the endpoints later.
  2. Call this function directly.
  3. 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: TGLine3D::~TGLine3D

~ TGLine3D ()

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: TGLine3D::GetPoints

void GetPoints (TGPoint3D & point0, TGPoint3D & point1) const

Interface Category:

API.

Purpose:

Returns, in its arguments, both endpoints of the line segment.

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: TGLine3D::GetStartPoint

TGPoint3D GetStartPoint () const

Interface Category:

API.

Purpose:

Returns the starting point of the line segment.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the starting point of the line segment.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine3D::GetEndPoint

TGPoint3D GetEndPoint () const

Interface Category:

API.

Purpose:

Returns the end point of the line segment.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the end point of the line segment.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine3D::SetStartPoint

void SetStartPoint (const TGPoint3D & p)

Interface Category:

API.

Purpose:

Sets the starting point of the line segment.

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: TGLine3D::SetEndPoint

void SetEndPoint (const TGPoint3D & p)

Interface Category:

API.

Purpose:

Sets the end point of the line segment.

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: TGLine3D::GetBounds

TGBox3D GetBounds () const

Interface Category:

API.

Purpose:

Returns the line segment's bounding box (the smallest TGBox3D that encloses the line segment).

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the bounding box.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine3D::DragPosition

void DragPosition (GParametric u, const TGPoint3D & p)

Interface Category:

API.

Purpose:

Moves the line so the specified parametric position on the line matches 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: TGLine3D::Evaluate

TGPoint3D Evaluate (GParametric u) const

Interface Category:

API.

Purpose:

Returns the point corresponding to the parameter. A value of 0 corresponds to the starting point, and 1 to the end point. Values outside the range return an extrapolated point.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the point corresponding to the parameter u.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine3D::Length

GCoordinate Length () const

Interface Category:

API.

Purpose:

Returns the length of the line segment.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the length of the line segment.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine3D::NearestParametric

GParametric NearestParametric (const TGPoint3D & p) const

Interface Category:

API.

Purpose:

Finds the parametric value corresponding to the point on the line segment that is nearest to the specified point.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the parametric value that best matches the specified point.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine3D::Intersects

bool Intersects (const TGBox3D & box) const

Interface Category:

API.

Purpose:

Specifies whether the line intersects the given box.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the line intersects the box.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine3D::TransformBy

void TransformBy (const TGrafMatrix3D & xform)

Interface Category:

API.

Purpose:

Transforms the line segment by 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: TGLine3D::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: TGLine3D::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: TGLine3D::operator=

TGLine3D & operator =(const TGLine3D & Src)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

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

bool operator ==(const TGLine3D & Src) const

Interface Category:

API.

Purpose:

Tests two line segments for equality.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if both endpoints of one line segment are equal to the corresponding endpoints of the other line segment.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine3D::operator!=

bool operator != (const TGLine3D & Src) const

Interface Category:

API.

Purpose:

Tests two line segments for inequality.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if either endpoint of one line segment is different from the corresponding endpoint of the other line segment.

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.