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

Requirements of Traits Classes for Smallest Enclosing Sphere

The class template Min_sphere_d is parameterized with a Traits class which defines the interface between the optimisation algorithm and the point class used to represent the input points. The following requirements catalog lists the types, member functions etc., that must be defined for a class that can be used to parameterize Min_sphere_d. Traits class implementations with points of the types Point_2<R>, Point_3<R> and Point_d<R> are available and described in Section reference.

Traits Class (Traits)

Definition

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

Types

Traits::Rep_tag
A compile time tag to distinguish between cartesian and homogeneous representation. Rep_tag is either Cartesian_tag or Homogeneous_tag.


Traits::NT
A type fulfilling the requirements of a CGAL number type.


Traits::Point
The point type must provide default and copy constructor and an assignment operator.


Traits::DA
The data accessor type defines the access to coordinates of the points. The requirements are listed in the next section below.

In addition, if I/O is used, the corresponding I/O operators for Point have to be provided.

Variables

Traits::DA da; A data accessor object.

Creation

Only default and copy constructor are required.

Traits traits;
A default constructor.


Traits traits ( Traits);
A copy constructor.

Read/Write Data Accessor (DA)

This type defines the coordinate access to points of the type Traits::Point, with respect to the representation Traits::Rep_tag (homogeneous or cartesian).

Types

DA::InputIterator
This class must satisfy the requirements of an STL input iterator. Its value type is NT.

Creation

DA da;
Default constructor.

DA da ( DA);
Copy constructor.

Operations

int da.get_dimension ( Point p)
returns the dimension of p.

InputIterator da.get_begin ( Point p)
returns an iterator pointing to the first coordinate of p.

In case of a cartesian representation, the coordinate range consists of get_dimension(p) numbers. For homogeneous representations, we have get_dimension(p)+1 numbers, the last of which is assumed to be the homogenizing coordinate.

void da.set ( Point& p, NT *first, NT *last)
copies the range [first, last) into p. The caller of this function guarantees that the range contains d elements in the cartesian and d+1 elements in the homogeneous case, where d is the ambient dimension of the CGAL_Min_sphere_d<Traits> object. set is never called if the sphere is empty.


Next: Function Declaration of minimum_enclosing_rectangle_2
Navigation: Up, Table of Contents, Bibliography, Index, Title Page
The GALIA project. Jan 18, 2000.