Commit Graph

90 Commits

Author SHA1 Message Date
Robert Osfield
a855faeff3 As the author of all the files in osgPresentation and present3D have rectified the license notices to reflect their intended license rather than histoical license they had prior to being merged into the OpenSceneGraph project. OSGPL was always intended but missed during merge.
Replaced the GPL notices with OSGPL usge in present3D and include/osgPresentation as this was intended when Present3D was merged back into OpenSceneGraph but missed.
2018-05-31 14:48:54 +01:00
Laurens Voerman
628f8fd9dc added call to copy constructor for virtual base classes in copy constructor of derived classes, removed these for abstract classes 2016-08-29 10:41:40 +02:00
Robert Osfield
8a83bd73bb Added missing initializers 2016-06-22 11:39:11 +01:00
Robert Osfield
68430ee8e5 Added a local implementation of SlideEventHandler::checkNeedToDoFrame() so that Present3D can toggle on/off the need for continuous rendering to only slides that require it,
enabling slides with no animation to sit iddle rather keeping rendering, reducing CPU/GPU overhead and saving power.
2016-03-10 16:35:08 +00:00
Robert Osfield
dd996a3289 Introduced CMake option OSG_PROVIDE_READFILE option that defaults to ON, but when switched to OFF disables the building of the osgDB::read*File() methods,
forcing users to use osgDB::readRef*File() methods.  The later is preferable as it closes a potential threading bug when using paging databases in conjunction
with the osgDB::Registry Object Cache.  This threading bug occurs when one thread gets an object from the Cache via an osgDB::read*File() call where only
a pointer to the object is passed back, so taking a reference to the object is delayed till it gets reassigned to a ref_ptr<>, but at the same time another
thread calls a flush of the Object Cache deleting this object as it's referenceCount is now zero.  Using osgDB::readREf*File() makes sure the a ref_ptr<> is
passed back and the referenceCount never goes to zero.

To ensure the OSG builds when OSG_PROVIDE_READFILE is to OFF the many cases of osgDB::read*File() usage had to be replaced with a ref_ptr<> osgDB::readRef*File()
usage.  The avoid this change causing lots of other client code to be rewritten to handle the use of ref_ptr<> in place of C pointer I introduced a serious of
templte methods in various class to adapt ref_ptr<> to the underly C pointer to be passed to old OSG API's, example of this is found in include/osg/Group:

    bool addChild(Node* child); // old method which can only be used with a Node*

    tempalte<class T> bool addChild(const osg::ref_ptr<T>& child) { return addChild(child.get()); } // adapter template method

These changes together cover 149 modified files, so it's a large submission. This extent of changes are warrent to make use of the Object Cache
and multi-threaded loaded more robust.



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15164 16af8721-9629-0410-8352-f15c8da7e697
2015-10-22 13:42:19 +00:00
Robert Osfield
0a1db3d6fc From Jannik Heller, typo fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14832 16af8721-9629-0410-8352-f15c8da7e697
2015-04-13 10:43:56 +00:00
Robert Osfield
70b5297575 From Jannik Heller, typo fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14826 16af8721-9629-0410-8352-f15c8da7e697
2015-04-07 18:01:12 +00:00
Robert Osfield
8c8b8f3305 Restructed the osgPresentation and present3D directories back to the structure that was present in OSG-3.2
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14759 16af8721-9629-0410-8352-f15c8da7e697
2015-03-04 18:36:44 +00:00
Robert Osfield
26d1679248 Removed the experiemental osgPresentation classes. These are only partially functional and not appropriate for the stable OSG-3.4 release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14758 16af8721-9629-0410-8352-f15c8da7e697
2015-03-04 17:42:30 +00:00
Robert Osfield
f2d11bb46e Added preliminary support for writing VolumeSettings to disk from within Present3D in response to pressing and releasing 'Ctrl-S'.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14363 16af8721-9629-0410-8352-f15c8da7e697
2014-07-04 16:45:05 +00:00
Robert Osfield
7a18876c5b Changed enum usage to use the new osgVolume::VolumeSettings versions and added support for reading a VolumeSettings file.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14349 16af8721-9629-0410-8352-f15c8da7e697
2014-07-03 13:01:05 +00:00
Robert Osfield
977ec20751 Refactored Callback system in osg::Node, osg::Drawable, osg::StateSet and osg::StateAttribute to use a new osg::Callback base class.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14244 16af8721-9629-0410-8352-f15c8da7e697
2014-06-05 16:26:13 +00:00
Robert Osfield
d7944b6ca9 Addd ExteriorTransparencyFactorProperty for support of upcomming functionality of rendering a cube volume with a hull volume inside it. 2014-03-18 18:14:15 +00:00
Robert Osfield
ed724a730e Added support for animating volume hulls. 2014-03-17 15:54:52 +00:00
Robert Osfield
ea865d0ff9 Added support for directly invoking scripts using <run-script> and <run-script-file> to enable scripts to interact with each other. 2014-03-13 10:28:18 +00:00
Robert Osfield
8f30a262f4 Added PresentationInterface class to make it more convinient to access the current presentation from scripting languages 2014-03-11 10:52:10 +00:00
Robert Osfield
ee266255eb Added scripting support for JumpData, KeyPosition, HomePosition and parts of SlideEventHandler that enable dispatching of user created events. 2014-03-10 19:08:46 +00:00
Robert Osfield
2b8be97297 Added support for a <hull> tag that can be used within <volume> tag. 2014-02-05 11:07:03 +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
1678dc3562 Added support for osgVolue::SampleRatioProperty. Fixed build errors when compiling with ref_ptr<> automatic type conversion. 2014-01-21 18:48:53 +00:00
Robert Osfield
e8cd06c6e9 Added hull="hul-filename" property support to <volume> tag that can used thus:
<layer>
            <volume renderer="MultiPass" hull="cow.osgt.0,-2,-4.trans.50,50,50.scale">CardiacCT</volume>
        </layer>
