Commit Graph

8735 Commits

Author SHA1 Message Date
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
9b299dc4b9 Added ability to replace callback objects via lua scripts to allow one to override callbacks.
Added fallback for osgGA::Widget::Extents.
2014-03-07 11:09:25 +00:00
Robert Osfield
9319350176 Added support for osg::Image to the lua plugin. 2014-03-06 10:27:26 +00:00
Robert Osfield
076adcbd82 Implement add, set and get methods for StateSet. 2014-03-04 13:36:13 +00:00
Robert Osfield
218e36b12b Relaxed the handling of Image objects 2014-03-04 13:35:27 +00:00
Robert Osfield
c6e72ee00b Fixed handling of OverrideValue 2014-03-04 13:34:23 +00:00
Robert Osfield
2b67196418 From Stephan Huber, fix for handling font paths on a local machine when other files have been source from a remote machine. 2014-02-28 17:38:36 +00:00
Robert Osfield
de09adcaa9 Added MapReverseIterator implementation. 2014-02-27 10:02:55 +00:00
Robert Osfield
46381cb15c Added MapIteratorObject and support for it in the lua plugin to provide map iterator functionality. 2014-02-26 18:18:08 +00:00
Robert Osfield
9394215d31 Added Map serializer size() method and support for it in the lua plugin. Renamed functions in lua plugin to be more consistent. 2014-02-26 11:01:35 +00:00
Robert Osfield
69e9f2c973 Added support for vector and map containers in osgDB::Serailizer's and lua plugin. 2014-02-26 08:26:51 +00:00
Robert Osfield
4ef5d9eb5f Added Vector serialization and support in lua plugin top enable script users to set/get vector properties such as osg::Array, osg::PrimitiveSet and children lists. 2014-02-24 10:19:48 +00:00
Robert Osfield
6d68718fba Fixed handling of enums in Lua plugin.
Fixed computation of getNumPrimitives() so that it returns 0 when PrimitiveSet is zero.

Added missing properties to PrimitiveSet serializers
2014-02-13 18:52:41 +00:00
Robert Osfield
cb805d7be5 Added inital cut of PrimitiveSetSet wrappers to scripting 2014-02-13 11:01:36 +00:00
Robert Osfield
42705bff3f Added full range of Array subclasses to wrappers 2014-02-12 18:10:52 +00:00
Robert Osfield
743a6b049c Added initial support for wrapping osg::Array in a way that can be used via scripting. 2014-02-12 18:03:53 +00:00
Robert Osfield
2797e8cb7c Improved support for setting/getting properties via the osg::UserDataContainer. 2014-02-11 18:07:37 +00:00
Robert Osfield
e3a003a08f Quitened down debug messages 2014-02-11 10:56:51 +00:00
Robert Osfield
a9f8af3fb6 Changed implementation of enums to use strings as lua type to make it easier to do comparisons and track values 2014-02-11 09:43:08 +00:00
Robert Osfield
e21865ee33 Implemented Widget::handle, handleImplementation, traverse and travseImplementation() wrappers to enable them to be extended via scripting 2014-02-10 18:07:26 +00:00
Robert Osfield
31e98b51df Added support for serailizing and scripting BoundingBox and BoundingSphere objects 2014-02-10 16:44:13 +00:00
Robert Osfield
3dcca431a9 Fixed handling of setting member variables via the Serializers when the value is the default.
Added support for more features of the osgDB::Widget class.

