Navigation: Up, Table of Contents, Bibliography, Index, Title Page

Requirements of Traits Classes for 2D Smallest Enclosing Ellipse

The class template CGAL_Min_ellipse_2 is parameterized with a Traits class which defines the abstract interface between the optimisation algorithm and the primitives it uses. The following requirements catalog lists the primitives, i.e. types, member functions etc., that must be defined for a class that can be used to parameterize CGAL_Min_ellipse_2. A traits class implementation using the CGAL 2D kernel is available and described in Section reference arrow. In addition, we provide traits class adapters to user supplied point classes, see Sections reference arrow and reference arrow. Both, the implementation and the adapters, can be used as a starting point for customizing own traits classes, e.g. through derivation and specialization.

Traits Class (Traits)

Definition

A class that satisfies the requirements of a traits class for CGAL_Min_ellipse_2 must provide the following primitives.

Types

Traits::Point
The point type must provide default and copy constructor, assignment and equality test.

Traits::Ellipse
The ellipse type must fulfill the requirements listed below in the next section.

In addition, if I/O is used, the corresponding I/O operators for Point and Ellipse have to be provided, see topic I/O in Section reference arrow.

Variables

Ellipse ellipse; The actual ellipse. This variable is maintained by the algorithm, the user should neither access nor modify it directly.

Creation

Only default and copy constructor are required. Note that further constructors can be provided.

Traits traits;
A default constructor.

Traits traits ( Traits);
A copy constructor.

Ellipse Type (Ellipse)

Definition

An object of the class Ellipse is an ellipse in two-dimensional euclidean plane E2. Its boundary splits the plane into a bounded and an unbounded side. By definition, an empty Ellipse has no boundary and no bounded side, i.e. its unbounded side equals the whole plane E2.

Types

Ellipse::Point
Point type.

Creation

void ellipse.set () sets ellipse to the empty ellipse.
void ellipse.set ( Point p)
sets ellipse to the ellipse containing exactly {p}.
void ellipse.set ( Point p, Point q)
sets ellipse to the ellipse containing exactly the segment connecting p and q. The algorithm guarantees that set is never called with two equal points.
void ellipse.set ( Point p, Point q, Point r)
sets ellipse to the smallest ellipse through p, q,r. The algorithm guarantees that set is never called with three collinear points.
void ellipse.set ( Point p, Point q, Point r, Point s)
sets ellipse to the smallest ellipse through p, q,r,s. The algorithm guarantees that this ellipse exists.
void
ellipse.set ( Point p,
Point q,
Point r,
Point s,
Point t)
sets ellipse to the unique conic through p,q, r,s,t. The algorithm guarantees that this conic is an ellipse.

Predicates

bool ellipse.has_on_unbounded_side ( Point p)
returns true, iff p lies properly outside of ellipse.

Each of the following predicates is only needed, if the corresponding predicate of CGAL_Min_ellipse_2 is used.

CGAL_Bounded_side ellipse.bounded_side ( Point p)
returns CGAL_ON_BOUNDED_SIDE, CGAL_ON_BOUNDARY or CGAL_ON_UNBOUNDED_SIDE iff p lies properly inside, on the boundary, or properly outside of ellipse, resp.
bool ellipse.has_on_bounded_side ( Point p)
returns true, iff p lies properly inside ellipse.
bool ellipse.has_on_boundary ( Point p)
returns true, iff p lies on the boundary of ellipse.
bool ellipse.is_empty ()
returns true, iff ellipse is empty (this implies degeneracy).
bool ellipse.is_degenerate ()
returns true, iff ellipse is degenerate, i.e. if ellipse is empty or equal to a single point.

I/O

The following I/O operators are only needed, if the corresponding I/O operators of CGAL_Min_ellipse_2 are used.

ostream& ostream& os << ellipse
writes ellipse to output stream os.
CGAL_Window_stream&
CGAL_Window_stream& ws << ellipse
writes ellipse to window stream ws.


Next: Class declaration of CGAL_Min_sphere_d<Traits>
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The CGAL Project. 22 January, 1999.