![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
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.
- TGEllipse ()
- TGEllipse (const TGEllipse &)
- TGEllipse (const TGRect & r)
- TGEllipse (const TGPoint & center, GCoordinate radius)
- TGEllipse (const TGPoint & center, GCoordinate Xradius, GCoordinate Yradius)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
- Creates an ellipse geometry to fit within the provided rectangle. If the rectangle is a square, the ellipse is a circle.
- Creates an ellipse geometry with a uniform radius (thus, the ellipse is a circle) whose center is at the specified location.
- Creates an ellipse geometry with the specified horizontal and vertical radii, and whose center is at the specified location.
Calling Context:
- Called by the stream-in operators.
- Called to copy an object.
- Call to create an ellipse specified through a rectangle.
- Call to create a circle at a given location.
- Call to create an ellipse at the given location with the given x and y radii.
Parameters:
- Takes no parameters.
- const TGEllipse & -The ellipse to be copied.
- const TGRect & r -The rectangle within which to construct the ellipse.
- const TGPoint & center -The location of the coordinate system to place the center of the circle.
- GCoordinate radius -The radius of the circle.
- const TGPoint & center -The location of the coordinate system to place the center of the ellipse.
- GCoordinate Xradius -The horizontal radius of the ellipse.
- GCoordinate Yradius -The vertical radius of the ellipse.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
~ 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:
- const TGRect & rect -The rectangle to test for intersection.
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:
- const TGPoint & point -The point to test for within the ellipse.
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:
- const TGPoint & center -The new center point for the ellipse.
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:
- const TGPoint & size -The new size for the ellipse, where TGPoint's fX value represents the width, and TGPoint's fY value represents the height.
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:
- const TGRect & bounds -The new bounding rectangle for the ellipse.
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:
- TStream & -The stream to which the object streams itself out.
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:
- TStream & -The stream from which the object streams itself in.
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:
- const TGEllipse & Src -The ellipse 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: 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:
- const TGEllipse & Src -The ellipse to be compared to this one.
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:
- const TGEllipse & Src -The ellipse to be compared to this one.
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.