53#include <Xm/DrawingA.h>
82 bool firstInit =
true;
101 UpdateControlPanel ();
118 G4cerr <<
"G4OpenGLXmViewer::GetXmConnection unable to Initialize"
119 " application context." <<
G4endl;
124 std::ostringstream oss;
135 "*frame*topOffset: 10\n"
136 "*frame*bottomOffset: 10\n"
137 "*frame*rightOffset: 10\n"
138 "*frame*leftOffset: 10\n"
139 "*frame*shadowType: SHADOW_IN\n"
140 "*frame*useColorObj: False\n"
141 "*frame*primaryColorSetId: 3\n"
142 "*frame*secondaryColorSetId: 3\n"
143 "*menubar*useColorObj: False\n"
144 "*menubar*primaryColorSetId: 3\n"
145 "*menubar*secondaryColorSetId: 3\n"
146 "*toplevel*useColorObj: False\n"
147 "*toplevel*primaryColorSetId: 3\n"
148 "*toplevel*secondaryColorSetId: 3\n";
153 shell = XtAppCreateShell ((String)
fName.data(),(String)
fName.data(),topLevelShellWidgetClass,XtDisplay(
toplevel),NULL,0);
160 G4cerr <<
"G4OpenGLXmViewer::GetXmConnection unable to connect to display."
167 G4cerr <<
"G4OpenGLXmViewer::GetXmConnection. X Server has no GLX extension."
175 bgnd = XWhitePixelOfScreen (XtScreen(
shell));
187 XtVaSetValues (
shell,
188 XtNvisual,
vi -> visual,
189 XtNdepth,
vi -> depth,
196 XtNbackground, &
bgnd,
197 XmNtitle,
fName.data(),
200 XtVaSetValues (
shell,
201 XtNvisual,
vi -> visual,
202 XtNdepth,
vi -> depth,
207 XtNbackground, &
bgnd,
208 XmNtitle,
fName.data(),
211 XtVaSetValues (
shell,
212 XtNvisual,
vi -> visual,
213 XtNdepth,
vi -> depth,
218 XtNbackground, &
bgnd,
219 XmNtitle,
fName.data(),
222 XtVaSetValues (
shell,
223 XtNvisual,
vi -> visual,
224 XtNdepth,
vi -> depth,
227 XtNbackground, &
bgnd,
228 XmNtitle,
fName.data(),
233 main_win = XtVaCreateManagedWidget (
"main_win",
234 xmMainWindowWidgetClass,
236 XtNvisual,
vi -> visual,
237 XtNdepth,
vi -> depth,
251 XmVaCASCADEBUTTON,
style_str, (KeySym)XK_S,
253 XmVaCASCADEBUTTON,
misc_str, (KeySym)XK_M,
254 XmVaCASCADEBUTTON,
spec_str, (KeySym)XK_p,
255 XtNvisual,
vi -> visual,
256 XtNdepth,
vi -> depth,
279 XmVaCASCADEBUTTON,
draw_str, (KeySym)XK_D,
280 XmVaCASCADEBUTTON,
bgnd_str, (KeySym)XK_B,
281 XtNvisual,
vi -> visual,
282 XtNdepth,
vi -> depth,
305 XmVaRADIOBUTTON,
hlr_str, (KeySym)XK_L, NULL, NULL,
306 XmVaRADIOBUTTON,
hsr_str, (KeySym)XK_S, NULL, NULL,
307 XmVaRADIOBUTTON,
hlhsr_str, (KeySym)XK_H, NULL, NULL,
308 XmNradioBehavior, True,
309 XmNradioAlwaysOne, True,
311 XtNvisual,
vi -> visual,
312 XtNdepth,
vi -> depth,
318 Widget special_widget;
326 XtVaSetValues (special_widget, XmNset, True, NULL);
331 XtVaSetValues (special_widget, XmNset, True, NULL);
336 XtVaSetValues (special_widget, XmNset, True, NULL);
341 XtVaSetValues (special_widget, XmNset, True, NULL);
345 (
"G4OpenGLXmViewer::CreateMainWindow",
347 "Invalid Drawing style in G4OpenGLXmViewer::CreateContext");
366 XmVaRADIOBUTTON,
white_str, (KeySym)XK_W, NULL, NULL,
367 XmVaRADIOBUTTON,
black_str, (KeySym)XK_B, NULL, NULL,
368 XmNradioBehavior, True,
369 XmNradioAlwaysOne, True,
371 XtNvisual,
vi -> visual,
372 XtNdepth,
vi -> depth,
383 XtVaSetValues (special_widget, XmNset, True, NULL);
388 XtVaSetValues (special_widget, XmNset, True, NULL);
407 XmVaPUSHBUTTON,
rot_str, (KeySym)XK_R, NULL, NULL,
408 XmVaPUSHBUTTON,
pan_str, (KeySym)XK_P, NULL, NULL,
409 XmVaPUSHBUTTON,
set_str, (KeySym)XK_S, NULL, NULL,
411 XtNvisual,
vi -> visual,
412 XtNdepth,
vi -> depth,
433 XmVaPUSHBUTTON,
misc_str, (KeySym)XK_M, NULL, NULL,
434 XmVaPUSHBUTTON,
exit_str, (KeySym)XK_E, NULL, NULL,
435 XmVaPUSHBUTTON,
print_str, (KeySym)XK_P, NULL, NULL,
437 XtNvisual,
vi -> visual,
438 XtNdepth,
vi -> depth,
460 XmVaCASCADEBUTTON,
trans_str, (KeySym)XK_T,
461 XmVaCASCADEBUTTON,
anti_str, (KeySym)XK_A,
462 XmVaCASCADEBUTTON,
halo_str, (KeySym)XK_H,
464 XtNvisual,
vi -> visual,
465 XtNdepth,
vi -> depth,
487 XmVaRADIOBUTTON,
off_str, (KeySym)XK_f, NULL, NULL,
488 XmVaRADIOBUTTON,
on_str, (KeySym)XK_n, NULL, NULL,
489 XmNradioBehavior, True,
490 XmNradioAlwaysOne, True,
492 XtNvisual,
vi -> visual,
493 XtNdepth,
vi -> depth,
502 XtVaSetValues (special_widget, XmNset, True, NULL);
507 XtVaSetValues (special_widget, XmNset, True, NULL);
511 (
"G4OpenGLXmViewer::CreateMainWindow",
513 "transparency_enabled in G4OpenGLXmViewer is neither true nor false!!");
522 XmVaRADIOBUTTON,
off_str, (KeySym)XK_f, NULL, NULL,
523 XmVaRADIOBUTTON,
on_str, (KeySym)XK_n, NULL, NULL,
524 XmNradioBehavior, True,
525 XmNradioAlwaysOne, True,
527 XtNvisual,
vi -> visual,
528 XtNdepth,
vi -> depth,
537 XtVaSetValues (special_widget, XmNset, True, NULL);
542 XtVaSetValues (special_widget, XmNset, True, NULL);
546 (
"G4OpenGLXmViewer::CreateMainWindow",
548 "antialiasing_enabled in G4OpenGLXmViewer is neither true nor false!!");
557 XmVaRADIOBUTTON,
off_str, (KeySym)XK_f, NULL, NULL,
558 XmVaRADIOBUTTON,
on_str, (KeySym)XK_n, NULL, NULL,
559 XmNradioBehavior, True,
560 XmNradioAlwaysOne, True,
562 XtNvisual,
vi -> visual,
563 XtNdepth,
vi -> depth,
572 XtVaSetValues (special_widget, XmNset, True, NULL);
577 XtVaSetValues (special_widget, XmNset, True, NULL);
581 (
"G4OpenGLXmViewer::CreateMainWindow",
583 "haloing_enabled in G4OpenGLXmViewer is neither true nor false!!");
592 XmVaRADIOBUTTON,
off_str, (KeySym)XK_f, NULL, NULL,
593 XmVaRADIOBUTTON,
on_str, (KeySym)XK_n, NULL, NULL,
594 XmNradioBehavior, True,
595 XmNradioAlwaysOne, True,
597 XtNvisual,
vi -> visual,
598 XtNdepth,
vi -> depth,
607 XtVaSetValues (special_widget, XmNset, True, NULL);
612 XtVaSetValues (special_widget, XmNset, True, NULL);
617 frame = XtVaCreateManagedWidget ((
char*)
menu_str[35].c_str(),
619 XtNvisual,
vi -> visual,
620 XtNdepth,
vi -> depth,
627 xmDrawingAreaWidgetClass,
629 XtNvisual,
vi -> visual,
630 XtNdepth,
vi -> depth,
645 XtRealizeWidget(
shell);
679drawing_style_pullright (0),
680background_color_pullright (0),
681transparency_pullright (0),
682antialias_pullright (0),
683haloing_pullright (0),
684aux_edge_pullright (0),
728original_vp(fVP.GetViewpointDirection()),
731fprotation_button_box (0),
732fprotation_button1 (0),
733fprotation_button2 (0),
734fprotation_slider_box (0),
735fprotation_slider (0),
736fprotation_arrow_box (0),
762fporthogonal_button (0),
763fpperspective_button (0),
768fpprint_style_box (0),
772fpprint_col_radio1 (0),
773fpprint_col_radio2 (0),
774fpprint_style_radio1 (0),
775fpprint_style_radio2 (0)
783void G4OpenGLXmViewer::UpdateControlPanel () {
841 XtDestroyWidget (
shell);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
G4double GetGreen() const
unsigned int getWinHeight() const
void ResizeWindow(unsigned int, unsigned int)
unsigned int getWinWidth() const
G4bool antialiasing_enabled
G4bool transparency_enabled
friend class G4OpenGLXmViewer
void SetMinValue(G4double)
void SetInitialValue(G4double)
void SetMaxValue(G4double)
static void background_color_callback(Widget w, XtPointer clientData, XtPointer callData)
static void antialias_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmSliderBar * fppanning_slider
static void drawing_style_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmSliderBar * fprotation_slider
Widget antialias_pullright
G4OpenGLXmTextField * fprot_set
static void resize_callback(Widget w, XtPointer clientData, XtPointer callData)
static void haloing_callback(Widget w, XtPointer clientData, XtPointer callData)
static void expose_callback(Widget w, XtPointer clientData, XtPointer callData)
static void aux_edge_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmTextField * fpdolly_lower
G4OpenGLXmTextField * fpzoom_lower
virtual ~G4OpenGLXmViewer()
Widget drawing_style_pullright
G4OpenGLXmTextField * fpdolly_upper
G4OpenGLXmSliderBar * fpwobble_slider
G4OpenGLXmSliderBar * fpzoom_slider
static void misc_callback(Widget w, XtPointer clientData, XtPointer callData)
virtual void CreateMainWindow()
G4OpenGLXmSliderBar * fpdolly_slider
G4OpenGLXmTextField * fpzoom_upper
Widget background_color_pullright
Widget transparency_pullright
static void actions_callback(Widget w, XtPointer clientData, XtPointer callData)
static void transparency_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmTextField * fppan_set
Widget aux_edge_pullright
const G4VisExtent & GetExtent() const
G4Interactor GetMainInteractor()
void RemoveShell(G4Interactor)
void AddShell(G4Interactor)
G4Scene * GetScene() const
G4VSceneHandler * GetSceneHandler() const
bool IsWindowLocationHintY() const
G4int GetWindowAbsoluteLocationHintY(G4int) const
bool IsWindowLocationHintX() const
unsigned int GetWindowSizeHintX() const
bool IsWindowSizeHintX() const
G4double GetZoomFactor() const
G4int GetWindowAbsoluteLocationHintX(G4int) const
unsigned int GetWindowSizeHintY() const
DrawingStyle GetDrawingStyle() const
G4bool IsAuxEdgeVisible() const
G4double GetDolly() const
G4double GetExtentRadius() const
static G4Xt * getInstance()
void PutStringInResourceDatabase(char *)