Class: TGEllipse

Declaration: AreaGeometry.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

A TGEllipse is a vertically or horizontally oriented ellipse. The ellipse is defined by the axis-aligned rectangle (TGRect) in which the ellipse is inscribed, so that the ellipse just touches the midpoint of each edge of the rectangle. If the rectangle is a square, the ellipse is a circle. A TGEllipse is an area-enclosing geometry that can be filled and framed.

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.

Member Function: TGEllipse::TGEllipse

  1. TGEllipse ()
  2. TGEllipse (const TGEllipse &)
  3. TGEllipse (const TGRect & r)
  4. TGEllipse (const TGPoint & center, GCoordinate radius)
  5. TGEllipse (const TGPoint & center, GCoordinate Xradius, GCoordinate Yradius)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.
  3. Creates an ellipse geometry to fit within the provided rectangle. If the rectangle is a square, the ellipse is a circle.
  4. Creates an ellipse geometry with a uniform radius (thus, the ellipse is a circle) whose center is at the specified location.
  5. Creates an ellipse geometry with the specified horizontal and vertical radii, and whose center is at the specified location.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to copy an object.
  3. Call to create an ellipse specified through a rectangle.
  4. Call to create a circle at a given location.
  5. Call to create an ellipse at the given location with the given x and y radii.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGEllipse::~TGEllipse

~ TGEllipse ()

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: TGEllipse::GetSize

TGPoint GetSize () const

Interface Category:

API.

Purpose:

Returns the ellipse's height and width. If the height and width are the same, the ellipse is a circle.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A TGPoint whose fX value contains the ellipse's width and whose fY value contains the ellipse's height.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGEllipse::GetCenter

TGPoint GetCenter () const

Interface Category:

API.

Purpose:

Returns the center point of the ellipse.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a TGPoint whose contents indicate the (x, y) coordinate of the center of the ellipse.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGEllipse::Intersects

bool Intersects (const TGRect & rect) const

Interface Category:

API.

Purpose:

Tests whether the ellipse intersects the given rectangle.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the ellipse intersects the given rectangle.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGEllipse::Contains

bool Contains (const TGPoint & point) const

Interface Category:

API.

Purpose:

Tests whether the ellipse contains the given point.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the ellipse contains the given point.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGEllipse::GetBounds

TGRect GetBounds () const

Interface Category:

API.

Purpose:

Returns the bounding rectangle of the ellipse.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the rectangle that completely encloses the ellipse.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGEllipse::SetCenter

void SetCenter (const TGPoint & center)

Interface Category:

API.

Purpose:

Moves the ellipse to be centered on the given point, without changing its radii.

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: TGEllipse::SetSize

void SetSize (const TGPoint & size)

Interface Category:

API.

Purpose:

Sets the ellipse's height and width without changing its center 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: TGEllipse::SetBounds

void SetBounds (const TGRect & bounds)

Interface Category:

API.

Purpose:

Sets the bounding rectangle (which generally changes the ellipse's shape and location).

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: TGEllipse::operator>>=

TStream & operator >>=(TStream &) 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: TGEllipse::operator<<=

TStream & operator <<= (TStream &)

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.

Member Function: TGEllipse::operator=

TGEllipse & operator =(const TGEllipse & Src)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

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: TGEllipse::operator==

bool operator ==(const TGEllipse & Src) const

Interface Category:

API.

Purpose:

Tests whether the two objects are equal.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if the two ellipses are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGEllipse::operator!=

bool operator != (const TGEllipse & Src) const

Interface Category:

API.

Purpose:

Tests whether the two objects are equal.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if the two ellipses 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.