EMAN2
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
EMAN::TetrahedralSym Class Reference

An encapsulation of tetrahedral symmetry Doctor Phil has this to say about tetrahedral symmetry: " Each Platonic Solid has 2E symmetry elements. More...

#include <symmetry.h>

Inheritance diagram for EMAN::TetrahedralSym:
Inheritance graph
[legend]
Collaboration diagram for EMAN::TetrahedralSym:
Collaboration graph
[legend]

Public Member Functions

 TetrahedralSym ()
 Constructor calls PlatonicSym::init. More...
 
virtual ~TetrahedralSym ()
 
virtual string get_name () const
 Return TetrahedralSym::NAME. More...
 
virtual string get_desc () const
 Get a description. More...
 
virtual int get_max_csym () const
 Gets the maximum symmetry of this object. More...
 
virtual Transform get_sym (const int n) const
 This function provides access to the unique rotational symmetries of a tetrahedron. More...
 
virtual bool is_in_asym_unit (const float &altitude, const float &azimuth, const bool inc_mirror) const
 In tetrahedral symmetry special consideration must be taken when generating orientations in the asymmetric unit. More...
 
virtual int get_nsym () const
 Gets the total number of unique roational symmetry operations associated with this symmetry For tetrahedral symmetry symmetry, this is 12. More...
 
virtual float get_az_alignment_offset () const
 Get the azimuth alignment offset required to ensure that orientations align correctly with symmetric axes of the tetrahedron. More...
 
virtual vector< Vec3fget_asym_unit_points (bool inc_mirror=false) const
 
virtual bool is_tet_sym () const
 A function that is used to determine if this is the tetrahedral symmetry object. More...
 
- Public Member Functions inherited from EMAN::PlatonicSym
 PlatonicSym ()
 
virtual ~PlatonicSym ()
 
virtual TypeDict get_param_types () const
 Get a dictionary containing the permissable parameters of this class Platonic symmetries actually have no parameters. More...
 
virtual Dict get_delimiters (const bool inc_mirror=false) const
 Returns the range of altitude and azimuth angles which encompass the asymmetric unit of the Platonic symmetry (and more). More...
 
virtual bool is_platonic_sym () const
 Determines whether or not this Symmetry3D is the platonic type - returns true. More...
 
- Public Member Functions inherited from EMAN::Symmetry3D
 Symmetry3D ()
 
virtual ~Symmetry3D ()
 
virtual bool is_h_sym () const
 A function that is used to determine if this is a Helical symmetry object This function is only virtually overidden by the HSym symmetry, which returns true, not false. More...
 
virtual bool is_c_sym () const
 A function that is used to determine if this is a c symmetry object This function is only virtually overidden by the CSym object, which returns true. More...
 
virtual bool is_d_sym () const
 A function that is used to determine if this is a d symmetry object This function is only virtually overidden by the DSym object, which returns true. More...
 
vector< Transformgen_orientations (const string &generatorname="eman", const Dict &parms=Dict())
 Ask the Symmetry3D object to generate a set of orientations in its asymmetric unit using an OrientationGenerator constructed from the given parameters (using a Factory). More...
 
virtual Transform reduce (const Transform &t3d, int n=0) const
 A function that will reduce an orientation, as characterized by Euler anges, into a specific asymmetric unit. More...
 
virtual int in_which_asym_unit (const Transform &t3d) const
 A function that will determine in which asymmetric unit a given orientation resides The asymmetric unit 'number' will depend entirely on the order in which different symmetry operations are return by the Symmetry3D::get_sym function. More...
 
virtual int point_in_which_asym_unit (const Vec3f &v) const
 A function that will determine in which asymmetric unit a given vector resides The asymmetric unit 'number' will depend entirely on the order in which different symmetry operations are return by the Symmetry3D::get_sym function The vector is a point. More...
 
virtual vector< Transformget_touching_au_transforms (bool inc_mirror=true) const
 Gets a vector of Transform objects that define the set of asymmetric units that touch the default asymmetric unit. More...
 
virtual vector< Transformget_syms () const
 
- Public Member Functions inherited from EMAN::FactoryBase
 FactoryBase ()
 
virtual ~FactoryBase ()
 
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
 

Static Public Member Functions

static Symmetry3DNEW ()
 Factory support function NEW. More...
 
- Static Public Member Functions inherited from EMAN::Symmetry3D
static vector< Transformget_symmetries (const string &symmetry)
 

Static Public Attributes

static const string NAME = "tet"
 The name of this class - used to access it from factories etc. Should be "tet". More...
 

Private Member Functions

 TetrahedralSym (const TetrahedralSym &)
 Disallow copy construction. More...
 
TetrahedralSymoperator= (const TetrahedralSym &)
 Disallow assignment. More...
 

