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_TRANSLATEAXISDRAGGER
16#define OSGMANIPULATOR_TRANSLATEAXISDRAGGER 1
18#include <osgManipulator/Translate1DDragger>
19#include <osg/ShapeDrawable>
20#include <osg/Geometry>
21#include <osg/LineWidth>
23namespace osgManipulator {
26 * Dragger for performing translation in all three axes.
28class OSGMANIPULATOR_EXPORT TranslateAxisDragger : public CompositeDragger
32 TranslateAxisDragger();
34 META_OSGMANIPULATOR_Object(osgManipulator,TranslateAxisDragger)
36 /** Setup default geometry for dragger. */
37 void setupDefaultGeometry();
39 /** Sets the width of the axis lines in pixels. */
40 void setAxisLineWidth(float linePixelWidth);
42 /** Retrieves the width of the axis lines in pixels. */
43 float getAxisLineWidth() const { return _axisLineWidth; }
45 /** Sets the radius of the cylinders representing the axis lines for picking. */
46 void setPickCylinderRadius(float pickCylinderRadius);
48 /** Retrieves the radius of the cylinders representing the axis lines for picking. */
49 float getPickCylinderRadius() const { return _pickCylinderRadius; }
51 /** Sets the height of the cones. */
52 void setConeHeight(float radius);
54 /** Retrieves the height of the cones. */
55 float getConeHeight() const { return _coneHeight; }
59 virtual ~TranslateAxisDragger();
61 osg::ref_ptr< Translate1DDragger > _xDragger;
62 osg::ref_ptr< Translate1DDragger > _yDragger;
63 osg::ref_ptr< Translate1DDragger > _zDragger;
67 float _pickCylinderRadius;
69 osg::ref_ptr<osg::Geode> _lineGeode;
70 osg::ref_ptr<osg::Cylinder> _cylinder;
71 osg::ref_ptr<osg::LineWidth> _lineWidth;
72 osg::ref_ptr<osg::Cone> _cone;