33 #if defined (G4VIS_BUILD_OPENGLXM_DRIVER) || defined (G4VIS_USE_OPENGLXM)
35 #ifndef G4OPENGLXMVIEWER_HH
36 #define G4OPENGLXMVIEWER_HH
43 class G4OpenGLXmTopLevelShell;
44 class G4OpenGLXmRadioButton;
45 class G4OpenGLXmPushButton;
46 class G4OpenGLXmSliderBar;
48 class G4OpenGLXmTextField;
49 class G4OpenGLXmFramedBox;
50 class G4OpenGLXmFourArrowButtons;
51 class G4OpenGLXmSeparator;
53 class G4OpenGLXmViewer:
public G4OpenGLXViewer {
56 G4OpenGLXmViewer (G4OpenGLSceneHandler& scene);
57 virtual ~G4OpenGLXmViewer ();
60 virtual void ShowView ();
62 void GetXmConnection ();
63 virtual void CreateMainWindow ();
75 drawing_style_pullright,
76 background_color_pullright,
77 transparency_pullright,
131 XtIntervalId rotation_timer,
139 G4OpenGLXmTopLevelShell* fprotation_top;
140 G4OpenGLXmBox* fprotation_button_box;
141 G4OpenGLXmRadioButton* fprotation_button1;
142 G4OpenGLXmRadioButton* fprotation_button2;
143 G4OpenGLXmBox* fprotation_slider_box;
144 G4OpenGLXmSliderBar* fprotation_slider;
145 G4OpenGLXmBox* fprotation_arrow_box;
146 G4OpenGLXmFourArrowButtons* fprotation_arrow;
148 G4OpenGLXmTopLevelShell* fppanning_top;
149 G4OpenGLXmFramedBox* fppanning_box;
150 G4OpenGLXmFourArrowButtons* fppanning_arrows;
151 G4OpenGLXmSliderBar* fppanning_slider;
152 G4OpenGLXmFramedBox* fpzoom_box;
153 G4OpenGLXmSliderBar* fpzoom_slider;
154 G4OpenGLXmFramedBox* fpdolly_box;
155 G4OpenGLXmSliderBar* fpdolly_slider;
157 G4OpenGLXmTopLevelShell* fpsetting_top;
158 G4OpenGLXmFramedBox* fpsetting_box;
159 G4OpenGLXmTextField* fppan_set;
160 G4OpenGLXmTextField* fprot_set;
161 G4OpenGLXmTextField* fpzoom_upper;
162 G4OpenGLXmTextField* fpzoom_lower;
163 G4OpenGLXmTextField* fpdolly_upper;
164 G4OpenGLXmTextField* fpdolly_lower;
165 G4OpenGLXmPushButton* fpok_button;
167 G4OpenGLXmTopLevelShell* fpmiscellany_top;
168 G4OpenGLXmFramedBox* fpwobble_box;
169 G4OpenGLXmPushButton* fpwobble_button;
170 G4OpenGLXmSliderBar* fpwobble_slider;
171 G4OpenGLXmFramedBox* fpreset_box;
172 G4OpenGLXmPushButton* fpreset_button;
173 G4OpenGLXmFramedBox* fpproj_style_box;
174 G4OpenGLXmRadioButton* fporthogonal_button;
175 G4OpenGLXmRadioButton* fpperspective_button;
176 G4OpenGLXmTextField* fpfov_text;
178 G4OpenGLXmTopLevelShell* fpprint_top;
179 G4OpenGLXmFramedBox* fpprint_box;
180 G4OpenGLXmFramedBox* fpprint_col_box;
181 G4OpenGLXmFramedBox* fpprint_style_box;
182 G4OpenGLXmTextField* fpprint_text;
183 G4OpenGLXmPushButton* fpprint_button;
184 G4OpenGLXmSeparator* fpprint_line;
185 G4OpenGLXmRadioButton* fpprint_col_radio1;
186 G4OpenGLXmRadioButton* fpprint_col_radio2;
187 G4OpenGLXmRadioButton* fpprint_style_radio1;
188 G4OpenGLXmRadioButton* fpprint_style_radio2;
192 static void expose_callback (Widget
w,
193 XtPointer clientData,
196 static void resize_callback (Widget
w,
197 XtPointer clientData,
200 static void actions_callback (Widget
w,
201 XtPointer clientData,
204 static void misc_callback (Widget
w,
205 XtPointer clientData,
208 static void Add_set_field (
char* widget,
213 G4OpenGLXmViewer* pView);
215 static void zoom_callback (Widget
w,
216 XtPointer clientData,
219 static void dolly_callback (Widget
w,
220 XtPointer clientData,
223 static void pan_left_right_callback (Widget
w,
224 XtPointer clientData,
227 static void left_right_pan_callback (XtPointer clientData,
228 XtIntervalId* timer_id);
230 static void theta_rotation_callback (Widget
w,
231 XtPointer clientData,
234 static void phi_rotation_callback (Widget
w,
235 XtPointer clientData,
238 static void pan_up_down_callback (Widget
w,
239 XtPointer clientData,
242 static void up_down_pan_callback (XtPointer clientData,
243 XtIntervalId* timer_id);
245 static void drawing_style_callback (Widget
w,
246 XtPointer clientData,
249 static void background_color_callback (Widget
w,
250 XtPointer clientData,
253 static void set_rot_subject_callback (Widget
w,
254 XtPointer clientData,
257 static void set_rot_sens_callback (Widget
w,
258 XtPointer clientData,
261 static void set_pan_sens_callback (Widget
w,
262 XtPointer clientData,
265 static void set_wob_sens_callback (Widget
w,
266 XtPointer clientData,
269 static void projection_callback (Widget
w,
270 XtPointer clientData,
273 static void wobble_callback (Widget
w,
274 XtPointer clientData,
277 static void reset_callback (Widget
w,
278 XtPointer clientData,
281 static void update_panels_callback (Widget
w,
282 XtPointer clientData,
285 static void wobble_timer_callback (XtPointer clientData,
286 XtIntervalId* timerid);
288 static void Add_radio_box (
char* label_string,
289 Widget* parent_frame_widget,
290 XtCallbackRec* radio_box_cb,
292 G4int default_button,
293 char* radio_box_name,
295 G4OpenGLXmViewer* pView);
297 static void Add_four_arrow_buttons (G4OpenGLXmViewer* pView,
298 XtCallbackRec** arrow_callbacks,
299 Widget* parent_widget);
301 static void Add_slider_box (
char* label_string,
304 G4OpenGLXmViewer* pView,
310 unsigned char* orientation,
311 unsigned char* direction,
312 XtCallbackRec** slider_box_cb,
313 Widget* parent_frame_widget);
315 static void rotate_in_theta (XtPointer clientData,
316 XtIntervalId* timer_id);
318 static void rotate_in_phi (XtPointer clientData,
319 XtIntervalId* timer_id);
321 static void get_double_value_callback (Widget
w,
322 XtPointer clientData,
325 static void get_text_callback (Widget
w,
326 XtPointer clientData,
329 static void transparency_callback (Widget
w,
330 XtPointer clientData,
333 static void antialias_callback (Widget
w,
334 XtPointer clientData,
337 static void haloing_callback (Widget
w,
338 XtPointer clientData,
341 static void aux_edge_callback (Widget
w,
342 XtPointer clientData,
345 static void set_print_colour_callback (Widget
w,
346 XtPointer clientData,
349 static void set_print_style_callback (Widget
w,
350 XtPointer clientData,
353 static void print_callback (Widget
w,
354 XtPointer clientData,
357 static G4bool get_boolean_userData (Widget
w);
359 static G4int get_int_userData (Widget
w);
361 friend class G4OpenGLXmVWidgetObject;
362 friend class G4OpenGLXmViewerMessenger;
365 G4OpenGLXmViewer (
const G4OpenGLXmViewer&);
366 G4OpenGLXmViewer& operator = (
const G4OpenGLXmViewer&);
367 void UpdateControlPanel();