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 : Frederic FRATANI (MMM yyyy) 00022 **=======================================================================*/ 00023 00024 00025 #ifndef SOTVIZNAVIGATIONTOOLS_H 00026 #define SOTVIZNAVIGATIONTOOLS_H 00027 00028 00029 #include <Inventor/SbLinear.h> 00030 #include <Inventor/nodes/SoSeparator.h> 00031 #include <TerrainViz/viewer/SoTVizViewer.h> 00032 #ifdef _WIN32 00033 # ifdef _SO_QT_ 00034 # include <wingdi.h> 00035 # else 00036 # include <Inventor/Win/SoWinDef.h> 00037 # endif 00038 #endif 00039 class SoOrthographicCamera; 00040 class SoTransform; 00041 class SoTranslation; 00042 class SoScale; 00043 class SoText3; 00044 class SoPickedPoint; 00045 class SoDEPRECATED SoTVizNavigationTools 00066 { 00067 public: 00068 00069 00073 SoTVizNavigationTools (SbVec2s viewport); 00074 00078 virtual ~SoTVizNavigationTools (); 00079 00083 virtual void addTool(SoTVizNavigationToolBase * tool); 00084 00088 virtual void removeTool(SoTVizNavigationToolBase * tool); 00089 00093 virtual int getNumTools() const; 00094 00098 virtual SoTVizNavigationToolBase* getTool (int index) const; 00099 00100 private: 00101 00102 // method used by SoTVizViewer to put navigation tools in the scene graph 00103 SoSeparator * getRoot () const {return m_toolsRoot;} 00104 00105 // use this when windows size changes 00106 void setViewport (SbVec2s newViewport); 00107 00108 // methods called by SoTVizViewer to update displayed values 00109 // and notify each tool 00110 virtual void notifyOrientation (float newOrientation); 00111 virtual void notifyElevation (float newRelativeElevation, float newGroundElevation, SoTVizCameraManager::lengthUnits newLengthUnit); 00112 virtual void notifySpeed (float newSpeed, SoTVizViewer::speedUnits newSpeedUnit); 00113 virtual void notifyPosition (SbVec3f& newPosition); 00114 00115 // method called in SoTVizViewer::processEvent to enable 00116 // interface interactivity. Events are then dispatched to all tools 00117 virtual SbBool processEvent (XAnyEvent * mouseEvent, SbBool ctrl, SbBool shft); 00118 00119 private: 00120 00121 // root node of internal scenegraph 00122 SoSeparator * m_toolsRoot; 00123 // camera of this scenegraph 00124 SoOrthographicCamera * m_camera; 00125 // window size in pixels 00126 SbVec2s m_viewport; 00127 00128 // list of navigation tools 00129 SbPList m_toolsList; 00130 00131 // a SoCallback associated function to be executed before the internal 00132 // scenegraph traversal (to prevent polygons collision in particular) 00133 static void terrainNavigationToolsCB (void *,class SoAction *); 00134 }; 00135 00136 #endif //SOTVIZNAVIGATIONTOOLS_H 00137 00138 00139