ARB
RNA3D_Interface.cxx
Go to the documentation of this file.
1 #include "RNA3D_GlobalHeader.hxx"
2 
3 #include <GL/aw_window_ogl.hxx>
5 
6 #include "RNA3D_Global.hxx"
7 #include "RNA3D_Graphics.hxx"
8 #include "RNA3D_OpenGLEngine.hxx"
9 #include "RNA3D_Interface.hxx"
10 #include "RNA3D_OpenGLGraphics.hxx"
11 #include "RNA3D_StructureData.hxx"
12 
13 #include <string>
14 #include <iostream>
15 
16 #include <X11/keysym.h>
17 
18 #include <aw_preset.hxx>
19 #include <aw_root.hxx>
20 #include <aw_msg.hxx>
21 #include <aw_awars.hxx>
22 
23 
24 using namespace std;
25 
27 static XtAppContext appContext;
28 static XtWorkProcId workId = 0;
29 
30 // ========= SpinMolecule(XtPointer ...) : The Actual WorkProc Routine ============//
31 // => Sets the Rotation speed to 0.05 : default speed in Rotation Mode.
32 // => Calls RefreshOpenGLDisplay() : to calculate new rotate matrix
33 // and then, redraws the entire scene.
34 // => Returns False : so that the work proc remains registered and
35 // the animation will continue.
36 // ===============================================================================//
37 
38 static Boolean SpinMolecule(XtPointer /* clientData */) {
39  RNA3D->ROTATION_SPEED = 0.05;
41  return false; // leave work proc active
42 }
43 
44 // ========== RotateMoleculeStateChanged(void)==================================//
45 // => if bAutoRotate, removes the WorkProc routine and sets bAutoRotate to false.
46 // => if not, adds the WorkProc routine [SpinMolecule()] and sets bAutoRotate to true.
47 // bAutoRotate is used in recalculation of Rotation Matrix
48 // in RenderOpenGLScene() ==> defined in RNA3D_OpenGLEngine.cxx.
49 // ===============================================================================//
50 
52  bool rotate = awr->awar(AWAR_3D_MOL_ROTATE)->read_int();
53  if (rotate != RNA3D->bAutoRotate) {
54  if (RNA3D->bAutoRotate) {
55  XtRemoveWorkProc(workId);
56  RNA3D->bAutoRotate = false;
57  }
58  else {
59  workId = XtAppAddWorkProc(appContext, SpinMolecule, NULp);
60  RNA3D->bAutoRotate = true;
61  }
62  }
63 }
64 
65 // ============ RotateMoleculeStateChanged_cb(AW_root *awr)===========================//
66 // Callback bound to Rotatation Awar (AWAR_3D_MOL_ROTATE)
67 // Is called when the
68 // 1. Rotation Awar is changed.
69 // 2. Also when the Spacebar is pressed in KeyBoardEventHandler().
70 // ===============================================================================//
71 
76 }
77 
78 static void ResizeOpenGLWindow(Widget /* w */, XtPointer /* client_data */, XEvent *event, char* /* x */) {
79  XConfigureEvent *evt;
80  evt = (XConfigureEvent*) event;
81 
83  return;
84  }
85 
86  ReshapeOpenGLWindow((GLint) evt->width, (GLint) evt->height);
87 
89 }
90 
91 static void KeyReleaseEventHandler(Widget /* w */, XtPointer /* client_data */, XEvent * /* event */, char* /* x */) {
93 }
94 
95 static void KeyPressEventHandler(Widget /* w */, XtPointer /* client_data */, XEvent *event, char* /* x */) {
96  char buffer[1];
97  KeySym keysym;
98 
99  // Converting keycode to keysym
100  XLookupString((XKeyEvent *) event, buffer, 1, &keysym, NULp);
101 
102  switch (keysym) {
103  case XK_space:
106  break;
107  case XK_Escape:
109  break;
110  case XK_Tab:
112  break;
113  case XK_Up:
114  RNA3D->Center.y -= 0.1;
115  break;
116  case XK_Down:
117  RNA3D->Center.y += 0.1;
118  break;
119  case XK_Left:
120  RNA3D->Center.x -= 0.1;
121  break;
122  case XK_Right:
123  RNA3D->Center.x += 0.1;
124  break;
125  }
126 
128 }
129 
130 static void ButtonReleaseEventHandler(Widget /* w */, XtPointer /* client_data */, XEvent *event, char* /* x */) {
131  XButtonEvent *xr;
132  xr = (XButtonEvent*) event;
133 
134  switch (xr->button) {
135  case LEFT_BUTTON: RNA3D->bRotateMolecule = false; break;
136  case MIDDLE_BUTTON: break;
137  case RIGHT_BUTTON: break;
138  }
139 
141 }
142 
143 static void ButtonPressEventHandler(Widget /* w */, XtPointer /* client_data */, XEvent *event, char* /* x */) {
144 
145  XButtonEvent *xp;
146  xp = (XButtonEvent*) event;
147 
148  switch (xp->button) {
149  case LEFT_BUTTON:
150  RNA3D->bRotateMolecule = true;
151  RNA3D->saved_x = xp->x;
152  RNA3D->saved_y = xp->y;
153  break;
154 
155  case MIDDLE_BUTTON:
157  break;
158 
159  case RIGHT_BUTTON:
160  break;
161 
162  case WHEEL_UP:
163  RNA3D->scale += ZOOM_FACTOR;
164  break;
165 
166  case WHEEL_DOWN:
167  RNA3D->scale -= ZOOM_FACTOR;
168  break;
169  }
170 
172 }
173 
174 static void MouseMoveEventHandler(Widget /* w */, XtPointer /* client_data */, XEvent *event, char* /* x */) {
175 
176  XMotionEvent *xp;
177  xp = (XMotionEvent*) event;
178 
179  if (!RNA3D->bAutoRotate) {
180  RNA3D->ROTATION_SPEED = 0.5;
181  }
182 
183  if (RNA3D->bRotateMolecule) {
184  // ComputeRotationXY : computes new rotation X and Y based on the mouse movement
185  ComputeRotationXY(xp->x, xp->y);
186  }
187 
189 }
190 
191 static void ExposeOpenGLWindow(Widget w, XtPointer /* client_data */, XEvent *event, char* /* x */) {
192  static bool ok = false;
193 
196 
197  XExposeEvent *evt;
198  evt = (XExposeEvent*) event;
199 
200  try {
201  InitializeOpenGLEngine((GLint) evt->height, (GLint) evt->height);
202  ReshapeOpenGLWindow((GLint) evt->width, (GLint) evt->height);
203  ok = true;
204  }
205  catch (string& err) {
206  // errors catched here should close the RNA3D window again (or prevent it from opening)
207  aw_message(GBS_global_string("Error in RNA3D: %s", err.c_str()));
208  awm->hide();
209  }
210  }
211 
212  if (ok) RefreshOpenGLDisplay();
213 }
214 
216 
217  if (RNA3D->OpenGLEngineState == CREATED) {
219  }
220 }
221 
222 static void RefreshCanvas(AW_root *awr) {
225 }
226 
228  // overwrites color settings with those from EDIT4
229 
230  AW_copy_GC_colors(aww->get_root(), "ARB_EDIT4", "RNA3D",
231  "User1", "User2", "Probe",
232  "Primerl", "Primerr", "Primerg",
233  "Sigl", "Sigr", "Sigg",
234  "RANGE_0", "RANGE_1", "RANGE_2",
235  "RANGE_3", "RANGE_4", "RANGE_5",
236  "RANGE_6", "RANGE_7", "RANGE_8",
237  "RANGE_9",
238  NULp);
239 }
240 
241 static void Change3DMolecule_CB(AW_root *awr) {
242  cout<<"Rendering new 3D molecule.... please wait..."<<endl;
243 
245 
246  RNA3D->cStructure->DeleteOldMoleculeData(); // Deleting the old molecule data
247  RNA3D->cStructure->ReadCoOrdinateFile(); // Reading Structure information
248  RNA3D->cStructure->GetSecondaryStructureInfo(); // Getting Secondary Structure Information
249  RNA3D->cStructure->Combine2Dand3DstructureInfo(); // Combining Secondary Structure data with 3D Coordinates
250  RNA3D->cStructure->GenerateDisplayLists(); // Generating Display Lists for Rendering
251 
252  // recalculate the mapping information
253  awr->awar(AWAR_SPECIES_NAME)->touch();
254 
255  // recalculate helix numbering
256  awr->awar(AWAR_3D_HELIX_FROM)->touch();
257 
258  // render new structure in OpenGL window
259  RefreshCanvas(awr);
260 }
261 
262 static void Change3DMolecule(AW_window *aww, int molID) {
263  // changes the displayed 3D structure in the case of 23S rRNA
264  aww->get_root()->awar(AWAR_3D_23S_RRNA_MOL)->write_int(molID);
265 }
266 
267 static void DisplayMoleculeMask(AW_root * /* awr */) {
270 }
271 
272 
273 // ---------------------------- Creating WINDOWS ------------------------------
274 static void AddCallBacks(AW_root *awr) {
275  // adding callbacks to the awars to refresh the display if received any changes
276 
277  // General Molecule Display Section
286 
287  // Display Base Section
297 
298  // Display Helix Section
302  awr->awar(AWAR_3D_HELIX_FROM)->add_callback(makeRootCallback(DisplayHelixNrsChanged_CB, false));
303  awr->awar(AWAR_3D_HELIX_TO)->add_callback(makeRootCallback(DisplayHelixNrsChanged_CB, true));
307 
308  // Mapping Sequence Data Section
311 
315 
323 
326 }
327 
328 static void InitCallBacks(AW_root *awr) {
329  // init callbacks
331 }
332 
333 static void RefreshMappingDisplay(AW_window * /* aw */) {
334  // Refreshes the SAI Display if and when ...
335  // 1.Changes made to SAI related settings in EDIT4 and not updated automatically
336  // 2.Colors related to SAI Display changed in RNA3D Application
338 
339  // Refreshes the Search Strings Display if
340  // Colors related to Search Strings changed in RNA3D Application
341  // and not updated automatically
343 
344  // Resetting the Molecule Transformations
345  // 1.Reset the Molecule view to Center of the viewer (default view).
346  // 2.Zoom the Molecule to fit to window (default zoom).
347  RNA3D->Center = Vector3(0.0, 0.0, 0.0);
348  RNA3D->scale = 0.01;
349 
351 }
352 
353 static void insertShapeSelection(AW_window *aws, const char *at, const char *awar_name) {
354  aws->at(at);
355  aws->create_toggle_field(awar_name, AW_HORIZONTAL);
356  aws->insert_toggle("#circle.xpm", "C", 0);
357  aws->insert_toggle("#diamond.xpm", "D", 1);
358  aws->insert_toggle("#polygon.xpm", "P", 2);
359  aws->insert_toggle("#star.xpm", "S", 3);
360  aws->insert_toggle("#rectangle.xpm", "R", 4);
361  aws->update_toggle_field();
362 }
363 
365  AW_window_simple *aws = new AW_window_simple;
366 
367  aws->init(aw_root, "DISPLAY_BASES", "RNA3D : Display BASES");
368  aws->load_xfig("RNA3D_DisplayBases.fig");
369 
370  aws->callback(makeHelpCallback("rna3d_dispBases.hlp"));
371  aws->at("help");
372  aws->button_length(0);
373  aws->create_button("HELP", "#help.xpm");
374 
375  aws->at("close");
376  aws->callback(AW_POPDOWN);
377  aws->button_length(0);
378  aws->create_button("CLOSE", "#closeText.xpm");
379 
380  { // Display Bases Section
381  aws->at("dispBases");
382  aws->create_toggle(AWAR_3D_DISPLAY_BASES);
383 
384  aws->at("helix");
385  aws->create_toggle(AWAR_3D_BASES_HELIX);
386  aws->at("unpairHelix");
387  aws->create_toggle(AWAR_3D_BASES_UNPAIRED_HELIX);
388  aws->at("nonHelix");
389  aws->create_toggle(AWAR_3D_BASES_NON_HELIX);
390 
391  aws->at("shapesSize");
392  aws->create_input_field(AWAR_3D_DISPLAY_SIZE, 5);
393 
394  aws->at("basesMode");
395  aws->create_toggle_field(AWAR_3D_BASES_MODE, AW_VERTICAL);
396  aws->insert_toggle("CHARACTERS", "C", 0);
397  aws->insert_toggle("SHAPES", "S", 1);
398  aws->update_toggle_field();
399 
401  insertShapeSelection(aws, "spUnpairedHelix", AWAR_3D_SHAPES_UNPAIRED_HELIX);
403  }
404 
405  aws->show();
406 
407  return aws;
408 }
409 
411  AW_window_simple *aws = new AW_window_simple;
412 
413  aws->init(aw_root, "DISPLAY_HELICES", "RNA3D : Display HELICES");
414  aws->load_xfig("RNA3D_DisplayHelices.fig");
415 
416  aws->callback(makeHelpCallback("rna3d_dispHelices.hlp"));
417  aws->at("help");
418  aws->button_length(0);
419  aws->create_button("HELP", "#help.xpm");
420 
421  aws->at("close");
422  aws->callback(AW_POPDOWN);
423  aws->button_length(0);
424  aws->create_button("CLOSE", "#closeText.xpm");
425 
426  { // Display Helices Section
427  aws->at("dispHelix");
428  aws->create_toggle(AWAR_3D_DISPLAY_HELIX);
429 
430  aws->at("backbone");
431  aws->create_toggle(AWAR_3D_HELIX_BACKBONE);
432  aws->at("midHelix");
433  aws->create_toggle(AWAR_3D_HELIX_MIDPOINT);
434  aws->at("helixNr");
435  aws->create_toggle(AWAR_3D_HELIX_NUMBER);
436  aws->at("from");
437  aws->create_input_field(AWAR_3D_HELIX_FROM, 5);
438  aws->at("to");
439  aws->create_input_field(AWAR_3D_HELIX_TO, 5);
440  aws->at("helixSize");
441  aws->create_input_field(AWAR_3D_HELIX_SIZE, 5);
442  {
443  const char *helixRange = NULp;
444 
446  int rnaType = RNA3D->cStructure->FindTypeOfRNA();
447 
448  switch (rnaType) {
449  case LSU_23S: helixRange = "[1-101]"; break;
450  case SSU_16S: helixRange = "[1-50]"; break;
451  case LSU_5S: helixRange = "[1-5]"; break;
452  }
453  aws->at("rangeLabel");
454  aws->create_autosize_button(NULp, helixRange);
455  }
456 
457  aws->at("dispTI");
458  aws->create_toggle(AWAR_3D_DISPLAY_TERTIARY_INTRACTIONS);
459  }
460  aws->show();
461  return aws;
462 }
463 
465  AW_window_simple *aws = new AW_window_simple;
466 
467  aws->init(aw_root, "GENERAL_DISPLAY", "RNA3D : General Display ");
468  aws->load_xfig("RNA3D_DisplayOptions.fig");
469 
470  aws->callback(makeHelpCallback("rna3d_dispMolecule.hlp"));
471  aws->at("help");
472  aws->button_length(0);
473  aws->create_button("HELP", "#help.xpm");
474 
475  aws->at("close");
476  aws->callback(AW_POPDOWN);
477  aws->button_length(0);
478  aws->create_button("CLOSE", "#closeText.xpm");
479 
480  { // Display Molecule Section
481  aws->at("backbone");
482  aws->create_toggle(AWAR_3D_MOL_BACKBONE);
483  aws->at("color");
484  aws->create_toggle(AWAR_3D_MOL_COLORIZE);
485  aws->at("dispPos");
486  aws->create_toggle(AWAR_3D_MOL_DISP_POS);
487  aws->at("rot");
488  aws->create_toggle(AWAR_3D_MOL_ROTATE);
489  aws->at("pos");
490  aws->create_input_field(AWAR_3D_MOL_POS_INTERVAL, 2);
491  aws->at("molSize");
492  aws->create_input_field(AWAR_3D_MOL_SIZE, 5);
493  aws->at("cp");
494  aws->create_toggle(AWAR_3D_CURSOR_POSITION);
495  }
496  aws->show();
497  return aws;
498 }
499 
500 
502  AW_window_simple *aws = new AW_window_simple;
503 
504  aws->init(aw_root, "MAP_SPECIES", "RNA3D : Map Sequence Data ");
505  aws->load_xfig("RNA3D_SeqMapping.fig");
506 
507  aws->callback(makeHelpCallback("rna3d_mapSeqData.hlp"));
508  aws->at("help");
509  aws->button_length(0);
510  aws->create_button("HELP", "#help.xpm");
511 
512  aws->at("close");
513  aws->callback(AW_POPDOWN);
514  aws->button_length(0);
515  aws->create_button("CLOSE", "#closeText.xpm");
516 
517  aws->callback(SynchronizeColorsWithEditor);
518  aws->at("sync");
519  aws->button_length(35);
520  aws->create_button("SYNC", "SYNCHRONIZE COLORS WITH EDITOR");
521 
522  { // Display Map Current Species Section
523  aws->at("en");
524  aws->create_toggle(AWAR_3D_MAP_ENABLE);
525 
526  aws->at("src");
527  aws->create_toggle(AWAR_3D_MAP_SEARCH_STRINGS);
528 
529  aws->at("sai");
530  aws->create_toggle(AWAR_3D_MAP_SAI);
531 
532  aws->callback(RefreshMappingDisplay);
533  aws->at("ref");
534  aws->button_length(0);
535  aws->create_button("REFRESH", "#refresh.xpm");
536 
537  aws->at("sp");
538  aws->create_toggle(AWAR_3D_MAP_SPECIES);
539  aws->at("base");
540  aws->create_toggle(AWAR_3D_MAP_SPECIES_DISP_BASE);
541  aws->at("pos");
542  aws->create_toggle(AWAR_3D_MAP_SPECIES_DISP_POS);
543  aws->at("del");
544  aws->create_toggle(AWAR_3D_MAP_SPECIES_DISP_DELETIONS);
545  aws->at("mis");
546  aws->create_toggle(AWAR_3D_MAP_SPECIES_DISP_MISSING);
547  aws->at("ins");
548  aws->create_toggle(AWAR_3D_MAP_SPECIES_DISP_INSERTIONS);
549  aws->at("bs");
550  aws->create_toggle(AWAR_3D_MAP_SPECIES_DISP_INSERTIONS_INFO);
551  }
552  aws->show();
553  return aws;
554 }
555 
557  AW_window_simple *aws = new AW_window_simple;
558 
559  aws->init(aw_root, "CHANGE_MOLECULE", "RNA3D : Change 3D Molecule");
560  aws->load_xfig("RNA3D_ChangeMolecule.fig");
561 
562  aws->callback(makeHelpCallback("rna3d_changeMolecule.hlp"));
563  aws->at("help");
564  aws->button_length(0);
565  aws->create_button("HELP", "#help.xpm");
566 
567  aws->at("close");
568  aws->callback(AW_POPDOWN);
569  aws->button_length(0);
570  aws->create_button("CLOSE", "#closeText.xpm");
571 
572  aws->callback(makeWindowCallback(Change3DMolecule, 1));
573  aws->at("1pnu");
574  aws->button_length(73);
575  aws->create_button(NULp, "1PNU: 8.7 A^ Vila-Sanjurjo et al. Proc.Nat.Acad.Sci.(2003) 100, 8682.");
576 
577  aws->callback(makeWindowCallback(Change3DMolecule, 2));
578  aws->at("1vor");
579  aws->button_length(73);
580  aws->create_button(NULp, "1VOR: 11.5 A^ Vila-Sanjurjo et al. Nat.Struct.Mol.Biol.(2004) 11, 1054.");
581 
582  aws->callback(makeWindowCallback(Change3DMolecule, 3));
583  aws->at("1c2w");
584  aws->button_length(73);
585  aws->create_button(NULp, "1C2W: 7.5 A^ Mueller et al. J.Mol.Biol.(2000) 298, 35-59.", NULp, "white");
586 
587  aws->show();
588  return aws;
589 }
590 
592  return AW_create_gc_window_named(awr, gcman, "RNA3D_COLOR_DEF2", "RNA3D colors and fonts");
593 }
594 
596  // Main Window - Canvas on which the actual painting is done
597  GB_transaction ta(gb_main);
598 
600 
602 
603  awm = new AW_window_menu_modes_opengl;
604  awm->init(awr, "RNA3D", "RNA3D: 3D Structure of Ribosomal RNA", WINDOW_WIDTH, WINDOW_HEIGHT);
605 
606  RNA3D_Graphics *rna3DGraphics = new RNA3D_Graphics(awr, gb_main);
607 
609 
610  RNA3D->gl_Canvas = new AWT_canvas(Structure3D::gb_main, awm, awm->get_window_id(), rna3DGraphics);
611 
612  AWT_auto_refresh allowed_on(RNA3D->gl_Canvas);
615 
616  awm->create_menu("File", "F", AWM_ALL);
617  {
619  int rnaType = RNA3D->cStructure->FindTypeOfRNA();
620  if (rnaType == LSU_23S) {
621  awm->insert_menu_topic("changeMolecule", "Change Molecule", "M", "rna3d_changeMolecule.hlp", AWM_ALL, CreateChangeMolecule_window);
622  }
623  }
624  awm->insert_menu_topic("close", "Close", "C", "quit.hlp", AWM_ALL, AW_POPDOWN);
625 
626  {
627  awm->at(1, 2);
628  awm->auto_space(2, 0);
629  awm->shadow_width(1);
630 
631  int cur_x, cur_y, start_x, first_line_y, second_line_y;
632  awm->get_at_position(&start_x, &first_line_y);
633  awm->button_length(0);
634  awm->callback(AW_POPDOWN);
635  awm->create_button("Quit", "#quit.xpm");
636 
637  awm->get_at_position(&cur_x, &cur_y);
639  awm->button_length(0);
640  awm->create_button("REFRESH", "#refresh.xpm");
641 
642  awm->get_at_position(&cur_x, &cur_y);
643  awm->button_length(0);
644  awm->create_toggle(AWAR_3D_DISPLAY_MASK, "#unmask.xpm", "#mask.xpm");
645 
646  awm->get_at_position(&cur_x, &cur_y);
647  awm->callback(makeCreateWindowCallback(CreateRNA3DGcWindow, RNA3D->gl_Canvas->gc_manager));
648  awm->button_length(0);
649  awm->create_button("setColors", "#colors.xpm");
650 
651  awm->get_at_position(&cur_x, &cur_y);
652  awm->help_text("rna3d_dispBases.hlp");
654  awm->button_length(0);
655  awm->create_button("displayBases", "#basesText.xpm");
656 
657  awm->get_at_position(&cur_x, &cur_y);
658  awm->at(cur_x-10, cur_y);
659  awm->create_toggle(AWAR_3D_DISPLAY_BASES, "#uncheck.xpm", "#check.xpm");
660 
661  awm->get_at_position(&cur_x, &cur_y);
662  awm->help_text("rna3d_dispHelices.hlp");
664  awm->button_length(0);
665  awm->create_button("displayHelix", "#helixText.xpm");
666 
667  awm->get_at_position(&cur_x, &cur_y);
668  awm->at(cur_x-10, cur_y);
669  awm->create_toggle(AWAR_3D_DISPLAY_HELIX, "#uncheck.xpm", "#check.xpm");
670 
671  awm->get_at_position(&cur_x, &cur_y);
672  awm->help_text("rna3d_dispMolecule.hlp");
674  awm->button_length(0);
675  awm->create_button("displayMolecule", "#molText.xpm");
676 
677  awm->get_at_position(&cur_x, &cur_y);
678  awm->help_text("rna3d_mapSeqData.hlp");
680  awm->button_length(0);
681  awm->create_button("mapSpecies", "#mapping.xpm");
682 
683  awm->get_at_position(&cur_x, &cur_y);
684  awm->at(cur_x-10, cur_y);
685  awm->create_toggle(AWAR_3D_MAP_ENABLE, "#uncheck.xpm", "#check.xpm");
686 
687  awm->get_at_position(&cur_x, &cur_y);
688  awm->callback(makeHelpCallback("rna3d_general.hlp"));
689  awm->button_length(0);
690  awm->create_button("help", "#helpText.xpm");
691 
692  awm->at_newline();
693  awm->get_at_position(&cur_x, &second_line_y);
694  awm->create_autosize_button(NULp, " Spacebar = auto rotate mode on/off | Mouse Left Button + Move = Rotates Molecule | Mouse Wheel = Zoom in/out");
695  }
696 
697  AddCallBacks(awr);
698  RNA3D->root = awr;
699 
701 
703 
704  // Add event handlers:
705  Widget middle_area_widget = AW_get_AreaWidget(RNA3D->gl_Canvas->aww, AW_MIDDLE_AREA);
706 
707  XtAddEventHandler(middle_area_widget, StructureNotifyMask, 0, ResizeOpenGLWindow, (XtPointer)NULp);
708  XtAddEventHandler(middle_area_widget, ExposureMask, 0, ExposeOpenGLWindow, (XtPointer)NULp);
709  XtAddEventHandler(middle_area_widget, KeyPressMask, 0, KeyPressEventHandler, (XtPointer)NULp);
710  XtAddEventHandler(middle_area_widget, KeyReleaseMask, 0, KeyReleaseEventHandler, (XtPointer)NULp);
711  XtAddEventHandler(middle_area_widget, ButtonPressMask, 0, ButtonPressEventHandler, (XtPointer)NULp);
712  XtAddEventHandler(middle_area_widget, ButtonReleaseMask, 0, ButtonReleaseEventHandler, (XtPointer)NULp);
713  XtAddEventHandler(middle_area_widget, PointerMotionMask, 0, MouseMoveEventHandler, (XtPointer)NULp);
714 
715 #ifdef DEBUG
716  cout<<"RNA3D: OpenGL Window created!"<<endl;
717 #endif
718 
719  InitCallBacks(awr);
720 
721  return awm;
722 }
#define AWAR_3D_MAP_SEARCH_STRINGS
static AW_window * CreateDisplayHelices_window(AW_root *aw_root)
void CursorPositionChanged_CB(AW_root *awr)
#define arb_assert(cond)
Definition: arb_assert.h:245
AW_window * AW_create_gc_window_named(AW_root *aw_root, AW_gc_manager *gcman, const char *wid, const char *windowname)
Definition: AW_preset.cxx:1323
static GBDATA * gb_main
void get_at_position(int *x, int *y) const
Definition: AW_at.cxx:296
static AW_window * CreateChangeMolecule_window(AW_root *aw_root)
static Boolean SpinMolecule(XtPointer)
void insert_toggle(AW_label toggle_label, const char *mnemonic, const char *var_value)
void button_length(int length)
Definition: AW_at.cxx:288
#define LSU_5S
#define AWAR_3D_SHAPES_UNPAIRED_HELIX
void insert_menu_topic(const char *id, const char *name, const char *mnemonic, const char *help_text_, AW_active mask, const WindowCallback &wcb)
Definition: AW_window.cxx:595
#define AWAR_3D_MOL_BACKBONE
void load_xfig(const char *file, bool resize=true)
Definition: AW_window.cxx:720
Structure3D * cStructure
const char * get_window_id() const
Definition: aw_window.hxx:375
XtAppContext AW_get_XtAppContext(AW_root *aw_root)
static void SynchronizeColorsWithEditor(AW_window *aww)
static AW_window * CreateMapSequenceData_window(AW_root *aw_root)
#define AWAR_3D_MAP_SPECIES_DISP_BASE
static void ResizeOpenGLWindow(Widget, XtPointer, XEvent *event, char *)
#define AWAR_CURSOR_POSITION
#define AWAR_3D_MOL_ROTATE
static void Change3DMolecule(AW_window *aww, int molID)
int Boolean
Definition: ClustalV.cxx:45
void at(int x, int y)
Definition: AW_at.cxx:93
void create_toggle(const char *awar_name)
Definition: AW_button.cxx:844
#define AWAR_3D_MOL_SIZE
void RefreshOpenGLDisplay()
long read_int() const
Definition: AW_awar.cxx:184
void ReshapeOpenGLWindow(GLint width, GLint height)
#define AWAR_3D_MAP_SPECIES
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:203
#define AWAR_3D_HELIX_TO
void DisplayPostionsIntervalChanged_CB(AW_root *awr)
STL namespace.
void AW_POPDOWN(AW_window *window)
Definition: AW_window.cxx:52
#define AWAR_3D_MOL_COLORIZE
#define AWAR_3D_HELIX_FROM
#define AWAR_3D_MAP_SPECIES_DISP_POS
static void DisplayMoleculeMask(AW_root *)
#define AWAR_3D_CURSOR_POSITION
float ROTATION_SPEED
char buffer[MESSAGE_BUFFERSIZE]
Definition: seq_search.cxx:34
#define AWAR_3D_SHAPES_HELIX
static void ExposeOpenGLWindow(Widget w, XtPointer, XEvent *event, char *)
void update_toggle_field()
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:231
#define AWAR_3D_SAI_SELECTED
#define AWAR_3D_MAP_SPECIES_DISP_MISSING
static XtWorkProcId workId
#define AWAR_3D_DISPLAY_TERTIARY_INTRACTIONS
#define AWAR_3D_23S_RRNA_MOL
#define AWAR_3D_MAP_ENABLE
WindowCallback makeHelpCallback(const char *helpfile)
Definition: aw_window.hxx:106
void create_toggle_field(const char *awar_name, AW_label label, AW_orientation orientation=AW_VERTICAL)
#define AWAR_SAI_GLOBAL
#define AWAR_3D_MAP_SPECIES_DISP_INSERTIONS
#define AWAR_3D_BASES_HELIX
Widget AW_get_AreaWidget(AW_window *aww, AW_area area)
#define AWAR_3D_DISPLAY_HELIX
void create_menu(const char *name, const char *mnemonic, AW_active mask=AWM_ALL)
Definition: AW_window.cxx:472
static void ButtonPressEventHandler(Widget, XtPointer, XEvent *event, char *)
#define NOT_CREATED
void help_text(const char *id)
Definition: AW_window.cxx:116
void touch()
Definition: AW_awar.cxx:207
void MapSelectedSpeciesChanged_CB(AW_root *awr)
#define AWAR_3D_BASES_NON_HELIX
static void KeyPressEventHandler(Widget, XtPointer, XEvent *event, char *)
#define AWAR_3D_DISPLAY_BASES
#define AWAR_3D_MOL_POS_INTERVAL
#define SSU_16S
AWT_canvas * gl_Canvas
void InitializeOpenGLWindow(Widget w)
#define AWAR_3D_MAP_SPECIES_DISP_INSERTIONS_INFO
static AW_window * CreateRNA3DGcWindow(AW_root *awr, AW_gc_manager *gcman)
#define AWAR_3D_MAP_SPECIES_DISP_DELETIONS
virtual void init(AW_root *root, const char *wid, const char *windowname, int width, int height)
#define AWAR_SPECIES_NAME
static void AddCallBacks(AW_root *awr)
void AW_copy_GC_colors(AW_root *aw_root, const char *source_gcman, const char *dest_gcman, const char *id0,...)
Definition: AW_preset.cxx:1090
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
#define AWAR_3D_HELIX_NUMBER
#define AWAR_3D_HELIX_MIDPOINT
void ComputeRotationXY(int x, int y)
#define AWAR_3D_MOL_DISP_POS
static void insertShapeSelection(AW_window *aws, const char *at, const char *awar_name)
void create_autosize_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, unsigned xtraSpace=1)
Definition: AW_button.cxx:421
static AW_window_menu_modes_opengl * awm
#define LSU_23S
#define WINDOW_HEIGHT
void DisplayHelixNrsChanged_CB(AW_root *awr, bool upper_limit_changed)
#define AWAR_3D_DISPLAY_MASK
static int FindTypeOfRNA()
#define AWAR_3D_DISPLAY_SIZE
static void ButtonReleaseEventHandler(Widget, XtPointer, XEvent *event, char *)
void set_mode(AWT_COMMAND_MODE mo)
Definition: awt_canvas.hxx:382
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:580
void auto_space(int xspace, int yspace)
Definition: AW_at.cxx:259
static void Change3DMolecule_CB(AW_root *awr)
static void RefreshCanvas(AW_root *awr)
void MapSaiToEcoliTemplateChanged_CB(AW_root *)
void InitializeOpenGLEngine(GLint width, GLint height)
#define AWAR_3D_SHAPES_NON_HELIX
AW_gc_manager * gc_manager
Definition: awt_canvas.hxx:341
#define WINDOW_WIDTH
void RNA3D_init_global_data(ED4_plugin_host &host)
void MapSearchStringsToEcoliTemplateChanged_CB(AW_root *awr)
#define AWAR_3D_HELIX_SIZE
AW_window * CreateRNA3DMainWindow(AW_root *awr, GBDATA *gb_main, ED4_plugin_host &host)
void RenderOpenGLScene(Widget w)
#define AWAR_3D_BASES_UNPAIRED_HELIX
void MapDisplayParameters(AW_root *root)
void aw_message(const char *msg)
Definition: AW_status.cxx:1142
void hide()
Definition: AW_window.cxx:1835
AW_root * get_root()
Definition: aw_window.hxx:359
static void RefreshMappingDisplay(AW_window *)
static AW_window * CreateDisplayBases_window(AW_root *aw_root)
static void RotateMoleculeStateChanged_cb(AW_root *awr)
#define NULp
Definition: cxxforward.h:116
static void RotateMoleculeStateChanged(AW_root *awr)
#define CREATED
static void MouseMoveEventHandler(Widget, XtPointer, XEvent *event, char *)
void GetSecondaryStructureInfo()
static void InitCallBacks(AW_root *awr)
GB_transaction ta(gb_var)
void callback(const WindowCallback &cb)
Definition: AW_window.cxx:133
GBDATA * gb_main
Definition: adname.cxx:32
AW_window * aww
Definition: awt_canvas.hxx:337
RNA3D_Global * RNA3D
void shadow_width(int shadow_thickness)
Definition: AW_window.cxx:1078
static XtAppContext appContext
#define AWAR_3D_HELIX_BACKBONE
void at_newline()
Definition: AW_at.cxx:119
#define ZOOM_FACTOR
#define AWAR_3D_MAP_SAI
void Combine2Dand3DstructureInfo()
#define AW_ROOT_DEFAULT
Definition: aw_base.hxx:106
GB_ERROR write_int(long aw_int)
struct _WidgetRec * Widget
Definition: aw_base.hxx:48
AW_root * root
static AW_window * CreateDisplayOptions_window(AW_root *aw_root)
static void KeyReleaseEventHandler(Widget, XtPointer, XEvent *, char *)
void request_resize()
Definition: awt_canvas.hxx:363
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)
Definition: AW_button.cxx:448
#define AWAR_3D_BASES_MODE