00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER
00036
00037 #include "G4OpenGLXmViewer.hh"
00038
00039 void G4OpenGLXmViewer::resize_callback (Widget w,
00040 XtPointer clientData,
00041 XtPointer x)
00042 {
00043 expose_callback(w,clientData,x);
00044 }
00045
00046
00047
00048 void G4OpenGLXmViewer::expose_callback (Widget w,
00049 XtPointer clientData,
00050 XtPointer)
00051 {
00052 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
00053 Dimension width, height;
00054
00055 XtVaGetValues (w,
00056 XmNwidth, &width,
00057 XmNheight, &height,
00058 NULL);
00059
00060 pView->ResizeWindow(width,height);
00061
00062 glXMakeCurrent (pView->dpy, XtWindow(pView->glxarea), pView->cx);
00063
00064 pView->SetView ();
00065 pView->ClearView ();
00066 pView->DrawView ();
00067 }
00068
00069 void G4OpenGLXmViewer::print_callback (Widget,
00070 XtPointer clientData,
00071 XtPointer)
00072 {
00073 G4OpenGLXViewer* pView = (G4OpenGLXmViewer*) clientData;
00074 pView->printEPS();
00075 }
00076
00077 void G4OpenGLXmViewer::set_print_colour_callback (Widget w,
00078 XtPointer clientData,
00079 XtPointer)
00080 {
00081 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
00082
00083 G4int choice = get_int_userData (w);
00084
00085 pView->fPrintColour=(G4bool)choice;
00086 G4cout << "Print colour set to " << pView->fPrintColour;
00087
00088 }
00089
00090 void G4OpenGLXmViewer::set_print_style_callback (Widget w,
00091 XtPointer clientData,
00092 XtPointer)
00093 {
00094 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
00095
00096 G4int choice = get_int_userData (w);
00097
00098 pView->fVectoredPs=(G4bool)choice;
00099 G4cout << "`Produce vectored PostScript ?' set to : " << pView->fPrintColour;
00100
00101 }
00102
00103 #endif