/home/tetron/hack/vos/libs/vos/metaobjects/a3dl/viewpoint.hh
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2001, 2002 Peter Amstutz 00003 Copyright (C) 2002 Reed Hedges 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 */ 00020 00021 #ifndef _VIEWPOINT_HH_ 00022 #define _VIEWPOINT_HH_ 00023 00024 #include "a3dldefs.hh" 00025 #include <vos/vos/vos.hh> 00026 00027 #ifndef A3DL_EXPORTS 00028 IMPORT_METAOBJECT_FACTORIES(A3DL_Viewpoint) 00029 #endif 00030 00031 00032 namespace A3DL 00033 { 00034 /** @class Viewpoint viewpoint.hh vos/metaobjects/a3dl/viewpoint.hh 00035 * @ingroup libmetaobject_a3dl 00036 * A viewpoint is some position and orientation in space that a user 00037 * may wish to assume. The recommended "starting positoin" in a sector 00038 * is represented by a viewpoint object named "default-viewpoint". 00039 * Additionaly, viewpoints may suggest an angular "field of view" for 00040 * rendering the world. 00041 */ 00042 class A3DL_API Viewpoint : public VOS::MetaObject 00043 { 00044 public: 00045 Viewpoint(VOS::VobjectBase* superobject); 00046 virtual ~Viewpoint(); 00047 00048 /** Set position of this viewpoint. 00049 @param x X translation, relative to origin of parent object 00050 @param y Y translation, relative to origin of parent object 00051 @param z Z translation, relative to origin of parent object 00052 @throws NoSuchObjectError if "position" subobject does not exist, or is not a property. 00053 */ 00054 virtual void setPosition(double x, double y, double z); 00055 00056 /** Get position of this viewpoint. 00057 @param x X translation, relative to origin of parent object 00058 @param y Y translation, relative to origin of parent object 00059 @param z Z translation, relative to origin of parent object 00060 @throws NoSuchObjectError if "position" subobject does not exist, or is not a property. 00061 */ 00062 virtual void getPosition(double& x, double& y, double& z); 00063 00064 00065 /** The orientation of this viewpoint in angle-axis 00066 representation. See A3DL::Object3D::setOrientation() for 00067 details */ 00068 virtual void setOrientation(double x, double y, double z, double r); 00069 00070 00071 /** The orientation of this viewpoint in angle-axis 00072 representation. See A3DL::Object3D::getOrientation() for 00073 details */ 00074 virtual void getOrientation(double& x, double& y, double& z, double& r); 00075 00076 /** Set viewpoint field of view. 00077 @param angle View angle in radians. PI > angle > 0 00078 @throws NoSuchObjectError if "viewpoint:fov" subobject does not exist, or is not a property. 00079 */ 00080 virtual void setFOV(double angle); 00081 00082 /** Get viewpoint field of view. 00083 @return the viewpoint field of view 00084 @throws NoSuchObjectError if "viewpoint:fov" subobject does not exist, or is not a property. 00085 */ 00086 virtual double getFOV(); 00087 00088 /** Set the viewpoint's title. 00089 @param text Title in plain text. 00090 */ 00091 virtual void setTitle(const std::string& text); 00092 00093 /** Get the viewpoint's title. */ 00094 virtual std::string getTitle(); 00095 00096 00097 /** Initialize subproperties: 00098 * position=(0,0,0), orientaiont=(0,0,0), viewpoint:fov and viewpoint:title 00099 * are unset. 00100 * @warning sets <i>No</i> access control by default! 00101 */ 00102 virtual void initialize(); 00103 00104 virtual const std::string getVOSType(); 00105 static VOS::MetaObject* new_Viewpoint(VOS::VobjectBase* superobject, const std::string& type); 00106 }; 00107 } 00108 00109 #endif