CGAL 6.1.1 - Quadtrees, Octrees, and Orthtrees

Loading...
Searching...
No Matches
List of all members
CGAL::Orthtree_traits_base< GeomTraits, dim > Struct Template Reference
Reference Manual » Traits

`#include <CGAL/Orthtree_traits_base.h>`

Inherited by CGAL::Orthtree_traits_point< GeomTraits, PointRange, PointMap, hypercubic_nodes, dimension >, and CGAL::Orthtree_traits_polygons< GeomTraits >.

## Definition

template<typename GeomTraits, int dim>
struct CGAL::Orthtree_traits_base< GeomTraits, dim >

The class `Orthtree_traits_base` is a base class providing common choices for types and functors.

The base class is extended by `CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, dimension>` and by `CGAL::Orthtree_traits_face_graph<PolygonMesh, VertexPointMap>`.

Template Parameters

  GeomTraits | a model of `Kernel`.
  dim | dimension of the ambient Euclidean space.

See also
  `CGAL::Orthtree_traits_point<GeomTraits, PointRange, PointMap, dim>`
  `CGAL::Orthtree_traits_face_graph<PolygonMesh, VertexPointMap>`

## Types
using | Node_index = std::size_t
using | Kernel = GeomTraits
using | FT = typename GeomTraits::FT
using | Point_d = typename GeomTraits::Point_d
using | Bbox_d = typename GeomTraits::Iso_box_d
using | Sphere_d = typename GeomTraits::Sphere_d
using | Cartesian_const_iterator_d = typename GeomTraits::Cartesian_const_iterator_d
using | Adjacency = int
| Adjacency type.
static constexpr int | dimension = dim

## Member Typedef Documentation

## ◆ Adjacency

template<typename GeomTraits , int dim>

using CGAL::Orthtree_traits_base< GeomTraits, dim >::Adjacency = int

Adjacency type.

Note
  This type is used to identify adjacency directions with easily understandable keywords (left, right, up, down, ...) and is thus mainly useful in 2D and 3D. In higher dimensions, such keywords do not exist and this type is simply an integer. Conversions from this integer to bitsets still work but do not provide any user-friendly API for adjacency selection.

Two directions along each axis in Cartesian space, relative to a node.

Directions are mapped to numbers as 3-bit integers in the 3D case or as 2-bit integers in the 2D case. In the 3d case the numbers 6 and 7 are not used because there are only 6 different directions.

The first two bits indicate the axis (00 = x, 01 = y, 10 = z), the third bit indicates the direction along that axis (0 = -, 1 = +).

The following diagram and table showing the 3D case may be a useful reference (2D case is identical with one dimension less):

           3 *
             |  * 4
             | /                  y+
             |/                   *
    0 *------+------* 1           |
            /|                    |
           / |                    +-----* x+
        5 *  |                   /
             * 2                /
                               * z+

This lookup table may also be helpful:

Direction | bitset | number | Enum
--- | --- | --- | ---
`-x` | 000 | 0 | LEFT
`+x` | 001 | 1 | RIGHT
`-y` | 010 | 2 | DOWN
`+y` | 011 | 3 | UP
`-z` | 100 | 4 | BACK
`+z` | 101 | 5 | FRONT