Break viewmgr.hxx dependency on on viewer.hxx.
This commit is contained in:
parent
3c84e07a25
commit
0c8c8380b1
12 changed files with 79 additions and 41 deletions
|
@ -44,6 +44,7 @@
|
|||
#include <Main/globals.hxx>
|
||||
#include <Main/fg_props.hxx>
|
||||
#include <Main/viewmgr.hxx>
|
||||
#include <Main/viewer.hxx>
|
||||
#include <Scenery/scenery.hxx>
|
||||
#include <GUI/gui.h>
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include <Main/globals.hxx>
|
||||
#include <Scenery/scenery.hxx>
|
||||
#include <Airports/runways.hxx>
|
||||
#include <Main/viewer.hxx>
|
||||
|
||||
#include "hud.hxx"
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#include "hud.hxx"
|
||||
#include "panel.hxx"
|
||||
|
||||
#include <Main/viewer.hxx>
|
||||
|
||||
// FIXME
|
||||
extern float get_roll(void);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <Environment/environment.hxx>
|
||||
#include <Environment/environment_mgr.hxx>
|
||||
#include <ATCDCL/ATCutils.hxx>
|
||||
#include <Main/viewer.hxx>
|
||||
|
||||
#include <osg/GLU>
|
||||
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include <Main/viewmgr.hxx>
|
||||
#include <Time/light.hxx>
|
||||
#include <GUI/new_gui.hxx> // FGFontCache
|
||||
#include <Main/viewer.hxx>
|
||||
|
||||
#include "hud.hxx"
|
||||
#include "panel.hxx"
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
#include <Main/globals.hxx>
|
||||
#include <Main/viewmgr.hxx>
|
||||
#include <Main/viewer.hxx>
|
||||
|
||||
#include "HUD.hxx"
|
||||
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "util.hxx"
|
||||
#include "viewmgr.hxx"
|
||||
#include "main.hxx"
|
||||
#include <Main/viewer.hxx>
|
||||
|
||||
using std::string;
|
||||
using std::ifstream;
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
#include "fg_init.hxx"
|
||||
#include "fg_os.hxx"
|
||||
#include "WindowSystemAdapter.hxx"
|
||||
|
||||
#include <Main/viewer.hxx>
|
||||
|
||||
static double real_delta_time_sec = 0.0;
|
||||
double delta_time_sec = 0.0;
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
#include "options.hxx"
|
||||
#include "util.hxx"
|
||||
#include "viewmgr.hxx"
|
||||
|
||||
#include <Main/viewer.hxx>
|
||||
|
||||
using std::string;
|
||||
using std::sort;
|
||||
|
|
|
@ -99,6 +99,7 @@
|
|||
#include "main.hxx"
|
||||
#include "CameraGroup.hxx"
|
||||
#include "FGEventHandler.hxx"
|
||||
#include <Main/viewer.hxx>
|
||||
|
||||
using namespace osg;
|
||||
using namespace simgear;
|
||||
|
|
|
@ -341,6 +341,64 @@ FGViewMgr::copyToCurrent()
|
|||
get_current_view()->getInternal());
|
||||
}
|
||||
|
||||
void FGViewMgr::clear()
|
||||
{
|
||||
views.clear();
|
||||
}
|
||||
|
||||
FGViewer*
|
||||
FGViewMgr::get_current_view()
|
||||
{
|
||||
if ( current < (int)views.size() ) {
|
||||
return views[current];
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
const FGViewer*
|
||||
FGViewMgr::get_current_view() const
|
||||
{
|
||||
if ( current < (int)views.size() ) {
|
||||
return views[current];
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FGViewer*
|
||||
FGViewMgr::get_view( int i )
|
||||
{
|
||||
if ( i < 0 ) { i = 0; }
|
||||
if ( i >= (int)views.size() ) { i = views.size() - 1; }
|
||||
return views[i];
|
||||
}
|
||||
|
||||
const FGViewer*
|
||||
FGViewMgr::get_view( int i ) const
|
||||
{
|
||||
if ( i < 0 ) { i = 0; }
|
||||
if ( i >= (int)views.size() ) { i = views.size() - 1; }
|
||||
return views[i];
|
||||
}
|
||||
|
||||
FGViewer*
|
||||
FGViewMgr::next_view()
|
||||
{
|
||||
setView((current+1 < (int)views.size()) ? (current + 1) : 0);
|
||||
view_number->fireValueChanged();
|
||||
return views[current];
|
||||
}
|
||||
|
||||
FGViewer*
|
||||
FGViewMgr::prev_view()
|
||||
{
|
||||
setView((0 < current) ? (current - 1) : (views.size() - 1));
|
||||
view_number->fireValueChanged();
|
||||
return views[current];
|
||||
}
|
||||
|
||||
void
|
||||
FGViewMgr::add_view( FGViewer * v )
|
||||
{
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
#include <simgear/structure/subsystem_mgr.hxx>
|
||||
#include <simgear/math/SGMath.hxx>
|
||||
|
||||
#include <Main/viewer.hxx> // FIXME - remove inlines here.
|
||||
|
||||
// forward decls
|
||||
class FGViewer;
|
||||
typedef SGSharedPtr<FGViewer> FGViewerPtr;
|
||||
|
@ -57,43 +55,18 @@ public:
|
|||
// getters
|
||||
inline int size() const { return views.size(); }
|
||||
inline int get_current() const { return current; }
|
||||
inline FGViewer *get_current_view() {
|
||||
if ( current < (int)views.size() ) {
|
||||
return views[current];
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
inline const FGViewer *get_current_view() const {
|
||||
if ( current < (int)views.size() ) {
|
||||
return views[current];
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
inline FGViewer *get_view( int i ) {
|
||||
if ( i < 0 ) { i = 0; }
|
||||
if ( i >= (int)views.size() ) { i = views.size() - 1; }
|
||||
return views[i];
|
||||
}
|
||||
inline const FGViewer *get_view( int i ) const {
|
||||
if ( i < 0 ) { i = 0; }
|
||||
if ( i >= (int)views.size() ) { i = views.size() - 1; }
|
||||
return views[i];
|
||||
}
|
||||
inline FGViewer *next_view() {
|
||||
setView((current+1 < (int)views.size()) ? (current + 1) : 0);
|
||||
view_number->fireValueChanged();
|
||||
return views[current];
|
||||
}
|
||||
inline FGViewer *prev_view() {
|
||||
setView((0 < current) ? (current - 1) : (views.size() - 1));
|
||||
view_number->fireValueChanged();
|
||||
return views[current];
|
||||
}
|
||||
|
||||
|
||||
FGViewer *get_current_view();
|
||||
const FGViewer *get_current_view() const;
|
||||
|
||||
FGViewer *get_view( int i );
|
||||
const FGViewer *get_view( int i ) const;
|
||||
|
||||
FGViewer *next_view();
|
||||
FGViewer *prev_view();
|
||||
|
||||
// setters
|
||||
inline void clear() { views.clear(); }
|
||||
void clear();
|
||||
inline void set_view( const int v ) { current = v; }
|
||||
void add_view( FGViewer * v );
|
||||
|
||||
|
|
Loading…
Reference in a new issue