Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4OpenGLXmViewer.hh
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 10th February 1997
30// G4OpenGLXmViewer : Class derived from G4OpenGLXViewer, to provide
31// (Motif) widget OpenGL functionality for GEANT4.
32
33#ifndef G4OPENGLXMVIEWER_HH
34#define G4OPENGLXMVIEWER_HH
35
36#include "G4OpenGLXViewer.hh"
37#include "globals.hh"
38
39#include <Xm/Xm.h>
40
45class G4OpenGLXmBox;
50
52
53public:
55 virtual ~G4OpenGLXmViewer ();
56
57protected:
58 virtual void ShowView ();
59 void ResetView ();
60 void GetXmConnection ();
61 virtual void CreateMainWindow ();
62
63 XtAppContext app;
64 XtWorkProcId workId;
65 Widget toplevel,
81
82 XmString style_str,
107
120
123
128
129 XtIntervalId rotation_timer,
132
134
136 static const G4String e_str;
137 G4String menu_str[37] = { "Style", "style",
138 "Actions", "actions",
139 "Miscellany", "miscellany",
140 "Special", "special",
141 "menubar", "Drawing",
142 "Background color", "Wireframe",
143 "Hidden line removal", "Hidden surface removal",
144 "Hidden line and surface removal", "drawing_style",
145 "White", "Black",
146 "background_color", "Rotation control panel",
147 "Panning control panel", "Set control panel limits",
148 "Miscellany control panel",
149 "Exit to G4Vis>", "Create .eps file",
150 "Transparency", "transparency",
151 "Antialiasing", "antialias",
152 "Haloing", "haloing",
153 "Auxiliary edges", "aux_edge",
154 "Off", "On", "frame", "glxarea" };
155
164
173
183
194
206
207public:
208
209 static void expose_callback (Widget w,
210 XtPointer clientData,
211 XtPointer callData);
212
213 static void resize_callback (Widget w,
214 XtPointer clientData,
215 XtPointer callData);
216
217 static void actions_callback (Widget w,
218 XtPointer clientData,
219 XtPointer callData);
220
221 static void misc_callback (Widget w,
222 XtPointer clientData,
223 XtPointer callData);
224
225 static void Add_set_field (char* widget,
226 char* widget_text,
227 Widget* row_col_box,
228 Widget* wid,
229 G4double* val,
230 G4OpenGLXmViewer* pView);
231
232 static void zoom_callback (Widget w,
233 XtPointer clientData,
234 XtPointer callData);
235
236 static void dolly_callback (Widget w,
237 XtPointer clientData,
238 XtPointer callData);
239
240 static void pan_left_right_callback (Widget w,
241 XtPointer clientData,
242 XtPointer callData);
243
244 static void left_right_pan_callback (XtPointer clientData,
245 XtIntervalId* timer_id);
246
247 static void theta_rotation_callback (Widget w,
248 XtPointer clientData,
249 XtPointer callData);
250
251 static void phi_rotation_callback (Widget w,
252 XtPointer clientData,
253 XtPointer callData);
254
255 static void pan_up_down_callback (Widget w,
256 XtPointer clientData,
257 XtPointer callData);
258
259 static void up_down_pan_callback (XtPointer clientData,
260 XtIntervalId* timer_id);
261
262 static void drawing_style_callback (Widget w,
263 XtPointer clientData,
264 XtPointer callData);
265
266 static void background_color_callback (Widget w,
267 XtPointer clientData,
268 XtPointer callData);
269
270 static void set_rot_subject_callback (Widget w,
271 XtPointer clientData,
272 XtPointer callData);
273
274 static void set_rot_sens_callback (Widget w,
275 XtPointer clientData,
276 XtPointer callData);
277
278 static void set_pan_sens_callback (Widget w,
279 XtPointer clientData,
280 XtPointer callData);
281
282 static void set_wob_sens_callback (Widget w,
283 XtPointer clientData,
284 XtPointer callData);
285
286 static void projection_callback (Widget w,
287 XtPointer clientData,
288 XtPointer callData);
289
290 static void wobble_callback (Widget w,
291 XtPointer clientData,
292 XtPointer callData);
293
294 static void reset_callback (Widget w,
295 XtPointer clientData,
296 XtPointer callData);
297
298 static void update_panels_callback (Widget w,
299 XtPointer clientData,
300 XtPointer callData);
301
302 static void wobble_timer_callback (XtPointer clientData,
303 XtIntervalId* timerid);
304
305 static void Add_radio_box (char* label_string,
306 Widget* parent_frame_widget,
307 XtCallbackRec* radio_box_cb,
308 G4int num_buttons,
309 G4int default_button,
310 char* radio_box_name,
311 char** button_names,
312 G4OpenGLXmViewer* pView);
313
314 static void Add_four_arrow_buttons (G4OpenGLXmViewer* pView,
315 XtCallbackRec** arrow_callbacks,
316 Widget* parent_widget);
317
318 static void Add_slider_box (char* label_string,
319 G4int num_sliders,
320 char** slider_name,
321 G4OpenGLXmViewer* pView,
322 G4double* min_array,
323 G4double* max_array,
324 G4double* value_array,
325 G4bool* show,
326 short* decimals,
327 unsigned char* orientation,
328 unsigned char* direction,
329 XtCallbackRec** slider_box_cb,
330 Widget* parent_frame_widget);
331
332 static void rotate_in_theta (XtPointer clientData,
333 XtIntervalId* timer_id);
334
335 static void rotate_in_phi (XtPointer clientData,
336 XtIntervalId* timer_id);
337
338 static void get_double_value_callback (Widget w,
339 XtPointer clientData,
340 XtPointer callData);
341
342 static void get_text_callback (Widget w,
343 XtPointer clientData,
344 XtPointer callData);
345
346 static void transparency_callback (Widget w,
347 XtPointer clientData,
348 XtPointer callData);
349
350 static void antialias_callback (Widget w,
351 XtPointer clientData,
352 XtPointer callData);
353
354 static void haloing_callback (Widget w,
355 XtPointer clientData,
356 XtPointer callData);
357
358 static void aux_edge_callback (Widget w,
359 XtPointer clientData,
360 XtPointer callData);
361
362 static void set_print_colour_callback (Widget w,
363 XtPointer clientData,
364 XtPointer callData);
365
366 static void set_print_style_callback (Widget w,
367 XtPointer clientData,
368 XtPointer callData);
369
370 static void print_callback (Widget w,
371 XtPointer clientData,
372 XtPointer callData);
373
374 static G4bool get_boolean_userData (Widget w);
375
376 static G4int get_int_userData (Widget w);
377
380
381private:
383 G4OpenGLXmViewer& operator = (const G4OpenGLXmViewer&);
384 void UpdateControlPanel();
385 // Update the content of the control panel
386};
387
388#endif
389
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
friend class G4OpenGLXmViewer
G4OpenGLXmPushButton * fpok_button
G4OpenGLXmTopLevelShell * fpmiscellany_top
static void rotate_in_theta(XtPointer clientData, XtIntervalId *timer_id)
static void wobble_timer_callback(XtPointer clientData, XtIntervalId *timerid)
virtual void ShowView()
static void set_pan_sens_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmFramedBox * fpprint_style_box
G4OpenGLXmPushButton * fpwobble_button
G4OpenGLXmBox * fprotation_slider_box
static void set_wob_sens_callback(Widget w, XtPointer clientData, XtPointer callData)
static void background_color_callback(Widget w, XtPointer clientData, XtPointer callData)
static void antialias_callback(Widget w, XtPointer clientData, XtPointer callData)
static void phi_rotation_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmSliderBar * fppanning_slider
static void set_print_colour_callback(Widget w, XtPointer clientData, XtPointer callData)
static void drawing_style_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmSliderBar * fprotation_slider
G4OpenGLXmTextField * fpfov_text
G4OpenGLXmTextField * fprot_set
static void resize_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmBox * fprotation_button_box
static void set_rot_sens_callback(Widget w, XtPointer clientData, XtPointer callData)
static void haloing_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmTopLevelShell * fpsetting_top
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
G4OpenGLXmRadioButton * fpperspective_button
static void pan_up_down_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmSeparator * fpprint_line
G4OpenGLXmRadioButton * fpprint_style_radio1
G4OpenGLXmFramedBox * fpproj_style_box
G4OpenGLXmPushButton * fpreset_button
static void print_callback(Widget w, XtPointer clientData, XtPointer callData)
XtIntervalId rotation_timer
static void Add_set_field(char *widget, char *widget_text, Widget *row_col_box, Widget *wid, G4double *val, G4OpenGLXmViewer *pView)
G4OpenGLXmRadioButton * fporthogonal_button
static void pan_left_right_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmTextField * fpprint_text
G4OpenGLXmTopLevelShell * fpprint_top
G4OpenGLXmFramedBox * fpzoom_box
static void set_print_style_callback(Widget w, XtPointer clientData, XtPointer callData)
static void rotate_in_phi(XtPointer clientData, XtIntervalId *timer_id)
G4OpenGLXmFramedBox * fpprint_box
G4OpenGLXmPushButton * fpprint_button
G4OpenGLXmRadioButton * fpprint_style_radio2
static void projection_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmTextField * fpdolly_upper
static void set_rot_subject_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmRadioButton * fprotation_button1
G4OpenGLXmFramedBox * fppanning_box
G4OpenGLXmBox * fprotation_arrow_box
G4OpenGLXmFramedBox * fpprint_col_box
G4OpenGLXmSliderBar * fpwobble_slider
static G4bool get_boolean_userData(Widget w)
static void zoom_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmTopLevelShell * fppanning_top
G4OpenGLXmRadioButton * fpprint_col_radio1
G4OpenGLXmSliderBar * fpzoom_slider
static G4int get_int_userData(Widget w)
G4OpenGLXmFramedBox * fpsetting_box
static const G4String e_str
G4OpenGLXmTopLevelShell * fprotation_top
static void misc_callback(Widget w, XtPointer clientData, XtPointer callData)
static void Add_four_arrow_buttons(G4OpenGLXmViewer *pView, XtCallbackRec **arrow_callbacks, Widget *parent_widget)
virtual void CreateMainWindow()
static void dolly_callback(Widget w, XtPointer clientData, XtPointer callData)
static void up_down_pan_callback(XtPointer clientData, XtIntervalId *timer_id)
G4OpenGLXmSliderBar * fpdolly_slider
static void left_right_pan_callback(XtPointer clientData, XtIntervalId *timer_id)
G4OpenGLXmRadioButton * fprotation_button2
static void Add_radio_box(char *label_string, Widget *parent_frame_widget, XtCallbackRec *radio_box_cb, G4int num_buttons, G4int default_button, char *radio_box_name, char **button_names, G4OpenGLXmViewer *pView)
G4OpenGLXmFramedBox * fpdolly_box
static void theta_rotation_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmTextField * fpzoom_upper
G4OpenGLXmRadioButton * fpprint_col_radio2
Widget background_color_pullright
G4OpenGLXmFramedBox * fpwobble_box
static void actions_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmFourArrowButtons * fprotation_arrow
static void reset_callback(Widget w, XtPointer clientData, XtPointer callData)
static void get_double_value_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmFramedBox * fpreset_box
static void wobble_callback(Widget w, XtPointer clientData, XtPointer callData)
static void Add_slider_box(char *label_string, G4int num_sliders, char **slider_name, G4OpenGLXmViewer *pView, G4double *min_array, G4double *max_array, G4double *value_array, G4bool *show, short *decimals, unsigned char *orientation, unsigned char *direction, XtCallbackRec **slider_box_cb, Widget *parent_frame_widget)
static void transparency_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmTextField * fppan_set
static void get_text_callback(Widget w, XtPointer clientData, XtPointer callData)
XtIntervalId wobble_timer
static void update_panels_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmFourArrowButtons * fppanning_arrows