CGAL 4.7 - STL Extensions for CGAL: CGAL::Spatial_lock_grid_3< Grid_lock_tag > Class Template Reference

\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)

CGAL 4.7 - STL Extensions for CGAL

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
List of all members
CGAL::Spatial_lock_grid_3< Grid_lock_tag > Class Template Reference
STL Extensions for CGAL Reference

`#include <CGAL/Spatial_lock_grid_3.h>`

## Definition

The class `Spatial_lock_grid_3` allows to lock points with coordinates (x, y, z) in a 3D grid.

The point type is called `P3` here. `P3` must provide x(), y() and z() functions, returning the respective point coordinates as numbers whose type is a model of the concept of `CGAL::RealEmbeddable`.

It is a model of `SurjectiveLockDataStructure`, with `T` being `P3` and `S` being the function that maps a point to the cell of the 3D grid containing this point.

For example, it can be used by concurrent algorithms to lock simplices.

Template Parameters

  Grid_lock_tag

  allows to choose the locking strategy used by the structure. The following tags are available:
  - `Tag_non_blocking` is non-blocking (i.e. try_lock will always return immediately) and uses atomics to perform lock operations.
  - `Tag_priority_blocking` provides both non-blocking and partially-blocking `try_lock` versions. The partially-blocking version will block (spin) if the thread owning the lock has a lower "ID" (each thread is given an arbitrary ID) or return immediately otherwise. It uses atomics to perform lock operations.

Is Model Of:
  `SurjectiveLockDataStructure`

## Creation

| Spatial_lock_grid_3 (const Bbox_3 &bbox, int num_grid_cells_per_axis)
| Constructs the lock grid of size `bbox`, with `num_grid_cells_per_axis` cells per axis. More...

## Operations

void | set_bbox (const CGAL::Bbox_3 &bbox)
| Sets the bounding box of the domain.

## Constructor & Destructor Documentation

template<typename Grid_lock_tag >

CGAL::Spatial_lock_grid_3< Grid_lock_tag >::Spatial_lock_grid_3 | ( | const Bbox_3 & | bbox,
|  | int | num_grid_cells_per_axis
| ) |  |

Constructs the lock grid of size `bbox`, with `num_grid_cells_per_axis` cells per axis.