]> git.mxchange.org Git - flightgear.git/blob - utils/fgviewer/HLAPerspectiveViewer.hxx
fgviewer: Import hla based viewer application.
[flightgear.git] / utils / fgviewer / HLAPerspectiveViewer.hxx
1 // Copyright (C) 2009 - 2012  Mathias Froehlich - Mathias.Froehlich@web.de
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Library General Public
5 // License as published by the Free Software Foundation; either
6 // version 2 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Library General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16 //
17
18 #ifndef HLAPerspectiveViewer_hxx
19 #define HLAPerspectiveViewer_hxx
20
21 #include "HLAEyeTracker.hxx"
22 #include "HLAObjectReferenceData.hxx"
23 #include "HLAView.hxx"
24 #include "HLAViewer.hxx"
25
26 namespace fgviewer {
27
28 class HLAPerspectiveViewerClass;
29
30 class HLAPerspectiveViewer : public HLAViewer {
31 public:
32     HLAPerspectiveViewer(HLAPerspectiveViewerClass* objectClass, const SGWeakPtr<simgear::HLAFederate>& federate);
33     virtual ~HLAPerspectiveViewer();
34
35     virtual void createAttributeDataElements();
36
37     const HLAView* getView() const;
38     HLAView* getView();
39     void setView(HLAView* view);
40
41     const SGVec3d& getPosition() const
42     { return _position.getValue(); }
43     void setPosition(const SGVec3d& position)
44     { _position.setValue(position); }
45
46     const SGQuatd& getOrientation() const
47     { return _orientation.getValue(); }
48     void setOrientation(const SGQuatd& orientation)
49     { _orientation.setValue(orientation); }
50
51     double getZoomFactor() const
52     { return _zoomFactor.getValue(); }
53     void setZoomFactor(double zoomFactor)
54     { _zoomFactor.setValue(zoomFactor); }
55
56     const HLAEyeTracker* getEyeTracker() const;
57     HLAEyeTracker* getEyeTracker();
58     void setEyeTracker(HLAEyeTracker* eyeTracker);
59
60     SGLocationd getLocation(const SGTimeStamp& simTime) const;
61
62     SGVec3d getLeftEyeOffset() const;
63     SGVec3d getRightEyeOffset() const;
64
65 private:
66     simgear::HLAObjectReferenceData<HLAView> _view;
67     simgear::HLAVec3dData _position;
68     simgear::HLAQuat3dData _orientation;
69     simgear::HLADoubleData _zoomFactor;
70     simgear::HLAObjectReferenceData<HLAEyeTracker> _eyeTracker;
71 };
72
73 } // namespace fgviewer
74
75 #endif