3 #include <GL/aw_window_ogl.hxx>
16 #include <X11/keysym.h>
80 evt = (XConfigureEvent*) event;
100 XLookupString((XKeyEvent *) event, buffer, 1, &keysym,
NULp);
132 xr = (XButtonEvent*) event;
134 switch (xr->button) {
146 xp = (XButtonEvent*) event;
148 switch (xp->button) {
177 xp = (XMotionEvent*) event;
192 static bool ok =
false;
198 evt = (XExposeEvent*) event;
205 catch (
string& err) {
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",
242 cout<<
"Rendering new 3D molecule.... please wait..."<<endl;
365 AW_window_simple *aws =
new AW_window_simple;
367 aws->init(aw_root,
"DISPLAY_BASES",
"RNA3D : Display BASES");
368 aws->
load_xfig(
"RNA3D_DisplayBases.fig");
372 aws->button_length(0);
373 aws->create_button(
"HELP",
"#help.xpm");
377 aws->button_length(0);
378 aws->create_button(
"CLOSE",
"#closeText.xpm");
381 aws->at(
"dispBases");
386 aws->at(
"unpairHelix");
391 aws->at(
"shapesSize");
394 aws->at(
"basesMode");
396 aws->insert_toggle(
"CHARACTERS",
"C", 0);
397 aws->insert_toggle(
"SHAPES",
"S", 1);
398 aws->update_toggle_field();
411 AW_window_simple *aws =
new AW_window_simple;
413 aws->init(aw_root,
"DISPLAY_HELICES",
"RNA3D : Display HELICES");
414 aws->
load_xfig(
"RNA3D_DisplayHelices.fig");
418 aws->button_length(0);
419 aws->create_button(
"HELP",
"#help.xpm");
423 aws->button_length(0);
424 aws->create_button(
"CLOSE",
"#closeText.xpm");
427 aws->at(
"dispHelix");
440 aws->at(
"helixSize");
443 const char *helixRange =
NULp;
449 case LSU_23S: helixRange =
"[1-101]";
break;
450 case SSU_16S: helixRange =
"[1-50]";
break;
451 case LSU_5S: helixRange =
"[1-5]";
break;
453 aws->at(
"rangeLabel");
454 aws->create_autosize_button(
NULp, helixRange);
465 AW_window_simple *aws =
new AW_window_simple;
467 aws->init(aw_root,
"GENERAL_DISPLAY",
"RNA3D : General Display ");
468 aws->
load_xfig(
"RNA3D_DisplayOptions.fig");
472 aws->button_length(0);
473 aws->create_button(
"HELP",
"#help.xpm");
477 aws->button_length(0);
478 aws->create_button(
"CLOSE",
"#closeText.xpm");
502 AW_window_simple *aws =
new AW_window_simple;
504 aws->init(aw_root,
"MAP_SPECIES",
"RNA3D : Map Sequence Data ");
509 aws->button_length(0);
510 aws->create_button(
"HELP",
"#help.xpm");
514 aws->button_length(0);
515 aws->create_button(
"CLOSE",
"#closeText.xpm");
519 aws->button_length(35);
520 aws->create_button(
"SYNC",
"SYNCHRONIZE COLORS WITH EDITOR");
534 aws->button_length(0);
535 aws->create_button(
"REFRESH",
"#refresh.xpm");
557 AW_window_simple *aws =
new AW_window_simple;
559 aws->init(aw_root,
"CHANGE_MOLECULE",
"RNA3D : Change 3D Molecule");
560 aws->
load_xfig(
"RNA3D_ChangeMolecule.fig");
564 aws->button_length(0);
565 aws->create_button(
"HELP",
"#help.xpm");
569 aws->button_length(0);
570 aws->create_button(
"CLOSE",
"#closeText.xpm");
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.");
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.");
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");
631 int cur_x, cur_y, start_x, first_line_y, second_line_y;
658 awm->
at(cur_x-10, cur_y);
668 awm->
at(cur_x-10, cur_y);
672 awm->
help_text(
"rna3d_dispMolecule.hlp");
684 awm->
at(cur_x-10, cur_y);
694 awm->
create_autosize_button(
NULp,
" Spacebar = auto rotate mode on/off | Mouse Left Button + Move = Rotates Molecule | Mouse Wheel = Zoom in/out");
708 XtAddEventHandler(middle_area_widget, ExposureMask, 0,
ExposeOpenGLWindow, (XtPointer)NULp);
716 cout<<
"RNA3D: OpenGL Window created!"<<endl;
#define AWAR_3D_MAP_SEARCH_STRINGS
static AW_window * CreateDisplayHelices_window(AW_root *aw_root)
void CursorPositionChanged_CB(AW_root *awr)
AW_window * AW_create_gc_window_named(AW_root *aw_root, AW_gc_manager *gcman, const char *wid, const char *windowname)
void get_at_position(int *x, int *y) const
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)
#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)
#define AWAR_3D_MOL_BACKBONE
void load_xfig(const char *file, bool resize=true)
const char * get_window_id() const
void GenerateDisplayLists()
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)
void create_toggle(const char *awar_name)
void RefreshOpenGLDisplay()
void ReshapeOpenGLWindow(GLint width, GLint height)
#define AWAR_3D_MAP_SPECIES
void DeleteOldMoleculeData()
const char * GBS_global_string(const char *templat,...)
void DisplayPostionsIntervalChanged_CB(AW_root *awr)
void AW_POPDOWN(AW_window *window)
#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
char buffer[MESSAGE_BUFFERSIZE]
#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)
#define AWAR_3D_SAI_SELECTED
#define AWAR_3D_MAP_SPECIES_DISP_MISSING
void ReadCoOrdinateFile()
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)
void create_toggle_field(const char *awar_name, AW_label label, AW_orientation orientation=AW_VERTICAL)
#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)
static void ButtonPressEventHandler(Widget, XtPointer, XEvent *event, char *)
void help_text(const char *id)
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
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
#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,...)
AW_awar * awar(const char *awar)
#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)
static AW_window_menu_modes_opengl * awm
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)
AW_awar * awar_int(const char *var_name, long default_value=0, AW_default default_file=AW_ROOT_DEFAULT)
void auto_space(int xspace, int yspace)
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
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)
static void RefreshMappingDisplay(AW_window *)
static AW_window * CreateDisplayBases_window(AW_root *aw_root)
static void RotateMoleculeStateChanged_cb(AW_root *awr)
static void RotateMoleculeStateChanged(AW_root *awr)
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)
void shadow_width(int shadow_thickness)
static XtAppContext appContext
#define AWAR_3D_HELIX_BACKBONE
void Combine2Dand3DstructureInfo()
GB_ERROR write_int(long aw_int)
struct _WidgetRec * Widget
static AW_window * CreateDisplayOptions_window(AW_root *aw_root)
static void KeyReleaseEventHandler(Widget, XtPointer, XEvent *, char *)
void create_button(const char *macro_name, AW_label label, const char *mnemonic=NULp, const char *color=NULp)
#define AWAR_3D_BASES_MODE