Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4OpenGLXmWindowHandlingCallbacks.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26//
27// $Id$
28//
29//
30// Andrew Walkden 16th June 1997
31// G4OpenGLXmWindowHandlingCallbacks : Callback functions for
32// (Motif) widgets to use.
33// in handling (Xm) windows
34
35#ifdef G4VIS_BUILD_OPENGLXM_DRIVER
36
37#include "G4OpenGLXmViewer.hh"
38
39void G4OpenGLXmViewer::resize_callback (Widget w,
40 XtPointer clientData,
41 XtPointer x)
42{
43 expose_callback(w,clientData,x);
44}
45
46
47
48void G4OpenGLXmViewer::expose_callback (Widget w,
49 XtPointer clientData,
50 XtPointer)
51{
52 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
53 Dimension width, height;
54
55 XtVaGetValues (w,
56 XmNwidth, &width,
57 XmNheight, &height,
58 NULL);
59
60 pView->ResizeWindow(width,height);
61
62 glXMakeCurrent (pView->dpy, XtWindow(pView->glxarea), pView->cx);
63
64 pView->SetView ();
65 pView->ClearView ();
66 pView->DrawView ();
67}
68
69void G4OpenGLXmViewer::print_callback (Widget,
70 XtPointer clientData,
71 XtPointer)
72{
73 G4OpenGLXViewer* pView = (G4OpenGLXmViewer*) clientData;
74 pView->printEPS();
75}
76
77void G4OpenGLXmViewer::set_print_colour_callback (Widget w,
78 XtPointer clientData,
79 XtPointer)
80{
81 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
82
83 G4int choice = get_int_userData (w);
84
85 pView->fPrintColour=(G4bool)choice;
86 G4cout << "Print colour set to " << pView->fPrintColour;
87
88}
89
90void G4OpenGLXmViewer::set_print_style_callback (Widget w,
91 XtPointer clientData,
92 XtPointer)
93{
94 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
95
96 G4int choice = get_int_userData (w);
97
98 pView->fVectoredPs=(G4bool)choice;
99 G4cout << "`Produce vectored PostScript ?' set to : " << pView->fPrintColour;
100
101}
102
103#endif
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
G4DLLIMPORT std::ostream G4cout