CGAL::Ambient_dimension<T, K = Kernel_traits<T>::Kernel>

Definition

The class Ambient_dimension<T, K = Kernel_traits<T>::Kernel> allows to retrieve the dimension of the ambient space of a type.

#include <CGAL/Dimension.h>

Constants

static const int value; The dimension value as a compile-time integral constant. It is implemented as K::Dimension<T>::type::value. It exists only when the dimension is a compile-time constant.

Types

Ambient_dimension<T, K = Kernel_traits<T>::Kernel>::type
Either Dimension_tag<dim> if the dimension is a compile-time constant of value dim, or Dynamic_dimension_tag otherwise. It is implemented as K::Ambient_dimension<T>::type.

Example

The following retrieves the dimension of a point type.

  typedef K::Point_2 Point;
  int dimension = Ambient_dimension<Point, K>::value;
  assert(dimension == 2);

See Also

CGAL::Dimension_tag<int dim>
CGAL::Dynamic_dimension_tag
CGAL::Feature_dimension<T, K = Kernel_traits<T>::Kernel>