Class: TGLine

Declaration: LineGeometry.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

TGLines are line segments, defined by two end points. 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:

Do not derive from this class.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TGLine::TGLine

  1. TGLine ()
  2. TGLine (const TGLine &)
  3. TGLine (TGPoint startPt, TGPoint endPt)

Interface Category:

API.

Purpose:

  1. Default constructor. The start and end points are initialized to TGPoint::kOrigin.
  2. Copy constructor.
  3. Constructor that takes two TGPoint as arguments.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to copy an object.
  3. 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: TGLine::~TGLine

virtual ~ TGLine ()

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

TGPoint GetStartPoint () const

Interface Category:

API.

Purpose:

Returns the starting point of the TGLine.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a TGPoint representing the starting point of the TGLine.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine::GetEndPoint

TGPoint GetEndPoint () const

Interface Category:

API.

Purpose:

Returns the end point of the TGLine.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a TGPoint representing the end point of the TGLine.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine::GetPoints

void GetPoints (TGPoint & startPt, TGPoint & endPt) const

Interface Category:

API.

Purpose:

Returns, in its arguments, both end points of the TGLine.

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

TGPoint Evaluate (GParametric u) const

Interface Category:

API.

Purpose:

Returns a 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 a TGPoint corresponding to the specified parameter.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine::SetStartPoint

void SetStartPoint (const TGPoint & point)

Interface Category:

API.

Purpose:

Sets the starting point of the TGLine.

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

void SetEndPoint (const TGPoint & point)

Interface Category:

API.

Purpose:

Sets the end point of the TGLine.

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

void TransformBy (const TGrafMatrix & transform)

Interface Category:

API.

Purpose:

Transforms the TGLine by the specified transformation.

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

void DragPosition (GParametric u, const TGPoint & toPoint)

Interface Category:

API.

Purpose:

Moves the TGLine so that the specified parametric position on the TGLine 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: TGLine::NearestParametric

GParametric NearestParametric (const TGPoint & test) const

Interface Category:

API.

Purpose:

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

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a GParametric that best matches the specified point.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine::Intersects

bool Intersects (const TGRect & g) const

Interface Category:

API.

Purpose:

Returns true if the TGLine intersects the specified rectangle.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the TGLine intersects the rectangle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine::GetBounds

TGRect GetBounds () const

Interface Category:

API.

Purpose:

Returns the TGLine's bounding box (the smallest TGRect that encloses the line).

Calling Context:

Call this function directly.

Parameters:

Return Value:

A TGRect that bounds the line.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine::operator>>=

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

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

TGLine & operator =(const TGLine & 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: TGLine::operator==

bool operator ==(const TGLine & Src) const

Interface Category:

API.

Purpose:

Tests two TGLines for equality.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if the starting and end points of both lines are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGLine::operator!=

bool operator != (const TGLine & Src) const

Interface Category:

API.

Purpose:

Tests two TGLines for inequality.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if the starting and end points of both lines 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.