Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
Traits_for_grid< Point_, Iterator_ > Struct Template Reference

#include <grid_of_cubes.h>

Static Public Member Functions

static void init_grid (const Iterator &begin, const Iterator &end, int &xlim, int &ylim, int &zlim, double &rmax, Point &lower_corner)
 
template<class Any_iterator >
static boost::tuple< int, int, int > locate_cube (Any_iterator it, const int &xlim, const int &ylim, const int &zlim, const double &cubel, const Point &lower_corner)
 
template<class Any_iterator >
static bool is_outside_grid (Any_iterator it, const int &xlim, const int &ylim, const int &zlim, const double &cubel, const Point &lower_corner)
 

Detailed Description

template<class Point_, class Iterator_>
struct ESBTL::Traits_for_grid< Point_, Iterator_ >

Traits for using with Grid_of_cubes. Objects are atoms/points, maximum radius is fixed to 3.

Template Parameters
Point_is the underlying point type used.
Iterator_is an iterator over objects to be stored in the grid.

Member Function Documentation

◆ init_grid()

static void init_grid ( const Iterator &  begin,
const Iterator &  end,
int &  xlim,
int &  ylim,
int &  zlim,
double &  rmax,
Point &  lower_corner 
)
inlinestatic

static function indicating how the grid must be initialized (the bounding box)

Parameters
beginfirst iterator over the range of objects to be inserted into the grid.
endpast-end iterator over the range of objects to be inserted into the grid.
xlimis the number of cubes in the x-direction. This value will be defined by that function.
ylimis the number of cubes in the y-direction. This value will be defined by that function.
zlimis the number of cubes in the z-direction. This value will be defined by that function.
rmaxis an upper bound on the radius of the atoms. This value will be defined by that function.
lower_corneris a point indicating the lower corner of the grid. This value will be defined by that function.

◆ is_outside_grid()

static bool is_outside_grid ( Any_iterator  it,
const int &  xlim,
const int &  ylim,
const int &  zlim,
const double &  cubel,
const Point &  lower_corner 
)
inlinestatic

static function indicating if an object can be in conflict with a grid object.

Parameters
itis an iterator over an object.
xlimis the number of cubes in the x-direction.
ylimis the number of cubes in the y-direction.
zlimis the number of cubes in the z-direction.
cubelis the edge length of a cube in the grid.
lower_corneris a point indicating the lower corner of the grid.
Returns
a tuple giving the cube position of the object in the grid.

◆ locate_cube()

static boost::tuple<int,int,int> locate_cube ( Any_iterator  it,
const int &  xlim,
const int &  ylim,
const int &  zlim,
const double &  cubel,
const Point &  lower_corner 
)
inlinestatic

static function computing the position of an object inside the grid.

Template Parameters
Any_iteratoris an iterator type over object to be stored in the grid.
Parameters
itis an iterator over an object.
xlimis the number of cubes in the x-direction.
ylimis the number of cubes in the y-direction.
zlimis the number of cubes in the z-direction.
cubelis the edge length of a cube in the grid.
lower_corneris a point indicating the lower corner of the grid.
Returns
a tuple giving the cube position of the object in the grid.