![]() |
Rosetta
2019.07
|
#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< typename >::Real |
typedef platform::Size numeric::VoxelGrid< typename >::Size |
typedef T numeric::VoxelGrid< typename >::t_DataType |
typedef std::pair< T const *, T const * > numeric::VoxelGrid< typename >::t_DataTypeCOPtrPair |
typedef std::pair< T const *, Vector const * > numeric::VoxelGrid< typename >::t_DataTypeVectorCOPtrPair |
typedef xyzVector<Real> numeric::VoxelGrid< typename >::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.
|
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 | ( | ) | const |
Get the bounding box of this grid.
Referenced by numeric::VoxelGrid< typename >::GetNeighbors1D(), and numeric::VoxelGrid< typename >::GetNeighborsMultiDimensional().
Size numeric::VoxelGrid< T >::GetDimension | ( | ) | const |
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 | ( | ) | const |
Get the items of this grid.
Referenced by numeric::VoxelGrid< typename >::GetNeighbors1D(), and numeric::VoxelGrid< typename >::GetNeighborsMultiDimensional().
|
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 numeric::xyzVector< typename >::x(), numeric::xyzVector< typename >::y(), and numeric::xyzVector< typename >::z().
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 |
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 |
|
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< typename >::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< typename >::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< typename >::distance_squared(), numeric::VoxelGrid< typename >::GetBoundingBox(), numeric::VoxelGrid< typename >::GetGridItems(), numeric::geometry::BoundingBox< typename >::lower(), make_symmdef_file_denovo::pos, runtime_assert_msg, and numeric::geometry::BoundingBox< typename >::upper().
utility::vector1< std::pair< std::pair< T const *, T const * >, Real > > numeric::VoxelGrid< T >::GetNeighborsIn | ( | VoxelGrid< typename > 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 |
|
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< typename >::distance_squared(), make_symmdef_file_denovo::pos, runtime_assert_msg, and numeric::crick_equations::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< typename >::distance_squared(), basic::options::OptionKeys::cutoutdomain::end, make_symmdef_file_denovo::pos, runtime_assert_msg, and numeric::crick_equations::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< typename >::distance_squared(), basic::options::OptionKeys::cutoutdomain::end, numeric::VoxelGrid< typename >::GetBoundingBox(), numeric::VoxelGrid< typename >::GetGridItems(), numeric::geometry::BoundingBox< typename >::lower(), make_symmdef_file_denovo::pos, runtime_assert_msg, numeric::geometry::BoundingBox< typename >::upper(), and numeric::crick_equations::z().
Size numeric::VoxelGrid< T >::GetNumberItems | ( | ) | const |
Get the number of items in the voxel grid.
Real numeric::VoxelGrid< T >::GetResolution | ( | ) | const |
Get the requested resolution by the user.
|
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< typename >::x(), numeric::xyzVector< typename >::y(), and numeric::xyzVector< typename >::z().
|
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< typename >::x(), numeric::xyzVector< typename >::y(), and numeric::xyzVector< typename >::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 |
|
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< typename >::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< typename >::distance_squared(), basic::options::OptionKeys::cutoutdomain::end, make_symmdef_file_denovo::pos, runtime_assert_msg, and numeric::crick_equations::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 |
References ObjexxFCL::index().
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 |
|
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 ObjexxFCL::index(), and make_symmdef_file_denovo::pos.
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 |
void numeric::VoxelGrid< T >::SetObjects | ( | utility::vector1< t_DataType const * > const & | new_data, |
bool | check_relevance = false |
||
) |
Update the VoxelGrid with new data.
new_data | Vector of the new data |
check_relevance | check if objects are relevant for neighbor calculation and only insert those |
References ObjexxFCL::index(), max(), and min().
|
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 erraser_analysis::diff, max(), min(), make_symmdef_file_denovo::pos, runtime_assert_msg, erraser_single_res_analysis::score, numeric::crick_equations::x(), numeric::xyzVector< typename >::x(), numeric::crick_equations::y(), numeric::xyzVector< typename >::y(), numeric::crick_equations::z(), and numeric::xyzVector< typename >::z().
void numeric::VoxelGrid< T >::Translate | ( | Vector const & | translation | ) |
Translate the grid.
translation | amount to translate by |
References basic::options::OptionKeys::rigid::translation, numeric::xyzVector< typename >::x(), numeric::xyzVector< typename >::y(), and numeric::xyzVector< typename >::z().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |