| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2003 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: camerainfo.h 4633 2005-01-03 01:43:11 +0000 (Mo, 03 Jan 2005) klimetschek $ 00019 // $Date: 2005-01-03 01:43:11 +0000 (Mo, 03 Jan 2005) $ 00020 // $Revision: 4633 $ 00021 // $State$ 00022 // $Author: klimetschek $ 00023 // 00024 // $Log$ 00025 // Revision 1.21 2005/01/03 01:43:07 klimetschek 00026 // - modified win32 project layout, splitted vrs.vcproj into vrs_container, vrs_core, vrs_sg, vrs_image, vrs_opengl and vrs_io 00027 // - removed vrs.vcproj 00028 // minor things: 00029 // - added all glutexamples to vrs4glut.sln 00030 // - fixed some problems in glutexamples 00031 // - removed all project references from all VS projects (using solution wide project dependencies instead) 00032 // 00033 // Revision 1.20 2004/11/05 13:58:09 basch 00034 // Class comment changed (Doxygen style) 00035 // 00036 // Revision 1.19 2004/03/12 16:28:38 baumann 00037 // macros VRS_NAMESPACE_BEGIN/_END expanded and removed 00038 // 00039 // Revision 1.18 2004/01/19 11:43:56 baumann 00040 // serialization mechanism improved 00041 // 00042 // Revision 1.17 2004/01/19 07:28:03 baumann 00043 // serialization mechanism improved 00044 // 00045 // Revision 1.16 2003/11/07 14:19:23 kirsch 00046 // removed leading underscore from include guards 00047 // 00048 // Revision 1.15 2003/06/26 15:17:58 baumann 00049 // code cleanup 00050 // 00051 // Revision 1.14 2003/06/26 14:57:25 baumann 00052 // new method added VRS::Engine::currentNormalizedDeviceCoordsTf() which returns the 00053 // normalized device coordinate tranformation (which is usually the identity matrix, 00054 // but during the tiling process of a large scale snapshot, this could be another 00055 // transformation) 00056 // 00057 // Revision 1.13 2003/02/13 20:23:31 skirsch 00058 // improved and corrected the comments 00059 // 00060 // Revision 1.12 2002/12/11 16:06:31 kirsch 00061 // use Matrix() instead of Matrix::identity in default constructor 00062 // 00063 // Revision 1.11 2002/10/29 10:32:51 baumann 00064 // macros VRS_CLASSNAME_* and VRS_IMPL_TYPEINFO_* removed 00065 // 00066 // Revision 1.10 2002/06/28 12:27:31 baumann 00067 // renamed CameraIll, CameraParallel and CameraPerspective to Unknown, Parallel and Perspective 00068 // 00069 // Revision 1.9 2002/04/07 17:14:11 baumann 00070 // Matrix::identity() changed to Matrix::identity 00071 // 00072 // Revision 1.8 2002/03/03 21:44:24 kosta 00073 // VRS_TYPEINFO-macro rewritten 00074 // 00075 // Revision 1.7 2002/02/19 10:34:07 kosta 00076 // undone all changes since 2002-02-15 00077 // 00078 // Revision 1.4 2002/01/15 16:25:53 kosta 00079 // macros rewritten for a better namespace support 00080 // 00081 // Revision 1.3 2001/11/13 16:36:30 kirsch 00082 // changed line feed to unix style (removed control-M) 00083 // 00084 // Revision 1.2 2001/07/05 12:43:14 kersting 00085 // added enum name and set method parameters due to enum name 00086 // 00087 // Revision 1.1.1.1 2001/06/08 08:09:20 kirsch 00088 // imported alpha-version by olli 00089 // 00090 00091 00092 #ifndef VRS_CAMERAINFO_H 00093 #define VRS_CAMERAINFO_H 00094 00095 #include <vrs/bounds.h> 00096 #include <vrs/matrix.h> 00097 #include <vrs/sharedobj.h> 00098 00099 00100 namespace VRS { 00101 00102 class Engine; 00103 00105 class VRS_CORE_API CameraInfo : public SharedObj { 00106 00107 public: 00108 CameraInfo(const Matrix& matrix = Matrix()); 00111 CameraInfo(const Engine* engine, bool objectCoordinates = false, bool useNDC = true); 00126 Vector direction() const; 00128 Vector position() const; 00130 Vector focus() const; 00132 00133 Vector rightVector() const; 00135 Vector upVector() const; 00137 Vector depthVector() const; 00139 00143 Vector leftPlaneNormal() const; 00150 Vector rightPlaneNormal() const; 00152 Vector topPlaneNormal() const; 00154 Vector bottomPlaneNormal() const; 00156 00157 Vector clipPlaneNormal() const; 00159 00163 double leftAngle() const; 00165 00168 double rightAngle() const; 00170 00172 double topAngle() const; 00174 00177 double bottomAngle() const; 00179 00182 double nearPlane() const; 00184 double farPlane() const; 00186 00187 Vector getLLF() const; 00189 Vector getURB() const; 00191 00192 enum PrjType { Unknown, Parallel, Perspective }; 00193 VRS_SERIALIZABLE_CLASS_ENUM(PrjType); 00194 PrjType projectionType() const; 00196 00197 void decompose(const Matrix & matrix); 00199 const Matrix& matrix() const; 00201 00202 enum CullingPos { Outside = -1, InAndOut = 0, Inside = 1 }; 00203 VRS_SERIALIZABLE_CLASS_ENUM(CullingPos); 00204 CullingPos culling(const Vector& point) const; 00206 CullingPos culling(const Bounds& bbox) const; 00208 00209 VRS_TYPEINFO(CameraInfo, SharedObj); 00210 00211 private: 00212 PrjType type_; 00213 00214 Matrix matrix_; 00215 00216 Vector position_; 00217 Vector focus_; 00218 Vector upVector_; 00219 Vector rightVector_; 00220 Vector depthVector_; 00221 Vector leftPlane_; 00222 Vector rightPlane_; 00223 Vector topPlane_; 00224 Vector bottomPlane_; 00225 Vector clipNormal_; 00226 00227 double leftAngle_; 00228 double rightAngle_; 00229 double topAngle_; 00230 double bottomAngle_; 00231 double nearPlane_; 00232 double farPlane_; 00233 00234 Vector llf_; 00235 Vector urb_; 00236 }; 00237 00238 } // namespace VRS 00239 00240 #endif // VRS_CAMERAINFO_H