| Bsoft 2.0.5 Bernard's software package

symmetry.h
Go to the documentation of this file.
1
9 #include "View.h"
10 #include "Bstring.h"
11
12 #ifndef _Bsymmetry_
13 /************************************************************************
14 @Object: struct Bsymop
15 @Description:
16 General symmetry operator.
17 @Features:
18 Both point groups and space groups are covered.
19 A symmetry operator describes the complete series of rotations around
20 an axis, with the number of operations given by the order field
21 and the rotation angle given by the angle field. The shift field
22 is used in gliding operations, such as needed for helical symmetry.
23 *************************************************************************/
24 struct Bsymop {
25 Vector3<double> axis; // Symmetry axis
26 int order; // Number of times the operation is applied, 1=identity
27 double angle; // Rotation angle, derived from order when 0
28 double shift; // Shift up symmetry axis for helix
29 } ;
30
31 /************************************************************************
32 @Object: struct Bsymmetry
33 @Description:
34 General symmetry structure.
35 @Features:
36 Both point groups and space groups are covered.
37 *************************************************************************/
38 struct Bsymmetry {
39 int point; // Point group (< 1 if a crystal)
40 int space; // Space group (< 1 if not a crystal)
41 Bstring label; // Symmetry label string
42 int n; // Number of symmetry operators
43 Bsymop* op; // Symmetry operators
44 } ;
45 #define _Bsymmetry_
46 #endif
47
48 // Function prototypes
49 Bsymmetry* init_point_group_symmetry(Bstring symmetry_string);
50 int kill_symmetry(Bsymmetry* sym);
51 Bstring symmetry_clean_pointgroup(Bstring& symmetry_string);
52 string symmetry_helical_label(double helix_rise, double helix_angle,
53 int dyad_axis, int cyclic, double seam_shift);
54 int symmetry_order(Bsymmetry* sym);
55 View view_symmetry_reference(Bsymmetry* sym);
56 Matrix3 symmetry_rotate_to_axis(Bsymmetry* sym, long axis, long axis_flag);
57 Vector3<double>* symmetry_get_axes(Bsymmetry* sym, long& nax);
58 View* symmetry_get_all_views(Bsymmetry* sym, View asu_view);
59 View* symmetry_get_all_views(Bsymmetry* sym, View* views);
60 Matrix3* symmetry_get_all_matrices(Bsymmetry* sym, long& nsym);
61 View* asymmetric_unit_views(Bsymmetry* sym, double theta_step, double phi_step, int flag);
62 View* asymmetric_unit_views(Bsymmetry* sym, double theta_step, double phi_step, double alpha_step, int flag);
63 View* side_views(Bsymmetry* sym, double side_ang, double theta_step, double phi_step);
64 View* side_views(Bsymmetry* sym, double side_ang, double theta_step, double phi_step, double alpha_step);
65 int change_views_to_asymmetric_unit(Bsymmetry* sym, View* view);
66 View find_asymmetric_unit_view(Bsymmetry* sym, View theview);
67 View find_closest_symmetric_view(Bsymmetry* sym, View view_ref, View view);
68 View* reference_asymmetric_unit_views(Bsymmetry* sym);
69 View random_symmetric_view(View& asu_view, Bsymmetry* sym);
70 int test_asymmetric_unit_view(View theview, Bsymmetry* sym);
71 float* sym_matrices_from_text_list(int nsym, char* symop, int line_len);
72 int sym_show_matrices(Bsymmetry* sym);
73 int sym_show_operational_matrices(Bsymmetry* sym);
74 int sym_show_pdb_matrices(Bsymmetry* sym);
75
find_closest_symmetric_view
View find_closest_symmetric_view(Bsymmetry *sym, View view_ref, View view)
Finds the closest symmetric match between two views.
Definition: symmetry.cpp:939
Bsymmetry::n
int n
Definition: symmetry.h:42
symmetry_order
int symmetry_order(Bsymmetry *sym)
Returns the symmetry order.
Definition: symmetry.cpp:301
sym_show_operational_matrices
int sym_show_operational_matrices(Bsymmetry *sym)
Show symmetry matrices associated with each symmetry operator.
Definition: symmetry.cpp:1146
sym_show_pdb_matrices
int sym_show_pdb_matrices(Bsymmetry *sym)
Show PDB format symmetry matrices associated with each symmetry operator.
Definition: symmetry.cpp:1167
sym_matrices_from_text_list
float * sym_matrices_from_text_list(int nsym, char *symop, int line_len)
Calculates symmetry matrices from a list of strings.
Definition: symmetry.cpp:1069
Matrix3
Definition: Matrix3.h:17
symmetry_rotate_to_axis
Matrix3 symmetry_rotate_to_axis(Bsymmetry *sym, long axis, long axis_flag)
Rotation matrix to orient a symmetry axis on the z axis.
Definition: symmetry.cpp:347
symmetry_helical_label
string symmetry_helical_label(double helix_rise, double helix_angle, int dyad_axis, int cyclic, double seam_shift)
Returns the label for helical symmetry.
Definition: symmetry.cpp:280
kill_symmetry
int kill_symmetry(Bsymmetry *sym)
Deallocates a symmetry structure.
Definition: symmetry.cpp:207
Bsymop::angle
double angle
Definition: symmetry.h:27
Bsymmetry::point
int point
Definition: symmetry.h:39
side_views
View * side_views(Bsymmetry *sym, double side_ang, double theta_step, double phi_step)
Initializes a set of views around the z-axis for helical projection.
Definition: symmetry.cpp:769
symmetry_get_all_matrices
Matrix3 * symmetry_get_all_matrices(Bsymmetry *sym, long &nsym)
Get all symmetry-related views of one given view.
Definition: symmetry.cpp:520
Bsymmetry::space
int space
Definition: symmetry.h:40
test_asymmetric_unit_view
int test_asymmetric_unit_view(View theview, Bsymmetry *sym)
Returns an asymmetric unit index number.
Definition: symmetry.cpp:1035
symmetry_get_axes
Vector3< double > * symmetry_get_axes(Bsymmetry *sym, long &nax)
Get all symmetry axes.
Definition: symmetry.cpp:379
init_point_group_symmetry
Bsymmetry * init_point_group_symmetry(Bstring symmetry_string)
Sets up a symmetry structure from a string identifier.
Definition: symmetry.cpp:39
asymmetric_unit_views
View * asymmetric_unit_views(Bsymmetry *sym, double theta_step, double phi_step, int flag)
Initializes a well-distributed set of views in an asymmetric unit.
Definition: symmetry.cpp:570
change_views_to_asymmetric_unit
int change_views_to_asymmetric_unit(Bsymmetry *sym, View *view)
Change the views to those in the asymmetric unit.
Definition: symmetry.cpp:834
Bsymop::order
int order
Definition: symmetry.h:26
reference_asymmetric_unit_views
View * reference_asymmetric_unit_views(Bsymmetry *sym)
Returns a reference view for each asymmetric unit.
Definition: symmetry.cpp:972
Bsymop::shift
double shift
Definition: symmetry.h:28
random_symmetric_view
View random_symmetric_view(View &asu_view, Bsymmetry *sym)
Returns a randomly picked symmetry view.
Definition: symmetry.cpp:1011
Bsymmetry::label
Bstring label
Definition: symmetry.h:41
Bsymmetry
Definition: symmetry.h:38
Bstring
Definition: Bstring.h:29
find_asymmetric_unit_view
View find_asymmetric_unit_view(Bsymmetry *sym, View theview)
Finds the corresponding view in the asymmetric unit.
Definition: symmetry.cpp:856
Bsymop
Definition: symmetry.h:24
Vector3< double >
Bstring.h
Header file for the string class.
View
Definition: View.h:26
Bsymmetry::op
Bsymop * op
Definition: symmetry.h:43
View.h
View object.
sym_show_matrices
int sym_show_matrices(Bsymmetry *sym)
Show symmetry matrices.
Definition: symmetry.cpp:1118
Bsymop::axis
Vector3< double > axis
Definition: symmetry.h:25
symmetry_get_all_views
View * symmetry_get_all_views(Bsymmetry *sym, View asu_view)
Get all symmetry-related views of one given view.
Definition: symmetry.cpp:448
view_symmetry_reference
View view_symmetry_reference(Bsymmetry *sym)
Returns an asymmetric unit reference point.
Definition: symmetry.cpp:315
symmetry_clean_pointgroup
Bstring symmetry_clean_pointgroup(Bstring &symmetry_string)
Corrects an existing point group string.
Definition: symmetry.cpp:226