Class: TRevolution3D

Declaration: Sweep3D.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MGraphic3D

Inherited By:

None.

Purpose:

TRevolution3D is a concrete class, derived from MGraphic3D, that can be used to generate a variety of shapes that are symmetrical around a line. To create the shape, a 2-D curve in the xy plane is revolved 360 degrees about the y-axis. For example, a cone can be generated by revolving a straight line segment that has one endpoint on the y-axis. A sphere can be generated by revolving a semicircle that has both its endpoints on the y-axis. The resulting shape can be reoriented by applying a transformation matrix. This mechanism is very similar to TSweep3D, but is less general, because a TSweep3D trajectory can be any 3-D curve (not just a revolution about an axis), and also because TSweep3D provides means to warp the shape beyond recognition. If you need to manipulate the shape in ways not provided by the TRevolution3D member functions, you can invoke TRevolution3D::CreateSweepSurface to access a TSweep3D with the same geometry and attributes as the TRevolution3D. Member functions are provided to set and get the revolved curve. In addition, all the standard MGraphic3D member functions are implemented (Draw, GetGeometricBounds, TransformBy, and so on).

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TRevolution3D::TRevolution3D

  1. TRevolution3D ()
  2. TRevolution3D (const TGCurve & RevolutionCurve, TGrafBundle3D * adoptBundle =NIL)
  3. TRevolution3D (const TRevolution3D & copy)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Creates a TRevolution3D from the specified curve and adopts the specified attribute bundle.
  3. Copy constructor.

Calling Context:

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

virtual ~ TRevolution3D ()

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: TRevolution3D::Draw

virtual void Draw (TGrafPort & port) const

Interface Category:

API.

Purpose:

Draws this TRevolution3D 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: TRevolution3D::GetGeometricBounds

virtual TGBox3D GetGeometricBounds () const

Interface Category:

API.

Purpose:

Returns this TRevolution3D'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: TRevolution3D::TransformBy

virtual void TransformBy (const TGrafMatrix3D & matrix)

Interface Category:

API.

Purpose:

Transforms this TRevolution3D'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: TRevolution3D::SetRevolutionCurve

virtual void SetRevolutionCurve (const TGCurve & RevolutionCurve)

Interface Category:

API.

Purpose:

Sets the curve to be revolved.

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: TRevolution3D::GetRevolutionCurve

virtual const TGCurve * GetRevolutionCurve () const

Interface Category:

API.

Purpose:

Gets the curve to be revolved.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the revolution curve.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRevolution3D::CreateSweepSurface

virtual TSweep3D * CreateSweepSurface () const

Interface Category:

API.

Purpose:

Creates and returns a TSweep3D from this TRevolution3D. 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 revolution.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRevolution3D::operator=

TRevolution3D & operator =(const TRevolution3D & source)

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: TRevolution3D::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: TRevolution3D::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.