1 | // ============================================================= // |
---|
2 | // // |
---|
3 | // File : RNA3D_Global.hxx // |
---|
4 | // Purpose : // |
---|
5 | // // |
---|
6 | // Institute of Microbiology (Technical University Munich) // |
---|
7 | // http://www.arb-home.de/ // |
---|
8 | // // |
---|
9 | // ============================================================= // |
---|
10 | |
---|
11 | #ifndef RNA3D_GLOBAL_HXX |
---|
12 | #define RNA3D_GLOBAL_HXX |
---|
13 | |
---|
14 | #ifndef ARBTOOLS_H |
---|
15 | #include <arbtools.h> |
---|
16 | #endif |
---|
17 | |
---|
18 | #ifndef ARB_OPENGL |
---|
19 | #error shall only be compiled in ARB_OPENGL mode |
---|
20 | #endif // ARB_OPENGL |
---|
21 | |
---|
22 | #ifndef M_PI |
---|
23 | #define M_PI 3.14159265358979323846 |
---|
24 | #endif |
---|
25 | |
---|
26 | #define rna3d_assert(cond) arb_assert(cond) |
---|
27 | |
---|
28 | // Awars for SAI |
---|
29 | #define AWAR_3D_SAI_SELECTED "rna3d/sai_selected" |
---|
30 | |
---|
31 | // Awars for Helix |
---|
32 | #define AWAR_3D_DISPLAY_HELIX "rna3d/display_helix" |
---|
33 | #define AWAR_3D_HELIX_BACKBONE "rna3d/helix_backbone" |
---|
34 | #define AWAR_3D_HELIX_MIDPOINT "rna3d/helix_midpoint" |
---|
35 | #define AWAR_3D_HELIX_SIZE "rna3d/helix_size" |
---|
36 | #define AWAR_3D_HELIX_FROM "rna3d/helix_from" |
---|
37 | #define AWAR_3D_HELIX_TO "rna3d/helix_to" |
---|
38 | #define AWAR_3D_HELIX_NUMBER "rna3d/helix_number" |
---|
39 | |
---|
40 | #define AWAR_3D_DISPLAY_TERTIARY_INTRACTIONS "rna3d/tertiary_interactions" |
---|
41 | |
---|
42 | // Awars for Bases |
---|
43 | #define AWAR_3D_DISPLAY_BASES "rna3d/display_bases" |
---|
44 | #define AWAR_3D_DISPLAY_SIZE "rna3d/display_size" |
---|
45 | #define AWAR_3D_BASES_MODE "rna3d/bases_mode" |
---|
46 | #define AWAR_3D_BASES_HELIX "rna3d/bases_helix" |
---|
47 | #define AWAR_3D_BASES_UNPAIRED_HELIX "rna3d/bases_unpaired_helix" |
---|
48 | #define AWAR_3D_BASES_NON_HELIX "rna3d/bases_non_helix" |
---|
49 | #define AWAR_3D_SHAPES_HELIX "rna3d/shapes_helix" |
---|
50 | #define AWAR_3D_SHAPES_UNPAIRED_HELIX "rna3d/shapes_unpaired_helix" |
---|
51 | #define AWAR_3D_SHAPES_NON_HELIX "rna3d/shapes_non_helix" |
---|
52 | |
---|
53 | // Awars for General Molecule |
---|
54 | #define AWAR_3D_MOL_BACKBONE "rna3d/mol_backbone" |
---|
55 | #define AWAR_3D_MOL_COLORIZE "rna3d/mol_colorize" |
---|
56 | #define AWAR_3D_MOL_SIZE "rna3d/mol_size" |
---|
57 | #define AWAR_3D_MOL_DISP_POS "rna3d/mol_disp_pos" |
---|
58 | #define AWAR_3D_MOL_POS_INTERVAL "rna3d/mol_pos_interval" |
---|
59 | #define AWAR_3D_MOL_ROTATE "rna3d/mol_rotate" |
---|
60 | |
---|
61 | #define AWAR_3D_MAP_SPECIES "rna3d/mol_map_species" |
---|
62 | #define AWAR_3D_MAP_SPECIES_DISP_BASE "rna3d/mol_map_species_base" |
---|
63 | #define AWAR_3D_MAP_SPECIES_DISP_POS "rna3d/mol_map_species_pos" |
---|
64 | #define AWAR_3D_MAP_SPECIES_DISP_DELETIONS "rna3d/mol_map_species_deletions" |
---|
65 | #define AWAR_3D_MAP_SPECIES_DISP_MISSING "rna3d/mol_map_species_missing" |
---|
66 | #define AWAR_3D_MAP_SPECIES_DISP_INSERTIONS "rna3d/mol_map_species_insertions" |
---|
67 | #define AWAR_3D_MAP_SPECIES_DISP_INSERTIONS_INFO "rna3d/mol_map_species_insertions_info" |
---|
68 | |
---|
69 | #define AWAR_3D_SELECTED_SPECIES "rna3d/selected_species" |
---|
70 | #define AWAR_3D_CURSOR_POSITION "rna3d/cursor_postion" |
---|
71 | |
---|
72 | #define AWAR_3D_MAP_ENABLE "rna3d/map_enable" |
---|
73 | #define AWAR_3D_MAP_SAI "rna3d/map_sai" |
---|
74 | #define AWAR_3D_MAP_SEARCH_STRINGS "rna3d/map_search_strings" |
---|
75 | |
---|
76 | #define AWAR_3D_DISPLAY_MASK "rna3d/display_mask" |
---|
77 | #define AWAR_3D_23S_RRNA_MOL "rna3d/rrna_mol_23s" |
---|
78 | |
---|
79 | struct Vector3 { |
---|
80 | float x, y, z; |
---|
81 | |
---|
82 | Vector3() : x(0), y(0), z(0) {} // default is zero vector |
---|
83 | Vector3(float X, float Y, float Z) : x(X), y(Y), z(Z) {} |
---|
84 | |
---|
85 | // Overloading Operator(+,-,*,/) functions |
---|
86 | |
---|
87 | // adding 2 vectors |
---|
88 | Vector3 operator+(Vector3 v) { return Vector3(v.x + x, v.y + y, v.z + z); } |
---|
89 | |
---|
90 | // subtracting 2 vectors |
---|
91 | Vector3 operator-(Vector3 v) { return Vector3(x - v.x, y - v.y, z - v.z); } |
---|
92 | |
---|
93 | // multiply by scalars |
---|
94 | Vector3 operator*(float num) { return Vector3(x * num, y * num, z * num); } |
---|
95 | |
---|
96 | // divide by scalars |
---|
97 | Vector3 operator/(float num) { return Vector3(x / num, y / num, z / num); } |
---|
98 | }; |
---|
99 | |
---|
100 | |
---|
101 | // Class to store all the GLOBAL variables that are used in the application |
---|
102 | |
---|
103 | class OpenGLGraphics; |
---|
104 | class Structure3D; |
---|
105 | class Texture2D; |
---|
106 | class GLRenderer; |
---|
107 | |
---|
108 | class AW_root; |
---|
109 | class AWT_canvas; |
---|
110 | struct ED4_plugin_host; |
---|
111 | |
---|
112 | struct RNA3D_Global : virtual Noncopyable { |
---|
113 | Widget glw; |
---|
114 | AW_root *root; |
---|
115 | AWT_canvas *gl_Canvas; |
---|
116 | |
---|
117 | int OpenGLEngineState; |
---|
118 | int iRotateMolecule; |
---|
119 | |
---|
120 | bool bPointSpritesSupported; |
---|
121 | bool bAutoRotate; |
---|
122 | bool bRotateMolecule; |
---|
123 | bool bDisplayMask; |
---|
124 | bool bDisplayComments; |
---|
125 | |
---|
126 | bool bEColiRefInitialized; |
---|
127 | bool bMapSearchStringsDispListCreated; |
---|
128 | bool bMapSaiDispListCreated; |
---|
129 | |
---|
130 | float ROTATION_SPEED; |
---|
131 | float saved_x, saved_y; |
---|
132 | float scale; |
---|
133 | |
---|
134 | OpenGLGraphics *cGraphics; |
---|
135 | Structure3D *cStructure; |
---|
136 | Texture2D *cTexture; |
---|
137 | GLRenderer *cRenderer; |
---|
138 | |
---|
139 | Vector3 Viewer; |
---|
140 | Vector3 Center; |
---|
141 | Vector3 Up; |
---|
142 | |
---|
143 | RNA3D_Global(ED4_plugin_host& host); |
---|
144 | ~RNA3D_Global(); |
---|
145 | }; |
---|
146 | |
---|
147 | // global variables |
---|
148 | |
---|
149 | extern RNA3D_Global *RNA3D; |
---|
150 | |
---|
151 | void RNA3D_init_global_data(ED4_plugin_host& host); |
---|
152 | |
---|
153 | #else |
---|
154 | #error RNA3D_Global.hxx included twice |
---|
155 | #endif // RNA3D_GLOBAL_HXX |
---|