00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #if defined(_WIN32)
00026 # include <Inventor/Win/viewers/SoWinWalkViewer.h>
00027 #else // _WIN32
00028
00029 #ifndef _SO_XT_WALK_VIEWER_
00030 #define _SO_XT_WALK_VIEWER_
00031
00032 #include <Inventor/MP/Xt/viewers/SoXtMPConstrainedViewer.h>
00033 #include <Inventor/SbLinear.h>
00034 #include <Inventor/SbTime.h>
00035
00036 class SoFieldSensor;
00037
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00071
00144 class SoXtMPWalkViewer : public SoXtMPConstrainedViewer {
00145 public:
00146
00151 SoXtMPWalkViewer(
00152 SoWidget parent = NULL,
00153 const char *name = NULL,
00154 SbBool buildInsideParent = TRUE,
00155 SoXtMPFullViewer::BuildFlag flag = BUILD_ALL,
00156 SoXtMPViewer::Type type = BROWSER);
00160 ~SoXtMPWalkViewer();
00161
00162
00163
00164
00165 virtual void setViewing(SbBool onOrOff);
00166 virtual void setCamera(SoCamera *cam);
00167 virtual void setCursorEnabled(SbBool onOrOff);
00168
00169
00170 virtual void setCameraType(SoType type);
00171
00172
00173 private:
00174
00175
00176
00177
00178 SoEXTENDER
00179 SoXtMPWalkViewer(
00180 SoWidget parent,
00181 const char *name,
00182 SbBool buildInsideParent,
00183 SoXtMPFullViewer::BuildFlag flag,
00184 SoXtMPViewer::Type type,
00185 SbBool buildNow);
00186
00187
00188 virtual SbString getDefaultWidgetName() const;
00189 virtual SbString getDefaultTitle() const;
00190 virtual SbString getDefaultIconTitle() const;
00191
00192
00193 virtual void processEvent(XAnyEvent *anyevent);
00194 virtual void setSeekMode(SbBool onOrOff);
00195 virtual void actualRedraw();
00196 virtual void rightWheelMotion(float);
00197
00198
00199 virtual SoWidget buildLeftTrim(SoWidget parent);
00200
00201
00202 virtual void createPrefSheet();
00203
00204
00205 virtual void openViewerHelpCard();
00206
00207 private:
00208
00209 int mode;
00210 SbBool createdCursors;
00211
00212 Cursor *walkCursor, *panCursor, *tiltCursor, *seekCursor, *upCursor;
00213 SbVec2s locator;
00214 SbVec2s prevPos;
00215 SbVec2s startPos;
00216
00217
00218 int heightWheelVal;
00219 static void heightWheelCB(SoWidget, SoXtMPWalkViewer *p, XtPointer *d);
00220
00221
00222 SoFieldSensor *animationSensor;
00223 SbBool animatingFlag;
00224 SbTime prevAnimTime;
00225 void startAnimating();
00226 void stopAnimating();
00227 static void animationSensorCB(void *v, SoSensor *);
00228
00229 void updateViewerMode(unsigned int state);
00230 void switchMode(int newMode);
00231 void updateCursor();
00232 void defineCursors();
00233 void doCameraAnimation();
00234 void dollyCamera(float dist);
00235 void rotateCamera();
00236
00237
00238 void updateCameraFocalPoint();
00239 static void setFocalPointFinishCallback(void *, SoXtMPViewer *);
00240
00241
00242 void constructorCommon(SbBool buildNow);
00243
00244 void mpXDefineCursor(Cursor * cursorToSetActive);
00245
00246 public:
00247 void drawViewerFeedback(void);
00248
00249
00250 };
00251
00252 #endif
00253
00254 #endif // _WIN32
00255
00256
00257