navigate.H

Go to the documentation of this file.
00001 /*
00002  * This file is part of the "Archon" framework.
00003  * (http://files3d.sourceforge.net)
00004  *
00005  * Copyright © 2002 by Kristian Spangsege and Brian Kristiansen.
00006  *
00007  * Permission to use, copy, modify, and distribute this software and
00008  * its documentation under the terms of the GNU General Public License is
00009  * hereby granted. No representations are made about the suitability of
00010  * this software for any purpose. It is provided "as is" without express
00011  * or implied warranty. See the GNU General Public License
00012  * (http://www.gnu.org/copyleft/gpl.html) for more details.
00013  *
00014  * The characters in this file are ISO8859-1 encoded.
00015  *
00016  * The documentation in this file is in "Doxygen" style
00017  * (http://www.doxygen.org).
00018  */
00019 
00020 #ifndef ARCHON_X3D_NAVIGATE_H
00021 #define ARCHON_X3D_NAVIGATE_H
00022 
00029 #include <archon/x3d/server/appear.H>
00030 
00031 namespace Archon
00032 {
00033   namespace X3D
00034   {
00038     struct Billboard: GroupingNode, BoundedObject
00039     {
00040       static Ref<NodeBase> instantiate(BackRef<ExecutionContext> c)
00041       {
00042         return new Billboard(c);
00043       }
00044 
00045       static const NodeType *type;
00046       const NodeType *getType() const { return type; }
00047 
00048       Billboard(BackRef<ExecutionContext> c):
00049         NodeBase(c),
00050         axisOfRotation(Vector3(0, 1, 0)) {}
00051 
00052       const Vector3 &getAxisOfRotation() const { return axisOfRotation; }
00053 
00054     private:
00055       friend class Viewer;
00056       friend void initializeNavigateComponent();
00057 
00058       Vector3 axisOfRotation;
00059 
00060       EventSource axisOfRotationChanged;
00061 
00062       Time axisOfRotationStamp;
00063     };
00064 
00068     struct Viewpoint: BindableNode
00069     {
00070       static Ref<NodeBase> instantiate(BackRef<ExecutionContext> c)
00071       {
00072         return new Viewpoint(c);
00073       }
00074 
00075       static const NodeType *type;
00076       const NodeType *getType() const { return type; }
00077 
00078       Viewpoint(BackRef<ExecutionContext> c):
00079         NodeBase(c),
00080         jump(true),
00081         position(Vector3(0, 0, 10)),
00082         orientation(Rotation3(Vector3(0, 0, 1), 0)),
00083         fieldOfView(M_PI_4),
00084         centerOfRotation(Vector3::zero()) {}
00085 
00086       bool getJump()                       const { return jump; }
00087       const Vector3 &getPosition()         const { return position; }
00088       const Rotation3 &getOrientation()    const { return orientation; }
00089       double getFieldOfView()              const { return fieldOfView; }
00090       const Vector3 &getCenterOfRotation() const { return centerOfRotation; }
00091       string getDescription()              const { return description; }
00092 
00093     private:
00094       friend void initializeNavigateComponent();
00095 
00096       bool      jump;
00097       Vector3   position;
00098       Rotation3 orientation;
00099       double    fieldOfView; // 0 - M_PI
00100       Vector3   centerOfRotation; // Trackball center
00101       string    description;
00102 
00103       EventSource jumpChanged;
00104       EventSource positionChanged;
00105       EventSource orientationChanged;
00106       EventSource fieldOfViewChanged;
00107       EventSource centerOfRotationChanged;
00108 
00109       Time jumpStamp;
00110       Time positionStamp;
00111       Time orientationStamp;
00112       Time fieldOfViewStamp;
00113       Time centerOfRotationStamp;
00114     };
00115   }
00116 }
00117 
00118 #endif // ARCHON_X3D_NAVIGATE_H

Generated on Sun Jul 30 22:55:49 2006 for Archon by  doxygen 1.4.4