OpenSceneGraph 3.6.5
Scale1DDragger
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_SCALE1DDRAGGER
16#define OSGMANIPULATOR_SCALE1DDRAGGER 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(double min) { _minScale = min; }
50 inline double 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 setLeftHandleNode (osg::Node& node) { _leftHandleNode = &node; }
66 inline void setRightHandleNode(osg::Node& node) { _rightHandleNode = &node; }
67 inline osg::Node* getLeftHandleNode() { return _leftHandleNode.get(); }
68 inline const osg::Node* getLeftHandleNode() const { return _leftHandleNode.get(); }
69 inline osg::Node* getRightHandleNode() { return _rightHandleNode.get(); }
70 inline const osg::Node* getRightHandleNode() const { return _rightHandleNode.get(); }
71
73 inline void setLeftHandlePosition(double pos) { _projector->getLineStart() = osg::Vec3d(pos,0.0,0.0); }
74 inline double getLeftHandlePosition() const { return _projector->getLineStart()[0]; }
75 inline void setRightHandlePosition(double pos) { _projector->getLineEnd() = osg::Vec3d(pos,0.0,0.0); }
76 inline double getRightHandlePosition() const { return _projector->getLineEnd()[0]; }
77
78 protected:
79
80 virtual ~Scale1DDragger();
81
85 double _minScale;
86
89
92
94};
95
96
97}
98
99#endif
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 triple for use as vertices, vectors and normals.
Definition Vec3d:30
Definition Dragger:84
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
META_OSGMANIPULATOR_Object(osgManipulator, Scale1DDragger) virtual bool handle(const PointerInfo &pi
Handle pick events on dragger and generate TranslateInLine commands.
void setLeftHandleNode(osg::Node &node)
Set/Get left and right handle nodes for dragger.
Definition Scale1DDragger:65
double _scaleCenter
Definition Scale1DDragger:84
osg::Node * getRightHandleNode()
Definition Scale1DDragger:69
const osgGA::GUIEventAdapter osgGA::GUIActionAdapter & us
Definition Scale1DDragger:43
void setPickColor(const osg::Vec4 &color)
Set/Get pick color for dragger.
Definition Scale1DDragger:61
osg::ref_ptr< osg::Node > _rightHandleNode
Definition Scale1DDragger:88
void setupDefaultGeometry()
Setup default geometry for dragger.
const osg::Node * getRightHandleNode() const
Definition Scale1DDragger:70
void setRightHandleNode(osg::Node &node)
Definition Scale1DDragger:66
void setMinScale(double min)
Set/Get min scale for dragger.
Definition Scale1DDragger:49
osg::Node * getLeftHandleNode()
Definition Scale1DDragger:67
osg::Vec4 _pickColor
Definition Scale1DDragger:91
void setColor(const osg::Vec4 &color)
Set/Get color for dragger.
Definition Scale1DDragger:53
const osg::Vec4 & getPickColor() const
Definition Scale1DDragger:62
ScaleMode _scaleMode
Definition Scale1DDragger:93
osg::Vec3d _startProjectedPoint
Definition Scale1DDragger:83
ScaleMode
Definition Scale1DDragger:31
@ SCALE_WITH_ORIGIN_AS_PIVOT
Definition Scale1DDragger:32
@ SCALE_WITH_OPPOSITE_HANDLE_AS_PIVOT
Definition Scale1DDragger:33
osg::Vec4 _color
Definition Scale1DDragger:90
const osgGA::GUIEventAdapter & ea
Definition Scale1DDragger:43
double _minScale
Definition Scale1DDragger:85
osg::ref_ptr< LineProjector > _projector
Definition Scale1DDragger:82
double getLeftHandlePosition() const
Definition Scale1DDragger:74
Scale1DDragger(ScaleMode scaleMode=SCALE_WITH_ORIGIN_AS_PIVOT)
osg::ref_ptr< osg::Node > _leftHandleNode
Definition Scale1DDragger:87
double getRightHandlePosition() const
Definition Scale1DDragger:76
void setRightHandlePosition(double pos)
Definition Scale1DDragger:75
double getMinScale() const
Definition Scale1DDragger:50
void setLeftHandlePosition(double pos)
Set left/right handle position.
Definition Scale1DDragger:73
const osg::Node * getLeftHandleNode() const
Definition Scale1DDragger:68
const osg::Vec4 & getColor() const
Definition Scale1DDragger:54
#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.