#include <symmetry.h>
Inheritance diagram for EMAN::DSym:


Public Member Functions | |
| DSym () | |
| virtual | ~DSym () |
| virtual string | get_name () const |
| Return DSym::NAME. | |
| virtual string | get_desc () const |
| Get a description. | |
| virtual TypeDict | get_param_types () const |
| Get a dictionary containing the permissable parameters of this class. | |
| virtual Dict | get_delimiters (const bool inc_mirror=false) const |
| Get the altitude and phi angle of the d symmetry, which depends on nysm. | |
| virtual Transform | get_sym (const int n) const |
| Provides access to the complete set of rotational symmetry operations associated with this symmetry. | |
| virtual int | get_nsym () const |
| Gets the total number of unique roational symmetry operations associated with this symmetry For D symmetry, this is simply 2*nsym. | |
| virtual int | get_max_csym () const |
| Gets the maximum symmetry of this object. | |
| virtual vector< Vec3f > | get_asym_unit_points (bool inc_mirror=false) const |
| virtual bool | is_in_asym_unit (const float &altitude, const float &azimuth, const bool inc_mirror) const |
| A function to be used when generating orientations over portion of the unit sphere defined by parameters returned by get_delimiters. | |
| virtual bool | is_d_sym () const |
| Returns true - this is indeed a c symmetry object. | |
| 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. | |
Static Public Member Functions | |
| Symmetry3D * | NEW () |
| Factory support function NEW. | |
Static Public Attributes | |
| const string | NAME = "d" |
| The name of this class - used to access it from factories etc. Should be "d". | |
Private Member Functions | |
| DSym (const DSym &) | |
| Disallow copy construction. | |
| DSym & | operator= (const DSym &) |
| Disallow assignment. | |
Definition at line 340 of file symmetry.h.
|
|
Definition at line 343 of file symmetry.h. 00343 {};
|
|
|
Definition at line 344 of file symmetry.h. 00344 {};
|
|
|
Disallow copy construction.
|
|
|
Implements EMAN::Symmetry3D. Definition at line 1450 of file symmetry.cpp. References get_delimiters(), EMAN::Dict::set_default(), EMAN::Vec3f, x, and y. Referenced by get_asym_unit_triangles(). 01451 {
01452 Dict delim = get_delimiters(inc_mirror);
01453
01454 vector<Vec3f> ret;
01455 int nsym = params.set_default("nsym",0);
01456 if ( nsym == 1 ) {
01457 if (inc_mirror == false ) {
01458 ret.push_back(Vec3f(0,0,1));
01459 ret.push_back(Vec3f(0,-1,0));
01460 ret.push_back(Vec3f(1,0,0));
01461 ret.push_back(Vec3f(0,1,0));
01462 }
01463 else {
01464 ret.push_back(Vec3f(0,-1,0));
01465 ret.push_back(Vec3f(1,0,0));
01466 ret.push_back(Vec3f(0,1,0));
01467 ret.push_back(Vec3f(-1,0,0));
01468 }
01469 }
01470 else if ( nsym == 2 && inc_mirror ) {
01471 ret.push_back(Vec3f(0,0,1));
01472 ret.push_back(Vec3f(0,-1,0));
01473 ret.push_back(Vec3f(1,0,0));
01474 ret.push_back(Vec3f(0,1,0));
01475 }
01476 else {
01477 float angle = (float)(EMConsts::deg2rad*float(delim["az_max"]));
01478 ret.push_back(Vec3f(0,0,1));
01479 ret.push_back(Vec3f(0,-1,0));
01480 float y = -cos(angle);
01481 float x = sin(angle);
01482 ret.push_back(Vec3f(x,y,0));
01483 }
01484
01485 return ret;
01486
01487 }
|
|
|
Get triangles that precisely occlude the projection area of the default asymmetric unit. This is used for collision detection in Symmetry3D::reduce
Implements EMAN::Symmetry3D. Definition at line 1395 of file symmetry.cpp. References get_asym_unit_points(), EMAN::Dict::set_default(), v, and EMAN::Vec3f. 01395 {
01396 vector<Vec3f> v = get_asym_unit_points(inc_mirror);
01397 int nsym = params.set_default("nsym",0);
01398 vector<vector<Vec3f> > ret;
01399 if ( (nsym == 1 && inc_mirror == false) || (nsym == 2 && inc_mirror)) {
01400 vector<Vec3f> tmp;
01401 tmp.push_back(v[0]);
01402 tmp.push_back(v[2]);
01403 tmp.push_back(v[1]);
01404 ret.push_back(tmp);
01405
01406 vector<Vec3f> tmp2;
01407 tmp2.push_back(v[2]);
01408 tmp2.push_back(v[0]);
01409 tmp2.push_back(v[3]);
01410 ret.push_back(tmp2);
01411 }
01412 else if (nsym == 1) {
01413 Vec3f z(0,0,1);
01414 vector<Vec3f> tmp;
01415 tmp.push_back(z);
01416 tmp.push_back(v[1]);
01417 tmp.push_back(v[0]);
01418 ret.push_back(tmp);
01419
01420 vector<Vec3f> tmp2;
01421 tmp2.push_back(z);
01422 tmp2.push_back(v[2]);
01423 tmp2.push_back(v[1]);
01424 ret.push_back(tmp2);
01425
01426 vector<Vec3f> tmp3;
01427 tmp3.push_back(z);
01428 tmp3.push_back(v[3]);
01429 tmp3.push_back(v[2]);
01430 ret.push_back(tmp3);
01431
01432 vector<Vec3f> tmp4;
01433 tmp4.push_back(z);
01434 tmp4.push_back(v[0]);
01435 tmp4.push_back(v[3]);
01436 ret.push_back(tmp4);
01437 }
01438 else {
01439 // if v.size() == 3
01440 vector<Vec3f> tmp;
01441 tmp.push_back(v[0]);
01442 tmp.push_back(v[2]);
01443 tmp.push_back(v[1]);
01444 ret.push_back(tmp);
01445 }
01446
01447 return ret;
01448 }
|
|
|
Get the altitude and phi angle of the d symmetry, which depends on nysm. The "alt_max" is always 90 degrees The "az_max" is 360/nsym degrees of 180/nsym, depending the inc_mirror argument
Implements EMAN::Symmetry3D. Definition at line 1343 of file symmetry.cpp. References InvalidValueException, and EMAN::Dict::set_default(). Referenced by get_asym_unit_points(), and is_in_asym_unit(). 01343 {
01344 Dict returnDict;
01345
01346 // Get the parameters of interest
01347 int nsym = params.set_default("nsym",0);
01348 if ( nsym <= 0 ) throw InvalidValueException(nsym,"Error, you must specify a positive non zero nsym");
01349
01350 returnDict["alt_max"] = 90.0f;
01351
01352 if ( inc_mirror ) returnDict["az_max"] = 360.0f/(float)nsym;
01353 else returnDict["az_max"] = 180.0f/(float)nsym;
01354
01355 return returnDict;
01356 }
|
|
|
Get a description.
Implements EMAN::FactoryBase. Definition at line 362 of file symmetry.h. 00362 { return "D symmetry support"; }
|
|
|
Gets the maximum symmetry of this object. This is used by OrientationGenerators, and is probably not something a general user would utilize.
Implements EMAN::Symmetry3D. Definition at line 404 of file symmetry.h. 00404 { return params["nsym"]; }
|
|
|
Return DSym::NAME.
Implements EMAN::FactoryBase. Definition at line 357 of file symmetry.h. 00357 { return NAME; }
|
|
|
Gets the total number of unique roational symmetry operations associated with this symmetry For D symmetry, this is simply 2*nsym.
Implements EMAN::Symmetry3D. Definition at line 397 of file symmetry.h. 00397 { return 2*(int)params["nsym"]; };
|
|
|
Get a dictionary containing the permissable parameters of this class.
Implements EMAN::FactoryBase. Definition at line 367 of file symmetry.h. References EMAN::TypeDict::put(). 00368 {
00369 TypeDict d;
00370 d.put("nsym", EMObject::INT, "The symmetry number");
00371 return d;
00372 }
|
|
|
Provides access to the complete set of rotational symmetry operations associated with this symmetry. The first half symmetry operations returned by this function are all about the z axis (i.e. only azimuth is non zero. The second half of the symmetry operations are replicas of the first half, except that they have an additional 180 degree rotation about x (in EMAN terms, the altitude angle is 180).
Implements EMAN::Symmetry3D. Definition at line 1375 of file symmetry.cpp. References InvalidValueException, and EMAN::Dict::set_default(). 01376 {
01377 int nsym = 2*params.set_default("nsym",0);
01378 if ( nsym <= 0 ) throw InvalidValueException(n,"Error, you must specify a positive non zero nsym");
01379
01380 Dict d("type","eman");
01381 // courtesy of Phil Baldwin
01382 if (n >= nsym / 2) {
01383 d["az"] = ( (n%nsym) - nsym/2) * 360.0f / (nsym / 2);
01384 d["alt"] = 180.0f;
01385 d["phi"] = 0.0f;
01386 }
01387 else {
01388 d["az"] = (n%nsym) * 360.0f / (nsym / 2);
01389 d["alt"] = 0.0f;
01390 d["phi"] = 0.0f;
01391 }
01392 return Transform(d);
01393 }
|
|
|
Returns true - this is indeed a c symmetry object.
Reimplemented from EMAN::Symmetry3D. Definition at line 428 of file symmetry.h. 00428 { return true; }
|
|
||||||||||||||||
|
A function to be used when generating orientations over portion of the unit sphere defined by parameters returned by get_delimiters. In platonic symmetry altitude and azimuth alone are not enough to correctly demarcate the asymmetric unit. See the get_delimiters comments.
Implements EMAN::Symmetry3D. Definition at line 1358 of file symmetry.cpp. References get_delimiters(), and EMAN::Dict::set_default(). 01359 {
01360 Dict d = get_delimiters(inc_mirror);
01361 float alt_max = d["alt_max"];
01362 float az_max = d["az_max"];
01363
01364 int nsym = params.set_default("nsym",0);
01365
01366 if ( nsym == 1 && inc_mirror ) {
01367 if (altitude >= 0 && altitude <= alt_max && azimuth <= az_max ) return true;
01368 }
01369 else {
01370 if ( altitude >= 0 && altitude <= alt_max && azimuth <= az_max && azimuth >= 0 ) return true;
01371 }
01372 return false;
01373 }
|
|
|
Factory support function NEW.
Definition at line 349 of file symmetry.h. 00350 {
00351 return new DSym();
00352 }
|
|
|
Disallow assignment.
|
|
|
The name of this class - used to access it from factories etc. Should be "d".
Definition at line 41 of file symmetry.cpp. |
1.3.9.1