2014-01-16 17:17:37 +00:00
Robert Osfield
865a47bd6b Added <switch> tag to .p3d to allow one to provide multiple ways to render children within a layer. 2013-12-20 09:57:35 +00:00
Robert Osfield
f16f278fea From Stephan Hunber, "attached you’ll find some changes to osg/p3d:
* a new command-line-option to present3d and a new option to the p3d-plugin to suppress any found <env> tags
* a new command-line-option to present3d to forward mouse-events via osgGA::Device (defaults to off) so we can test the interface-files with present3d better
* I added a new attribute forward_to_devices for click_to_event to forward the event to all attached devices instead of handling the event locally. This will fix the annoyance with the new interface-files when toggling polygon-mode or switching light on/off.

Here’s an example:

<click_to_event forward_to_devices="true">0x72</click_to_event>
"
2013-12-19 13:49:27 +00:00
Robert Osfield
a8dc460085 Implemented support for calling scripts from with Present3D. 2013-12-19 10:02:16 +00:00
Robert Osfield
591c5bae42 Added support for new osgVolume::MultiPassTechnique to Present3D. To use add property renderer="MultiPass":
<volume renderer="MultiPass">MyVolumeData</volume>
2013-12-17 12:18:06 +00:00
Robert Osfield
d3a7115c45 Removed trailing spaces, added missing return to last lines 2013-11-22 09:38:50 +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
f42481b60f Removed unneccessary return 2013-09-19 16:18:20 +00:00
Robert Osfield
898c716841 Added osgPresentation::Show node and implementations with basic property reporting for various internal nodes of presentation graph 2013-09-10 09:23:30 +00:00
Robert Osfield
7050c59cae Initial cut of Audio/Volume/Movie/Image presentation objects 2013-09-06 09:35:56 +00:00
Robert Osfield
856ec46467 Added PrintProperties visitor 2013-09-04 16:25:18 +00:00
Robert Osfield
ccf7bbdb50 Added PrintPropertiesAction to osgPresentation 2013-09-04 15:39:17 +00:00
Robert Osfield
9f5e131203 Added Action class NodeVisitor that supports osgPresentation nodes. 2013-09-04 10:33:11 +00:00
Robert Osfield
fdfe3210ce Added beginings of Text implementation 2013-09-03 10:17:06 +00:00
Robert Osfield
820ba45fab Added Audio, Image, Movie, Model and Volume class to osgPresentation. 2013-09-01 17:24:35 +00:00
Robert Osfield
c678fed113 Added initial classes for present3D refactor 2013-08-21 19:54:03 +00:00
Robert Osfield
4e3715d4bb Moved old osgPresentation source files to osgPresentation/deprecated subdirectory. 2013-08-18 18:10:39 +00:00
Robert Osfield
82401defc7 Added osgPresentation::Cursor class to wrap up 3D cursor in the scene functionality 2013-08-08 16:49:33 +00:00
Robert Osfield
e7e517f2d0 Added <display_broadcast_event> and <dismiss_broadcast_event> support to <timeout> to allow the different timeout statges to be broadcast. 2013-01-17 13:51:52 +00:00
Robert Osfield
dd189f22e5 Completed <timeout> support, to use it with p3d use it along the lines:
<slide>
    <layer>
        <paragraph>Test</paragraph>
        <timeout>
            <idle_duration_before_timeout>3.0</idle_duration_before_timeout>
            <idle_duration_before_action>5.0</idle_duration_before_action>
            <key_starts_timeout_display>A</key_starts_timeout_display>
            <key_dismiss_timeout_display>S</key_dismiss_timeout_display>
            <key_run_action>D</key_run_action>
            <timeout_jump slide="0" layer="1"></timeout_jump>
            <timeout_event>w</timeout_event>
            <timeout_broadcast_event>t</timeout_broadcast_event>
            <image width="0.5">Images/lz.rgb</image>
        </timeout>
    </layer>
    <layer>
        <model>cow.osg</model>
    </layer>
