OpenSceneGraph 3.6.5
Scale2DDragger
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_SCALE2DDRAGGER
16#define OSGMANIPULATOR_SCALE2DDRAGGER 1
17
20
21namespace osgManipulator {
22
27{
28 public:
29
35
37
39
40
43 virtual bool handle(const PointerInfo& pi, const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us);
44
47
49 inline void setMinScale(const osg::Vec2d& min) { _minScale = min; }
50 inline const osg::Vec2d& getMinScale() const { return _minScale; }
51
53 inline void setColor(const osg::Vec4& color) { _color = color; setMaterialColor(_color,*this); }
54 inline const osg::Vec4& getColor() const { return _color; }
55
61 inline void setPickColor(const osg::Vec4& color) { _pickColor = color; }
62 inline const osg::Vec4& getPickColor() const { return _pickColor; }
63
65 inline void setTopLeftHandleNode (osg::Node& node) { _topLeftHandleNode = &node; }
67 inline const osg::Node* getTopLeftHandleNode() const { return _topLeftHandleNode.get(); }
70 inline const osg::Node* getBottomLeftHandleNode() const { return _bottomLeftHandleNode.get(); }
71 inline void setTopRightHandleNode(osg::Node& node) { _topRightHandleNode = &node; }
73 inline const osg::Node* getTopRightHandleNode() const { return _topRightHandleNode.get(); }
76 inline const osg::Node* getBottomRightHandleNode() const { return _bottomRightHandleNode.get(); }
77
87
88 protected:
89
90 virtual ~Scale2DDragger();
91
97
102
107
110
112};
113
114
115}
116
117#endif
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec4f Vec4
Definition Vec4:21
The 'GA' in osgGA stands for 'GUI Abstraction'; the osgGA namespace provides facilities to help devel...
Definition Callback:21
The osgManipulator library is a NodeKit that extends the core scene graph to support 3D interactive m...
Definition AntiSquish:23
void OSGMANIPULATOR_EXPORT setMaterialColor(const osg::Vec4 &color, osg::Node &node)
Convenience function for setting the material color on a node.
Base class for all internal nodes in the scene graph.
Definition Node:72
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
General purpose double pair, uses include representation of texture coordinates.
Definition Vec2d:29
General purpose double triple for use as vertices, vectors and normals.
Definition Vec3d:30
Definition Dragger:84
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
void setColor(const osg::Vec4 &color)
Set/Get color for dragger.
Definition Scale2DDragger:53
const osg::Node * getBottomLeftHandleNode() const
Definition Scale2DDragger:70
osg::Vec2d _topLeftHandlePosition
Definition Scale2DDragger:103
const osg::Vec2d & getBottomLeftHandlePosition() const
Definition Scale2DDragger:82
osg::Vec2d _bottomLeftHandlePosition
Definition Scale2DDragger:104
void setBottomLeftHandlePosition(const osg::Vec2d &pos)
Definition Scale2DDragger:81
const osg::Vec4 & getPickColor() const
Definition Scale2DDragger:62
void setMinScale(const osg::Vec2d &min)
Set/Get min scale for dragger.
Definition Scale2DDragger:49
const osg::Vec4 & getColor() const
Definition Scale2DDragger:54
osg::Node * getTopLeftHandleNode()
Definition Scale2DDragger:66
void setBottomRightHandlePosition(const osg::Vec2d &pos)
Definition Scale2DDragger:85
ScaleMode _scaleMode
Definition Scale2DDragger:111
const osg::Node * getTopRightHandleNode() const
Definition Scale2DDragger:73
osg::ref_ptr< osg::Node > _bottomLeftHandleNode
Definition Scale2DDragger:99
osg::ref_ptr< osg::Node > _topRightHandleNode
Definition Scale2DDragger:100
void setBottomLeftHandleNode(osg::Node &node)
Definition Scale2DDragger:68
void setPickColor(const osg::Vec4 &color)
Set/Get pick color for dragger.
Definition Scale2DDragger:61
void setTopRightHandlePosition(const osg::Vec2d &pos)
Definition Scale2DDragger:83
void setupDefaultGeometry()
Setup default geometry for dragger.
META_OSGMANIPULATOR_Object(osgManipulator, Scale2DDragger) virtual bool handle(const PointerInfo &pi
Handle pick events on dragger and generate TranslateInLine commands.
osg::ref_ptr< osg::Node > _topLeftHandleNode
Definition Scale2DDragger:98
osg::Vec4 _color
Definition Scale2DDragger:108
osg::Node * getBottomRightHandleNode()
Definition Scale2DDragger:75
void setBottomRightHandleNode(osg::Node &node)
Definition Scale2DDragger:74
Scale2DDragger(ScaleMode scaleMode=SCALE_WITH_ORIGIN_AS_PIVOT)
osg::Vec4 _pickColor
Definition Scale2DDragger:109
osg::Vec2d _bottomRightHandlePosition
Definition Scale2DDragger:106
const osg::Node * getTopLeftHandleNode() const
Definition Scale2DDragger:67
osg::Vec2d _minScale
Definition Scale2DDragger:96
const osg::Vec2d & getTopLeftHandlePosition() const
Definition Scale2DDragger:80
osg::Node * getBottomLeftHandleNode()
Definition Scale2DDragger:69
ScaleMode
Definition Scale2DDragger:31
@ SCALE_WITH_ORIGIN_AS_PIVOT
Definition Scale2DDragger:32
@ SCALE_WITH_OPPOSITE_HANDLE_AS_PIVOT
Definition Scale2DDragger:33
osg::ref_ptr< osg::Node > _bottomRightHandleNode
Definition Scale2DDragger:101
osg::Vec3d _startProjectedPoint
Definition Scale2DDragger:93
const osg::Vec2d & getTopRightHandlePosition() const
Definition Scale2DDragger:84
void setTopLeftHandleNode(osg::Node &node)
Set/Get the handle nodes for dragger.
Definition Scale2DDragger:65
osg::Vec2d _topRightHandlePosition
Definition Scale2DDragger:105
const osgGA::GUIEventAdapter osgGA::GUIActionAdapter & us
Definition Scale2DDragger:43
const osg::Node * getBottomRightHandleNode() const
Definition Scale2DDragger:76
const osg::Vec2d & getBottomRightHandlePosition() const
Definition Scale2DDragger:86
void setTopLeftHandlePosition(const osg::Vec2d &pos)
Set/Get the handle nodes position for dragger.
Definition Scale2DDragger:79
osg::Node * getTopRightHandleNode()
Definition Scale2DDragger:72
const osgGA::GUIEventAdapter & ea
Definition Scale2DDragger:43
osg::Vec2d _scaleCenter
Definition Scale2DDragger:94
const osg::Vec2d & getMinScale() const
Definition Scale2DDragger:50
osg::ref_ptr< PlaneProjector > _projector
Definition Scale2DDragger:92
void setTopRightHandleNode(osg::Node &node)
Definition Scale2DDragger:71
osg::Vec2d _referencePoint
Definition Scale2DDragger:95
#define OSGMANIPULATOR_EXPORT
Definition Export:27

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.