The class template 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 Min_ellipse_2. A traits class implementation using the 2D CGAL-kernel is available and described in Section . In addition, we provide traits class adapters to user supplied point classes, see Sections and . Both, the implementation and the adapters, can be used as a starting point for customizing own traits classes, e.g. through derivation and specialization.
A class that satisfies the requirements of a traits class for Min_ellipse_2 must provide the following primitives.
| |
The point type must provide default and copy constructor,
assignment and equality test.
| |
| |
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 .
|
| The actual ellipse. This variable is maintained by the algorithm, the user should neither access nor modify it directly. |
Only default and copy constructor are required. Note that further constructors can be provided.
| |
A default constructor.
| |
| |
A copy constructor.
|
An object of the class Ellipse is an ellipse in two-dimensional Euclidean plane 2. 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 2.
| |
Point type.
|
|
| sets ellipse to the empty ellipse. | ||
|
| |||
sets ellipse to the ellipse containing exactly {p}. | ||||
|
| |||
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. | ||||
|
| |||
sets ellipse to the smallest ellipse through p,q,r. The algorithm guarantees that set is never called with three collinear points. | ||||
|
| |||
sets ellipse to the smallest ellipse through p,q,r,s. The algorithm guarantees that this ellipse exists. | ||||
|
| |||
sets ellipse to the unique conic through p,q,r,s,t. The algorithm guarantees that this conic is an ellipse. |
|
| |
returns true, iff p lies properly outside of ellipse. |
Each of the following predicates is only needed, if the corresponding predicate of Min_ellipse_2 is used.
|
| |
returns ON_BOUNDED_SIDE, ON_BOUNDARY, or ON_UNBOUNDED_SIDE iff p lies properly inside, on the boundary, or properly outside of ellipse, resp. | ||
|
| |
returns true, iff p lies properly inside ellipse. | ||
|
| |
returns true, iff p lies on the boundary of ellipse. | ||
|
| |
returns true, iff ellipse is empty (this implies degeneracy). | ||
|
| |
returns true, iff ellipse is degenerate, i.e. if ellipse is empty or equal to a single point. |
The following I/O operators are only needed, if the corresponding I/O operators of Min_ellipse_2 are used.
|
| |
writes ellipse to output stream os. | ||
|
| |
writes ellipse to window stream ws. |