ScaleAxisDragger 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #ifndef OSGMANIPULATOR_SCALEAXISDRAGGER
  15. #define OSGMANIPULATOR_SCALEAXISDRAGGER 1
  16. #include <osgManipulator/Scale1DDragger>
  17. #include <osg/ShapeDrawable>
  18. #include <osg/Geometry>
  19. #include <osg/LineWidth>
  20. namespace osgManipulator {
  21. /**
  22. * Dragger for performing scaling on all 3 axes.
  23. */
  24. class OSGMANIPULATOR_EXPORT ScaleAxisDragger : public CompositeDragger
  25. {
  26. public:
  27. ScaleAxisDragger();
  28. META_OSGMANIPULATOR_Object(osgManipulator,ScaleAxisDragger)
  29. /** Setup default geometry for dragger. */
  30. void setupDefaultGeometry();
  31. /** Sets the width of the axis lines in pixels. */
  32. void setAxisLineWidth(float linePixelWidth);
  33. /** Retrieves the width of the axis lines in pixels. */
  34. float getAxisLineWidth() const { return _axisLineWidth; }
  35. /** Sets the size of the boxes. */
  36. void setBoxSize(float size);
  37. /** Retrieves the size of the boxes. */
  38. float getBoxSize() const { return _boxSize; }
  39. protected:
  40. virtual ~ScaleAxisDragger();
  41. osg::ref_ptr< Scale1DDragger > _xDragger;
  42. osg::ref_ptr< Scale1DDragger > _yDragger;
  43. osg::ref_ptr< Scale1DDragger > _zDragger;
  44. float _boxSize;
  45. float _axisLineWidth;
  46. osg::ref_ptr<osg::Geode> _lineGeode;
  47. osg::ref_ptr<osg::LineWidth> _lineWidth;
  48. osg::ref_ptr<osg::Box> _box;
  49. };
  50. }
  51. #endif