Rosetta
2016.11
|
#include <BumpGrid.hh>
Public Types | |
typedef core::Real | Real |
typedef core::Vector | Vector |
typedef numeric::geometry::BoundingBox < core::Vector > | BoundingBox |
typedef numeric::geometry::hashing::Bin3D | Bin3D |
typedef utility::fixedsizearray1 < Vector, 8 > | CornerPoints |
typedef std::pair < Bool3DGrid::Size, unsigned char > | index_mask_pair |
Public Member Functions | |
Bool3DGrid () | |
Creation and initialization. More... | |
virtual | ~Bool3DGrid () |
void | set_bounding_box (BoundingBox const &bb) |
void | set_bin_width (Real width) |
Bool3DGrid | create_grid_for_sphere (Vector const ¢er, Real radius) const |
create a grid for the input sphere that aligns to this grid, such that it is large enough to hold a particular sphere. More... | |
Bool3DGrid | create_grid_for_bb (BoundingBox const &bb) |
create a grid for the input bounding box that aligns to this grid More... | |
Bin3D | dimsizes () const |
Accessors. More... | |
Real | bin_width () const |
CornerPoints | corners (Bin3D const &bin) const |
BoundingBox | bin_extrema (Bin3D const &bin) const |
bounding box points for a bin. More... | |
Vector | bin_center (Bin3D const &bin) const |
bool | occupied (Vector const &) const |
bool | occupied (Bin3D const &bin) const |
BoundingBox | actual_bb () const |
void | set_value_for_bin (Bin3D const &bin, bool setting) |
set the boolean value for a particular bin. The bin dimensions are indexed from 0 to nbins-1. More... | |
void | or_by_sphere_conservative (Vector const ¢er, Real radius) |
Set the value to true for any voxel that is wholy contained by the given sphere. A voxel is wholy contained iff all 8 corners of the voxel are within the sphere. More... | |
void | or_by_sphere_liberal (Vector const ¢er, Real radius) |
Set the value to true for any voxel that is partially contained by a given sphere. A voxel is partially contained iff any of the 8 corners of the voxel are within the sphere. More... | |
void | or_by_spheres_conservative (utility::vector1< std::pair< Vector, Real > > const &spheres) |
Consider a voxel filled if each of its corners are covered, even if they are covered by seperate spheres. Dangerous, in that some voxels will be counted as being fully occupied when they are only partially occupied. More... | |
void | or_by_box_liberal (BoundingBox const &bb) |
Turn the values of all the bins that overlap with the volume in this bounding box to true. More... | |
void | or_with (Bool3DGrid const &other) |
Performs a boolean OR on the voxels shared by the two grids, and ignores all voxels that are not shared by the two grids. These grids must be "compatible", in that the lower corner of other must lie on a grid point of this. More... | |
void | and_with (Bool3DGrid const &other) |
Performs a boolean AND on the voxels shared by the two grids, and ignores all voxels that are not shared by the two grids. These grids must be "compatible", in that the lower corner of other must lie on a grid point of this. More... | |
void | subtract (Bool3DGrid const &other) |
Sets any voxel on this grid to "false" which is true on the other grid. but does not set any voxel to "true" on this grid – even if the other voxel is "false". More... | |
void | clear () |
Set all values in all bins to false. More... | |
Private Member Functions | |
index_mask_pair | index_and_mask_for_point (Vector const &point) const |
index_mask_pair | index_and_mask_for_bin (Bin3D const &bin) const |
Bin3D | bin_for_point (Vector const &point) const |
void | reset_grid () |
unsigned char | mask_from_offsets (Size xmod2, Size ymod2, Size zmod2) const |
unsigned char | negmask_from_offsets (Size xmod2, Size ymod2, Size zmod2) const |
Size | byte_index_from_doublebin (Bin3D const &halfbin) const |
Private Attributes | |
BoundingBox | bb_ |
BoundingBox | bb_extended_ |
Real | bin_width_ |
Real | bin_width_2x_ |
Real | half_bin_width_root_three_ |
Bin3D | dimsizes_ |
Bin3D | dimprods_ |
Bin3D | halfdimsizes_ |
Bin3D | halfdimprods_ |
Bin3D | supervoxel_dimsizes_ |
Bin3D | supervoxel_dimprods_ |
utility::vector0< unsigned char > | grid_ |
Static Private Attributes | |
static const Size | n_doublebins_per_supervoxel = 4 |
typedef numeric::geometry::hashing::Bin3D protocols::match::Bool3DGrid::Bin3D |
typedef numeric::geometry::BoundingBox< core::Vector > protocols::match::Bool3DGrid::BoundingBox |
typedef utility::fixedsizearray1< Vector, 8 > protocols::match::Bool3DGrid::CornerPoints |
typedef std::pair< Bool3DGrid::Size, unsigned char > protocols::match::Bool3DGrid::index_mask_pair |
protocols::match::Bool3DGrid::Bool3DGrid | ( | ) |
Creation and initialization.
|
virtual |
|
inline |
References bb_extended_.
void protocols::match::Bool3DGrid::and_with | ( | Bool3DGrid const & | other | ) |
Performs a boolean AND on the voxels shared by the two grids, and ignores all voxels that are not shared by the two grids. These grids must be "compatible", in that the lower corner of other must lie on a grid point of this.
References bb_, bin_width_, grid_, and index_and_mask_for_bin().
Bool3DGrid::Vector protocols::match::Bool3DGrid::bin_center | ( | Bin3D const & | bin | ) | const |
References bb_extended_, and bin_width_.
Referenced by or_by_sphere_conservative(), and or_by_sphere_liberal().
Bool3DGrid::BoundingBox protocols::match::Bool3DGrid::bin_extrema | ( | Bin3D const & | bin | ) | const |
bounding box points for a bin.
References bb_, and bin_width_.
|
private |
References bb_, bin_width_, and dimsizes_.
Referenced by or_by_box_liberal().
|
inline |
References bin_width_.
Referenced by protocols::match::Bool3DGridKinemageWriter::write_grid_to_kinemage().
|
private |
References halfdimsizes_, n_doublebins_per_supervoxel, and supervoxel_dimprods_.
Referenced by index_and_mask_for_bin(), index_and_mask_for_point(), and set_value_for_bin().
void protocols::match::Bool3DGrid::clear | ( | ) |
Set all values in all bins to false.
References grid_.
Bool3DGrid::CornerPoints protocols::match::Bool3DGrid::corners | ( | Bin3D const & | bin | ) | const |
References bb_, and bin_width_.
Referenced by or_by_sphere_conservative(), or_by_sphere_liberal(), or_by_spheres_conservative(), and protocols::match::Bool3DGridKinemageWriter::write_grid_to_kinemage().
Bool3DGrid protocols::match::Bool3DGrid::create_grid_for_bb | ( | BoundingBox const & | bb | ) |
create a grid for the input bounding box that aligns to this grid
References bb_, bin_width_, set_bin_width(), and set_bounding_box().
Bool3DGrid protocols::match::Bool3DGrid::create_grid_for_sphere | ( | Vector const & | center, |
Real | radius | ||
) | const |
create a grid for the input sphere that aligns to this grid, such that it is large enough to hold a particular sphere.
References bb_, bin_width_, bin_width_2x_, set_bin_width(), and set_bounding_box().
Bool3DGrid::Bin3D protocols::match::Bool3DGrid::dimsizes | ( | ) | const |
Accessors.
References dimsizes_.
Referenced by protocols::match::Bool3DGridKinemageWriter::write_grid_to_kinemage().
|
private |
References byte_index_from_doublebin(), and mask_from_offsets().
Referenced by and_with(), occupied(), or_with(), and subtract().
|
private |
References bb_, bin_width_, bin_width_2x_, byte_index_from_doublebin(), and mask_from_offsets().
Referenced by occupied().
|
private |
Referenced by index_and_mask_for_bin(), index_and_mask_for_point(), and set_value_for_bin().
|
private |
Referenced by set_value_for_bin().
References bb_extended_, grid_, and index_and_mask_for_point().
Referenced by protocols::match::Bool3DGridKinemageWriter::write_grid_to_kinemage().
References dimsizes_, grid_, and index_and_mask_for_bin().
void protocols::match::Bool3DGrid::or_by_box_liberal | ( | BoundingBox const & | bb | ) |
Turn the values of all the bins that overlap with the volume in this bounding box to true.
References bb_, bin_for_point(), and set_value_for_bin().
Set the value to true for any voxel that is wholy contained by the given sphere. A voxel is wholy contained iff all 8 corners of the voxel are within the sphere.
Sets the value of a voxel to true if all eight corners of the voxel are contained by the sphere.
References bb_extended_, bin_center(), bin_width_, corners(), dimsizes_, half_bin_width_root_three_, and set_value_for_bin().
Set the value to true for any voxel that is partially contained by a given sphere. A voxel is partially contained iff any of the 8 corners of the voxel are within the sphere.
Sets the value of a voxel to true if any volume of a voxel is inside the sphere. Handles edge cases properly where a voxel is glanced by a sphere at a face, but where the corners of the voxel are not contained by the sphere, and when a sphere is entirely contained within a voxel.
References bb_extended_, bin_center(), bin_width_, core::conformation::membrane::center, corners(), dimsizes_, half_bin_width_root_three_, and set_value_for_bin().
void protocols::match::Bool3DGrid::or_by_spheres_conservative | ( | utility::vector1< std::pair< Vector, Real > > const & | spheres | ) |
Consider a voxel filled if each of its corners are covered, even if they are covered by seperate spheres. Dangerous, in that some voxels will be counted as being fully occupied when they are only partially occupied.
The sphere list should describe spheres by the centers and by their square radii, not by their radii.
References corners(), dimsizes_, and set_value_for_bin().
void protocols::match::Bool3DGrid::or_with | ( | Bool3DGrid const & | other | ) |
Performs a boolean OR on the voxels shared by the two grids, and ignores all voxels that are not shared by the two grids. These grids must be "compatible", in that the lower corner of other must lie on a grid point of this.
References bb_, bin_width_, grid_, and index_and_mask_for_bin().
|
private |
References bb_, bb_extended_, bin_width_, bin_width_2x_, dimprods_, dimsizes_, grid_, half_bin_width_root_three_, halfdimprods_, halfdimsizes_, n_doublebins_per_supervoxel, supervoxel_dimprods_, and supervoxel_dimsizes_.
Referenced by set_bin_width(), and set_bounding_box().
void protocols::match::Bool3DGrid::set_bin_width | ( | Real | width | ) |
References bin_width_, and reset_grid().
Referenced by create_grid_for_bb(), and create_grid_for_sphere().
void protocols::match::Bool3DGrid::set_bounding_box | ( | BoundingBox const & | bb | ) |
References bb_, and reset_grid().
Referenced by create_grid_for_bb(), and create_grid_for_sphere().
set the boolean value for a particular bin. The bin dimensions are indexed from 0 to nbins-1.
References byte_index_from_doublebin(), grid_, mask_from_offsets(), and negmask_from_offsets().
Referenced by or_by_box_liberal(), or_by_sphere_conservative(), or_by_sphere_liberal(), and or_by_spheres_conservative().
void protocols::match::Bool3DGrid::subtract | ( | Bool3DGrid const & | other | ) |
Sets any voxel on this grid to "false" which is true on the other grid. but does not set any voxel to "true" on this grid – even if the other voxel is "false".
Set all the values in this grid to "false" that are true in the other grid.
References bb_, bin_width_, grid_, and index_and_mask_for_bin().
|
private |
|
private |
Referenced by actual_bb(), bin_center(), occupied(), or_by_sphere_conservative(), or_by_sphere_liberal(), and reset_grid().
|
private |
|
private |
Referenced by create_grid_for_sphere(), index_and_mask_for_point(), and reset_grid().
|
private |
Referenced by reset_grid().
|
private |
Referenced by bin_for_point(), dimsizes(), occupied(), or_by_sphere_conservative(), or_by_sphere_liberal(), or_by_spheres_conservative(), and reset_grid().
|
private |
Each byte represents the boolean "covered" status for 8 voxels in a double-voxel. The double voxel
Referenced by and_with(), clear(), occupied(), or_with(), reset_grid(), set_value_for_bin(), and subtract().
|
private |
Referenced by or_by_sphere_conservative(), or_by_sphere_liberal(), and reset_grid().
|
private |
Referenced by reset_grid().
|
private |
Referenced by byte_index_from_doublebin(), and reset_grid().
|
staticprivate |
creates super voxels of size 8x8x8 = 512 bits -> 64 bytes = cache line size on Core2 Duo, though this size should not have a very large effect for caches of larger or smaller size. The main point of the super voxel is to allow data locality as it's very often the same region of space that's being queried repeatedly during rotamer building.
Referenced by byte_index_from_doublebin(), and reset_grid().
|
private |
Referenced by byte_index_from_doublebin(), and reset_grid().
|
private |
Referenced by reset_grid().