Class: TLine3D

Declaration: Graphics3D.h

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.

Member Function: TLine3D::TLine3D

  1. TLine3D ()
  2. TLine3D (const TGPoint3D & startPoint, const TGPoint3D & endPoint, TGrafBundle3D * adoptBundle =NIL)
  3. TLine3D (const TGLine3D & line, TGrafBundle3D * adoptBundle =NIL)
  4. TLine3D (const TLine3D & copy)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a TLine3D with the specified starting and endpoints and the specified attribute bundle.
  3. Creates a TLine3D using the specified line's geometry and adopting the specified attribute bundle.
  4. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and directly.
  2. Call this function directly.
  3. Call this function directly.
  4. 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: TLine3D::~TLine3D

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:

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:

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:

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TLine3D::RotateBy

  1. virtual void RotateBy (GDegrees angle, TGrafMatrix3D :: EAxis axis)
  2. virtual void RotateBy (GDegrees angle, const TGLine3D & ray)

Interface Category:

API.

Purpose:

  1. 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.
  2. 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:

  1. Call this function directly.
  2. 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::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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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:

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.