1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3 * This library is 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.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
13//osgManipulator - Copyright (C) 2007 Fugro-Jason B.V.
15#ifndef OSGMANIPULATOR_TRACKBALLDRAGGER
16#define OSGMANIPULATOR_TRACKBALLDRAGGER 1
18#include <osgManipulator/RotateCylinderDragger>
19#include <osgManipulator/RotateSphereDragger>
20#include <osg/ShapeDrawable>
21#include <osg/Geometry>
23#include <osg/LineWidth>
25namespace osgManipulator {
28 * Dragger for performing rotation in all axes.
30class OSGMANIPULATOR_EXPORT TrackballDragger : public CompositeDragger
34 TrackballDragger(bool useAutoTransform=false);
36 META_OSGMANIPULATOR_Object(osgManipulator,TrackballDragger)
38 /** Setup default geometry for dragger. */
39 void setupDefaultGeometry();
41 /** Sets the width of the axis lines in pixels. */
42 void setAxisLineWidth(float linePixelWidth);
44 /** Retrieves the width of the axis lines in pixels. */
45 float getAxisLineWidth() const { return _axisLineWidth; }
47 /** Sets the height of the cylinders representing the axis lines for picking. */
48 void setPickCylinderHeight(float pickCylinderHeight);
50 /** Retrieves the height of the cylinders representing the axis lines for picking. */
51 float getPickCylinderHeight() const { return _pickCylinderHeight; }
55 virtual ~TrackballDragger();
57 osg::ref_ptr<RotateCylinderDragger> _xDragger;
58 osg::ref_ptr<RotateCylinderDragger> _yDragger;
59 osg::ref_ptr<RotateCylinderDragger> _zDragger;
60 osg::ref_ptr<RotateSphereDragger> _xyzDragger;
63 float _pickCylinderHeight;
65 osg::ref_ptr<osg::Geode> _geode;
66 osg::ref_ptr<osg::Cylinder> _cylinder;
67 osg::ref_ptr<osg::LineWidth> _lineWidth;