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.
- TGLine ()
- TGLine (const TGLine &)
- TGLine (TGPoint startPt, TGPoint endPt)
Interface Category:
API.
Purpose:
- Default constructor. The start and end points are initialized to TGPoint::kOrigin.
- Copy constructor.
- Constructor that takes two TGPoint as arguments.
Calling Context:
- Called by the stream-in operators.
- Called to copy an object.
- Call this function directly.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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:
- TGPoint & startPt -The starting point.
- TGPoint & endPt -The end point.
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:
- GParametric u -The parametric position on the TGLine.
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:
- const TGPoint & point -The new starting point.
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:
- const TGPoint & point -The new end point.
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:
- const TGrafMatrix & transform -The transformation matrix to be applied to the TGLine.
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:
- GParametric u -The parametric position on the TGLine.
- const TGPoint & toPoint -The point to match.
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:
- const TGPoint & test -The point whose parametric value is to be found.
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:
- const TGRect & g -The rectangle to be tested.
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:
- TStream & -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: TGLine::operator<<=
TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -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: 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:
- const TGLine & Src -The line whose value is copied.
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:
- const TGLine & Src -The line to be compared to this line.
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:
- const TGLine & Src -The line to be compared to this line.
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.