Fixed handling of boolean values in the Lua plugin
2014-02-08 17:53:51 +00:00
Robert Osfield
1319c2d281 Added support for enum's in the Lua script integration 2014-02-08 10:39:20 +00:00
Robert Osfield
8ad0ab1f6b Fixed handling of returns when invoking a script, removed some debug messages, added a warning message when detecting erronous types.
Added FocusBehaviour enum to osgGA::Widget serialization
2014-02-07 16:06:57 +00:00
Robert Osfield
6f5e5c23df Added initial Widget wrapper 2014-02-07 10:46:16 +00:00
Robert Osfield
4016aed62d Moved experimental Widget class to osgGA
Add computeIntersections() to the osgGA::GUIActionAdapter base class to enable intersection tests without needing to directly link to osgViewer.
2014-02-06 17:32:41 +00:00
Robert Osfield
99eb81e743 Added support for casting objects to allow one to access a parent classes methods. 2014-02-06 11:25:37 +00:00
Robert Osfield
ca3737e002 Tweaked the detection of when the position transform for the hull is required. 2014-02-05 11:08:39 +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
1909093cac Improved the white space trimming 2014-02-05 11:04:29 +00:00
Robert Osfield
c599189d7d Added lua-5.2.3 as source code so it can be optinally built as part of the lua plugin, making it possible to work out of the box across all platforms with needing lua as an external dependency.
Added the Cmake option OSG_USE_LOCAL_LUA_SOURCE to control whether to build and use the Lua source code in the lua plugin, or look for lua as an external dependency.
2014-02-04 16:49:13 +00:00
Robert Osfield
6bf6d5eeb2 Added test code for nesting a <hull> within a volume tag. 2014-02-04 16:46:33 +00:00
Robert Osfield
488e1692cc From Stephan Huber, added support for compile source code of lua with the lua plugin 2014-02-04 11:24:01 +00:00
Robert Osfield
f44369777f Fixed error in the computation of tex coords of Maximum Intensity Projection + Transfer Function rendering. 2014-02-03 15:35:22 +00:00
Robert Osfield
306a4f2d2d Replaced C cast to long with a static_cast<const void*>() to avoid a build error under Mingw 64. 2014-01-31 19:18:18 +00:00
Robert Osfield
5f8e2bda2f Added osg::CallbackObject to be used to extend C++ class from scripting languages by providing callback objects assigned to the osg::Object UserDataContainer, with the CallbackObject's Name used to map the "method" provided by the CallbackObject. The CallbackObject is implemented by the script engine to provide the neccessary glue to invoking the script with the appropriate input parameters and handling the output parameters.
To the Lua plugin added support for assigned lua functions to C++ osg::Objects via the new osg::CallbackObject mechanism.  To invoke the scripts function from C++ one must get the CallbackObject and call run on it.

Renamed ScriptCallback to ScriptNodeCallback to avoid possibly confusion between osg::CallbackObject and the ScriptNodeCallback.
2014-01-31 16:20:29 +00:00
Robert Osfield
4814a5341e Removed the invocation of gcc on all platforms 2014-01-28 15:28:17 +00:00
Robert Osfield
f7e6f0092c From Kristofer Tingdahl, "the vertical bar is upside down, and hence not as the documentation says it should be. This is corrected with this patch"
From Robert Osfield, changed the example so that the vertical and horizon scalar bars are rotated to the XZ plane so you can see them with the default viewer's camera orientation.
Tweaked the positioning of title text of vertic scalar bar to avoid overlap of text.
2014-01-28 11:01:28 +00:00
Robert Osfield
5292c7ca50 From Laurens Voerman, "I experienced a crash in Geometry::fixDeprecatedData(), on certain files, and brought the problem down to a very simple test file, attached as test3.zip.
There are two problems:
1> for DrawElementsUShortPrimitiveType (and UInt) the source_pindex still equals -1 and causes a crash
     in DrawElementsUBytePrimitiveType source_pindex is incremented, and in DrawElementsU(Short/Int)PrimitiveType primitiveNum is incremented, but never used

2> The drawelements need to be rewritten as the vertices are reordered.

created a patch for osg stable branch(r14038): attached as Geometry-osg-3.2.zip
and for svn brach(r14044): attached as Geometry_osg_svn.zip"
2014-01-24 17:31:09 +00:00
Robert Osfield
70bfad0371 From Aurelien Albert, "In the "apply" method of osg::FrameBufferObject, the draw buffers are always enabled, even if the target is only "READ_FRAMEBUFFER".
This can lead to inconsistency if you bind a framebuffer with multiple attachments in DRAW mode and then a framebuffer with different attachment count in READ mode (for example to manually "blit" from a FBo to another).

On some ATI cards (at least RADEON HD) this also leads to an "incomplete " FBO status

