Geant4 10.7.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//
28//
29// Andrew Walkden 16th June 1997
30// G4OpenGLXmWindowHandlingCallbacks : Callback functions for
31// (Motif) widgets to use.
32// in handling (Xm) windows
33
34#ifdef G4VIS_BUILD_OPENGLXM_DRIVER
35
36#include "G4OpenGLXmViewer.hh"
37
38void G4OpenGLXmViewer::resize_callback (Widget w,
39 XtPointer clientData,
40 XtPointer x)
41{
42 expose_callback(w,clientData,x);
43}
44
45
46
47void G4OpenGLXmViewer::expose_callback (Widget w,
48 XtPointer clientData,
49 XtPointer)
50{
51 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*) clientData;
52 Dimension width, height;
53
54 XtVaGetValues (w,
55 XmNwidth, &width,
56 XmNheight, &height,
57 NULL);
58
59 pView->ResizeWindow(width,height);
60
61//??????????????????????????? This might be a problem in MT mode.
62// glXMakeCurrent (pView->dpy, XtWindow(pView->glxarea), pView->cxMaster);
63// pView->SetView ();
64// pView->ClearView ();
65// pView->DrawView ();
66//???????????????????????????? Commented out 14/06/16 JA
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
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4GLOB_DLL std::ostream G4cout