Geant4-11
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
145
154
164
175
187
188public:
189
190 static void expose_callback (Widget w,
191 XtPointer clientData,
192 XtPointer callData);
193
194 static void resize_callback (Widget w,
195 XtPointer clientData,
196 XtPointer callData);
197
198 static void actions_callback (Widget w,
199 XtPointer clientData,
200 XtPointer callData);
201
202 static void misc_callback (Widget w,
203 XtPointer clientData,
204 XtPointer callData);
205
206 static void Add_set_field (char* widget,
207 char* widget_text,
208 Widget* row_col_box,
209 Widget* wid,
210 G4double* val,
211 G4OpenGLXmViewer* pView);
212
213 static void zoom_callback (Widget w,
214 XtPointer clientData,
215 XtPointer callData);
216
217 static void dolly_callback (Widget w,
218 XtPointer clientData,
219 XtPointer callData);
220
221 static void pan_left_right_callback (Widget w,
222 XtPointer clientData,
223 XtPointer callData);
224
225 static void left_right_pan_callback (XtPointer clientData,
226 XtIntervalId* timer_id);
227
228 static void theta_rotation_callback (Widget w,
229 XtPointer clientData,
230 XtPointer callData);
231
232 static void phi_rotation_callback (Widget w,
233 XtPointer clientData,
234 XtPointer callData);
235
236 static void pan_up_down_callback (Widget w,
237 XtPointer clientData,
238 XtPointer callData);
239
240 static void up_down_pan_callback (XtPointer clientData,
241 XtIntervalId* timer_id);
242
243 static void drawing_style_callback (Widget w,
244 XtPointer clientData,
245 XtPointer callData);
246
247 static void background_color_callback (Widget w,
248 XtPointer clientData,
249 XtPointer callData);
250
251 static void set_rot_subject_callback (Widget w,
252 XtPointer clientData,
253 XtPointer callData);
254
255 static void set_rot_sens_callback (Widget w,
256 XtPointer clientData,
257 XtPointer callData);
258
259 static void set_pan_sens_callback (Widget w,
260 XtPointer clientData,
261 XtPointer callData);
262
263 static void set_wob_sens_callback (Widget w,
264 XtPointer clientData,
265 XtPointer callData);
266
267 static void projection_callback (Widget w,
268 XtPointer clientData,
269 XtPointer callData);
270
271 static void wobble_callback (Widget w,
272 XtPointer clientData,
273 XtPointer callData);
274
275 static void reset_callback (Widget w,
276 XtPointer clientData,
277 XtPointer callData);
278
279 static void update_panels_callback (Widget w,
280 XtPointer clientData,
281 XtPointer callData);
282
283 static void wobble_timer_callback (XtPointer clientData,
284 XtIntervalId* timerid);
285
286 static void Add_radio_box (char* label_string,
287 Widget* parent_frame_widget,
288 XtCallbackRec* radio_box_cb,
289 G4int num_buttons,
290 G4int default_button,
291 char* radio_box_name,
292 char** button_names,
293 G4OpenGLXmViewer* pView);
294
295 static void Add_four_arrow_buttons (G4OpenGLXmViewer* pView,
296 XtCallbackRec** arrow_callbacks,
297 Widget* parent_widget);
298
299 static void Add_slider_box (char* label_string,
300 G4int num_sliders,
301 char** slider_name,
302 G4OpenGLXmViewer* pView,
303 G4double* min_array,
304 G4double* max_array,
305 G4double* value_array,
306 G4bool* show,
307 short* decimals,
308 unsigned char* orientation,
309 unsigned char* direction,
310 XtCallbackRec** slider_box_cb,
311 Widget* parent_frame_widget);
312
313 static void rotate_in_theta (XtPointer clientData,
314 XtIntervalId* timer_id);
315
316 static void rotate_in_phi (XtPointer clientData,
317 XtIntervalId* timer_id);
318
319 static void get_double_value_callback (Widget w,
320 XtPointer clientData,
321 XtPointer callData);
322
323 static void get_text_callback (Widget w,
324 XtPointer clientData,
325 XtPointer callData);
326
327 static void transparency_callback (Widget w,
328 XtPointer clientData,
329 XtPointer callData);
330
331 static void antialias_callback (Widget w,
332 XtPointer clientData,
333 XtPointer callData);
334
335 static void haloing_callback (Widget w,
336 XtPointer clientData,
337 XtPointer callData);
338
339 static void aux_edge_callback (Widget w,
340 XtPointer clientData,
341 XtPointer callData);
342
343 static void set_print_colour_callback (Widget w,
344 XtPointer clientData,
345 XtPointer callData);
346
347 static void set_print_style_callback (Widget w,
348 XtPointer clientData,
349 XtPointer callData);
350
351 static void print_callback (Widget w,
352 XtPointer clientData,
353 XtPointer callData);
354
355 static G4bool get_boolean_userData (Widget w);
356
357 static G4int get_int_userData (Widget w);
358
361
362private:
365 void UpdateControlPanel();
366 // Update the content of the control panel
367};
368
369#endif
370
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
friend class G4OpenGLXmViewer
G4OpenGLXmPushButton * fpok_button
G4OpenGLXmViewer & operator=(const G4OpenGLXmViewer &)
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()
XtWorkProcId workId
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)
G4OpenGLXmViewer(const G4OpenGLXmViewer &)
G4OpenGLXmRadioButton * fporthogonal_button
static void pan_left_right_callback(Widget w, XtPointer clientData, XtPointer callData)
virtual ~G4OpenGLXmViewer()
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
Widget drawing_style_pullright
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
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 pan_timer
XtIntervalId wobble_timer
static void update_panels_callback(Widget w, XtPointer clientData, XtPointer callData)
G4OpenGLXmFourArrowButtons * fppanning_arrows