I've added a test to enable drawbuffers only if target is "DRAW" or "READ_DRAW", this solves my problems on ATI cards."
2014-01-24 17:06:32 +00:00
Robert Osfield
fcc34a8b45 From Michael Schanne, "small fix for a duplicate OR operand in KdTree.cpp." 2014-01-24 16:45:45 +00:00
Robert Osfield
1270236715 From Torben Dannhauer, VisualStudio 2013 build fixes 2014-01-24 16:24:59 +00:00
Robert Osfield
8a334e724b From Kristofer, "The osgSim::ScalarBar has a problem in that if the scalarbar has a color in one end that co-incides with the background color, one cannot see where the scalarbar ends. With this patch, we add a line around the perimiter of the bar to mark it.
Secondly, we thought the text-annotation missed ticks that mark out precisely where on the bar the texts relate to, so we added that as well."
2014-01-24 16:19:38 +00:00
Robert Osfield
8ae57c2797 From Marc Helbling, "I am sending a small fix in the PLY pseudo-loader; the extension was checked in plyfile.cpp thus preventing the loading of any .PLY file (extension in uppercase). The extension filtering is already handled by ReaderWriter::acceptsExtension in a case unsensitive way." 2014-01-24 16:01:59 +00:00
Robert Osfield
eb56080277 Fixed warnings 2014-01-24 15:40:18 +00:00
Robert Osfield
91b7104a92 Changed the handling of single window configurations so that simply reuse the View::getCamera() instead of creating a slave. 2014-01-24 14:26:25 +00:00
Robert Osfield
f0df819cbf Fixed crash when reading a viewer configuration file where the EventVisitor was being re-assigned but left a dangling pointer 2014-01-24 11:37:35 +00:00
Robert Osfield
29ab577bc3 From Stephan Huber, "attached is a new zip containing two small fixes:
* forwarded touch-events do have a correct input-range from 0 .. 1
* I refactored sending touch-events per osc so the receiver can detect a TOUCH_ENDED better"
2014-01-24 10:10:43 +00:00
Robert Osfield
4886a8941d Fixed warnings 2014-01-23 19:55:37 +00:00
Robert Osfield
d8482ef1ba From Kristofer Tingdahl,"we have a bunch of classes that inherit osg::Node, and they create their own, internal geometry which is passed into the render bucket at the cull-traversal. Last week, we realised that these classes are not accounted for when doing an ComputeBoundVisitor- traversal, as there is no specialization in ComputeBoundVisitor for them.
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.
2014-01-23 16:48:29 +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
09c09628ac Removed debug message 2014-01-23 10:56:17 +00:00
Robert Osfield
15882aae5f Changed the TransprencyProperty range to 0 to 2.0 to enable forcing opaque qualities on fragments 2014-01-23 10:50:55 +00:00
Robert Osfield
8876394c7c Cleaned up debug message. 2014-01-23 10:11:15 +00:00
Robert Osfield
ea429d5d46 Added clean up of osg::Program that are applied by the GLObjectsVisitor, which addresses a state leak that creates GL error once the main scene graph is rendered. 2014-01-23 09:41:09 +00:00
Robert Osfield
7f9f7dd216 Added GL_TEXTURE_2D_MULTISAMPLE to texture mode list. 2014-01-23 07:59:46 +00:00
Robert Osfield
4fef6a3c2f Refactored .p3d loader to make it less strict about the tag, property and value strings when matching them to supported values.
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
2014-01-22 16:29:45 +00:00
Robert Osfield
7fe3244c71 Added support for sampleRatio and sampleRatioWhenMoving <volume> properties 2014-01-22 11:25:54 +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
e48d6812fa Build fixes for when ref_ptr<> has no auto type conversion 2014-01-21 18:31:20 +00:00
Robert Osfield
504b42aa61 Fixed build error 2014-01-21 17:27:21 +00:00
Robert Osfield
779bd20fd5 Fixed build error due to typo. 2014-01-21 17:00:56 +00:00
Robert Osfield
752d40b118 Integrated multipass volume rendering shaders from OpenSceneGraph-Data 2014-01-20 17:23:11 +00:00
Robert Osfield
8a0e49d780 Removed nolonger used code paths 2014-01-20 16:21:24 +00:00
Robert Osfield
54a3f76a2b Disable depth test for rendering of hull backface 2014-01-20 15:54:48 +00:00
Robert Osfield
15399bbf35 From Kristofer Tingdahl, reimplement of AntiSquish node to avoid the use of an update callback.
From Robert Osfield, small ammendments to clean up header.
2014-01-20 11:00:09 +00:00
Robert Osfield
6246cd5d85 From Roni Zanolli,Added use of Qt's new devicePixelRatio() method to assist with handling the upscalling of resolution on iPhone for "retina" displays.
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.
2014-01-20 10:40:49 +00:00
Robert Osfield
0d4a448c34 Fixed warning 2014-01-17 18:20:39 +00:00
Robert Osfield
8efe470d07 From Stephan Huber, fix for OSX build issue 2014-01-17 18:20:28 +00:00
Robert Osfield
e968caae80 From Kristoger Tingdahl, "the patch I sent to src/osgQt/CMakeModules.txt did not do the work on windows. I have fixed that, and also made it more generic so there is no special handling of qt5.2, but all qt5 are the same.
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)
"
2014-01-17 14:02:30 +00:00
Robert Osfield
354d79acd1 From Jordi Torres, "Fixed a typo in ReaderWriterCURL::ReaderWriterCURL() changed Psuedo for Pseudo." 2014-01-17 13:54:14 +00:00
Robert Osfield
235a52405d Fixed handling of background colours. 2014-01-17 12:40:58 +00:00
Robert Osfield
706afaccae Removed old redundent TexGen usage. 2014-01-16 17:26:35 +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
1264ec736a Added support for controlling the extents of the volume rendering by nesting the hull underneath VolumeTile. Currently only supported by the new osgVolume::MultipassTechnique 2014-01-16 16:08:43 +00:00
Robert Osfield
110fbf89b0 Added per TileData RTT Camera in prep for rendering backface of volume to a depth texture 2014-01-09 09:41:43 +00:00
Robert Osfield
2efd52dda2 Changed near/far values to use CullVisitor::value_type and use std::numeric_limits<>. 2014-01-08 15:56:43 +00:00
Robert Osfield
889e4749ef From Farshid Lashkari, "I've attached a fix for the Collada loader that prevents a crash with some files containing textures. I also converted an OSG_NOTICE to OSG_INFO to be consistent with other log messages within the loader." 2014-01-08 10:33:00 +00:00
Robert Osfield
84d301715e Removed more odd characters 2014-01-08 10:31:36 +00:00
Robert Osfield
32d7a48712 Removed more odd characters 2014-01-08 10:28:24 +00:00
Robert Osfield
db82bb4ab1 Removed odd characters 2014-01-08 10:24:43 +00:00
Robert Osfield
d48091d37e From Farshid Lashkari, "I've attached a small change to the DAE writer to support writing out unknown transform types. It will essentially treat it as a matrix transform, using the the local to world matrix value." 2014-01-07 16:29:22 +00:00
Robert Osfield
7bc373a056 Bumped SO_VERSION number of OpenThreads to avoid conflicts with Debian SO_VERSION bump 2014-01-07 16:18:05 +00:00
Robert Osfield
cc99a40b16 Added support for Switch::set/getValue() 2014-01-06 17:19:21 +00:00
Robert Osfield
8ae971bdaa Added Group::setChild(..) and Geode::setDrawable(..) MethodObjects 2014-01-06 16:58:07 +00:00
Robert Osfield
fa7f25d75d Removed the prototype MethodObject classes 2014-01-06 15:46:36 +00:00
Robert Osfield
6490f1b6a5 Moved osgDB::MethodObject from lua plugin into osgDB, added support for running methods via the osgDB::PropertyInterface class.
Updated lua plugin to use new osgDB::PropertyInterface to run methods.

