TabPlaneDragger 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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_TABPLANEDRAGGER
  15. #define OSGMANIPULATOR_TABPLANEDRAGGER 1
  16. #include <osgManipulator/TranslatePlaneDragger>
  17. #include <osgManipulator/Scale2DDragger>
  18. #include <osgManipulator/Scale1DDragger>
  19. namespace osgManipulator {
  20. /**
  21. * Tab plane dragger consists of a plane with tabs on it's corners and edges
  22. * for scaling. And the plane is used as a 2D translate dragger.
  23. */
  24. class OSGMANIPULATOR_EXPORT TabPlaneDragger : public CompositeDragger
  25. {
  26. public:
  27. TabPlaneDragger(float handleScaleFactor=20.0f);
  28. META_OSGMANIPULATOR_Object(osgManipulator,TabPlaneDragger)
  29. virtual bool handle(const PointerInfo& pi, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
  30. /** Setup default geometry for dragger. */
  31. void setupDefaultGeometry(bool twoSidedHandle = true);
  32. void setPlaneColor(const osg::Vec4& color) { _translateDragger->setColor(color); }
  33. protected:
  34. virtual ~TabPlaneDragger();
  35. osg::ref_ptr< TranslatePlaneDragger > _translateDragger;
  36. osg::ref_ptr< Scale2DDragger > _cornerScaleDragger;
  37. osg::ref_ptr< Scale1DDragger > _horzEdgeScaleDragger;
  38. osg::ref_ptr< Scale1DDragger > _vertEdgeScaleDragger;
  39. float _handleScaleFactor;
  40. };
  41. }
  42. #endif