openscenegraph
TranslatePlaneDragger
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_TRANSLATEPLANEDRAGGER
16#define OSGMANIPULATOR_TRANSLATEPLANEDRAGGER 1
17
18#include <osgManipulator/Translate2DDragger>
19#include <osgManipulator/Translate1DDragger>
20
21namespace osgManipulator {
22
23/**
24 * Translate plane dragger consists of a wireframe box representing a plane that can be dragged to translate along the plane.
25 */
26class OSGMANIPULATOR_EXPORT TranslatePlaneDragger : public CompositeDragger
27{
28 public:
29
30 TranslatePlaneDragger();
31
32 META_OSGMANIPULATOR_Object(osgManipulator,TranslatePlaneDragger)
33
34 virtual bool handle(const PointerInfo& pi, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
35
36 /** Setup default geometry for dragger. */
37 void setupDefaultGeometry();
38
39 inline void setColor(const osg::Vec4& color) { if (_translate2DDragger.valid()) _translate2DDragger->setColor(color); }
40
41 Translate1DDragger* getTranslate1DDragger() { return _translate1DDragger.get(); }
42 Translate2DDragger* getTranslate2DDragger() { return _translate2DDragger.get(); }
43
44 protected:
45
46 virtual ~TranslatePlaneDragger();
47
48 osg::ref_ptr< Translate2DDragger > _translate2DDragger;
49 osg::ref_ptr< Translate1DDragger > _translate1DDragger;
50 bool _usingTranslate1DDragger;
51};
52
53
54}
55
56#endif