1 // viewmgr.hxx -- class for managing all the views in the flightgear world.
3 // Written by Curtis Olson, started October 2000.
5 // Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 #include <simgear/compiler.h>
30 #include <simgear/structure/subsystem_mgr.hxx>
31 #include <simgear/props/props.hxx>
32 #include <simgear/props/tiedpropertylist.hxx>
33 #include <simgear/math/SGMath.hxx>
39 typedef SGSharedPtr<flightgear::View> ViewPtr;
42 // Define a structure containing view information
43 class FGViewMgr : public SGSubsystem
55 virtual void postinit();
57 virtual void unbind ();
58 virtual void update (double dt);
59 virtual void reinit ();
60 virtual void shutdown();
63 inline int size() const { return views.size(); }
64 inline int get_current() const { return current; }
66 flightgear::View* get_current_view();
67 const flightgear::View* get_current_view() const;
69 flightgear::View* get_view( int i );
70 const flightgear::View* get_view( int i ) const;
72 flightgear::View* next_view();
73 flightgear::View* prev_view();
78 void add_view( flightgear::View * v );
80 static const char* subsystemName() { return "view-manager"; }
82 simgear::TiedPropertyList _tiedProperties;
85 void setView (int newview);
88 std::vector<SGPropertyNode_ptr> config_list;
89 SGPropertyNode_ptr _viewNumberProp;
90 typedef std::vector<flightgear::ViewPtr> viewer_list;
97 #endif // _VIEWMGR_HXX