00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2009 University of Malaga | 00007 | | 00008 | This software was written by the Machine Perception and Intelligent | 00009 | Robotics Lab, University of Malaga (Spain). | 00010 | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> | 00011 | | 00012 | This file is part of the MRPT project. | 00013 | | 00014 | MRPT is free software: you can redistribute it and/or modify | 00015 | it under the terms of the GNU General Public License as published by | 00016 | the Free Software Foundation, either version 3 of the License, or | 00017 | (at your option) any later version. | 00018 | | 00019 | MRPT is distributed in the hope that it will be useful, | 00020 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00021 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 00022 | GNU General Public License for more details. | 00023 | | 00024 | You should have received a copy of the GNU General Public License | 00025 | along with MRPT. If not, see <http://www.gnu.org/licenses/>. | 00026 | | 00027 +---------------------------------------------------------------------------+ */ 00028 00029 #ifndef opengl_CCamera_H 00030 #define opengl_CCamera_H 00031 00032 #include <mrpt/opengl/CRenderizable.h> 00033 00034 namespace mrpt 00035 { 00036 namespace opengl 00037 { 00038 class COpenGLViewport; 00039 class CCamera; 00040 00041 // This must be added to any CSerializable derived class: 00042 DEFINE_SERIALIZABLE_PRE_CUSTOM_BASE( CCamera, CRenderizable ) 00043 00044 00048 class MRPTDLLIMPEXP CCamera : public CRenderizable 00049 { 00050 friend class COpenGLViewport; 00051 00052 DEFINE_SERIALIZABLE( CCamera ) 00053 protected: 00054 00055 float m_pointingX,m_pointingY,m_pointingZ; 00056 float m_distanceZoom; 00057 float m_azimuthDeg,m_elevationDeg; 00058 00059 bool m_projectiveModel; 00060 float m_projectiveFOVdeg; 00061 00062 public: 00063 void setPointingAt(float x,float y, float z) { m_pointingX=x; m_pointingY=y; m_pointingZ=z; } 00064 00065 float getPointingAtX() const { return m_pointingX; } 00066 float getPointingAtY() const { return m_pointingY; } 00067 float getPointingAtZ() const { return m_pointingZ; } 00068 00069 void setZoomDistance(float z) { m_distanceZoom=z; } 00070 float getZoomDistance() const { return m_distanceZoom; } 00071 00072 float getAzimuthDegrees() const { return m_azimuthDeg; } 00073 float getElevationDegrees() const { return m_elevationDeg; } 00074 00075 void setAzimuthDegrees(float ang) { m_azimuthDeg=ang; } 00076 void setElevationDegrees(float ang) { m_elevationDeg=ang; } 00077 00078 void setProjectiveModel(bool v=true) { m_projectiveModel=v; } 00079 void setOrthogonal(bool v=true) { m_projectiveModel=!v; } 00080 00081 bool isProjective() const { return m_projectiveModel; } 00082 bool isOrthogonal() const { return !m_projectiveModel; } 00083 00084 void setProjectiveFOVdeg(float ang) { m_projectiveFOVdeg=ang; } 00085 float getProjectiveFOVdeg() const { return m_projectiveFOVdeg; } 00086 00087 00089 static CCameraPtr Create() 00090 { 00091 return CCameraPtr( new CCamera ); 00092 } 00093 00096 void render() const { } 00097 00098 private: 00101 CCamera(); 00102 00104 virtual ~CCamera() { } 00105 00106 }; 00107 00108 } // end namespace opengl 00109 00110 } // End of namespace 00111 00112 00113 #endif
Page generated by Doxygen 1.5.8 for MRPT 0.6.5 SVN: at Thu Feb 26 02:07:47 EST 2009 |