Gemmi C++ API
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
gemmi::NeighborSearch Struct Reference

#include <neighbor.hpp>

Classes

struct  Mark
 

Public Member Functions

 NeighborSearch ()=default
 
 NeighborSearch (Model &model_, const UnitCell &cell, double radius)
 
 NeighborSearch (SmallStructure &small_st, double radius)
 
NeighborSearchpopulate (bool include_h_=true)
 
void add_chain (const Chain &chain, bool include_h_=true)
 
void add_chain_n (const Chain &chain, int n_ch)
 
void add_atom (const Atom &atom, int n_ch, int n_res, int n_atom)
 
void add_site (const SmallStructure::Site &site, int n)
 
std::vector< Mark > & get_subcell (const Fractional &fr)
 
template<typename Func >
void for_each_cell (const Position &pos, const Func &func, int k=1)
 
template<typename Func >
void for_each (const Position &pos, char alt, double radius, const Func &func, int k=1)
 
int sufficient_k (double r) const
 
std::vector< Mark * > find_atoms (const Position &pos, char alt, double min_dist, double radius)
 
std::vector< Mark * > find_neighbors (const Atom &atom, double min_dist, double max_dist)
 
std::vector< Mark * > find_site_neighbors (const SmallStructure::Site &site, double min_dist, double max_dist)
 
std::pair< Mark *, doublefind_nearest_atom_within_k (const Position &pos, int k, double radius)
 
Markfind_nearest_atom (const Position &pos, double radius=INFINITY)
 
double dist_sq (const Position &pos1, const Position &pos2) const
 
double dist (const Position &pos1, const Position &pos2) const
 
FTransform get_image_transformation (int image_idx) const
 

Public Attributes

Grid< std::vector< Mark > > grid
 
double radius_specified = 0.
 
Modelmodel = nullptr
 
SmallStructuresmall_structure = nullptr
 
bool use_pbc = true
 
bool include_h = true
 

Detailed Description

Definition at line 19 of file neighbor.hpp.

Constructor & Destructor Documentation

◆ NeighborSearch() [1/3]

gemmi::NeighborSearch::NeighborSearch ( )
default

◆ NeighborSearch() [2/3]

gemmi::NeighborSearch::NeighborSearch ( Model model_,
const UnitCell cell,
double  radius 
)
inline

Definition at line 63 of file neighbor.hpp.

◆ NeighborSearch() [3/3]

gemmi::NeighborSearch::NeighborSearch ( SmallStructure small_st,
double  radius 
)
inline

Definition at line 69 of file neighbor.hpp.

Member Function Documentation

◆ populate()

NeighborSearch & gemmi::NeighborSearch::populate ( bool  include_h_ = true)
inline

Definition at line 237 of file neighbor.hpp.

◆ add_chain()

void gemmi::NeighborSearch::add_chain ( const Chain chain,
bool  include_h_ = true 
)
inline

Definition at line 254 of file neighbor.hpp.

◆ add_chain_n()

void gemmi::NeighborSearch::add_chain_n ( const Chain chain,
int  n_ch 
)
inline

Definition at line 267 of file neighbor.hpp.

◆ add_atom()

void gemmi::NeighborSearch::add_atom ( const Atom atom,
int  n_ch,
int  n_res,
int  n_atom 
)
inline

Definition at line 278 of file neighbor.hpp.

◆ add_site()

void gemmi::NeighborSearch::add_site ( const SmallStructure::Site site,
int  n 
)
inline

Definition at line 301 of file neighbor.hpp.

◆ get_subcell()

std::vector< Mark > & gemmi::NeighborSearch::get_subcell ( const Fractional fr)
inline

Definition at line 83 of file neighbor.hpp.

◆ for_each_cell()

template<typename Func >
void gemmi::NeighborSearch::for_each_cell ( const Position pos,
const Func func,
int  k = 1 
)

Definition at line 326 of file neighbor.hpp.

◆ for_each()

template<typename Func >
void gemmi::NeighborSearch::for_each ( const Position pos,
char  alt,
double  radius,
const Func func,
int  k = 1 
)
inline

Definition at line 93 of file neighbor.hpp.

◆ sufficient_k()

int gemmi::NeighborSearch::sufficient_k ( double  r) const
inline

Definition at line 106 of file neighbor.hpp.

◆ find_atoms()

std::vector< Mark * > gemmi::NeighborSearch::find_atoms ( const Position pos,
char  alt,
double  min_dist,
double  radius 
)
inline

Definition at line 112 of file neighbor.hpp.

◆ find_neighbors()

std::vector< Mark * > gemmi::NeighborSearch::find_neighbors ( const Atom atom,
double  min_dist,
double  max_dist 
)
inline

Definition at line 125 of file neighbor.hpp.

◆ find_site_neighbors()

std::vector< Mark * > gemmi::NeighborSearch::find_site_neighbors ( const SmallStructure::Site site,
double  min_dist,
double  max_dist 
)
inline

Definition at line 128 of file neighbor.hpp.

◆ find_nearest_atom_within_k()

std::pair< Mark *, double > gemmi::NeighborSearch::find_nearest_atom_within_k ( const Position pos,
int  k,
double  radius 
)
inline

Definition at line 135 of file neighbor.hpp.

◆ find_nearest_atom()

Mark * gemmi::NeighborSearch::find_nearest_atom ( const Position pos,
double  radius = INFINITY 
)
inline

Definition at line 152 of file neighbor.hpp.

◆ dist_sq()

double gemmi::NeighborSearch::dist_sq ( const Position pos1,
const Position pos2 
) const
inline

Definition at line 176 of file neighbor.hpp.

◆ dist()

double gemmi::NeighborSearch::dist ( const Position pos1,
const Position pos2 
) const
inline

Definition at line 179 of file neighbor.hpp.

◆ get_image_transformation()

FTransform gemmi::NeighborSearch::get_image_transformation ( int  image_idx) const
inline

Definition at line 183 of file neighbor.hpp.

Member Data Documentation

◆ grid

Grid<std::vector<Mark> > gemmi::NeighborSearch::grid

Definition at line 54 of file neighbor.hpp.

◆ radius_specified

double gemmi::NeighborSearch::radius_specified = 0.

Definition at line 55 of file neighbor.hpp.

◆ model

Model* gemmi::NeighborSearch::model = nullptr

Definition at line 56 of file neighbor.hpp.

◆ small_structure

SmallStructure* gemmi::NeighborSearch::small_structure = nullptr

Definition at line 57 of file neighbor.hpp.

◆ use_pbc

bool gemmi::NeighborSearch::use_pbc = true

Definition at line 58 of file neighbor.hpp.

◆ include_h

bool gemmi::NeighborSearch::include_h = true

Definition at line 59 of file neighbor.hpp.


The documentation for this struct was generated from the following file: