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-2017 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : C. HUFSCHMITT (Jul 2001) 00022 **=======================================================================*/ 00023 00024 #ifndef _SO_MPEGNAVRENDERER_ 00025 #define _SO_MPEGNAVRENDERER_ 00026 00027 #include <Inventor/MPEG/SoMPEGRenderer.h> 00028 #include <Inventor/nodes/SoCamera.h> 00029 #include <Inventor/sensors/SoFieldSensor.h> 00030 #include <Inventor/SbBasic.h> 00031 #include <Inventor/SbPList.h> 00032 #include <Inventor/nodes/SoDirectionalLight.h> 00033 #include <Inventor/nodes/SoRotation.h> 00034 #include <Inventor/SoOffscreenRenderArea.h> 00035 00036 /*----------------------------------------------------------------------------*/ 00037 00062 class SoMPEGNavRenderer : public SoMPEGRenderer { 00063 00064 public: 00065 00072 SoMPEGNavRenderer(SoNode *node); 00073 00077 virtual ~SoMPEGNavRenderer(); 00078 00082 virtual void setSceneGraph(SoNode *node); 00083 00088 virtual void record(); 00089 00094 virtual void stop(); 00095 00115 void adjustNumFramesPerSecond(SbBool flag); 00116 00121 SbBool isAdjustedNumFramesPerSecond() const; 00122 00128 void setCamera(SoCamera* camera); 00129 00133 SoCamera *getCamera(); 00134 00135 /*----------------------------------------------------------------------------*/ 00136 00137 private: 00138 SbPList *getHistory (); 00139 00140 struct CamPosition { 00141 SbVec3f position; 00142 SbRotation orientation; 00143 float nearDistance; 00144 float farDistance; 00145 unsigned long time; 00146 }; 00147 00148 static void cameraChangedCB(void *render, SoSensor *s); 00149 00150 void searchCameraAndHeadlight(); 00151 00152 private: 00153 00154 SoCamera *m_Camera; 00155 SoDirectionalLight *m_Light; 00156 SoRotation *m_LightRotation; 00157 SoFieldSensor *m_Sensor; 00158 SbBool m_AdjustFrameRate; 00159 SbPList *m_CamHistory; 00160 00161 SoRef<SoOffscreenRenderArea> m_osRenderArea; 00162 };/*----------------------------------------------------------------------------*/ 00163 00164 #endif /* _SO_MPEGNAVRENDERER_ */ 00165 00166 00167