---
name: "ellipses"
section: "3"
platform: "linux"
package: "ivtools-dev"
version: "1.1.3-4"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/ellipses"
---

# ellipses(3)

abstract base class and predefined subclasses for elliptical structured graphics

## NAME

Ellipse, S\_Ellipse, F\_Ellipse, SF\_Ellipse, S\_Circle, F\_Circle, SF\_Circle - abstract base class and predefined subclasses for elliptical structured graphics

## SYNOPSIS

**#include \<Unidraw/Graphic/ellipses.h\>**

## DESCRIPTION

Ellipse is an abstract base class for elliptical structured graphics objects.  It stores geometric information that such graphics require and provides helper functions for calculating extents and for hit detection.  Predefined subclasses include S\_Ellipse, F\_Ellipse, and SF\_Ellipse, which draw stroked, filled, and stroked-filled ellipses, respectively; and S\_Circle, F\_Circle, and SF\_Circle, which draw stroked, filled, and stroked-filled circles, respectively. The stroked subclasses store a PSBrush, the filled subclasses store a PSPattern, and the stroked-filled subclasses store one of each.

## ELLIPSE PUBLIC OPERATIONS

- **void GetOriginal(Coord& x, Coord& y, int& rx, int& ry)**

  Return the ellipse's geometry.  (*x, y*) defines the ellipse's center, while *rx* and *ry* define its horizontal and vertical radii, respectively.

## ELLIPSE PROTECTED OPERATIONS

- **Ellipse(Coord x, Coord y, int rx, int ry, Graphic\* = nil)**

  The constructor is protected to disallow instantiation of the abstract base class.  An ellipse's geometry is defined in terms of its center and its horizontal and vertical radii.  The constructor also takes an optional graphic from which to obtain an initial set of graphics state.

- **void s\_getExtent(**

  - **float&, float&, float&, float&, float&, Graphic\***

  - **)**

  - **void f\_getExtent(**

  - **float&, float&, float&, float&, float&, Graphic\***

  - **)**

  - **boolean s\_contains(PointObj&, Graphic\*)**

  - **boolean f\_contains(PointObj&, Graphic\*)**

  - **boolean s\_intersects(BoxObj&, Graphic\*)**

  - **boolean f\_intersects(BoxObj&, Graphic\*)**

  Helper functions that return extent and hit detection information based on the bounding box that the ellipse defines.  s\_getExtent, s\_contains, and s\_intersects return information that accounts for the width of a brush, as would be necessary if the ellipse is stroked, while f\_getExtent, f\_contains, and f\_intersects assumes that the ellipse is filled.  Subclasses can use the operations to help implement their getExtent, contains, and intersects operations.

## SUBCLASS PUBLIC OPERATIONS

- **S\_Ellipse(Coord x, Coord y, int rx, int ry, Graphic\* = nil)**

  - **F\_Ellipse(Coord x, Coord y, int rx, int ry, Graphic\* = nil)**

  - **SF\_Ellipse(Coord x, Coord y, int rx, int ry, Graphic\* = nil)**

  - **S\_Circle(Coord x, Coord y, int radius, Graphic\* = nil)**

  - **F\_Circle(Coord x, Coord y, int radius, Graphic\* = nil)**

  - **SF\_Circle(Coord x, Coord y, int radius, Graphic\* = nil)**

  Constructors for the various predefined Ellipse subclasses.

## SEE ALSO

Graphic(3U), geomobjs(3U), pspaint(3U)