Added addChild/removeChild() etc to Group.cpp, and addDrawable/removeDrawable() etc. to Geode.cpp serializers.
2014-01-06 15:45:46 +00:00
Robert Osfield
bfdcf4d8d1 Fixed build of V8 and Python plugins 2014-01-03 14:36:58 +00:00
Robert Osfield
afab78ed40 Preliminary support for wrapping methods in the lua script plugin. 2013-12-25 17:36:32 +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
a72508bc71 From Kristofer Tingdahl, "the syntax of the moc executable has changed between 5.1.1 and 5.2.0 versions of qt (see below). The difference is that the <file> argument has become mandatory after the -f option.
Hence, moc will complain when osg throws in a -f without anything after it. Hence I propose removing the -f on Qt5 builds. I have tested building without -f on both qt520 and qt511, and that works well.

The attached src/osgQt/CMakeLists.txt that can be patched into 3.2 safely. For the trunk, I would consider dropping the check on the version, and simply remove the option on qt5. I have tested that on qt5.1.1, and that worked fine. Question is however if it works on qt5.0. Probably it does, so the question is simplicity of CMakeList.txt vs safety."
2013-12-19 17:13:24 +00:00
Robert Osfield
3e171414bd From Michal Durkovic, "I’m building current trunk on Mac OS X 10.9 and have encountered this error during linking of osgdb_lua plugin:
Undefined symbols for architecture x86_64:

  "lua::LuaScriptEngine::pushValue(osg::Quat const&) const", referenced from:

      PushStackValueVisitor::apply(osg::Quat const&) in LuaScriptEngine.o

  "lua::LuaScriptEngine::pushValue(osg::Plane const&) const", referenced from:

      PushStackValueVisitor::apply(osg::Plane const&) in LuaScriptEngine.o

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)



Looks like LuaScriptEngine was missing implementation of those 2 member functions. Fixed src/osgPlugins/lua/LuaScriptEngine.cpp file in attachment.

"
2013-12-19 13:53:40 +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
02120e188e From Stephan Hunber, "I found some time and ported osgDB::FileUtils and DarwinUtils across new apis to fix the warnings about deprecated api-usage.
* osgDB::FileUtils uses now the Cocoa-API to determine the paths of the application-support-folder
* DarwinUtils uses now modern functions of the quartz-api to get and set screen-resolutions. Removed some of the osg-deprecated stuff.
"
2013-12-19 13:44:42 +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
666aa81185 Added experimental image 3d downsample function. 2013-12-17 10:52:50 +00:00
Robert Osfield
723ecfad8d Removed the unused Texture::Extensions::numTextureUnits() 2013-12-16 11:28:10 +00:00
Robert Osfield
5571c361dc Implemented ability to switch between different shaders with new MultipassTechnique 2013-12-13 12:38:01 +00:00