| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2000-2008 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: spheregroundplatenavigation.h 6429 2008-07-04 15:03:07Z Stefan_Maass $ 00019 00020 #ifndef VRS_SG_SPHEREGROUNDPLATENAVIGATION_H 00021 #define VRS_SG_SPHEREGROUNDPLATENAVIGATION_H 00022 00023 #include <vrs/sg/groundplatenavigation.h> 00024 00025 namespace VRS { 00026 00033 class VRS_CORE_API SphereGroundPlateNavigation : public GroundPlateNavigation { 00034 00035 public: 00036 00038 SphereGroundPlateNavigation(double yValOfGroundPlate = 0.0); 00039 00040 00041 static const MouseButtonFunctionID MoveCamera; 00042 00046 void setSensitivity(double degreesPerPixel = 0.25); 00047 00049 double getSensitivity() const; 00050 00055 void enableVisualFlowLimit(double visualFlow); 00056 void disableVisualFlowLimit(); 00057 double getVisualFlowLimit() const; 00058 bool getVisualFlowLimitEnabled() const; 00059 00060 virtual void onDragMotion( 00061 int x, int y, 00062 SO<MotionEvent>, 00063 MouseButtonFunctionID id, 00064 int startX, int startY); 00065 00066 VRS_TYPEINFO(SphereGroundPlateNavigation, GroundPlateNavigation); 00067 00068 private: 00069 static const double EPSILON; 00070 00071 // Shots a ray through the middle of the screen. It returns true if a focus point has been found. 00072 // In this case 'newFocus' contains the new focus point: 00073 // - 'newFocus' is the nearest intersection point in front of the camera or 00074 // - 'newFocus' is another intersection points, that equals the old focus 00075 bool updateFocus(const Vector& from, const Vector& to, SO<Canvas> canvas, 00076 Vector& newFocus); 00077 00078 void updateFocus(SO<Canvas> canvas); 00079 00080 bool focusValid_; // Indicates the validity of lastFocus_ 00081 Vector lastFocus_; 00082 double sensitivity_; 00083 bool limitVisualFlow_; 00084 double maxLengthPerPixel_; // maximum allowed movement per pixel in heigth 1.0 00085 }; 00086 00087 } // namespace VRS 00088 00089 #endif // VRS_SG_SPHEREGROUNDPLATENAVIGATION_H