Additional Inherited Members

- Public Types inherited from EMAN::Symmetry3D
typedef vector< vector< Vec3f > >::const_iterator cit
 
typedef vector< vector< Vec3f > >::iterator ncit
 
- Protected Member Functions inherited from EMAN::PlatonicSym
void init ()
 Init - Called to initialize platonic_params, should be called in the constructor of all Platonic solids that derive from this. More...
 
float platonic_alt_lower_bound (const float &azimuth, const float &alpha) const
 Returns the lower bound of the asymmetric unit, as dependent on azimuth, and on alpha - alpha is alt_max for icos and oct, but may be alt_max/2.0 for tet depending on mirror symmetry etc. More...
 
virtual vector< vector< Vec3f > > get_asym_unit_triangles (bool inc_mirror) const
 Get triangles that precisely occlude the projection area of the default asymmetric unit. More...
 
- Protected Member Functions inherited from EMAN::Symmetry3D
void cache_au_planes () const
 Establish the asymmetric unit planes cache. More...
 
void delete_au_planes ()
 Clear the asymmetric unit planes cache. More...
 
- Protected Attributes inherited from EMAN::PlatonicSym
Dict platonic_params
 A dictionary that stores important angles, in radians. More...
 
- Protected Attributes inherited from EMAN::Symmetry3D
float ** cached_au_planes
 The asymmetric unit planes are cached to provide a great speed up the point_in_which_asym_unit function, which is called by reduce and by in_which_asym_unit. More...
 
int cache_size
 Have to remember the cache size. More...
 
int num_triangles
 This is stores the number of triangles returned by get_asym_unit_triangles(true) More...
 
vector< vector< Vec3f > > au_sym_triangles
 This cache is of size cache_size. More...
 
- Protected Attributes inherited from EMAN::FactoryBase
Dict params
 This is the dictionary the stores the parameters of the object. More...
 

Detailed Description

An encapsulation of tetrahedral symmetry Doctor Phil has this to say about tetrahedral symmetry: " Each Platonic Solid has 2E symmetry elements.

The tetrahedron has n=m=3; F=4, E=6=nF/2, V=4=nF/m. It is composed of four triangles."

Author
David Woolford (based on previous work by Phil Baldwin and Steve Ludtke)
Date
Feb 2008

Definition at line 675 of file symmetry.h.

Constructor & Destructor Documentation

◆ TetrahedralSym() [1/2]

EMAN::TetrahedralSym::TetrahedralSym ( )
inline

Constructor calls PlatonicSym::init.

Definition at line 680 of file symmetry.h.

680{init();}
void init()
Init - Called to initialize platonic_params, should be called in the constructor of all Platonic soli...
Definition: symmetry.cpp:1673

References EMAN::PlatonicSym::init().

Referenced by NEW().

◆ ~TetrahedralSym()

virtual EMAN::TetrahedralSym::~TetrahedralSym ( )
inlinevirtual

Definition at line 681 of file symmetry.h.

681{}

◆ TetrahedralSym() [2/2]

EMAN::TetrahedralSym::TetrahedralSym ( const TetrahedralSym )
private

Disallow copy construction.

Member Function Documentation

◆ get_asym_unit_points()

vector< Vec3f > TetrahedralSym::get_asym_unit_points ( bool  inc_mirror = false) const
virtual
Parameters
inc_mirrorwhether or not to include the mirror portion of the asymmetric unit
Returns
a cyclic set of points which can be connected using great arcs on the unit sphere to demarcate the asymmetric unit. The last should may be connected to the first.

Reimplemented from EMAN::PlatonicSym.

Definition at line 2031 of file symmetry.cpp.

