openscenegraph
ScaleAxisDragger
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
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.
7 *
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.
12*/
13//osgManipulator - Copyright (C) 2007 Fugro-Jason B.V.
14
15#ifndef OSGMANIPULATOR_SCALEAXISDRAGGER
16#define OSGMANIPULATOR_SCALEAXISDRAGGER 1
17
18#include <osgManipulator/Scale1DDragger>
19#include <osg/ShapeDrawable>
20#include <osg/Geometry>
21#include <osg/LineWidth>
22
23namespace osgManipulator {
24
25/**
26 * Dragger for performing scaling on all 3 axes.
27 */
28class OSGMANIPULATOR_EXPORT ScaleAxisDragger : public CompositeDragger
29{
30 public:
31
32 ScaleAxisDragger();
33
34 META_OSGMANIPULATOR_Object(osgManipulator,ScaleAxisDragger)
35
36 /** Setup default geometry for dragger. */
37 void setupDefaultGeometry();
38
39 /** Sets the width of the axis lines in pixels. */
40 void setAxisLineWidth(float linePixelWidth);
41
42 /** Retrieves the width of the axis lines in pixels. */
43 float getAxisLineWidth() const { return _axisLineWidth; }
44
45 /** Sets the size of the boxes. */
46 void setBoxSize(float size);
47
48 /** Retrieves the size of the boxes. */
49 float getBoxSize() const { return _boxSize; }
50
51 protected:
52
53 virtual ~ScaleAxisDragger();
54
55 osg::ref_ptr< Scale1DDragger > _xDragger;
56 osg::ref_ptr< Scale1DDragger > _yDragger;
57 osg::ref_ptr< Scale1DDragger > _zDragger;
58
59 float _boxSize;
60 float _axisLineWidth;
61
62 osg::ref_ptr<osg::Geode> _lineGeode;
63 osg::ref_ptr<osg::LineWidth> _lineWidth;
64 osg::ref_ptr<osg::Box> _box;
65};
66
67
68}
69
70#endif