1 | /* -*-c++-*- osgVisual - Copyright (C) 2009-2011 Torben Dannhauer |
---|
2 | * |
---|
3 | * This library is based on OpenSceneGraph, open source and may be redistributed and/or modified under |
---|
4 | * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or |
---|
5 | * (at your option) any later version. The full license is in LICENSE file |
---|
6 | * included with this distribution, and on the openscenegraph.org website. |
---|
7 | * |
---|
8 | * osgVisual requires for some proprietary modules a license from the correspondig manufacturer. |
---|
9 | * You have to aquire licenses for all used proprietary modules. |
---|
10 | * |
---|
11 | * This library is distributed in the hope that it will be useful, |
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | * OpenSceneGraph Public License for more details. |
---|
15 | */ |
---|
16 | |
---|
17 | #include <osg/Node> |
---|
18 | #include <osg/Notify> |
---|
19 | #include <osg/ArgumentParser> |
---|
20 | #include <osgViewer/Viewer> |
---|
21 | |
---|
22 | #include <visual_dataIO.h> |
---|
23 | |
---|
24 | // OSG Eventhandler |
---|
25 | #include <osgViewer/ViewerEventHandlers> |
---|
26 | |
---|
27 | // OSG manipulator |
---|
28 | #include <osgGA/TrackballManipulator> |
---|
29 | #include <osgGA/FlightManipulator> |
---|
30 | #include <osgGA/DriveManipulator> |
---|
31 | #include <osgGA/KeySwitchMatrixManipulator> |
---|
32 | #include <osgGA/StateSetManipulator> |
---|
33 | #include <osgGA/AnimationPathManipulator> |
---|
34 | #include <osgGA/TerrainManipulator> |
---|
35 | #include <osgGA/NodeTrackerManipulator> |
---|
36 | |
---|
37 | // Spacenavigator manipulator |
---|
38 | #ifdef USE_SPACENAVIGATOR |
---|
39 | #include <manip_spaceMouse.h> |
---|
40 | #include <manip_nodeTrackerSpaceMouse.h> |
---|
41 | #include <manip_freeSpaceMouse.h> |
---|
42 | #endif |
---|
43 | |
---|
44 | // Object mounted manipulator |
---|
45 | #include <manip_objectMounted.h> |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | |
---|
50 | namespace osgVisual |
---|
51 | { |
---|
52 | |
---|
53 | class core_manipulator : public osg::Node |
---|
54 | { |
---|
55 | #include <leakDetection.h> |
---|
56 | public: |
---|
57 | core_manipulator(); |
---|
58 | ~core_manipulator(){}; |
---|
59 | |
---|
60 | bool init(osgViewer::Viewer* viewer, osg::ArgumentParser& arguments, std::string configFilename, osg::Node* rootNode); |
---|
61 | void shutdown(); |
---|
62 | void trackNode( osg::Node* node_ ); |
---|
63 | void trackNode( int trackingID ); |
---|
64 | int getCurrentTrackingID(){return _currentTrackingID;}; |
---|
65 | |
---|
66 | private: |
---|
67 | |
---|
68 | #ifdef USE_SPACENAVIGATOR |
---|
69 | /** |
---|
70 | * Spacemouse node tracker manipulator |
---|
71 | */ |
---|
72 | osg::ref_ptr<NodeTrackerSpaceMouse> _mouseTrackerManip; |
---|
73 | |
---|
74 | /** |
---|
75 | * Space mouse hardware driver instance |
---|
76 | */ |
---|
77 | SpaceMouse* _mouse; |
---|
78 | #endif |
---|
79 | |
---|
80 | /** |
---|
81 | * This Matrix manipulator is used for controlling Camera by Nodes. |
---|
82 | */ |
---|
83 | osg::ref_ptr<objectMountedManipulator> _objectMountedCameraManip; |
---|
84 | |
---|
85 | /** |
---|
86 | * Classical OSG NodeTrackerManipulator |
---|
87 | */ |
---|
88 | osg::ref_ptr<osgGA::NodeTrackerManipulator> _nt; |
---|
89 | |
---|
90 | /** |
---|
91 | * ID of the currently tracked ID |
---|
92 | */ |
---|
93 | int _currentTrackingID; |
---|
94 | |
---|
95 | /** |
---|
96 | * Pointer to the scene root node |
---|
97 | */ |
---|
98 | osg::ref_ptr<osg::Node> _rootNode; |
---|
99 | }; |
---|
100 | |
---|
101 | } // END NAMESPACE |
---|