2032{
2033 vector<Vec3f> ret;
2034
2035 Vec3f b = Vec3f(0,0,1);
2036 ret.push_back(b);
2037 float theta_c_on_two = (float)platonic_params["theta_c_on_two"]; // already in radians
2038 float theta_c = 2*theta_c_on_two;
2039
2040 Vec3f c_on_two = Vec3f(0,-sin(theta_c_on_two),cos(theta_c_on_two));
2041 Vec3f c = Vec3f(0,-sin(theta_c),cos(theta_c));
2042 ret.push_back(c_on_two);
2043 float cap_sig = platonic_params["az_max"];
2044 if ( inc_mirror ) {
2045 Vec3f a = Vec3f(sin(theta_c)*sin(cap_sig),-sin(theta_c)*cos(cap_sig),cos(theta_c));
2046
2047 Vec3f f = a+b+c;
2048 f.normalize();
2049
2050 ret.push_back(f);
2051 }
2052
2053 Vec3f a_on_two = Vec3f(sin(theta_c_on_two)*sin(cap_sig),-sin(theta_c_on_two)*cos(cap_sig),cos(theta_c_on_two));
2054 ret.push_back(a_on_two);
2055
2056
2057 if ( get_az_alignment_offset() != 0 ) {
2058 Dict d("type","eman");
2059 d["az"] = get_az_alignment_offset();
2060 d["phi"] = 0.0f;
2061 d["alt"] = 0.0f;
2062 Transform t(d);
2063 for (vector<Vec3f>::iterator it = ret.begin(); it != ret.end(); ++it )
2064 {
2065 *it = (*it)*t;
2066 }
2067 }
2068
2069 return ret;
2070}
Dict is a dictionary to store <string, EMObject> pair.
Definition: emobject.h:385
Dict platonic_params
A dictionary that stores important angles, in radians.
Definition: symmetry.h:631
virtual float get_az_alignment_offset() const
Get the azimuth alignment offset required to ensure that orientations align correctly with symmetric ...
Definition: symmetry.cpp:1977
A Transform object is a somewhat specialized object designed specifically for EMAN2/Sparx storage of ...
Definition: transform.h:75
float normalize()
Normalize the vector and return its length before the normalization.
Definition: vec3.h:332
Vec3< float > Vec3f
Definition: vec3.h:693

References get_az_alignment_offset(), EMAN::Vec3< Type >::normalize(), and EMAN::PlatonicSym::platonic_params.

◆ get_az_alignment_offset()

float TetrahedralSym::get_az_alignment_offset ( ) const
virtual

Get the azimuth alignment offset required to ensure that orientations align correctly with symmetric axes of the tetrahedron.

This offset is directly related to the way the symmetric operations are generated by get_sym. All orientations generated as a result of using the delimiters supplied by this class should by offset by this azimuth to ensure proper alignment with tetrahedral objects in EMAN2

Reimplemented from EMAN::Symmetry3D.

Definition at line 1977 of file symmetry.cpp.

1977{ return 0.0; }

Referenced by get_asym_unit_points().

◆ get_desc()

virtual string EMAN::TetrahedralSym::get_desc ( ) const
inlinevirtual

Get a description.

Returns
a clear desciption of this class

Implements EMAN::FactoryBase.

Definition at line 700 of file symmetry.h.

700{ return "Tetrahedral symmetry support"; }

◆ get_max_csym()

virtual int EMAN::TetrahedralSym::get_max_csym ( ) const
inlinevirtual

Gets the maximum symmetry of this object.

This is used by OrientationGenerators, and is probably not something a general user would utilize.

Returns
for tetrahedral symmetry, this number is 3

Implements EMAN::Symmetry3D.

Definition at line 706 of file symmetry.h.

706{ return 3; }

◆ get_name()

virtual string EMAN::TetrahedralSym::get_name ( ) const
inlinevirtual

Return TetrahedralSym::NAME.

Returns
the unique name of this class

Implements EMAN::FactoryBase.

Definition at line 694 of file symmetry.h.

694{ return NAME; }
static const string NAME
The name of this class - used to access it from factories etc. Should be "tet".
Definition: symmetry.h:747

References NAME.

◆ get_nsym()

virtual int EMAN::TetrahedralSym::get_nsym ( ) const
inlinevirtual

Gets the total number of unique roational symmetry operations associated with this symmetry For tetrahedral symmetry symmetry, this is 12.

Returns
12

Implements EMAN::Symmetry3D.

Definition at line 736 of file symmetry.h.

736{ return 12; };

◆ get_sym()

Transform TetrahedralSym::get_sym ( const int  n) const
virtual

This function provides access to the unique rotational symmetries of a tetrahedron.

In this implementation, the tetrahedral symmetry group has a face along the z-axis. In all, there are 12 (accessed by get_nysm) unique rotational symmetric operations for the tetrahedron. In the terminology defined Append A (titled Symmetry Elements) in the manuscript Baldwin and Penczek, 2007. The Transform Class in SPARX and EMAN2. JSB 157(250-261), Doctor Phil has this to say: "B^3=A^3=1; BABA=1; implies A^2=BAB, ABA=B^2 , AB^2A = B^2AB^2 and 12 words with at most a single A 1 B BB A BA AB BBA BAB ABB BBAB BABB BBABB at most one A is necessary"

Parameters
nthe symmetric operation number
Returns
a transform containing the correct rotational symmetry operation.

Implements EMAN::Symmetry3D.

Definition at line 2006 of file symmetry.cpp.

