Commit Graph

55 Commits

Author SHA1 Message Date
Robert Osfield
bc5575f83a From Kristofer Tingdahl, "I and my team have gone over the code again, and we feel that we are comfortable in our current proposal for change. It goes deeper than it did before, and I explain why:
There was code in the osgViewer/Viewer.cpp and osgViewer/CompositeViewer.cpp that transformed the Y-coordinates of an event. The code in the composite viewer did however miss the touch-data of the event. I thought that it should really be the GUIEventAdapter that should know about this, and hence I added the
GUIEventAdapter::setMouseYOrientationAndUpdateCoords which is re-computing the coordinates. First I simply added a boolean to the setMouseYOrientation function:

setMouseYOrientation( MouseYOrientation, bool updatecooreds=false );

but then the serializer complained.

This function is called from both the Viewer and the CompositeViewer. We have not tested from the viewer, but I cannot see it would not work from visual inspection.

The other change is in MultiTouchTrackballManipulator::handleMultiTouchDrag. I have removed the normalisation. The reason for that is that it normalised into screen coordinates from 0,0 to 1,1. The problem with that is that if you have a pinch event and you keep the distance say 300 pixels between your fingers, these 300 pixels represent 0.20 of the screen in the horizontal domain, but 0.3 of the screen in the vertical domain. A rotation of the pinch-fingers will hence result in a zoom in, as the normalised distance is changing between them.

A consequence of this is that I have changed the pan-code to use the same algorithm as the middle-mouse-pan.

The rest of it is very similar from previous revision, and there has been some fine-tuning here and there.

"
2014-04-24 17:14:54 +00:00
Robert Osfield
a96ad565c7 From Stephan Huber, "attached are some fixes to the osc-plugin and the touch-implementations for iOS and os x and other small bugfixes. These fixes will normalize the orientation of the touch points, and transmitting the touch points over osc via the TUIO-protocol works now more robustly between two osg-applications.
I added a new tag to p3d called forward_touch_event_to_device and renamed the existing forward_event_to_device to forward_mouse_event_to_device. This new tag will transmit touches to the virtual trackpad as touch events. I added the MultitouchTrackball to the p3d-app so zooming and moving a model remotely should now work, if you use forward_touch_event_to_device. I kept (and fixed) forward_mouse_event_to_device for background compatibility, so old presentations works as in previous versions, without the ability to zoom + scale. of course.

forward_touch_event_to_device needs some more testing, (e.g. with image-streams and keystone, afaik there’s no support for touch-events...) but for a first version it works nice.
"
2014-01-23 15:37:48 +00:00
Robert Osfield
e0d3ab4412 From Stephan Huber, * GUIEventAdapter: add support for getting normalized touch points
* MultiTouchTrackball: some code cleanup and support for normalized touch-points
* oscdevice: receiving and sending multi-touch-events via the Cursor2D-profile from TUIO
* added some documentation
2013-11-18 13:25:55 +00:00
Robert Osfield
c194e92df8 Moved Handled propety from GUIEventAdapter to Event base class.
Added CameraManipulator::finishAnimation() method to allow application code to stop any animation/throw of manipulators.
2013-11-15 16:15:09 +00:00
Robert Osfield
4a660f6266 Introduce new osgGA::Event and osgGA::EventHandler base classes that the old GUIEventAdapter and GUIEventHandler now subclass from.
The new osgGA::Event is written to support more generic events than the original GUIEventAdapter which are written for keyboard and mouse events.
2013-10-25 14:54:15 +00:00
Robert Osfield
097aedf23c From David Callu, warning fixes and removal of spaces at end of lines. 2013-06-28 12:00:43 +00:00
Robert Osfield
9921c77136 From Ulrich Hertlein, "attached is a patch that fixes another clang++ compiler warning when returning
std::vector::size() as 'unsigned int'.
"
2013-05-31 10:23:49 +00:00
Robert Osfield
1a683e2f83 From Ulrich Hertlein, "Attached is a patch that introduces 'static_cast<unsigned int>' on some instances where
the code returns '.size()' of a std::vector.  This caused some warnings when using clang++
on OS X."
2013-05-14 16:12:21 +00:00
Robert Osfield
668d351765 Introduced new scheme for handling mouse events with osgViewer. The new scheme enables robust event handling even when using distortion correction render to texture Cameras. 2013-05-03 19:26:27 +00:00
Robert Osfield
740f660ef1 Made TouchData and osg::Object to aid with serialization. 2012-10-05 16:31:23 +00:00
Robert Osfield
2e79a0e2d4 Added set methods to assist with serialization support 2012-10-05 10:07:09 +00:00
Robert Osfield
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
67ae23f2cf From Alexander Sinditskiy, "reason of this changes described in http://forum.openscenegraph.org/viewtopic.php?t=7596
and another problem is:
example osgkeyboard is not work (keys not highlight) if user have 2 keyboard layout native and english and current user layout is native

I try to explain my changes

we need something that is identify key without modifier keys and layout  -> this is UnmodifedKey

I think osg must have its own UnmodifiedKeys table. Code must be run same on different platforms. This can de guaranteed by UnmodifiedKeys table.

