35 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER
40 void G4OpenGLXmViewer::drawing_style_callback (Widget
w,
45 G4OpenGLXmViewer* pView;
46 XtVaGetValues (XtParent(w),
72 (
"G4OpenGLXmViewer::drawing_style_callback",
74 "Unrecognised case in drawing_style_callback.");
77 pView->fVP.SetDrawingStyle (style);
84 void G4OpenGLXmViewer::background_color_callback (Widget w,
89 G4OpenGLXmViewer* pView;
90 XtVaGetValues (XtParent(w),
104 SetBackgroundColour(
G4Colour(1.,1.,1.));
109 SetBackgroundColour(
G4Colour(0.,0.,0.));
114 (
"G4OpenGLXmViewer::background_color_callback",
116 "Unrecognised case in background_color_callback.");
124 void G4OpenGLXmViewer::transparency_callback (Widget w,
125 XtPointer clientData,
129 G4OpenGLXmViewer* pView;
130 XtVaGetValues (XtParent(w),
137 pView->transparency_enabled =
false;
141 pView->transparency_enabled =
true;
146 (
"G4OpenGLXmViewer::transparency_callback",
148 "Unrecognised case in transparency_callback.");
151 pView->SetNeedKernelVisit (
true);
157 void G4OpenGLXmViewer::antialias_callback (Widget w,
158 XtPointer clientData,
162 G4OpenGLXmViewer* pView;
163 XtVaGetValues (XtParent(w),
170 pView->antialiasing_enabled =
false;
171 glDisable (GL_LINE_SMOOTH);
172 glDisable (GL_POLYGON_SMOOTH);
176 pView->antialiasing_enabled =
true;
177 glEnable (GL_LINE_SMOOTH);
178 glHint (GL_LINE_SMOOTH_HINT, GL_NICEST);
179 glEnable (GL_POLYGON_SMOOTH);
180 glHint (GL_POLYGON_SMOOTH_HINT, GL_NICEST);
185 (
"G4OpenGLXmViewer::antialias_callback",
187 "Unrecognised case in antialiasing_callback.");
195 void G4OpenGLXmViewer::haloing_callback (Widget w,
196 XtPointer clientData,
200 G4OpenGLXmViewer* pView;
201 XtVaGetValues (XtParent(w),
208 pView->haloing_enabled =
false;
212 pView->haloing_enabled =
true;
217 (
"G4OpenGLXmViewer::haloing_callback",
219 "Unrecognised case in haloing_callback.");
227 void G4OpenGLXmViewer::aux_edge_callback (Widget w,
228 XtPointer clientData,
232 G4OpenGLXmViewer* pView;
233 XtVaGetValues (XtParent(w),
240 pView->fVP.SetAuxEdgeVisible(
false);
244 pView->fVP.SetAuxEdgeVisible(
true);
249 (
"G4OpenGLXmViewer::aux_edge_callback",
251 "Unrecognised case in aux_edge_callback.");
254 pView->SetNeedKernelVisit (
true);
260 void G4OpenGLXmViewer::projection_callback (Widget w,
261 XtPointer clientData,
264 G4OpenGLXmViewer* pView = (G4OpenGLXmViewer*)clientData;
266 G4int choice = get_int_userData (w);
271 pView->fVP.SetFieldHalfAngle (0.);
277 if (pView->fov > 89.5 || pView->fov <= 0.0) {
278 G4cout <<
"Field half angle should be 0 < angle <= 89.5 degrees.";
282 pView->fVP.SetFieldHalfAngle (pView->fov *
deg);
289 (
"G4OpenGLXmViewer::projection_callback",
291 "Unrecognised choice made in projection_callback");