2007{
2008 // These rotations courtesy of Phil Baldwin
2009 // It has n=m=3; F=4, E=6=nF/2, V=4=nF/m
2010 float lvl0 = 0.0f; // There is a face along z
2011 float lvl1 = (float)(EMConsts::rad2deg*acos(-1.0f/3.0f)); // There are 3 faces at this angle
2012
2013 float TET[36] = {// This is with the face along z
2014 0,lvl0,0, 0,lvl0,120, 0,lvl0,240,
2015 0,lvl1,60, 0,lvl1,180, 0,lvl1,300,
2016 120,lvl1,60, 120,lvl1,180, 120,lvl1,300,
2017 240,lvl1,60, 240,lvl1,180, 240,lvl1,300
2018 };
2019
2020 int idx = n % 12;
2021
2022 Dict d("type","eman");
2023 d["az"] = TET[idx * 3 ];
2024 d["alt"] = TET[idx * 3 + 1];
2025 d["phi"] = TET[idx * 3 + 2];
2026 return Transform(d);
2027
2028}
static const double rad2deg
Definition: emobject.h:77

References EMAN::EMConsts::rad2deg.

◆ is_in_asym_unit()

bool TetrahedralSym::is_in_asym_unit ( const float &  altitude,
const float &  azimuth,
const bool  inc_mirror 
) const
virtual

In tetrahedral symmetry special consideration must be taken when generating orientations in the asymmetric unit.

This function is a specialization of the functionality in PlatonicSym::is_in_asym_unit

Parameters
altitudethe EMAN style altitude of the 3D orientation in degrees
azimuththe EMAN style azimuth of the 3D orientation in degrees
inc_mirrorwhether or not to include orientations if they are in the mirror portion of the asymmetric unit
Returns
true or false, depending on whether or not the orientation is within the asymmetric unit

Reimplemented from EMAN::PlatonicSym.

Definition at line 1979 of file symmetry.cpp.

1980{
1981 Dict d = get_delimiters(inc_mirror);
1982 float alt_max = d["alt_max"];
1983 float az_max = d["az_max"];
1984 if ( altitude >= 0 && altitude <= alt_max && azimuth < az_max && azimuth >= 0) {
1985 // convert azimuth to radians
1986 float tmpaz = (float)(EMConsts::deg2rad * azimuth);
1987
1988 float cap_sig = platonic_params["az_max"];
1989 float alt_max = platonic_params["alt_max"];
1990 tmpaz = Util::get_min( tmpaz, cap_sig-tmpaz);
1991
1992 // convert altitude to radians
1993 float tmpalt = (float)(EMConsts::deg2rad * altitude);
1994 if ( platonic_alt_lower_bound(tmpaz, alt_max ) > tmpalt ) {
1995 if ( inc_mirror ) return true;
1996 else {
1997 // you could change the "<" to a ">" here to get the other mirror part of the asym unit
1998 if ( platonic_alt_lower_bound( tmpaz, alt_max/2.0f) < tmpalt ) return false;
1999 else return true;
2000 }
2001 } else return false;
2002 } else return false;
2003}
static const double deg2rad
Definition: emobject.h:78
float platonic_alt_lower_bound(const float &azimuth, const float &alpha) const
Returns the lower bound of the asymmetric unit, as dependent on azimuth, and on alpha - alpha is alt_...
Definition: symmetry.cpp:1737
virtual Dict get_delimiters(const bool inc_mirror=false) const
Returns the range of altitude and azimuth angles which encompass the asymmetric unit of the Platonic ...
Definition: symmetry.cpp:1694
static int get_min(int f1, int f2)
Get the minimum of 2 numbers.
Definition: util.h:922

References EMAN::EMConsts::deg2rad, EMAN::PlatonicSym::get_delimiters(), EMAN::Util::get_min(), EMAN::PlatonicSym::platonic_alt_lower_bound(), and EMAN::PlatonicSym::platonic_params.

◆ is_tet_sym()

virtual bool EMAN::TetrahedralSym::is_tet_sym ( ) const
inlinevirtual

A function that is used to determine if this is the tetrahedral symmetry object.

Returns
true - indicating that this is not a tetrahedral symmetry object

Reimplemented from EMAN::Symmetry3D.

Definition at line 758 of file symmetry.h.

758{ return true; }

◆ NEW()

static Symmetry3D * EMAN::TetrahedralSym::NEW ( )
inlinestatic

Factory support function NEW.

Returns
a newly instantiated class of this type

Definition at line 686 of file symmetry.h.

687 {
688 return new TetrahedralSym();
689 }
TetrahedralSym()
Constructor calls PlatonicSym::init.
Definition: symmetry.h:680

References TetrahedralSym().

◆ operator=()

TetrahedralSym & EMAN::TetrahedralSym::operator= ( const TetrahedralSym )
private

Disallow assignment.

Member Data Documentation

◆ NAME

const string TetrahedralSym::NAME = "tet"
static

The name of this class - used to access it from factories etc. Should be "tet".

Definition at line 747 of file symmetry.h.

Referenced by get_name().


The documentation for this class was generated from the following files: