EMAN2
|
An orientation generator is a kind of class that will generate orientations for a given symmetry If one needs to generate orientations in the unit sphere, one simply uses the C1 symmetry. More...
#include <symmetry.h>
Public Member Functions | |
OrientationGenerator () | |
virtual | ~OrientationGenerator () |
virtual vector< Transform > | gen_orientations (const Symmetry3D *const sym) const =0 |
generate orientations given some symmetry type More... | |
virtual TypeDict | get_param_types () const |
bool | add_orientation (vector< Transform > &v, const float &az, const float &alt) const |
This functions adds one or more Transform objects to the vector v, depending on the parameters stored in the dictionary (which the inheriting class may include by initializing the typedict in get_param_types by calling. More... | |
float | get_optimal_delta (const Symmetry3D *const sym, const int &n) const |
This function gets the optimal value of the delta (or angular spacing) of the orientations based on a desired total number of orientations (n). More... | |
virtual int | get_orientations_tally (const Symmetry3D *const sym, const float &delta) const =0 |
This function returns how many orientations will be generated for a given delta (angular spacing) It should general do this by simulating the function gen_orientations. More... | |
Public Member Functions inherited from EMAN::FactoryBase | |
FactoryBase () | |
virtual | ~FactoryBase () |
virtual string | get_name () const =0 |
Get the unique name of this class (especially for factory based instantiation access) More... | |
virtual string | get_desc () const =0 |
Get a clear, concise description of this class. More... | |
Dict | get_params () const |
get a copy of the parameters of this class More... | |
void | set_params (const Dict &new_params) |
Set new parameters. More... | |
void | set_param (const string key, const EMObject val) |
void | insert_params (const Dict &new_params) |
Insert parameters. More... | |
Dict | copy_relevant_params (const FactoryBase *const that) const |
Protected Member Functions | |
void | get_az_max (const Symmetry3D *const sym, const float &altmax, const bool inc_mirror, const float &alt_iterator, const float &h, bool &d_odd_mirror_flag, float &azmax_adjusted) const |
Private Member Functions | |
OrientationGenerator (const OrientationGenerator &) | |
Disallow copy construction. More... | |
OrientationGenerator & | operator= (const OrientationGenerator &) |
Disallow assignment. More... | |
Additional Inherited Members | |
Protected Attributes inherited from EMAN::FactoryBase | |
Dict | params |
This is the dictionary the stores the parameters of the object. More... | |
An orientation generator is a kind of class that will generate orientations for a given symmetry If one needs to generate orientations in the unit sphere, one simply uses the C1 symmetry.
It inherits from a factory base, making it amenable to incorporation in EMAN2 style factories. Objects that inherit from this class must write a gen_orientations function, in addition to fulfilling the responsibilities of the FactoryBase class
Definition at line 999 of file symmetry.h.
|
inline |
Definition at line 1002 of file symmetry.h.
|
inlinevirtual |
Definition at line 1003 of file symmetry.h.
|
private |
Disallow copy construction.
bool OrientationGenerator::add_orientation | ( | vector< Transform > & | v, |
const float & | az, | ||
const float & | alt | ||
) | const |
This functions adds one or more Transform objects to the vector v, depending on the parameters stored in the dictionary (which the inheriting class may include by initializing the typedict in get_param_types by calling.
to initialize. If phitoo is no zero, this cause extra orientations to be included in phi (in steps of phitoo). If random_phi is true, the phi of the Transform object is randomized. This function is for internal convenience of child classes.
v | the vector to add Transform objects to |
az | the azimuth to be used as a basis for generated Transform objects (in degrees) |
alt | the altitude to be used as a basis for generated Transform objects (in degrees) |
Definition at line 273 of file symmetry.cpp.
References EMAN::Util::get_frand(), InvalidValueException, EMAN::FactoryBase::params, and EMAN::Dict::set_default().
Referenced by EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::EvenOrientationGenerator::gen_orientations(), EMAN::SaffOrientationGenerator::gen_orientations(), and EMAN::OptimumOrientationGenerator::gen_orientations().
|
pure virtual |
generate orientations given some symmetry type
sym | the symmetry which defines the interesting asymmetric unit |
Implemented in EMAN::EmanOrientationGenerator, EMAN::SingleOrientationGenerator, EMAN::RandomOrientationGenerator, EMAN::EvenOrientationGenerator, EMAN::SaffOrientationGenerator, and EMAN::OptimumOrientationGenerator.
Referenced by EMAN::Symmetry3D::gen_orientations(), and EMAN::OptimumOrientationGenerator::gen_orientations().
|
protected |
Definition at line 187 of file symmetry.cpp.
References EMAN::Symmetry3D::get_nsym(), EMAN::Symmetry3D::is_c_sym(), EMAN::Symmetry3D::is_d_sym(), EMAN::Symmetry3D::is_platonic_sym(), and EMAN::Symmetry3D::is_tet_sym().
Referenced by EMAN::EmanOrientationGenerator::gen_orientations(), and EMAN::EmanOrientationGenerator::get_orientations_tally().
float OrientationGenerator::get_optimal_delta | ( | const Symmetry3D *const | sym, |
const int & | n | ||
) | const |
This function gets the optimal value of the delta (or angular spacing) of the orientations based on a desired total number of orientations (n).
It does this using a bifurcation strategy, calling get_orientations_tally (which must be supplied by the child class) using the next best guess etc. The solution may not exist (simply because the orientation generation strategy does not contain it), so a best guess may be returned.
The inheriting class must supply the get_orientations_tally function, which returns the number of orientations generated (an int), for a given delta.
sym | the symmetry which defines the interesting asymmetric unit |
n | the desired number of orientations |
Definition at line 236 of file symmetry.cpp.
References get_orientations_tally().
Referenced by EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::EvenOrientationGenerator::gen_orientations(), EMAN::SaffOrientationGenerator::gen_orientations(), and EMAN::OptimumOrientationGenerator::gen_orientations().
|
pure virtual |
This function returns how many orientations will be generated for a given delta (angular spacing) It should general do this by simulating the function gen_orientations.
sym | the symmetry which defines the interesting asymmetric unit |
delta | the desired angular spacing of the orientations |
Implemented in EMAN::EmanOrientationGenerator, EMAN::SingleOrientationGenerator, EMAN::RandomOrientationGenerator, EMAN::EvenOrientationGenerator, EMAN::SaffOrientationGenerator, and EMAN::OptimumOrientationGenerator.
Referenced by get_optimal_delta(), and EMAN::OptimumOrientationGenerator::get_orientations_tally().
|
inlinevirtual |
Implements EMAN::FactoryBase.
Reimplemented in EMAN::EmanOrientationGenerator, EMAN::SingleOrientationGenerator, EMAN::RandomOrientationGenerator, EMAN::EvenOrientationGenerator, EMAN::SaffOrientationGenerator, and EMAN::OptimumOrientationGenerator.
Definition at line 1011 of file symmetry.h.
References EMAN::EMObject::BOOL, EMAN::EMObject::FLOAT, and EMAN::TypeDict::put().
Referenced by EMAN::EmanOrientationGenerator::get_param_types(), EMAN::SingleOrientationGenerator::get_param_types(), EMAN::EvenOrientationGenerator::get_param_types(), EMAN::SaffOrientationGenerator::get_param_types(), and EMAN::OptimumOrientationGenerator::get_param_types().
|
private |
Disallow assignment.