source: osgVisual/trunk/include/core/visual_core.h @ 395

Last change on this file since 395 was 231, checked in by Torben Dannhauer, 14 years ago

Reloaced eventhandler and manipulator in a dedicated manipulator and tracking class (preparation for automatic tracking by extLink)

File size: 3.3 KB
Line 
1#pragma once
2/* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer
3 *
4 * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under
5 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
6 * (at your option) any later version.  The full license is in LICENSE file
7 * included with this distribution, and on the openscenegraph.org website.
8 *
9 * osgVisual requires for some proprietary modules a license from the correspondig manufacturer.
10 * You have to aquire licenses for all used proprietary modules.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * OpenSceneGraph Public License for more details.
16*/
17
18// XML Parser
19#include <stdio.h>
20#include <libxml/parser.h>
21#include <libxml/tree.h>
22
23
24#include <osg/Referenced>
25#include <osg/Notify>
26#include <osgViewer/Viewer>
27#include <osgDB/ReadFile>
28
29// Manipulator and eventhandler
30#include <core_manipulator.h>
31
32
33#ifdef USE_DISTORTION
34// Distortion
35#include <visual_distortion.h>
36#endif
37
38#ifdef USE_SKY_SILVERLINING
39// Sky
40#include <visual_skySilverLining.h>
41#endif
42
43// DataIO
44#include <visual_dataIO.h>
45#include <object_updater.h>
46
47// visual_object
48#include <visual_object.h>
49
50// visual_hud
51#include <visual_hud.h>
52#include <visual_debug_hud.h>
53
54// visual_draw2D
55#include <visual_draw2D.h>
56#include <visual_draw3D.h>
57
58// visual util
59#include <visual_util.h>
60
61// visual_vista2D
62#ifdef USE_VISTA2D
63#include <visual_vista2D.h>
64#endif
65
66
67
68// Test
69#include <dataIO_transportContainer.h>
70#include <osgDB/OutputStream>
71#include <iostream>
72
73
74
75
76namespace osgVisual
77{
78
79class visual_core : public osg::Referenced
80{
81        #include <leakDetection.h>
82
83public:
84        visual_core(osg::ArgumentParser& arguments_);
85        void initialize();
86        void shutdown();
87
88        void parseScenery(xmlNode * a_node);
89        bool loadTerrain(osg::ArgumentParser& arguments_);
90        bool checkCommandlineArgumentsForFinalErrors();
91
92        void setupScenery();
93
94protected:
95        /**
96         * \brief Destrcutor
97         *
98         */ 
99        virtual ~visual_core(void);
100
101private:
102        /**
103         * \brief This function starts the main rendering loop
104         *
105         */ 
106        void mainLoop();
107
108        /**
109         * Argument object, with contains all commandline arguments, which where called during programm sstartup
110         */ 
111        osg::ArgumentParser& arguments;
112
113        /**
114         * This CSN is at the top node on the complete scenery. Only the nodes for distortion are located above this node.
115         */ 
116        osg::ref_ptr<osg::CoordinateSystemNode> rootNode;
117
118        /**
119         * Reference pointer to the viewer instance. The viewer is the core of the graphical subsystem.
120         */ 
121        osg::ref_ptr<osgViewer::Viewer> viewer;
122
123        /**
124         * XML configuration filename.
125         */
126        std::string configFilename;
127
128
129
130#ifdef USE_SKY_SILVERLINING
131        /**
132         * Silverlining Sky instance
133         */ 
134        osg::ref_ptr<visual_skySilverLining> sky;
135
136        xmlNode* skySilverliningConfig;
137#endif
138
139#ifdef USE_DISTORTION
140        /**
141         * Distortion instance.
142         */ 
143        osg::ref_ptr<visual_distortion> distortion;
144
145        xmlNode* distortionConfig;
146#endif
147
148        osg::ref_ptr<visual_object> testObj;
149
150        osg::ref_ptr<visual_debug_hud> hud;
151
152        osg::ref_ptr<core_manipulator> manipulators;
153};
154
155}       // END NAMESPACE
Note: See TracBrowser for help on using the repository browser.