1 /***********************************************************************/
2 /* Open Visualization Data Explorer                                    */
3 /* (C) Copyright IBM Corp. 1989,1999                                   */
4 /* ALL RIGHTS RESERVED                                                 */
5 /* This code licensed under the                                        */
6 /*    "IBM PUBLIC LICENSE - Open Visualization Data Explorer"          */
7 /***********************************************************************/
8 
9 #include <dxconfig.h>
10 #include "../base/defines.h"
11 
12 
13 #ifndef _ViewControlDialog_h
14 #define _ViewControlDialog_h
15 
16 
17 #include "Dialog.h"
18 #include "Dictionary.h"
19 
20 //
21 // Class name definition:
22 //
23 #define ClassViewControlDialog	"ViewControlDialog"
24 
25 //
26 // XtCallbackProc (*CB), XtEventHandler (*EH) and XtActionProc (*AP)
27 // DialogCallback (*DCB), XtInputCallbackProc (*ICP), XtWorkProc (*WP)
28 // functions for this and derived classes
29 //
30 extern "C" void ViewControlDialog_SelectPickCB(Widget, XtPointer, XtPointer);
31 extern "C" void ViewControlDialog_SelectProbeCB(Widget, XtPointer, XtPointer);
32 extern "C" void ViewControlDialog_NumberCB(Widget, XtPointer, XtPointer);
33 extern "C" void ViewControlDialog_ScaleCB(Widget, XtPointer, XtPointer);
34 
35 //
36 // Referenced Classes
37 //
38 class ButtonInterface;
39 class Command;
40 class ImageWindow;
41 
42 
43 //
44 // ViewControlDialog class definition:
45 //
46 class ViewControlDialog : public Dialog
47 {
48   friend class  ImageWindow;
49 
50   private:
51     //
52     // Private member data:
53     //
54     static boolean ClassInitialized;
55 
56     friend void ViewControlDialog_ScaleCB(Widget	 widget,
57 		        XtPointer clientData,
58 		        XtPointer callData);
59     friend void ViewControlDialog_NumberCB(Widget	 widget,
60 		         XtPointer clientData,
61 		         XtPointer callData);
62     friend void ViewControlDialog_SelectProbeCB(Widget widget,
63 			      XtPointer clientData,
64 			      XtPointer callData);
65     friend void ViewControlDialog_SelectPickCB(Widget widget,
66 			      XtPointer clientData,
67 			      XtPointer callData);
68 
69     // Is the form going to expand due to the mode change?
70     boolean isExpanding();
71 
72   protected:
73     //
74     // Protected member data:
75     //
76     ImageWindow *imageWindow;
77     static String DefaultResources[];
78     Dictionary probeWidgetList;
79     Dictionary pickWidgetList;
80 
81 
82     Widget mainForm;
83     Widget modeOptionMenu;
84     ButtonInterface	*modeNone;
85     ButtonInterface	*modeCamera;
86     ButtonInterface	*modeCursors;
87     ButtonInterface	*modePick;
88     ButtonInterface	*modeNavigate;
89     ButtonInterface	*modePanZoom;
90     ButtonInterface	*modeRoam;
91     ButtonInterface	*modeRotate;
92     ButtonInterface	*modeZoom;
93     Widget setViewOptionMenu;
94     ButtonInterface	*setViewNone;
95     ButtonInterface	*setViewTop;
96     ButtonInterface	*setViewBottom;
97     ButtonInterface	*setViewFront;
98     ButtonInterface	*setViewBack;
99     ButtonInterface	*setViewLeft;
100     ButtonInterface	*setViewRight;
101     ButtonInterface	*setViewDiagonal;
102     ButtonInterface	*setViewOffTop;
103     ButtonInterface	*setViewOffBottom;
104     ButtonInterface	*setViewOffFront;
105     ButtonInterface	*setViewOffBack;
106     ButtonInterface	*setViewOffLeft;
107     ButtonInterface	*setViewOffRight;
108     ButtonInterface	*setViewOffDiagonal;
109     Widget projectionOptionMenu;
110     ButtonInterface     *orthographic;
111     ButtonInterface     *perspective;
112     Widget viewAngleStepper;
113     ButtonInterface	*constraintNone;
114     ButtonInterface	*constraintX;
115     ButtonInterface	*constraintY;
116     ButtonInterface	*constraintZ;
117 
118 
119 
120     boolean cursorFormManaged;
121     Widget cursorForm;
122     Widget probeSeparator;
123     Widget probeLabel;
124     Widget probePulldown;
125     Widget probeOptionMenu;
126     Widget constraintLabel;
127     Widget constraintOptionMenu;
128 
129     boolean roamFormManaged;
130 
131     boolean pickFormManaged;
132     Widget pickForm;
133     Widget pickPulldown;
134     Widget pickOptionMenu;
135 
136     boolean cameraFormManaged;
137     Widget cameraForm;
138     Widget cameraWhichOptionMenu;
139     ButtonInterface	*cameraTo;
140     ButtonInterface	*cameraFrom;
141     ButtonInterface	*cameraUp;
142     Widget cameraXNumber;
143     Widget cameraYNumber;
144     Widget cameraZNumber;
145     Widget cameraWidthNumber;
146     Widget cameraWindowWidthNumber;
147     Widget cameraWindowHeightNumber;
148 
149     boolean navigateFormManaged;
150     Widget navigateForm;
151     Widget motionScale;
152     Widget pivotScale;
153     Widget navigateLookOptionMenu;
154     ButtonInterface     *lookForward;
155     ButtonInterface     *lookLeft45;
156     ButtonInterface     *lookRight45;
157     ButtonInterface     *lookUp45;
158     ButtonInterface     *lookDown45;
159     ButtonInterface     *lookLeft90;
160     ButtonInterface     *lookRight90;
161     ButtonInterface     *lookUp90;
162     ButtonInterface     *lookDown90;
163     ButtonInterface     *lookBackward;
164     ButtonInterface     *lookAlign;
165 
166     ButtonInterface	*undoButton;
167     ButtonInterface	*redoButton;
168     ButtonInterface	*resetButton;
169 
170     Widget buttonForm;
171 
172     Command *cameraToVectorCmd;
173     Command *cameraFromVectorCmd;
174     Command *cameraUpVectorCmd;
175 
176     virtual Widget createDialog(Widget parent);
177     virtual Widget createModePulldown(Widget parent);
178     virtual Widget createSetViewPulldown(Widget parent);
179     virtual Widget createProjectionPulldown(Widget parent);
180     virtual Widget createConstraintPulldown(Widget parent);
181     virtual Widget createCameraWhichPulldown(Widget parent);
182     virtual Widget createNavigateLookPulldown(Widget parent);
183 
184     //
185     // Install the default resources for this class and then call the
186     // same super class method to get the default resources from the
187     // super classes.
188     //
189     virtual void installDefaultResources(Widget baseWidget);
190 
191   public:
192     //
193     // Constructor:
194     //
195     ViewControlDialog(Widget parent, ImageWindow *w);
196 
197     //
198     // Destructor:
199     //
200     ~ViewControlDialog();
201 
202     virtual void createProbePulldown();
203     virtual void createPickPulldown();
204     virtual void manage();
205     virtual void manageCursorForm();
206     virtual void unmanageCursorForm();
207     virtual void managePickForm();
208     virtual void unmanagePickForm();
209     virtual void manageCameraForm();
210     virtual void unmanageCameraForm();
211     virtual void manageNavigationForm();
212     virtual void unmanageNavigationForm();
213     virtual void manageRoamForm();
214     virtual void unmanageRoamForm();
215 
216     virtual void resetMode();
217     virtual void resetLookDirection();
218     virtual void resetSetView();
219     virtual void resetProjection();
220 
221     virtual void setNavigateSpeed(double s);
222     virtual void setNavigatePivot(double s);
223 
224     virtual void newCamera(double *from, double *to, double *up,
225 	int image_width, int image_height, double width,
226 	boolean perspective, double viewAngle);
227     void setSensitivity(boolean s);
228 
229     void setWhichCameraVector();
230     //
231     // Returns a pointer to the class name.
232     //
233 
234     void setCurrentProbeByInstance(int i);
235     void setCurrentPickByInstance(int i);
236 
237     void sensitizeProbeOptionMenu(Boolean sensitize);
238     void sensitizePickOptionMenu(Boolean sensitize);
239 
240 
getClassName()241     const char* getClassName()
242     {
243 	return ClassViewControlDialog;
244     }
245 };
246 
247 
248 #endif // _ViewControlDialog_h
249