|
Rosetta 3.5
|
#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 |
Definition at line 52 of file BumpGrid.hh.
| typedef numeric::geometry::hashing::Bin3D protocols::match::Bool3DGrid::Bin3D |
Definition at line 58 of file BumpGrid.hh.
| typedef numeric::geometry::BoundingBox< core::Vector > protocols::match::Bool3DGrid::BoundingBox |
Definition at line 57 of file BumpGrid.hh.
| typedef utility::fixedsizearray1< Vector, 8 > protocols::match::Bool3DGrid::CornerPoints |
Definition at line 59 of file BumpGrid.hh.
| typedef std::pair< Bool3DGrid::Size, unsigned char > protocols::match::Bool3DGrid::index_mask_pair |
Definition at line 60 of file BumpGrid.hh.
Definition at line 55 of file BumpGrid.hh.
Definition at line 56 of file BumpGrid.hh.
| protocols::match::Bool3DGrid::Bool3DGrid | ( | ) |
Creation and initialization.
Definition at line 36 of file BumpGrid.cc.
|
virtual |
Definition at line 47 of file BumpGrid.cc.
|
inline |
Definition at line 97 of file BumpGrid.hh.
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.
Definition at line 575 of file BumpGrid.cc.
References bb_, bin_width_, grid_, and index_and_mask_for_bin().
| Bool3DGrid::Vector protocols::match::Bool3DGrid::bin_center | ( | Bin3D const & | bin) | const |
Definition at line 428 of file BumpGrid.cc.
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.
Definition at line 415 of file BumpGrid.cc.
References bb_, and bin_width_.
|
private |
Definition at line 779 of file BumpGrid.cc.
References bb_, bin_width_, and dimsizes_.
Referenced by or_by_box_liberal().
|
inline |
Definition at line 83 of file BumpGrid.hh.
References bin_width_.
Referenced by protocols::match::Bool3DGridKinemageWriter::write_grid_to_kinemage().
|
private |
Definition at line 902 of file BumpGrid.cc.
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 | ( | ) |
| Bool3DGrid::CornerPoints protocols::match::Bool3DGrid::corners | ( | Bin3D const & | bin) | const |
Definition at line 372 of file BumpGrid.cc.
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
Definition at line 89 of file BumpGrid.cc.
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.
Definition at line 61 of file BumpGrid.cc.
References bb_, bin_width_, bin_width_2x_, set_bin_width(), and set_bounding_box().
| Bool3DGrid::Bin3D protocols::match::Bool3DGrid::dimsizes | ( | ) | const |
Accessors.
Definition at line 367 of file BumpGrid.cc.
References dimsizes_.
Referenced by protocols::match::Bool3DGridKinemageWriter::write_grid_to_kinemage().
|
private |
Definition at line 756 of file BumpGrid.cc.
References byte_index_from_doublebin(), and mask_from_offsets().
Referenced by and_with(), occupied(), or_with(), and subtract().
|
private |
Definition at line 732 of file BumpGrid.cc.
References bb_, bin_width_, bin_width_2x_, byte_index_from_doublebin(), and mask_from_offsets().
Referenced by occupied().
|
private |
Definition at line 857 of file BumpGrid.cc.
Referenced by index_and_mask_for_bin(), index_and_mask_for_point(), and set_value_for_bin().
|
private |
Definition at line 879 of file BumpGrid.cc.
Referenced by set_value_for_bin().
Definition at line 436 of file BumpGrid.cc.
References bb_extended_, grid_, and index_and_mask_for_point().
Referenced by protocols::match::Bool3DGridKinemageWriter::write_grid_to_kinemage().
Definition at line 445 of file BumpGrid.cc.
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.
Definition at line 342 of file BumpGrid.cc.
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.
Definition at line 115 of file BumpGrid.cc.
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.
Definition at line 184 of file BumpGrid.cc.
References bb_extended_, bin_center(), bin_width_, 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.
Definition at line 306 of file BumpGrid.cc.
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.
Definition at line 503 of file BumpGrid.cc.
References bb_, bin_width_, grid_, and index_and_mask_for_bin().
|
private |
Definition at line 794 of file BumpGrid.cc.
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) |
Definition at line 55 of file BumpGrid.cc.
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) |
Definition at line 50 of file BumpGrid.cc.
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.
Definition at line 458 of file BumpGrid.cc.
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.
Definition at line 648 of file BumpGrid.cc.
References bb_, bin_width_, grid_, and index_and_mask_for_bin().
|
private |
Definition at line 176 of file BumpGrid.hh.
Referenced by and_with(), bin_extrema(), bin_for_point(), corners(), create_grid_for_bb(), create_grid_for_sphere(), index_and_mask_for_point(), or_by_box_liberal(), or_with(), reset_grid(), set_bounding_box(), and subtract().
|
private |
Definition at line 177 of file BumpGrid.hh.
Referenced by actual_bb(), bin_center(), occupied(), or_by_sphere_conservative(), or_by_sphere_liberal(), and reset_grid().
|
private |
Definition at line 179 of file BumpGrid.hh.
Referenced by and_with(), bin_center(), bin_extrema(), bin_for_point(), bin_width(), corners(), create_grid_for_bb(), create_grid_for_sphere(), index_and_mask_for_point(), or_by_sphere_conservative(), or_by_sphere_liberal(), or_with(), reset_grid(), set_bin_width(), and subtract().
|
private |
Definition at line 180 of file BumpGrid.hh.
Referenced by create_grid_for_sphere(), index_and_mask_for_point(), and reset_grid().
|
private |
Definition at line 183 of file BumpGrid.hh.
Referenced by reset_grid().
|
private |
Definition at line 182 of file BumpGrid.hh.
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
Definition at line 199 of file BumpGrid.hh.
Referenced by and_with(), clear(), occupied(), or_with(), reset_grid(), set_value_for_bin(), and subtract().
|
private |
Definition at line 181 of file BumpGrid.hh.
Referenced by or_by_sphere_conservative(), or_by_sphere_liberal(), and reset_grid().
|
private |
Definition at line 186 of file BumpGrid.hh.
Referenced by reset_grid().
|
private |
Definition at line 185 of file BumpGrid.hh.
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.
Definition at line 195 of file BumpGrid.hh.
Referenced by byte_index_from_doublebin(), and reset_grid().
|
private |
Definition at line 189 of file BumpGrid.hh.
Referenced by byte_index_from_doublebin(), and reset_grid().
|
private |
Definition at line 188 of file BumpGrid.hh.
Referenced by reset_grid().
1.8.4