]> git.mxchange.org Git - flightgear.git/commitdiff
Header clean-ups in viewer/view-mgr.
authorjmt <jmt>
Fri, 18 Sep 2009 16:50:08 +0000 (16:50 +0000)
committerTim Moore <timoore@redhat.com>
Fri, 18 Sep 2009 18:25:54 +0000 (20:25 +0200)
src/Main/fg_props.hxx
src/Main/viewer.hxx
src/Main/viewmgr.cxx
src/Main/viewmgr.hxx

index 8516c93c924aa0a6a4f226da39ab387408231dc8..7651d65f99a385d39a7bfffd2261167a2d34286e 100644 (file)
@@ -10,8 +10,6 @@
 
 #include <simgear/structure/subsystem_mgr.hxx>
 #include <simgear/math/SGMath.hxx>
-
-#include <Main/globals.hxx>
 \f
 ////////////////////////////////////////////////////////////////////////
 // Property management.
index 50d56743974db75c965e6755c67cf4d8f689f733..965e8569a8a8cb3cdf8bb6829c482522f375908c 100644 (file)
 
 
 #ifndef _VIEWER_HXX
-#define _VIEWER_HXX
-
-
-#ifndef __cplusplus                                                          
-# error This library requires C++
-#endif                                   
+#define _VIEWER_HXX                                
 
 namespace flightgear
 {
index 950eace8315ac46253e8deffc90a0d6c05fdc0ef..fd6f25fd98265d4fa9251f9628774c355bc7f966 100644 (file)
 #  include "config.h"
 #endif
 
+#include "viewmgr.hxx"
+
 #include <string.h>            // strcmp
 
 #include <simgear/compiler.h>
-
 #include <Model/acmodel.hxx>
-
-#include "viewmgr.hxx"
-
+#include <Main/viewer.hxx>
+#include <Main/fg_props.hxx>
 
 // Constructor
 FGViewMgr::FGViewMgr( void ) :
@@ -341,7 +341,13 @@ FGViewMgr::copyToCurrent()
                 get_current_view()->getInternal());
 }
 
-
+void
+FGViewMgr::add_view( FGViewer * v )
+{
+  views.push_back(v);
+  v->init();
+}
+    
 double
 FGViewMgr::getViewHeadingOffset_deg () const
 {
index ea4470fbb6a93bbd0dd78d416b611b3fcb83166c..c6476a15bf5db9dd32651826b21e1a468a4cd8da 100644 (file)
 
 #include <simgear/compiler.h>
 #include <simgear/structure/subsystem_mgr.hxx>
+#include <simgear/math/SGMath.hxx>
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-#include "fg_props.hxx"
-#include "viewer.hxx"
-
-using std::vector;
-
+// forward decls
+class FGViewer;
+typedef SGSharedPtr<FGViewer> FGViewerPtr;
 
 // Define a structure containing view information
 class FGViewMgr : public SGSubsystem
@@ -98,10 +93,8 @@ public:
     // setters
     inline void clear() { views.clear(); }
     inline void set_view( const int v ) { current = v; }
-    inline void add_view( FGViewer * v ) {
-       views.push_back(v);
-        v->init();
-    }
+    void add_view( FGViewer * v );
+    
     // copies current offset settings to current-view path...
     void copyToCurrent ();
 
@@ -150,7 +143,7 @@ private:
 
     SGPropertyNode_ptr view_number;
     vector<SGPropertyNode_ptr> config_list;
-    typedef vector<SGSharedPtr<FGViewer> > viewer_list;
+    typedef std::vector<FGViewerPtr> viewer_list;
     viewer_list views;
     SGVec3d abs_viewer_position;