Mikhail Izmestev helped me. He implemented VirtualKey changes in GraphicsWindowX11"
2011-01-27 16:23:48 +00:00
Robert Osfield
04b6a0888b Build fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF 2010-11-22 19:38:18 +00:00
Robert Osfield
e36c4d3a3b From Stephan Huber, "attached you'll find a proposal for handling multi-touch-events with
osgGA. My approach is to bundle all touchpoints into one custom data
structure which is attached to an GUIEventAdapter.

The current approach simulates a moving mouse for the first touch-point,
so basic manipulators do work, sort of.

I created a MultiTouchTrackballManipulator-class, one touch-point does
rotate the view, two touch-points pan and zoom the view as known from
the iphone or other similar multi-touch-devices. A double-tap (similar
to a double-click) resets the manipulator to its home-position.

The multi-touch-trackball-implementation is not the best, see it as a
first starting point. (there's a demo-video at http://vimeo.com/15017377 )"
2010-11-22 17:30:44 +00:00
Robert Osfield
86f491e649 Replaced use of unsigned int/enum mask combinations with int/enum mask combinations to avoid the need for casting enums to unsigned ints,
and to avoid associated warnings.

Update wrappers to reflect these changes.
2010-03-05 12:55:08 +00:00
Robert Osfield
6bcc1c527c From Ulrich Hertlein, "please find attached a patch for TrackballManipulator to fix zooming using the MBP touchpad. The old code would always zoom-in even when using the gesture to zoom-out.
Also attached are some code and documentation cleanups for GUIEventAdapter that collect related values (e.g. scrolling, tablet pen) in a struct.
"
2009-05-14 16:08:12 +00:00
Robert Osfield
e09e07d45b Added support for assigning GraphicsContext to individual GUIEventAdapter events,
and use of this within osgViewer::View to better track the sources of events.
2008-06-02 17:34:47 +00:00
Robert Osfield
c10acfcc47 From Bob Kuehne, "he attached are conversions of the 3 main places i found in osg where tokens are used to represent bitmasks with 'magic' numbers, like 32. i've changed these to a more representative bitshift representation, showing clearly in which bit you can expect this token to manifest. ie, converted things like:
from:            DEEP_COPY_STATESETS         = 8,
to:              DEEP_COPY_STATESETS         = 1<<3,

showing clearly that this isn't the _value_ 8, but the _bit_ 8. this is an old pattern i see (and like to promulgate) to make code a bit more readable and maintainable. 
"
2008-04-16 15:23:12 +00:00
Robert Osfield
76e0198007 From Philipp Machler, "We have extended the support for Wacom Tablet devices:
- Mac OS X
  - not only pressure, but tilt and z-rotation is supported now
"
2008-04-11 13:28:09 +00:00
Robert Osfield
11f9575b24 From Melchior Franz, "The GUIEventAdapter header file had KeySymbols for the super and
hyper keys defined already, but these modifiers were missing in
GUIEventAdapter::ModKeyMask, and the EventQueue ingored them as well.

The attached diff/archive adds the missing parts for Super/Hyper
modifier key support.


I'm aware that this might not be supported on all systems/keyboards
out of the box, but decided to submit it anyway because:

- developers are aware of differences between input devices
 (Some mice have scroll wheels, others don't. Some have five or
 more buttons, some have only one. Some keyboards don't have
 numpads, some have AltGr, some don't etc.)

- even if someone relies on Hyper/Super in distributed software,
 this is easy to fix and doesn't create lock-in conditions

- while the names Hyper/Super may only be common on X11, they are
 just symbol names and not OS-specific

- even though some systems might not offer these additional modifiers
 by default, it's likely that all of them have at least 8 modifier
 levels internally, so it should only be a matter of OS configuration
 to make them work

- having super/hyper available is useful to offer a user ways
 to define local key definitions that are safe from collisions with
 predefined "official" key assignments"
2008-04-11 11:10:12 +00:00
Robert Osfield
f4afa427a7 From Roland Smeenk, "Attached you will find a large set of small typo fixes (mainly in the comments)." 2007-12-10 17:30:18 +00:00
Robert Osfield
d5cc0e966f Introduce GUIEventHandler::handleWithCheckAgainstIgnoreHandledEventsMask() methods
to help make it easier to get event handles to ingore events that have already been handled.
2007-09-14 10:44:46 +00:00
Robert Osfield
290adbe7ab From Ole-Morten Duesund, added IgnoreUsedEventsMask. 2007-09-14 10:26:14 +00:00
Robert Osfield
b2535d55c6 Introduced new GUIEventAdatper singleton for sharing the current state between
multiple GraphicsWindows, this singleton is accessable via GUIEventEvent::getAccumulatedEventState().

Added use of this new singleton in GraphicsWindow* implementations.

Added WindowSizeHandler to osgkeyboard to help with debugging of event state
between windows.
2007-07-13 11:17:41 +00:00
Robert Osfield
e3747b1004 From Rafa Giatan and Robert Osfield, added support for User defined events, by adding
UserData to Events.
2007-05-19 13:39:55 +00:00
Robert Osfield
a01cade782 Added setHandled/getHandled to osgGA::GUIEventAdapter 2007-01-24 12:21:29 +00:00
Robert Osfield
16d1c00a3d Changed the return types of makeCurrent to bool, and added a bool GraphicsContext::releaseContext method
along with implementations in osgViewer.
2007-01-08 19:29:59 +00:00
Robert Osfield
7155f7d1b0 Various work on osgViewer library, including warp point and graphics window resize support 2007-01-01 18:20:10 +00:00
Robert Osfield
2255771b74 Further work osgViewer::Viewer and related classes. 2006-12-20 21:13:29 +00:00
Robert Osfield
5c0eb0b013 Added bare bones osgGA::SimpleViewer class to help simplify OSG setup when embedding the OSG
into existing GUI applications, and for one one a single camera, single window is required.
2006-09-25 16:25:53 +00:00
Robert Osfield
f1c2694c17 Updated copyright years. 2006-07-18 15:21:48 +00:00
Robert Osfield
519157aeab From Vincent Vivanloc, Removed commas from end of enum lists, and removed semi-colon
from end of namespace.
2006-07-12 09:50:45 +00:00
Robert Osfield
e7d9e91525 From Stephan Huber,
"attached you'll find some modifications to Producer, osgGA and
osgProducer to enable Mac OS X support for

+ scrollwheels,
+ mightymouse-srollballs
+ new tracking-pads with scroll feature
+ tablet-support (pressure, proximity and pointertype) (Wacom only tested)

I think there was a bug in the windows-implementation of scroll-wheel
support (wrong order of ScrollingMotion-enum, casting problem) which is
fixed now.

The scrollwheel-code is a bit klunky across platforms, some devices on
OS X can report an absolute delta in pixel-coordinates not only the
direction, so for now there is scrollingMotion (which describes the
direction) and scrolldeltax and scrolldeltay. I decided to leave the
scrollingmotion-stuff to not break old code relying on this."
2006-07-04 14:18:44 +00:00
Robert Osfield
46ad44a9e7 Fixed typo. 2006-06-16 09:28:35 +00:00
Robert Osfield
dbbabf87c6 Converted osgGA::GUIEventAdapter into a concrete class capable of respresenting
keyboard and mouse events.

Added osgGA::EventQueue class to support a thread safe event queue and adaption
of keyboard and mouse events.

Removed osgProducer::EventAdapter as GUIEventAdapter replaces it.

Adapted osgProducer and examples to work with the new changes to osgGA.
2006-03-08 14:09:47 +00:00
Robert Osfield
c448e4d791 Began work on making EventVisitor capable of adapting events directly. 2006-03-05 20:46:59 +00:00
Robert Osfield
678b22ce83 Updated Copyright notices to 1998-2005. 2005-04-14 21:41:28 +00:00
Robert Osfield
79a59e596c Tweak to comment. 2005-02-15 09:37:20 +00:00
Robert Osfield
6524fe1293 From Norman Vine, fixes for Mingw 2004-08-02 09:11:31 +00:00
Robert Osfield
ba8bf1e94c From Eric Sokolowsky, support for mouse scroll wheel in osgGA/osgProducer. 2003-05-07 11:13:49 +00:00
Robert Osfield
f543d69881 Improved the handling of Producer's no dimensional mouse coords. 2003-04-14 13:23:12 +00:00
Robert Osfield
169bf25f77 Implemented support for float x and y mouse positions, and normalization of
mouse coords in osgGA::GUIEventAdapter, and ported osgGA camera manaipulators
to use the new normalized values.

Moved osgProducer across to tracking the window dimensions and ensure that the
internals values in osgProducer::EventAdapter are kept consistent.  Moved
the warp pointer in Viewer across to using KeyboardMouse::positionPointer().
2003-04-04 19:10:37 +00:00
Robert Osfield
a03675495a Added new osgkeyboad example. 2003-03-24 21:17:51 +00:00
Robert Osfield
c2167be67b Fixed typo. 2003-03-24 15:21:52 +00:00
Robert Osfield
19e2368991 Added osgGA::GUIEventAdapter::KeySymbol enumate list, which is a remapping
of the X settings.

Added a pass through of X11 sybmbols from Producer to osgGA::GUIEventAdapter::KeySymbol
in the osgProducer::EventAdapter.
2003-03-24 13:43:22 +00:00
Robert Osfield
6dbc770347 Made the osgGA::GUIEventHandler sublassed from osg::Object as a virtual
inheritence to allow handler to also be used as node callbacks.

Fix to UpdateVisitor to make the visitation of Drawable more consistent
with the way that nodes are traversed.
2003-03-24 08:42:35 +00:00
Robert Osfield
48bda9cc79 Added new Copyright/License notice to header and source files. 2003-01-21 16:45:36 +00:00
Robert Osfield
1c602035ef Added DOUBLECLICK EventType to GUIEventAdapter. 2003-01-16 19:27:30 +00:00
Robert Osfield
af6a6ff9f0 Fixes for Win32 build. 2003-01-14 16:39:41 +00:00