Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MGraphic3D
Inherited By:
None.
Purpose:
TLine3D provides a wrapper for the TGLine3D geometry class, to which it adds the facilities inherited from MGraphic3D: an attribute bundle, transformations, and hit detection. TLine3D has a, not is a, TGLine3D. TLine3D is used for drawing line segments; there is no TInfiniteLine3D class.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TLine3D ()
- TLine3D (const TGPoint3D & startPoint, const TGPoint3D & endPoint, TGrafBundle3D * adoptBundle =NIL)
- TLine3D (const TGLine3D & line, TGrafBundle3D * adoptBundle =NIL)
- TLine3D (const TLine3D & copy)
Interface Category:
API.
Purpose:
- Default constructor.
- Creates a TLine3D with the specified starting and endpoints and the specified attribute bundle.
- Creates a TLine3D using the specified line's geometry and adopting the specified attribute bundle.
- 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 TGPoint3D & startPoint -The starting point of the line.
- const TGPoint3D & endPoint -The endpoint of the line.
- TGrafBundle3D * adoptBundle =NIL -The bundle to be adopted.
- const TGLine3D & line -The line to be copied.
- TGrafBundle3D * adoptBundle =NIL -The bundle to be adopted.
- const TLine3D & copy -The line to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TLine3D ()
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: TLine3D::Draw
virtual void Draw (TGrafPort & port) const
Interface Category:
API.
Purpose:
Draws this TLine3D to the specific TGrafPort. Attributes in the graphic's bundle override those already provided in the port (if any).
Calling Context:
Call this function directly.
Parameters:
- TGrafPort & port -The port to which drawing should go. The port in turn invokes rendering on a particular TGrafDevice.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::GetGeometricBounds
virtual TGBox3D GetGeometricBounds () const
Interface Category:
API.
Purpose:
Returns the bounding box of this TLine3D's geometry, without considering any volume added by its bundle.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the bounding box of the graphic's geometry.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::TransformBy
virtual void TransformBy (const TGrafMatrix3D & matrix)
Interface Category:
API.
Purpose:
Transforms this TLine3D's shape and position by applying the specified transformation matrix.
Calling Context:
Call this function directly.
Parameters:
- const TGrafMatrix3D & matrix -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: TLine3D::TranslateBy
virtual void TranslateBy (const TGPoint3D & delta)
Interface Category:
API.
Purpose:
Moves the TLine3D's position by the specified vector.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint3D & delta -The vector whose x-, y-, and z-coordinates are to be added to those of each point in the line's geometry.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::ScaleBy
virtual void ScaleBy (const TGPoint3D & scaleFactor, const TGPoint3D & centerOfScale =TGPoint3D :: kOrigin)
Interface Category:
API.
Purpose:
Changes the size of this TLine3D by multiplying the coordinates by the specified scaling factor. It scales the graphic about the specified center of scale. The factor parameter is a vector of type TGPoint3D that allows non-uniform scaling using x-, y-, and z-coordinates of different values. For uniform scaling, the x-, y-, and z-coordinates should be the same.
The effect of negative scaling factors is the same as mirroring. (For example, scaling by -1.0 in the x-coordinate is like mirroring about the Y-Z plane.)
Calling Context:
Call this function directly.
Parameters:
- const TGPoint3D & scaleFactor -A vector of three values that determines the amount each coordinate is to be scaled.
- const TGPoint3D & centerOfScale =TGPoint3D :: kOrigin -The center of the scaling.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::RotateBy
- virtual void RotateBy (GDegrees angle, TGrafMatrix3D :: EAxis axis)
- virtual void RotateBy (GDegrees angle, const TGLine3D & ray)
Interface Category:
API.
Purpose:
- Rotates this TLine3D counterclockwise around the specified axis by the specified angle. The right-handed coordinate system determines the orientation. That is, when you look from the positive axis towards the 3-D origin, a 90 degree counterclockwise rotation transforms one positive axis into the other.
- Rotates this TLine3D around the specified (arbitrary) axis by the specified angle. The direction of the vector (the ray parameter) determines the orientation of the rotation. The first point of the TGLine3D parameter is the origin; the second point determines the direction of the vector. The orientation of the rotation is counterclockwise around the vector.
Calling Context:
- Call this function directly.
- Call this function directly.
Parameters:
- GDegrees angle -The degree of the specified rotation.
- TGrafMatrix3D :: EAxis axis -Determines which axis the specified rotation is to take place about. There are three enumerated types: kAboutXAxis, kAboutYAxis, or kAboutZAxis.
- GDegrees angle -The specified angle of rotation.
- const TGLine3D & ray -The arbitrary axis of rotation.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::GetPoints
void GetPoints (TGPoint3D & startPoint, TGPoint3D & endPoint) const
Interface Category:
API.
Purpose:
Gets both endpoints of this TLine3D's line geometry and returns them in the specified parameters.
Calling Context:
Call this function directly.
Parameters:
- TGPoint3D & startPoint -The starting point of the line.
- TGPoint3D & endPoint -The endpoint of the line.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::GetStartPoint
TGPoint3D GetStartPoint () const
Interface Category:
API.
Purpose:
Gets the starting point of this TLine3D's line geometry.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the starting point of the line.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::GetEndPoint
TGPoint3D GetEndPoint () const
Interface Category:
API.
Purpose:
Gets the endpoint of this TLine3D's line geometry.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the endpoint of the line.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::SetStartPoint
void SetStartPoint (const TGPoint3D & point)
Interface Category:
API.
Purpose:
Specifies a new value for the starting point of this TLine3D's line geometry.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint3D & point -The new value for the line's starting point.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::SetEndPoint
void SetEndPoint (const TGPoint3D & point)
Interface Category:
API.
Purpose:
Specifies a new value for the endpoint of this TLine3D's line geometry.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint3D & point -The new value for the line's endpoint.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::ReverseDirection
void ReverseDirection ()
Interface Category:
API.
Purpose:
Swaps the endpoints so that this TLine3D's parameterization runs the opposite direction. The geometric shape is unchanged.
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: TLine3D::DragPosition
virtual void DragPosition (GParametric u, const TGPoint3D & toPt)
Interface Category:
API.
Purpose:
Moves this TLine3D so that the specified parametric position on the line matches the specified point.
Calling Context:
Call this function directly.
Parameters:
- GParametric u -The parametric position on the line.
- const TGPoint3D & toPt -The point that the parametric position is to be matched to.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::Evaluate
virtual TGPoint3D Evaluate (GParametric u) const
Interface Category:
API.
Purpose:
Returns the point corresponding to the specified parameter. A value of 0.0 corresponds to the starting point, and 1.0 to the endpoint. Values outside the range return an extrapolated point.
Calling Context:
Call this function directly.
Parameters:
- GParametric u -The parameter on the line.
Return Value:
Returns the point on the line at the specified parametric value.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::Length
virtual GCoordinate Length () const
Interface Category:
API.
Purpose:
Determines the length of this TLine3D.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the length of the line.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::NearestParametric
virtual GParametric NearestParametric (const TGPoint3D & point) const
Interface Category:
API.
Purpose:
Finds the parametric value corresponding to the point on this TLine3D that is nearest to the specified point.
Calling Context:
Call this function directly.
Parameters:
- const TGPoint3D & point -The point whose parametric value is to be found.
Return Value:
Returns the parametric value that best matches the point.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::operator==
bool operator ==(const TLine3D & source) const
Interface Category:
API.
Purpose:
Tests two TLine3Ds for equality, by determining whether the geometries are equal and the bundles are equal.
Calling Context:
Call this operator directly.
Parameters:
- const TLine3D & source -The line to be compared with this one.
Return Value:
Returns true if this TLine3D and the argument have equal geometries and bundles.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::operator!=
bool operator != (const TLine3D & source) const
Interface Category:
API.
Purpose:
Tests two TLine3Ds for inequality, by determining whether the geometries are unequal and the bundles are unequal.
Calling Context:
Call this operator directly.
Parameters:
- const TLine3D & source -The line to be compared with this one.
Return Value:
Returns true if the geometries and bundles of this TLine3D and the parameter are not equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TLine3D::operator=
TLine3D & operator =(const TLine3D & source)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
- const TLine3D & source -The line to be copied.
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: TLine3D::operator>>=
virtual 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 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: TLine3D::operator<<=
virtual 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 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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.