34 #ifdef G4VIS_BUILD_OPENGLXM_DRIVER
36 #ifndef G4OPENGLXMVIEWER_HH
37 #define G4OPENGLXMVIEWER_HH
44 class G4OpenGLXmTopLevelShell;
45 class G4OpenGLXmRadioButton;
46 class G4OpenGLXmPushButton;
47 class G4OpenGLXmSliderBar;
49 class G4OpenGLXmTextField;
50 class G4OpenGLXmFramedBox;
51 class G4OpenGLXmFourArrowButtons;
52 class G4OpenGLXmSeparator;
54 class G4OpenGLXmViewer:
public G4OpenGLXViewer {
57 G4OpenGLXmViewer (G4OpenGLSceneHandler& scene);
58 virtual ~G4OpenGLXmViewer ();
61 virtual void ShowView ();
63 void GetXmConnection ();
64 virtual void CreateMainWindow ();
76 drawing_style_pullright,
77 background_color_pullright,
78 transparency_pullright,
132 XtIntervalId rotation_timer,
140 G4OpenGLXmTopLevelShell* fprotation_top;
141 G4OpenGLXmBox* fprotation_button_box;
142 G4OpenGLXmRadioButton* fprotation_button1;
143 G4OpenGLXmRadioButton* fprotation_button2;
144 G4OpenGLXmBox* fprotation_slider_box;
145 G4OpenGLXmSliderBar* fprotation_slider;
146 G4OpenGLXmBox* fprotation_arrow_box;
147 G4OpenGLXmFourArrowButtons* fprotation_arrow;
149 G4OpenGLXmTopLevelShell* fppanning_top;
150 G4OpenGLXmFramedBox* fppanning_box;
151 G4OpenGLXmFourArrowButtons* fppanning_arrows;
152 G4OpenGLXmSliderBar* fppanning_slider;
153 G4OpenGLXmFramedBox* fpzoom_box;
154 G4OpenGLXmSliderBar* fpzoom_slider;
155 G4OpenGLXmFramedBox* fpdolly_box;
156 G4OpenGLXmSliderBar* fpdolly_slider;
158 G4OpenGLXmTopLevelShell* fpsetting_top;
159 G4OpenGLXmFramedBox* fpsetting_box;
160 G4OpenGLXmTextField* fppan_set;
161 G4OpenGLXmTextField* fprot_set;
162 G4OpenGLXmTextField* fpzoom_upper;
163 G4OpenGLXmTextField* fpzoom_lower;
164 G4OpenGLXmTextField* fpdolly_upper;
165 G4OpenGLXmTextField* fpdolly_lower;
166 G4OpenGLXmPushButton* fpok_button;
168 G4OpenGLXmTopLevelShell* fpmiscellany_top;
169 G4OpenGLXmFramedBox* fpwobble_box;
170 G4OpenGLXmPushButton* fpwobble_button;
171 G4OpenGLXmSliderBar* fpwobble_slider;
172 G4OpenGLXmFramedBox* fpreset_box;
173 G4OpenGLXmPushButton* fpreset_button;
174 G4OpenGLXmFramedBox* fpproj_style_box;
175 G4OpenGLXmRadioButton* fporthogonal_button;
176 G4OpenGLXmRadioButton* fpperspective_button;
177 G4OpenGLXmTextField* fpfov_text;
179 G4OpenGLXmTopLevelShell* fpprint_top;
180 G4OpenGLXmFramedBox* fpprint_box;
181 G4OpenGLXmFramedBox* fpprint_col_box;
182 G4OpenGLXmFramedBox* fpprint_style_box;
183 G4OpenGLXmTextField* fpprint_text;
184 G4OpenGLXmPushButton* fpprint_button;
185 G4OpenGLXmSeparator* fpprint_line;
186 G4OpenGLXmRadioButton* fpprint_col_radio1;
187 G4OpenGLXmRadioButton* fpprint_col_radio2;
188 G4OpenGLXmRadioButton* fpprint_style_radio1;
189 G4OpenGLXmRadioButton* fpprint_style_radio2;
193 static void expose_callback (Widget w,
194 XtPointer clientData,
197 static void resize_callback (Widget w,
198 XtPointer clientData,
201 static void actions_callback (Widget w,
202 XtPointer clientData,
205 static void misc_callback (Widget w,
206 XtPointer clientData,
209 static void Add_set_field (
char* widget,
214 G4OpenGLXmViewer* pView);
216 static void zoom_callback (Widget w,
217 XtPointer clientData,
220 static void dolly_callback (Widget w,
221 XtPointer clientData,
224 static void pan_left_right_callback (Widget w,
225 XtPointer clientData,
228 static void left_right_pan_callback (XtPointer clientData,
229 XtIntervalId* timer_id);
231 static void theta_rotation_callback (Widget w,
232 XtPointer clientData,
235 static void phi_rotation_callback (Widget w,
236 XtPointer clientData,
239 static void pan_up_down_callback (Widget w,
240 XtPointer clientData,
243 static void up_down_pan_callback (XtPointer clientData,
244 XtIntervalId* timer_id);
246 static void drawing_style_callback (Widget w,
247 XtPointer clientData,
250 static void background_color_callback (Widget w,
251 XtPointer clientData,
254 static void set_rot_subject_callback (Widget w,
255 XtPointer clientData,
258 static void set_rot_sens_callback (Widget w,
259 XtPointer clientData,
262 static void set_pan_sens_callback (Widget w,
263 XtPointer clientData,
266 static void set_wob_sens_callback (Widget w,
267 XtPointer clientData,
270 static void projection_callback (Widget w,
271 XtPointer clientData,
274 static void wobble_callback (Widget w,
275 XtPointer clientData,
278 static void reset_callback (Widget w,
279 XtPointer clientData,
282 static void update_panels_callback (Widget w,
283 XtPointer clientData,
286 static void wobble_timer_callback (XtPointer clientData,
287 XtIntervalId* timerid);
289 static void Add_radio_box (
char* label_string,
290 Widget* parent_frame_widget,
291 XtCallbackRec* radio_box_cb,
293 G4int default_button,
294 char* radio_box_name,
296 G4OpenGLXmViewer* pView);
298 static void Add_four_arrow_buttons (G4OpenGLXmViewer* pView,
299 XtCallbackRec** arrow_callbacks,
300 Widget* parent_widget);
302 static void Add_slider_box (
char* label_string,
305 G4OpenGLXmViewer* pView,
311 unsigned char* orientation,
312 unsigned char* direction,
313 XtCallbackRec** slider_box_cb,
314 Widget* parent_frame_widget);
316 static void rotate_in_theta (XtPointer clientData,
317 XtIntervalId* timer_id);
319 static void rotate_in_phi (XtPointer clientData,
320 XtIntervalId* timer_id);
322 static void get_double_value_callback (Widget w,
323 XtPointer clientData,
326 static void get_text_callback (Widget w,
327 XtPointer clientData,
330 static void transparency_callback (Widget w,
331 XtPointer clientData,
334 static void antialias_callback (Widget w,
335 XtPointer clientData,
338 static void haloing_callback (Widget w,
339 XtPointer clientData,
342 static void aux_edge_callback (Widget w,
343 XtPointer clientData,
346 static void set_print_colour_callback (Widget w,
347 XtPointer clientData,
350 static void set_print_style_callback (Widget w,
351 XtPointer clientData,
354 static void print_callback (Widget w,
355 XtPointer clientData,
358 static G4bool get_boolean_userData (Widget w);
360 static G4int get_int_userData (Widget w);
362 friend class G4OpenGLXmVWidgetObject;
363 friend class G4OpenGLXmViewerMessenger;
366 G4OpenGLXmViewer (
const G4OpenGLXmViewer&);
367 G4OpenGLXmViewer& operator = (
const G4OpenGLXmViewer&);
368 void UpdateControlPanel();