OpenSceneGraph 3.6.5
Keystone
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
14
15#ifndef OSGVIEWER_Keystone
16#define OSGVIEWER_Keystone 1
17
18#include <osg/Geometry>
19#include <osg/Geode>
20#include <osg/DisplaySettings>
21
22#include <osgGA/GUIEventHandler>
23#include <osgViewer/Export>
24
25namespace osgViewer
26{
27
29{
30public:
32
34
36
37 void reset();
38
39 Keystone& operator = (const Keystone& rhs);
40
43
44 void setGridColor(const osg::Vec4& color) { gridColour = color; }
46 const osg::Vec4& getGridColor() const { return gridColour; }
47
48 void setBottomLeft(const osg::Vec2d& v) { bottom_left = v; }
50 const osg::Vec2d& getBottomLeft() const { return bottom_left; }
51
52 void setBottomRight(const osg::Vec2d& v) { bottom_right = v; }
54 const osg::Vec2d& getBottomRight() const { return bottom_right; }
55
56 void setTopLeft(const osg::Vec2d& v) { top_left = v; }
58 const osg::Vec2d& getTopLeft() const { return top_left; }
59
60 void setTopRight(const osg::Vec2d& v) { top_right = v; }
62 const osg::Vec2d& getTopRight() const { return top_right; }
63
64
65
67
69
71
74
77
78
79protected:
80
82
84
89
90
91protected:
92
93 virtual ~Keystone() {}
94
95
96};
97
146
147}
148
149#endif
Vec3f Vec3
Definition Vec3:21
Vec4f Vec4
Definition Vec4:21
The osgViewer library provides high level viewer functionality designed to make it easier to write a ...
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
DisplaySettings class for encapsulating what visuals are required and have been set up,...
Definition DisplaySettings:34
A Geode is a "geometry node", that is, a leaf node on the scene graph that can have "renderable thing...
Definition Geode:29
Base class for all internal nodes in the scene graph.
Definition Node:72
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
General purpose double pair, uses include representation of texture coordinates.
Definition Vec2d:29
Definition GUIActionAdapter:62
Event class for storing Keyboard, mouse and window events.
Definition GUIEventAdapter:82
GUIEventHandler provides a basic interface for any class which wants to handle a GUI Events.
Definition GUIEventHandler:50
Definition Keystone:29
void setGridColor(const osg::Vec4 &color)
Definition Keystone:44
const osg::Vec2d & getTopRight() const
Definition Keystone:62
const osg::Vec2d & getBottomRight() const
Definition Keystone:54
META_Object(osgViewer, Keystone) void reset()
osg::Vec2d top_right
Definition Keystone:88
osg::Vec2d & getTopRight()
Definition Keystone:61
osg::Vec2d & getTopLeft()
Definition Keystone:57
void setTopLeft(const osg::Vec2d &v)
Definition Keystone:56
osg::Vec2d top_left
Definition Keystone:87
osg::Vec2d & getBottomRight()
Definition Keystone:53
void compute3DPositions(osg::DisplaySettings *ds, osg::Vec3 &tl, osg::Vec3 &tr, osg::Vec3 &br, osg::Vec3 &bl) const
void setTopRight(const osg::Vec2d &v)
Definition Keystone:60
void setBottomRight(const osg::Vec2d &v)
Definition Keystone:52
osg::Node * createGrid()
static bool loadKeystoneFiles(osg::DisplaySettings *ds)
Convenience function that loads and assigns any keystone files specified in the DisplaySettings::Keys...
void setBottomLeft(const osg::Vec2d &v)
Definition Keystone:48
virtual ~Keystone()
Definition Keystone:93
const osg::Vec2d & getTopLeft() const
Definition Keystone:58
const osg::Vec2d & getBottomLeft() const
Definition Keystone:50
osg::Vec4 gridColour
Definition Keystone:83
const osg::Vec4 & getGridColor() const
Definition Keystone:46
bool writeToFile()
Write the file specified by the "filename" user value field.
bool getKeystoneEditingEnabled() const
Definition Keystone:42
bool keystoneEditingEnabled
Definition Keystone:81
void setKeystoneEditingEnabled(bool flag)
Definition Keystone:41
osg::Geode * createKeystoneDistortionMesh()
Keystone(const Keystone &rhs, const osg::CopyOp &copop=osg::CopyOp::SHALLOW_COPY)
osg::Vec2d bottom_right
Definition Keystone:86
osg::Vec2d bottom_left
Definition Keystone:85
osg::Vec2d & getBottomLeft()
Definition Keystone:49
osg::Vec4 & getGridColor()
Definition Keystone:45
bool getKeystoneEditingEnabled() const
Definition Keystone:109
osg::Vec2d incrementScale(const osgGA::GUIEventAdapter &ea) const
osg::ref_ptr< Keystone > _currentControlPoints
Definition Keystone:143
osg::Vec2d _ctrlIncrement
Definition Keystone:135
osg::Vec2d _startPosition
Definition Keystone:139
osg::ref_ptr< Keystone > _startControlPoints
Definition Keystone:140
osg::Vec2d _shiftIncrement
Definition Keystone:136
void move(Region region, const osg::Vec2d &delta)
osg::Vec2d _keyIncrement
Definition Keystone:137
KeystoneHandler(Keystone *keystone)
osg::ref_ptr< Keystone > _keystone
Definition Keystone:132
Region
Definition Keystone:112
@ TOP
Definition Keystone:115
@ CENTER
Definition Keystone:122
@ NONE_SELECTED
Definition Keystone:113
@ RIGHT
Definition Keystone:117
@ TOP_RIGHT
Definition Keystone:116
@ LEFT
Definition Keystone:121
@ BOTTOM
Definition Keystone:119
@ TOP_LEFT
Definition Keystone:114
@ BOTTOM_LEFT
Definition Keystone:120
@ BOTTOM_RIGHT
Definition Keystone:118
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa, osg::Object *obj, osg::NodeVisitor *nv)
Handle events, return true if handled, false otherwise.
void setKeystoneEditingEnabled(bool enabled)
Definition Keystone:108
Region computeRegion(const osgGA::GUIEventAdapter &ea) const
~KeystoneHandler()
Definition Keystone:104
Region _selectedRegion
Definition Keystone:142
osg::Vec2d _defaultIncrement
Definition Keystone:134
#define OSGVIEWER_EXPORT
Definition Export:40

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.