00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : Olivier Fedkiw (MMM yyyy) 00022 **=======================================================================*/ 00023 00024 #ifndef _SO_STEREO_ELEMENT 00025 #define _SO_STEREO_ELEMENT 00026 00027 #include <Inventor/nodes/SoCamera.h> 00028 #include <Inventor/elements/SoSubElement.h> 00029 00041 SoEXTENDER_Documented class SoStereoElement : public SoElement { 00042 00043 SO_ELEMENT_HEADER(SoStereoElement); 00044 00045 public: 00051 static void setStereoAbsoluteAdjustments(SoState * state, SbBool absolute); 00055 static bool isStereoAbsoluteAdjustments(SoState * state); 00056 00060 static void setStereoAdjustment(SoState * state, float stoffset); 00061 00066 static void setBalanceAdjustment(SoState * state, float stbalance, SbBool stNearFrac = false); 00067 00071 static void setInterEyeDistance(SoState * state, float ied); 00072 00076 static void setReversedView(SoState * state, bool strev); 00077 00081 static float getStereoAdjustment(SoState *state); 00082 00086 static float getBalanceAdjustment(SoState *state); 00087 00092 static SbBool isBalanceAdjustmentNearFrac(SoState *state); 00093 00097 static float getInterEyeDistance(SoState *state); 00098 00102 static bool getReversedView(SoState *state); 00103 00107 static void set(SoState *state, const SoCamera::StereoMode mode); 00108 00109 // Returns the boolean that tells the camera to narrow or not the view volume 00110 //static const SbBool getNarrow(SoState *state); 00111 00115 static SoCamera::StereoMode getStereoMode(SoState *state); 00116 00122 static SoStereoElement *getInstance(const SoState *state, SbBool &elemIsSet); 00123 00124 private: 00125 00127 virtual void init(SoState *state); 00128 00132 virtual SbBool matches(const SoElement* elt) const; 00133 00137 virtual SoElement* copyMatchInfo() const; 00138 00139 private: 00140 // Initializes the SoStereoElement class 00141 static void initClass(); 00142 static void exitClass(); 00143 00144 private: 00145 00146 SoCamera::StereoMode stereoMode; 00147 SbBool stereoAbsoluteAdjustments; 00148 float stereoOffset; 00149 bool stereoNearFrac; 00150 float stereoBalance; 00151 float interEyeDistance; 00152 bool reversed; 00153 SbBool isSet; 00154 00155 virtual ~SoStereoElement(); 00156 00157 friend class SoGuiRenderArea; 00158 friend class SoBaseStereo; 00159 friend class SoStereoCamera; 00160 }; 00161 #endif /* _SO_STEREO_ELEMENT */ 00162 00163 00164