Rosetta
|
#include <VoxelGrid.hh>
Public Types | |
typedef T | t_DataType |
typedef platform::Size | Size |
typedef platform::Real | Real |
typedef xyzVector< Real > | Vector |
typedef std::pair< T const *, T const * > | t_DataTypeCOPtrPair |
typedef std::pair< T const *, Vector const * > | t_DataTypeVectorCOPtrPair |
Public Member Functions | |
VoxelGrid (Real const &resolution=4.0, bool const &cache_edges=false) | |
default constructor More... | |
virtual | ~VoxelGrid () |
destructor More... | |
virtual Vector const * | ExtractPosition (t_DataType const &input) const =0 |
extract the 3D coordinates of a given t_DataType input. TO BE IMPLEMENTED BY DERIVED CLASSES. More... | |
virtual bool | IsSameItem (t_DataType const &item1, t_DataType const &item2) const =0 |
check if two grid items are the same. TO BE IMPLEMENTED BY DERIVED CLASSES. More... | |
virtual bool | IsRelevantItem (t_DataType const &item) const =0 |
is item relevant to consider as neighbor. TO BE IMPLEMENTED BY DERIVED CLASSES. More... | |
Size | GetNumberItems () const |
Get the number of items in the voxel grid. More... | |
Size | GetDimension () const |
Get the actual internally used dimension of the voxel grid. More... | |
Real | GetResolution () const |
Get the requested resolution by the user. More... | |
geometry::BoundingBox< Vector > const & | GetBoundingBox () const |
Get the bounding box of this grid. More... | |
utility::vector1< utility::vector1< t_DataTypeVectorCOPtrPair > > const & | GetGridItems () const |
Get the items of this grid. More... | |
utility::vector1< std::pair< t_DataType const *, Real > > | GetNeighbors (t_DataType const &input, Real const &neighborhood, bool check_relevance=false) const |
Find neighbors within a specified distance of a given DATA. More... | |
bool | HasNeighbors (t_DataType const &input, Real const &neighborhood, bool check_relevance=false) const |
Has given DATA a neighbor in the grid within a specified distance. More... | |
utility::vector1< std::pair< t_DataTypeCOPtrPair, Real > > | GetNeighborsIn (VoxelGrid const &grid, Real const &neighborhood, bool check_relevance=false) const |
Find all neighbor pairs within a specified distance. More... | |
utility::vector1< std::pair< t_DataTypeCOPtrPair, Real > > | GetNeighbors (Real const &neighborhood, bool check_relevance=false) const |
Find all neighbor pairs within a specified distance. More... | |
void | SetObjects (utility::vector1< t_DataType const * > const &new_data, bool check_relevance=false) |
Update the VoxelGrid with new data. More... | |
void | InsertObject (t_DataType const &new_item, bool check_relevance=false) |
insert a new t_DataType object into the manager More... | |
void | InsertObjects (utility::vector1< t_DataType const * > const &new_items, bool check_relevance=false) |
inserts multiple t_DataType objects into the manager More... | |
void | RemoveObject (t_DataType const &item_to_remove) |
remove a t_DataType object from the manager More... | |
void | RemoveObjects (utility::vector1< t_DataType const * > const &items_to_remove) |
remove multiple t_DataType objects from the manager More... | |
void | Clear () |
Remove all objects from the voxel grid while keeping the grid itself intact. More... | |
void | Translate (Vector const &translation) |
Translate the grid. More... | |
Private Types | |
enum | BorderFlag { e_None = 0 , e_XMin = 1 , e_XMax = 2 , e_YMin = 4 , e_YMax = 8 , e_ZMin = 16 , e_ZMax = 32 } |
Private Member Functions | |
Size | GetIndex (Real const &X, Real const &Y, Real const &Z) const |
Get the position for the given coordinate vector. Places out-of-bounds vector in the bin closest to where they belong. More... | |
Size | GetIndex (Vector const &pos) const |
Get the position for the given coordinate vector. Places out-of-bounds vector in the bin closest to where they belong. More... | |
void | SetupGrid (Vector const &min_vals, Vector const &max_vals, Size const &expected_n_elements) |
Try to allocate a grid of a given size. If this size would cause the object to definitely exceed the max memory allotment, the grid will be truncated to include only the core. It is assumed that Resolution_ has been setup prior to this. More... | |
Real | GetSqDistanceOutsideBoundingBox (Vector const &point) const |
Compute distance from this point to the nearest edge of the bounding box of all given points, provided the point is outside the box. More... | |
Real | GetSqDistanceOutsideBoundingBox (Vector const &min_box, Vector const &max_box) const |
Compute distance from another grid's bounding box to the nearest edge of this bounding box provided that the MIN and MAX is outside of this bounding box. More... | |
utility::vector1< std::pair< t_DataTypeCOPtrPair, Real > > | GetNeighborsMultiDimensional (Real const &neighborhood, bool check_relevance=false) const |
Find all neighbor pairs of this grid within a specified distance. More... | |
utility::vector1< std::pair< t_DataType const *, Real > > | GetNeighborsMultiDimensional (t_DataType const &obj, Real const &neighborhood, bool check_relevance=false) const |
Find all neighbors of this object within a specified distance. More... | |
utility::vector1< std::pair< t_DataTypeCOPtrPair, Real > > | GetNeighborsMultiDimensional (VoxelGrid< t_DataType > const &grid, Real const &neighborhood, bool check_relevance=false) const |
Find all neighbors between the input and this grid within a specified distance. More... | |
bool | HasNeighborsMultiDimensional (t_DataType const &obj, Real const &neighborhood, bool check_relevance=false) const |
Has given object a neighbor in the grid within a specified distance. More... | |
utility::vector1< std::pair< t_DataTypeCOPtrPair, Real > > | GetNeighbors1D (Real const &neighborhood, bool check_relevance=false) const |
Find all neighbor pairs of this 1D grid within a specified distance. More... | |
utility::vector1< std::pair< t_DataType const *, Real > > | GetNeighbors1D (t_DataType const &obj, Real const &neighborhood, bool check_relevance=false) const |
Find all neighbors of this object within a specified distance. More... | |
utility::vector1< std::pair< t_DataTypeCOPtrPair, Real > > | GetNeighbors1D (VoxelGrid< t_DataType > const &grid, Real const &neighborhood, bool check_relevance=false) const |
Find all neighbors between the input and this grid within a specified distance. More... | |
bool | HasNeighbors1D (t_DataType const &obj, Real const &neighborhood, bool check_relevance=false) const |
Has given object a neighbor in the grid within a specified distance. More... | |
typedef platform::Real numeric::VoxelGrid< T >::Real |
typedef platform::Size numeric::VoxelGrid< T >::Size |
typedef T numeric::VoxelGrid< T >::t_DataType |
typedef std::pair< T const *, T const * > numeric::VoxelGrid< T >::t_DataTypeCOPtrPair |
typedef std::pair< T const *, Vector const * > numeric::VoxelGrid< T >::t_DataTypeVectorCOPtrPair |
typedef xyzVector<Real> numeric::VoxelGrid< T >::Vector |
|
private |
numeric::VoxelGrid< T >::VoxelGrid | ( | Real const & | resolution = 4.0 , |
bool const & | cache_edges = false |
||
) |
default constructor
|
virtual |
destructor
void numeric::VoxelGrid< T >::Clear |
Remove all objects from the voxel grid while keeping the grid itself intact.
References create_a3b_hbs::i.
|
pure virtual |
extract the 3D coordinates of a given t_DataType input. TO BE IMPLEMENTED BY DERIVED CLASSES.
input | reference to object T |
geometry::BoundingBox< xyzVector< Real > > const & numeric::VoxelGrid< T >::GetBoundingBox |
Get the bounding box of this grid.
Size numeric::VoxelGrid< T >::GetDimension |
Get the actual internally used dimension of the voxel grid.
utility::vector1< utility::vector1< std::pair< T const *, xyzVector< Real > const * > > > const & numeric::VoxelGrid< T >::GetGridItems |
Get the items of this grid.
|
private |
Get the position for the given coordinate vector. Places out-of-bounds vector in the bin closest to where they belong.
pos | the position of interest |
References make_symmdef_file_denovo::pos.
utility::vector1< std::pair< std::pair< T const *, T const * >, Real > > numeric::VoxelGrid< T >::GetNeighbors | ( | Real const & | neighborhood, |
bool | check_relevance = false |
||
) | const |
Find all neighbor pairs within a specified distance.
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return neighboring objects which are relevant |
utility::vector1< std::pair< T const *, Real > > numeric::VoxelGrid< T >::GetNeighbors | ( | t_DataType const & | input, |
Real const & | neighborhood, | ||
bool | check_relevance = false |
||
) | const |
Find neighbors within a specified distance of a given DATA.
input | datapoint of interest |
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return neighboring objects which are relevant |
References gaussian-sampling::input.
|
private |
Find all neighbor pairs of this 1D grid within a specified distance.
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return neighboring objects which are relevant |
References numeric::xyzVector< T >::distance_squared(), and runtime_assert_msg.
|
private |
Find all neighbors of this object within a specified distance.
obj | object to look for neighbors |
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return neighboring objects which are relevant |
References numeric::xyzVector< T >::distance_squared(), make_symmdef_file_denovo::pos, and runtime_assert_msg.
|
private |
Find all neighbors between the input and this grid within a specified distance.
grid | input grid in which to look for objects that are neighbors of this grid |
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return neighboring objects which are relevant |
References numeric::xyzVector< T >::distance_squared(), basic::options::OptionKeys::docking::ligand::grid::grid, make_symmdef_file_denovo::pos, and runtime_assert_msg.
utility::vector1< std::pair< std::pair< T const *, T const * >, Real > > numeric::VoxelGrid< T >::GetNeighborsIn | ( | VoxelGrid< T > const & | grid, |
Real const & | neighborhood, | ||
bool | check_relevance = false |
||
) | const |
Find all neighbor pairs within a specified distance.
grid | other grid to search for neighbors with this grid |
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return neighboring objects which are relevant |
References basic::options::OptionKeys::docking::ligand::grid::grid.
|
private |
Find all neighbor pairs of this grid within a specified distance.
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return neighboring objects which are relevant |
References numeric::xyzVector< T >::distance_squared(), kmeans_adaptive_kernel_density_bb_dependent_rotlib::flag, make_symmdef_file_denovo::pos, runtime_assert_msg, and predPRE::z.
|
private |
Find all neighbors of this object within a specified distance.
obj | object to look for neighbors |
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return neighboring objects which are relevant |
References begin, numeric::xyzVector< T >::distance_squared(), end, kmeans_adaptive_kernel_density_bb_dependent_rotlib::flag, make_symmdef_file_denovo::pos, runtime_assert_msg, and predPRE::z.
|
private |
Find all neighbors between the input and this grid within a specified distance.
grid | input grid in which to look for objects that are neighbors of this grid |
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return neighboring objects which are relevant |
References begin, numeric::xyzVector< T >::distance_squared(), end, kmeans_adaptive_kernel_density_bb_dependent_rotlib::flag, basic::options::OptionKeys::docking::ligand::grid::grid, make_symmdef_file_denovo::pos, runtime_assert_msg, and predPRE::z.
Size numeric::VoxelGrid< T >::GetNumberItems |
Get the number of items in the voxel grid.
Real numeric::VoxelGrid< T >::GetResolution |
Get the requested resolution by the user.
|
private |
Compute distance from another grid's bounding box to the nearest edge of this bounding box provided that the MIN and MAX is outside of this bounding box.
min_box | min of the grid of interest |
min_box | max of the grid of interest |
References numeric::xyzVector< T >::x(), numeric::xyzVector< T >::y(), and numeric::xyzVector< T >::z().
|
private |
Compute distance from this point to the nearest edge of the bounding box of all given points, provided the point is outside the box.
point | point of interest |
References numeric::xyzVector< T >::x(), numeric::xyzVector< T >::y(), and numeric::xyzVector< T >::z().
bool numeric::VoxelGrid< T >::HasNeighbors | ( | t_DataType const & | input, |
Real const & | neighborhood, | ||
bool | check_relevance = false |
||
) | const |
Has given DATA a neighbor in the grid within a specified distance.
input | datapoint of interest |
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return true if neighboring objects are relevant |
References gaussian-sampling::input.
|
private |
Has given object a neighbor in the grid within a specified distance.
obj | object to look for neighbors |
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return true if neighboring objects are relevant |
References numeric::xyzVector< T >::distance_squared(), make_symmdef_file_denovo::pos, and runtime_assert_msg.
|
private |
Has given object a neighbor in the grid within a specified distance.
obj | object to look for neighbors |
neighborhood | range in which to search for neighbors; must be <= resolution |
check_relevance | check and only return true if neighboring objects are relevant |
References begin, numeric::xyzVector< T >::distance_squared(), end, kmeans_adaptive_kernel_density_bb_dependent_rotlib::flag, make_symmdef_file_denovo::pos, runtime_assert_msg, and predPRE::z.
void numeric::VoxelGrid< T >::InsertObject | ( | t_DataType const & | new_item, |
bool | check_relevance = false |
||
) |
insert a new t_DataType object into the manager
new_item | reference to item to insert |
check_relevance | check and only insert if object is relevant for neighbor calculation |
void numeric::VoxelGrid< T >::InsertObjects | ( | utility::vector1< t_DataType const * > const & | new_items, |
bool | check_relevance = false |
||
) |
inserts multiple t_DataType objects into the manager
new_items | vector of references to items to insert |
check_relevance | check and only insert if objects are relevant for neighbor calculation |
References create_a3b_hbs::i.
|
pure virtual |
is item relevant to consider as neighbor. TO BE IMPLEMENTED BY DERIVED CLASSES.
item | item to check |
|
pure virtual |
check if two grid items are the same. TO BE IMPLEMENTED BY DERIVED CLASSES.
item1 | first comparison item |
item2 | second comparison item |
void numeric::VoxelGrid< T >::RemoveObject | ( | t_DataType const & | item_to_remove | ) |
remove a t_DataType object from the manager
item_to_remove | reference to the item to remove |
References make_symmdef_file_denovo::pos, and vec().
void numeric::VoxelGrid< T >::RemoveObjects | ( | utility::vector1< t_DataType const * > const & | items_to_remove | ) |
remove multiple t_DataType objects from the manager
items_to_remove | vector of references to items to remove |
References create_a3b_hbs::i.
void numeric::VoxelGrid< T >::SetObjects | ( | utility::vector1< t_DataType const * > const & | new_data, |
bool | check_relevance = false |
||
) |
|
private |
Try to allocate a grid of a given size. If this size would cause the object to definitely exceed the max memory allotment, the grid will be truncated to include only the core. It is assumed that Resolution_ has been setup prior to this.
min_vals | dimension of bounding box |
max_vals | dimension of bounding box |
References create_a3b_hbs::best_score, bin_torsions::bins, erraser_analysis::diff, enumerate_junctions::int, max(), min(), make_symmdef_file_denovo::pos, runtime_assert_msg, create_a3b_hbs::score, x, numeric::xyzVector< T >::x(), predPRE::y, numeric::xyzVector< T >::y(), predPRE::z, and numeric::xyzVector< T >::z().
void numeric::VoxelGrid< T >::Translate | ( | Vector const & | translation | ) |
Translate the grid.
translation | amount to translate by |
References basic::options::OptionKeys::rigid::translation.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |