Index: osgVisual/trunk/include/core/core_manipulator.h
===================================================================
--- osgVisual/trunk/include/core/core_manipulator.h	(revision 231)
+++ osgVisual/trunk/include/core/core_manipulator.h	(revision 231)
@@ -0,0 +1,101 @@
+/* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer
+ *
+ * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under 
+ * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
+ * (at your option) any later version.  The full license is in LICENSE file
+ * included with this distribution, and on the openscenegraph.org website.
+ *
+ * osgVisual requires for some proprietary modules a license from the correspondig manufacturer.
+ * You have to aquire licenses for all used proprietary modules.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * OpenSceneGraph Public License for more details.
+*/
+
+#include <osg/Node>
+#include <osg/Notify>
+#include <osg/ArgumentParser>
+#include <osgViewer/Viewer>
+
+#include <visual_dataIO.h>
+
+// OSG Eventhandler
+#include <osgViewer/ViewerEventHandlers>
+
+// OSG manipulator
+#include <osgGA/TrackballManipulator>
+#include <osgGA/FlightManipulator>
+#include <osgGA/DriveManipulator>
+#include <osgGA/KeySwitchMatrixManipulator>
+#include <osgGA/StateSetManipulator>
+#include <osgGA/AnimationPathManipulator>
+#include <osgGA/TerrainManipulator>
+#include <osgGA/NodeTrackerManipulator>
+
+// Spacenavigator manipulator
+#ifdef USE_SPACENAVIGATOR
+#include <manip_spaceMouse.h>
+#include <manip_nodeTrackerSpaceMouse.h>
+#include <manip_freeSpaceMouse.h>
+#endif
+
+// Object mounted manipulator
+#include <manip_objectMounted.h>
+
+
+
+
+namespace osgVisual
+{ 
+
+class core_manipulator : public osg::Node
+{
+	#include <leakDetection.h>
+public:
+	core_manipulator();
+	~core_manipulator(){};
+
+	bool init(osgViewer::Viewer* viewer, osg::ArgumentParser& arguments, std::string configFilename, osg::Node* rootNode);
+	void shutdown();
+	void trackNode( osg::Node* node_ );
+	void trackNode( int trackingID );
+	int getCurrentTrackingID(){return _currentTrackingID;};
+
+private:
+
+#ifdef USE_SPACENAVIGATOR
+	/**
+	 * Spacemouse node tracker manipulator
+	 */ 
+	osg::ref_ptr<NodeTrackerSpaceMouse> _mouseTrackerManip;
+
+	/**
+	 * Space mouse hardware driver instance
+	 */ 
+	SpaceMouse* _mouse;
+#endif
+
+	/**
+	 * This Matrix manipulator is used for controlling Camera by Nodes.
+	 */ 
+	osg::ref_ptr<objectMountedManipulator> _objectMountedCameraManip;
+
+	/**
+	 * Classical OSG NodeTrackerManipulator
+	 */ 
+	osg::ref_ptr<osgGA::NodeTrackerManipulator> _nt;
+
+	/**
+	 * ID of the currently tracked ID
+	 */ 
+	int _currentTrackingID;
+
+	/**
+	 * Pointer to the  scene root node
+	 */ 
+	osg::ref_ptr<osg::Node> _rootNode;
+};
+
+}	// END NAMESPACE
Index: osgVisual/trunk/include/core/visual_core.h
===================================================================
--- osgVisual/trunk/include/core/visual_core.h	(revision 230)
+++ osgVisual/trunk/include/core/visual_core.h	(revision 231)
@@ -24,31 +24,10 @@
 #include <osg/Referenced>
 #include <osg/Notify>
-
 #include <osgViewer/Viewer>
-
 #include <osgDB/ReadFile>
 
-// OSG eventhandler
-#include <osgViewer/ViewerEventHandlers>
+// Manipulator and eventhandler
+#include <core_manipulator.h>
 
-// OSG manipulator
-#include <osgGA/TrackballManipulator>
-#include <osgGA/FlightManipulator>
-#include <osgGA/DriveManipulator>
-#include <osgGA/KeySwitchMatrixManipulator>
-#include <osgGA/StateSetManipulator>
-#include <osgGA/AnimationPathManipulator>
-#include <osgGA/TerrainManipulator>
-#include <osgGA/NodeTrackerManipulator>
-
-// Spacenavigator manipulator
-#ifdef USE_SPACENAVIGATOR
-#include <manip_spaceMouse.h>
-#include <manip_nodeTrackerSpaceMouse.h>
-#include <manip_freeSpaceMouse.h>
-#endif
-
-// Object mounted manipulator
-#include <manip_objectMounted.h>
 
 #ifdef USE_DISTORTION
@@ -85,4 +64,6 @@
 #endif
 
+
+
 // Test
 #include <dataIO_transportContainer.h>
@@ -105,5 +86,4 @@
 	void shutdown();
 
-	void addManipulators();
 	void parseScenery(xmlNode * a_node);
 	bool loadTerrain(osg::ArgumentParser& arguments_);
@@ -111,13 +91,17 @@
 
 	void setupScenery();
-	void trackNode( osg::Node* node_ );
-	void trackNode( int trackingID );
-	int getCurrentTrackingID(){return currentTrackingID;};
 
 protected:
+	/**
+	 * \brief Destrcutor
+	 * 
+	 */ 
 	virtual ~visual_core(void);
 
-
 private:
+	/**
+	 * \brief This function starts the main rendering loop
+	 * 
+	 */ 
 	void mainLoop();
 
@@ -143,21 +127,4 @@
 
 
-#ifdef USE_SPACENAVIGATOR
-	/**
-	 * Spacemouse node tracker manipulator
-	 */ 
-	osg::ref_ptr<NodeTrackerSpaceMouse> mouseTrackerManip;
-
-	/**
-	 * Space mouse hardware driver instance
-	 */ 
-	SpaceMouse* mouse;
-#endif
-
-	/**
-	 * This Matrix manipulator is used for controlling Camera by Nodes.
-	 */ 
-	osg::ref_ptr<objectMountedManipulator> objectMountedCameraManip;
-
 
 #ifdef USE_SKY_SILVERLINING
@@ -181,9 +148,7 @@
 	osg::ref_ptr<visual_object> testObj;
 
-	osg::ref_ptr<osgGA::NodeTrackerManipulator> nt;
-
 	osg::ref_ptr<visual_debug_hud> hud;
 
-	int currentTrackingID;
+	osg::ref_ptr<core_manipulator> manipulators;
 };
 
