Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MGraphic3D
Inherited By:
None.
Purpose:
TTorus3D is a concrete class, derived from MGraphic3D, that represents a toroidal (doughnut-shaped) surface. Think of a Torus as the shape generated when a small circle moves along a larger circular trajectory. At each point on the larger circle, the smaller circle is centered at this point and lies in a plane that is perpendicular to the trajectory. The TTorus3D class provides member functions to set and get the radius of both these circles. In addition, all the standard MGraphic3D member functions are implemented (Draw, GetGeometricBounds, TransformBy, and so on).
A torus can also be generated by using TSweep3D, but such an object can easily be altered beyond recognition. If you need to manipulate the torus in ways not provided by the TTorus3D member functions, you can invoke TTorus3D::CreateSweepSurface to access a TSweep3D with the same geometry and attributes as the TTorus3D.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
None.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
- TTorus3D ()
- TTorus3D (GCoordinate bigRadius, GCoordinate smallRadius, TGrafBundle3D * adoptBundle =NIL)
- TTorus3D (const TTorus3D & copy)
Interface Category:
API.
Purpose:
- Default constructor.
- Creates TTorus3D from the specified parameters and adopts the specified attribute bundle.
- Copy constructor.
Calling Context:
- Called by the stream-in operators and directly.
- Call this function directly.
- Called to copy an object.
Parameters:
- Takes no parameters.
- GCoordinate bigRadius -The radius of the bigger circle (that is, the trajectory for the smaller circle).
- GCoordinate smallRadius -The radius of the smaller circle (that is, the cross section of the torus or the sweeping curve).
- TGrafBundle3D * adoptBundle =NIL -The attribute bundle to be adopted.
- const TTorus3D & copy -The torus to be copied.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual ~ TTorus3D ()
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: TTorus3D::Draw
virtual void Draw (TGrafPort & port) const
Interface Category:
API.
Purpose:
Draws this TTorus3D 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: TTorus3D::GetGeometricBounds
virtual TGBox3D GetGeometricBounds () const
Interface Category:
API.
Purpose:
Returns this TTorus3D's bounding box, without considering any volume added by its bundle.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the bounding box of the cylinder's geometry.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTorus3D::TransformBy
virtual void TransformBy (const TGrafMatrix3D & matrix)
Interface Category:
API.
Purpose:
Transforms this TTorus3D'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: TTorus3D::SetOuterRadius
virtual void SetOuterRadius (GCoordinate bigRadius)
Interface Category:
API.
Purpose:
Sets this TTorus3D's outer radius.
Calling Context:
Call this function directly.
Parameters:
- GCoordinate bigRadius -The outer radius (that is, the radius of the trajectory).
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTorus3D::SetTubeRadius
virtual void SetTubeRadius (GCoordinate smallRadius)
Interface Category:
API.
Purpose:
Sets this 'TTorus3D's tube radius.
Calling Context:
Call this function directly.
Parameters:
- GCoordinate smallRadius -The tube radius (that is, the sweeping curve).
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTorus3D::GetOuterRadius
virtual GCoordinate GetOuterRadius () const
Interface Category:
API.
Purpose:
Gets this TTorus3D's outer radius (that is, the radius of the trajectory).
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns this torus' outer radius.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTorus3D::GetTubeRadius
virtual GCoordinate GetTubeRadius () const
Interface Category:
API.
Purpose:
Gets this TTorus3D's tube radius.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns the torus' tube radius.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTorus3D::CreateSweepSurface
virtual TSweep3D * CreateSweepSurface () const
Interface Category:
API.
Purpose:
Creates and returns a TSweep3D from this TTorus3D. This allows you to manipulate the cone in ways not permitted by its member functions.
Calling Context:
Call this function directly.
Parameters:
Return Value:
Returns a sweep that corresponds to the torus.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TTorus3D::operator=
TTorus3D & operator =(const TTorus3D & source)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
- const TTorus3D & source -The torus to be 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: TTorus3D::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: TTorus3D::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.