One solution is naturally to create a new class that would inherit the osg::ComputeBoundVisitor, and use that. I don't like that idea as the ComputeBoundVisitor does actually have what I need - it is only hidden in a protected function.
I am therefor suggesting a slight generalization of the ComputeBoundVisitor with the attached patch, which is tested.
The patch has two parts:
we add applyBBox() so that one can use that in a customized traverse-function and add a bbox to the visitor. I considered calling this function expandByBBox(), but I though applyBBox was better.
The MatrixStack is made available to the outside world. That enables a traverse-function to do whatever it wishes.
I do actually only need one of the two, as I can implement what I wish either way, but adding getMatrixStack() will make more generic expansions possible.
"
From Robert Osfield, changed the name of the new applyBBox(..) method to applyBoundingBox(..) to keep it's naming more consistent with the rest of the OSG.
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.
"
Examples of supported matches are:
<Slide> and <slide> will be treated the same
<bgcolor>WHITE</bgcolor> and <bgcolor>White</bgcolor> will be treated the same
<text alignment="TOP_LEFT"</text> and <text alignment="top left"</text>, <text alignment="TopLeft"</text> will all be treated the same
with the --write-to-source-file-directory added to allow one to have the original behaviour
of writing to the same directory as the original source file.
From Robert Osfield, changed Roni's code to use a #define GETDEVICEPIXELRATIO to access the versioned Qt devicePixelRatio() method to avoid duplication of the Qt version checking.
I have tested this on:
mac/qt5.2
linux/qt5.2
windows/qt5.2, and
mac/qt5.1
All platforms perform as expected.
The previous fix removed the -f flag to the moc-pre-processor, but on windows, it turned out that -f "osgQt/QGraphicsViewer" was needed.
This becomes an include-statement in the file generated by moc which is needed for compiling it. I ask you consider this patch for the trunk and the 3.2 branch.
Secondly, I wonder if it would be possible to apply my patch for FindRSVG.cmake from 22nd November in the 3.2 branch.
In short, the version of librsvg must be equal or higher to 2.35:
PKG_CHECK_MODULES(RSVG librsvg-2.0>=2.35)
"
....
GUIEventHandler: In copy constructor 'osgGA::GUIEventHandler::GUIEventHandler(const osgGA::GUIEventHandler&, const osg::CopyOp&)':
/include/osgGA/GUIEventHandler:56:9: error: base class 'class osg::Object' should be explicitly initialized in the copy constructor [-Werror=extra]
It seems the diamond problem:
A = osg::Object
/ \
/ \--> Virtual inheritance
B C
\ /
\ /
D = EventHandler
|
|
E = GUIEventHandler
The most derived class(E) handles the instantiation of A (osg::Object), but all have to be responsible in case they are the ones instantiated.
In case A is not initialized in the copy constructor of derived classes the default constructor will be called, which seems a bug.
I've added osg::Object to the initalization list of EventHandler and GUIEventHandler copy constructors, because both classes are instantiables.
"