#include <symmetry.h>
Inheritance diagram for EMAN::CSym:
Public Member Functions | |
CSym () | |
virtual | ~CSym () |
virtual string | get_name () const |
Return CSym::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 c 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 C symmetry, this is simply 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 |
to demarcate the asymmetric unit. | |
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_c_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 = "c" |
The name of this class - used to access it from factories etc. Should be "c". | |
Private Member Functions | |
CSym (const CSym &) | |
Disallow copy construction. | |
CSym & | operator= (const CSym &) |
Disallow assignment. |
Definition at line 233 of file symmetry.h.
|
Definition at line 236 of file symmetry.h. 00236 {};
|
|
Definition at line 237 of file symmetry.h. 00237 {};
|
|
Disallow copy construction.
|
|
to demarcate the asymmetric unit. The last should may be connected to the first.
Implements EMAN::Symmetry3D. Definition at line 1324 of file symmetry.cpp. References get_delimiters(), EMAN::Dict::set_default(), EMAN::Vec3f, x, and y. Referenced by get_asym_unit_triangles(). 01325 { 01326 Dict delim = get_delimiters(inc_mirror); 01327 int nsym = params.set_default("nsym",0); 01328 vector<Vec3f> ret; 01329 01330 if ( nsym == 1 ) { 01331 if (inc_mirror == false ) { 01332 ret.push_back(Vec3f(0,-1,0)); 01333 ret.push_back(Vec3f(1,0,0)); 01334 ret.push_back(Vec3f(0,1,0)); 01335 ret.push_back(Vec3f(-1,0,0)); 01336 } 01337 // else return ret; // an empty vector! this is fine 01338 } 01339 else if (nsym == 2 && !inc_mirror) { 01340 ret.push_back(Vec3f(0,0,1)); 01341 ret.push_back(Vec3f(0,-1,0)); 01342 ret.push_back(Vec3f(1,0,0)); 01343 ret.push_back(Vec3f(0,1,0)); 01344 } 01345 else { 01346 ret.push_back(Vec3f(0,0,1)); 01347 ret.push_back(Vec3f(0,-1,0)); 01348 if (inc_mirror == true) { 01349 ret.push_back(Vec3f(0,0,-1)); 01350 } 01351 float angle = (float)(EMConsts::deg2rad*float(delim["az_max"])); 01352 float y = -cos(angle); 01353 float x = sin(angle); 01354 ret.push_back(Vec3f(x,y,0)); 01355 } 01356 01357 return ret; 01358 01359 }
|
|
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 1229 of file symmetry.cpp. References get_asym_unit_points(), EMAN::Dict::set_default(), v, EMAN::Vec3f, and x. 01229 { 01230 vector<Vec3f> v = get_asym_unit_points(inc_mirror); 01231 int nsym = params.set_default("nsym",0); 01232 01233 vector<vector<Vec3f> > ret; 01234 if (v.size() == 0) return ret; // nsym == 1 and inc_mirror == true, this is the entire sphere! 01235 if (nsym == 1 && !inc_mirror) { 01236 Vec3f z(0,0,1); 01237 vector<Vec3f> tmp; 01238 tmp.push_back(z); 01239 tmp.push_back(v[1]); 01240 tmp.push_back(v[0]); 01241 ret.push_back(tmp); 01242 01243 vector<Vec3f> tmp2; 01244 tmp2.push_back(z); 01245 tmp2.push_back(v[2]); 01246 tmp2.push_back(v[1]); 01247 ret.push_back(tmp2); 01248 01249 vector<Vec3f> tmp3; 01250 tmp3.push_back(z); 01251 tmp3.push_back(v[3]); 01252 tmp3.push_back(v[2]); 01253 ret.push_back(tmp3); 01254 01255 vector<Vec3f> tmp4; 01256 tmp4.push_back(z); 01257 tmp4.push_back(v[0]); 01258 tmp4.push_back(v[3]); 01259 ret.push_back(tmp4); 01260 } 01261 else if (nsym == 2 && inc_mirror) { 01262 Vec3f x(1,0,0); 01263 vector<Vec3f> tmp; 01264 tmp.push_back(v[1]); 01265 tmp.push_back(v[0]); 01266 tmp.push_back(x); 01267 ret.push_back(tmp); 01268 01269 vector<Vec3f> tmp2; 01270 tmp2.push_back(v[2]); 01271 tmp2.push_back(v[1]); 01272 tmp2.push_back(x); 01273 ret.push_back(tmp2); 01274 01275 vector<Vec3f> tmp3; 01276 tmp3.push_back(v[3]); 01277 tmp3.push_back(v[2]); 01278 tmp3.push_back(x); 01279 ret.push_back(tmp3); 01280 01281 vector<Vec3f> tmp4; 01282 tmp4.push_back(v[0]); 01283 tmp4.push_back(v[3]); 01284 tmp4.push_back(x); 01285 ret.push_back(tmp4); 01286 } 01287 else if (nsym == 2 && !inc_mirror) { 01288 vector<Vec3f> tmp; 01289 tmp.push_back(v[0]); 01290 tmp.push_back(v[2]); 01291 tmp.push_back(v[1]); 01292 ret.push_back(tmp); 01293 01294 vector<Vec3f> tmp2; 01295 tmp2.push_back(v[2]); 01296 tmp2.push_back(v[0]); 01297 tmp2.push_back(v[3]); 01298 ret.push_back(tmp2); 01299 } 01300 else if (v.size() == 3) { 01301 vector<Vec3f> tmp; 01302 tmp.push_back(v[0]); 01303 tmp.push_back(v[2]); 01304 tmp.push_back(v[1]); 01305 ret.push_back(tmp); 01306 } 01307 else if (v.size() == 4) { 01308 vector<Vec3f> tmp; 01309 tmp.push_back(v[0]); 01310 tmp.push_back(v[3]); 01311 tmp.push_back(v[1]); 01312 ret.push_back(tmp); 01313 01314 vector<Vec3f> tmp2; 01315 tmp2.push_back(v[1]); 01316 tmp2.push_back(v[3]); 01317 tmp2.push_back(v[2]); 01318 ret.push_back(tmp2); 01319 } 01320 01321 return ret; 01322 }
|
|
Get the altitude and phi angle of the c symmetry, which depends on nysm. The "alt_max" value in the return dicts is 180 or 90 degrees, depending inc_mirror The "az_max" is 360/nsym degrees.
Implements EMAN::Symmetry3D. Definition at line 1203 of file symmetry.cpp. References InvalidValueException, and EMAN::Dict::set_default(). Referenced by get_asym_unit_points(), and is_in_asym_unit(). 01203 { 01204 Dict returnDict; 01205 // Get the parameters of interest 01206 int nsym = params.set_default("nsym",0); 01207 if ( nsym <= 0 ) throw InvalidValueException(nsym,"Error, you must specify a positive non zero nsym"); 01208 01209 if ( inc_mirror ) returnDict["alt_max"] = 180.0f; 01210 else returnDict["alt_max"] = 90.0f; 01211 01212 returnDict["az_max"] = 360.0f/(float)nsym; 01213 01214 return returnDict; 01215 }
|
|
Get a description.
Implements EMAN::FactoryBase. Definition at line 255 of file symmetry.h. 00255 { return "C 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 296 of file symmetry.h. 00296 { return params["nsym"]; }
|
|
Return CSym::NAME.
Implements EMAN::FactoryBase. Definition at line 250 of file symmetry.h. 00250 { return NAME; }
|
|
Gets the total number of unique roational symmetry operations associated with this symmetry For C symmetry, this is simply nsym.
Implements EMAN::Symmetry3D. Definition at line 289 of file symmetry.h. 00289 { return params["nsym"]; };
|
|
Get a dictionary containing the permissable parameters of this class.
Implements EMAN::FactoryBase. Definition at line 260 of file symmetry.h. References EMAN::TypeDict::put(). 00261 { 00262 TypeDict d; 00263 d.put("nsym", EMObject::INT, "The symmetry number"); 00264 return d; 00265 }
|
|
Provides access to the complete set of rotational symmetry operations associated with this symmetry. Rotational symmetry operations for C symmetry are always about the z-axis (in the EMAN convention), and therefore the only non zero return angle is azimuth. Specifically, it is n*360/nsym degrees.
Implements EMAN::Symmetry3D. Definition at line 1361 of file symmetry.cpp. References InvalidValueException, and EMAN::Dict::set_default(). 01361 { 01362 int nsym = params.set_default("nsym",0); 01363 if ( nsym <= 0 ) throw InvalidValueException(n,"Error, you must specify a positive non zero nsym"); 01364 01365 Dict d("type","eman"); 01366 // courtesy of Phil Baldwin 01367 d["az"] = (n%nsym) * 360.0f / nsym; 01368 d["alt"] = 0.0f; 01369 d["phi"] = 0.0f; 01370 return Transform(d); 01371 }
|
|
Returns true - this is indeed a c symmetry object.
Reimplemented from EMAN::Symmetry3D. Definition at line 320 of file symmetry.h. 00320 { 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 1217 of file symmetry.cpp. References get_delimiters(), and EMAN::Dict::set_default(). 01218 { 01219 Dict d = get_delimiters(inc_mirror); 01220 float alt_max = d["alt_max"]; 01221 float az_max = d["az_max"]; 01222 01223 int nsym = params.set_default("nsym",0); 01224 if ( nsym != 1 && azimuth < 0) return false; 01225 if ( altitude <= alt_max && azimuth <= az_max ) return true; 01226 return false; 01227 }
|
|
Factory support function NEW.
Definition at line 242 of file symmetry.h. 00243 { 00244 return new CSym(); 00245 }
|
|
Disallow assignment.
|
|
The name of this class - used to access it from factories etc. Should be "c".
Definition at line 40 of file symmetry.cpp. |