</slide>
2013-01-17 11:48:20 +00:00
Robert Osfield
1fcadcf514 Added support for <timeout_jump> to Timeout support. 2013-01-17 09:51:15 +00:00
Robert Osfield
b8b8365c06 Implemented basic Timeout display and timing codes 2013-01-16 16:13:30 +00:00
Robert Osfield
81008c24df Added shell of Timeout class 2013-01-15 11:31:44 +00:00
Robert Osfield
93334e7df0 Added movie volume animation control to <image> and <stereo_image> tags to be used in the form:
<slide>
        <properties>
            <property name="volume" type="float">0.20</property>
        </properties>

        <property_animation>
            <key_frame time="0.0">
                <property name="volume" type="float">0.0</property>
            </key_frame>
            <key_frame time="2.0">
                <property name="volume" type="float">1.0</property>
            </key_frame>
            <key_frame time="10.0">
                <property name="volume" type="float">1.0</property>
            </key_frame>
            <key_frame time="12.0">
                <property name="volume" type="float">0.0</property>
            </key_frame>
        </property_animation>

        <layer>
              <image volume="$volume" looping="ON">big_buck_bunny_1080p_stereo.ogg</image>
       </layer>
    </slide>
2013-01-11 11:30:44 +00:00
Robert Osfield
4f8847dd50 Added support for <image delay="time" stop="time"> properties that works in conjunction with the start="time" property support checked in in previous submission,
together these control the delay, start position and stop position of movies.
2013-01-10 19:55:50 +00:00
Robert Osfield
e569671d13 Added support for <image "start=10"> property that tells a video to start specificied number of sections into a video. 2013-01-10 14:37:52 +00:00
Robert Osfield
e76e3a7b1b From Stephan Huber, "* osgGA: fixed a small bug regarding emulating mouse-events from touch-events
* resthttp/osc: encapsulate RequestHandler-classes in their own namespaces to prevent class-name-lookup-errors in the debugger/code (had some weird crashes)
* QTKit: fixed a compile-bug for gcc and blocks
* osgPresentation: click_to_* will fire on RELEASE, only if the drawable received a PUSH beforehand
* p3d/osgPresentation: implemented "forward_mouse_event_to_device"-tag, which will forward mouse-events to all registered devices of a viewer, if an intersection occurs. The mouse-coordinates get reprojected
* present3d: all devices get registered with the viewer
* osgViewer: only devices which are capable of receiving events are queried for new events.
* GraphicWindowIOS: added a flag to GraphicWindowIOS::WindowData to set up a retained backing buffer (defaults to false) This will enable read-back of the render-buffer with glReadPixels even after the renderbuffer got presented
* curl: added an optimized check for file-existance, now only the headers are requested and checked, instead of reading the whole file and handle it with a ReaderWriter
* p3d: fixed a bug, where the existence of a local file may prevent the remote loading of a file with the same name.

"
2013-01-07 12:17:26 +00:00
Robert Osfield
6d0e1bd50b Added region="$xmin $ymin $zmin $xmax $ymax $zmax" support to <model> tag, along with animation support via the <property_animation> support. 2012-12-20 12:14:53 +00:00
Robert Osfield
9f0906984b Removed erroneous region setting 2012-12-18 11:20:20 +00:00
Robert Osfield
9a2f7c7d8e From Wang Rui, build fix 2012-12-02 11:45:57 +00:00