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
00026
00027 #ifndef _SO_WIN_MP_EXAMINER_VIEWER_
00028 #define _SO_WIN_MP_EXAMINER_VIEWER_
00029
00030 #if defined(_WIN32)
00031 # include <Inventor/Win/SoWinBeginStrict.h>
00032 #endif // _WIN32
00033 #include <Inventor/MP/Win/viewers/SoWinMPFullViewer.h>
00034 #include <Inventor/SbLinear.h>
00035
00036
00037 class SbSphereSheetProjector;
00038 class SoFieldSensor;
00039 class SoSeparator;
00040 class SoSwitch;
00041 class SoTranslation;
00042 class SoScale;
00043
00044 class SoWinBitmapButton;
00045
00046
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00077
00092 class SoWinMPExaminerViewer : public SoWinMPFullViewer {
00093
00094 public:
00095 SoWinMPExaminerViewer(SoWidget parent = NULL,
00096 const char *name = NULL,
00097 SbBool buildInsideParent = TRUE,
00098 SoWinMPFullViewer::BuildFlag flag = BUILD_ALL,
00099 SoWinMPViewer::Type type = BROWSER);
00100 ~SoWinMPExaminerViewer();
00101
00102
00103
00104
00105
00106 void setFeedbackVisibility(SbBool onOrOff);
00107 SbBool isFeedbackVisible() const { return feedbackFlag; }
00108
00109
00110
00111
00112 void setFeedbackSize(int newSize);
00113 int getFeedbackSize() const { return (int)feedbackSize; }
00114
00115
00116
00117
00118
00119 void setAnimationEnabled(SbBool onOrOff);
00120 SbBool isAnimationEnabled() { return animationEnabled; }
00121
00122
00123
00124
00125
00126 void stopAnimating();
00127 SbBool isAnimating() { return animatingFlag; }
00128
00129
00130
00131
00132 virtual void viewAll();
00133 virtual void resetToHomePosition();
00134 virtual void setCamera(SoCamera *cam);
00135 virtual void setViewing(SbBool onOrOff);
00136 virtual void setCursorEnabled(SbBool onOrOff);
00137
00138 private:
00139
00140
00141
00142
00143 SoEXTENDER
00144 SoWinMPExaminerViewer(SoWidget parent,
00145 const char *name,
00146 SbBool buildInsideParent,
00147 SoWinMPFullViewer::BuildFlag flag,
00148 SoWinMPViewer::Type type,
00149 SbBool buildNow);
00150
00151
00152 virtual SbString getDefaultWidgetName() const;
00153 virtual SbString getDefaultTitle() const;
00154 virtual SbString getDefaultIconTitle() const;
00155
00156
00157 virtual void processEvent(XAnyEvent *anyevent);
00158 virtual void setSeekMode(SbBool onOrOff);
00159 virtual void prepareRedraw();
00160 virtual void actualRedraw();
00161 virtual void endRedraw();
00162
00163
00164 SoWidget buildWidget(SoWidget parent);
00165
00166
00167 virtual void bottomWheelMotion(float newVal);
00168 virtual void leftWheelMotion(float newVal);
00169 virtual void rightWheelMotion(float newVal);
00170
00171
00172 virtual void bottomWheelStart();
00173 virtual void leftWheelStart();
00174
00175
00176 virtual void createPrefSheet();
00177
00178
00179 virtual void createViewerButtons(SoWidget parent);
00180
00181
00182 virtual void openViewerHelpCard();
00183
00184
00185
00186
00187
00188
00189
00190 virtual void pushButtonCB(SoWidget, int id, void *);
00191
00192 private:
00193
00194 int mode;
00195
00196 SbSphereSheetProjector *sphereSheet;
00197 SbVec2s locator;
00198 SbBool firstBuild;
00199
00200
00201 SbBool feedbackFlag;
00202 float feedbackSize;
00203 SoSeparator *feedbackRoot;
00204 SoSwitch *feedbackSwitch;
00205 SoTranslation *feedbackTransNode;
00206 SoScale *feedbackScaleNode;
00207 static char *geometryBuffer;
00208 void createFeedbackNodes();
00209
00210
00211 SbBool animationEnabled, animatingFlag;
00212 SoFieldSensor *animationSensor;
00213 SbRotation *rotBuffer;
00214 int firstIndex, lastIndex;
00215 long lastMotionTime;
00216 SbRotation averageRotation;
00217 SbBool computeAverage;
00218 static void animationSensorCB(void *v, SoSensor *s);
00219 static void visibilityChangeCB(void *pt, SbBool visible);
00220 void doSpinAnimation();
00221
00222
00223 SbVec3f locator3D;
00224 SbPlane focalplane;
00225
00226 void updateViewerMode(unsigned int state);
00227 void switchMode(int newMode);
00228 void updateCursor();
00229
00230 void rotateCamera(const SbRotation &rot);
00231 void rollCamera(const SbVec2s &newLocator);
00232 void spinCamera(const SbVec2f &newLocator);
00233 void dollyCamera(const SbVec2s &newLocator);
00234 void panCamera(const SbVec2f &newLocator);
00235
00236
00237 SoWidget createExamPrefSheetGuts(SoWidget parent);
00238 static void animPrefSheetToggleCB(SoWidget, SoWinMPExaminerViewer *, void *);
00239
00240
00241 int feedbackSizeWheelVal;
00242 SoWidget feedbackLabel[2], feedbackField, feedbackSizeWheel;
00243 static void feedbackSizeWheelCB(SoWidget, SoWinMPExaminerViewer *p, XtPointer *d);
00244 static void feedbackSizeFieldCB(SoWidget, SoWinMPExaminerViewer *, void *);
00245 static void feedbackPrefSheetToggleCB(SoWidget, SoWinMPExaminerViewer *, void *);
00246 void toggleFeedbackWheelSize(SoWidget toggle);
00247
00248
00249 SoWinBitmapButton *buttonList[10];
00250 static void camPushCB(SoWidget, SoWinMPExaminerViewer *, void *);
00251
00252
00253 void constructorCommon(SbBool buildNow);
00254
00255
00256 void processPopupItem(int item);
00257
00258 };
00259
00260 #if defined(_WIN32)
00261 # include <Inventor/Win/SoWinEndStrict.h>
00262 #endif
00263
00264 #endif
00265
00266