00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _SO_WIN_STEREOVIEW_TYPE
00025 #define _SO_WIN_STEREOVIEW_TYPE
00026
00027 #include <Inventor/Gui/SoGui.h>
00028 #include <Inventor/sys/port.h>
00029 #include <Inventor/SbBasic.h>
00030 #include <Inventor/nodes/SoCamera.h>
00031 #include <Inventor/nodes/SoSeparator.h>
00032 #include <Inventor/Gui/viewers/SoGuiViewer.h>
00033
00034 class SoStereoViewer;
00035 class SoSceneManager;
00036 class SoGLRenderAction;
00037
00060 class SoBaseStereo
00061 {
00062
00063 public:
00065 enum StereoViewType
00066 {
00070 NO_STEREO_VIEW = 0,
00074 INTERLACED_STEREO = 1,
00078 HALF_SCREEN_STEREO = 2,
00082 RAW_STEREO = 3,
00084 OPENGL_STEREO = 3,
00088 ANAGLYPH_STEREO = 4,
00090 ANAGLYPH = 4,
00091 #ifndef HIDDEN_FROM_DOC
00092
00095 SSDI_STEREO = 5,
00096 #endif
00097 PASSIVE_STEREO = 6
00098 };
00099
00103 SoBaseStereo( SoStereoViewer* stereoViewer = NULL, SoGuiViewer* guiViewer = NULL );
00104
00108 virtual ~SoBaseStereo();
00109
00113 void setStereoViewer( SoStereoViewer* viewer = NULL ) { m_stereoViewer = viewer; }
00114
00119 SoStereoViewer* getStereoViewer() { return m_stereoViewer; }
00120
00125 virtual void reverseStereoView( SbBool reverse );
00126
00130 virtual SbBool isStereoViewReversed() const;
00131
00136 virtual void renderStereoView();
00137
00141 virtual StereoViewType getStereoViewType() = 0;
00142
00150 virtual SbBool canClearBeforeRender() const;
00151
00155 virtual SbBool requireHardware() { return FALSE; }
00156
00161 virtual void clearStereo();
00162
00164 void setStereoElement( SoSceneManager*, SoCamera::StereoMode stereoMode );
00165
00166 private:
00176 virtual SbBool isMPStereoViewTypeSupported();
00177
00181 virtual void doLeftEyeSettings( SoGLRenderAction* ) {};
00182 virtual void doRightEyeSettings( SoGLRenderAction* ) {};
00183 virtual void doMonoscopicSettings( SoGLRenderAction* ) {};
00184
00188 void setRenderFastEditNodes( SbBool render );
00189
00193 void setGuiViewer( SoGuiViewer* viewer = NULL ) { m_guiViewer = viewer; }
00194
00195 private:
00196
00197 void insertTestPattern( SoSceneManager* mgr );
00198 void removeTestPattern( SoSceneManager* mgr );
00199
00200 SoStereoViewer* m_stereoViewer;
00201 SoGuiViewer* m_guiViewer;
00202 SbBool m_renderFastEdit;
00203 SbBool m_reversed;
00204 SbBool m_clearBuffer;
00205
00206 private:
00207 SoRef<SoSeparator> m_patternSceneGraph;
00208
00210 SoRef<SoSeparator> m_oldRootSlot;
00211 };
00212
00213 #endif // _SO_WIN_STEREOVIEW_TYPE
00214
00215