Commit Graph

6492 Commits

Author SHA1 Message Date
Cedric Pinson
9b95a78e5d From Michael Platings, I have removed Target::normalize() as calling it was incorrect - the interpolation is already done in such a way that the Target's value is always normalized.
Finally, I have fixed TemplateTarget<osg::Quat>::lerp() as it was giving incorrect results when interpolating between some small rotations.
From Cedric Pinson, i renamed the method in channel to be more general. Adjusted the CubicBezier key constructor to use a single value as input.
2009-09-09 09:52:54 +00:00
Robert Osfield
a851b0b412 Tweaked debugging info 2009-09-08 15:36:44 +00:00
Robert Osfield
5c2e89ac28 Fixed the set up of osgVolume::ImageLayer scale and offset. 2009-09-08 15:36:28 +00:00
Robert Osfield
b2a3d84d08 Added filter for .filename files 2009-09-07 12:51:00 +00:00
Robert Osfield
7201ce1960 Updated volume setup code to use the new ImageDetails structure. 2009-09-07 10:54:08 +00:00
Robert Osfield
0b3284072d Added check for null masterLocator 2009-09-07 10:50:48 +00:00
Robert Osfield
b9e4313029 Fixed assingment of layerLocator 2009-09-07 08:30:54 +00:00
Robert Osfield
288dd85af4 Added scaling of shader transfer function input values to honour original dicom input values 2009-09-03 14:39:29 +00:00
Robert Osfield
fa84f280f6 Renamed the osgVolume::Layer/ImageDetails parameters RescaleIntercept and RescaleSlope to more general TexelOffset and TexelScale, and changed type to Vec4.
Refactored the transfer function set up in RayTracedTechnique to prepare for new scale and offset uniforms.

Updated wrappers
2009-09-03 13:40:50 +00:00
Robert Osfield
43e3089417 Added support for recording the RescaleIntecept and RescaleSlope from the dicome files and passing these values onto osgVolume::ImageLayer 2009-09-01 10:48:32 +00:00
Robert Osfield
ea43bc7d52 Updated wrappers 2009-08-31 15:10:38 +00:00
Cedric Pinson
641769a681 From Cedric Pinson, add missing files 2009-08-31 10:37:44 +00:00
Cedric Pinson
b6ab5bbe27 From Cedric Pinson, The following modification are
Update Timeline.cpp to add current layer to the ActionVisitor, use correctly the priority
Add accessors in Action.cpp to retrieve protected data
Split files and rename them to classname
Change de default color of UpdateMaterial to FFOOFF to detect unset value
Add accessors in LinkVisitor instead of accessing data directly
Update osganimationtimeline example to fit the api callback
2009-08-31 09:40:56 +00:00
Robert Osfield
79f780d4b8 Fixed the compute of the extents/bounding sphere 2009-08-27 19:25:23 +00:00
Robert Osfield
ca78f3a6bc Added support to .p3d format's volume tag for the properties:
region="xmin ymin zmin xmax ymax zmax"
   alpha="float_value"
   cutoff="float_value"
   sampleDenstiy="float_value"
2009-08-27 16:42:47 +00:00
Cedric Pinson
3f9216800d From Michael Platings, I've moved the matrix updating from UpdateSkeleton to UpdateBone. UpdateSkeleton now merely checks that Bones appear before other children and issues a warning if this isn't the case 2009-08-27 16:21:01 +00:00
Cedric Pinson
729d5205ef From Michael Platings, I've just added a few simple accessors I found necessary 2009-08-26 16:39:53 +00:00
Cedric Pinson
3c45fb1e6c From Michael Platings,
- Animations with equal priority are now weighted correctly relative to each other
- (minor) Channels no longer store their weight as the only time it's used is in update() when Animation can pass in the weight directly
From Cedric Pinson,
- I adjusted the quaternion blending to keep the commutativy property
2009-08-26 09:24:02 +00:00
Robert Osfield
a63dbc225e Fixed osgAnimation wrappers 2009-08-21 13:55:03 +00:00
Robert Osfield
5d7d7137d2 Updated wrappers 2009-08-21 12:53:23 +00:00
Robert Osfield
8f0322d9d1 Fixed handling of double precision bounding sphere type. 2009-08-21 10:18:46 +00:00
Robert Osfield
e8eeaa0c8b From Wojciech Lewandowski, part of the FBO attachment submission 2009-08-21 09:43:41 +00:00
Robert Osfield
613c59ad3b Updated wrappers 2009-08-21 09:42:54 +00:00
Robert Osfield
3f65f4f80b From Wojciech Lewandowski, support for FBO's without colour or depth attachments.
Note from Robert Osfield, I've temporarily re-enabled the old focing of of color and depth attachment to avoid regressions on some OpenGL driver.  We'll revist this once
we have a mechanism for controlling this override at runtime.

#define FORCE_COLOR_ATTACHMENT  1
#define FORCE_DEPTH_ATTACHMENT  1
2009-08-21 09:34:48 +00:00
Robert Osfield
564ae70d45 From Tom Moore, "Parens were being returned when the bracket keys were typed. The fix
is easy and the original code looks like a typo"
2009-08-20 16:05:06 +00:00
Robert Osfield
9347fc1ddb From Colin McDonald, "This file didn't build when OSG_USE_UTF8_FILENAME was on" 2009-08-20 15:32:02 +00:00
Robert Osfield
60253d164d From Colin McDonald, "There is a duplicate class definition in the obj & dxf plugins trunk,
causing static builds to fail."
2009-08-20 15:20:55 +00:00
Robert Osfield
9f454c1714 From Colin McDonald, "The bsp & mdl plugins have calls to atof() without including the
associated <stdlib.h> header.  This breaks the build on my Solaris setup.

Rather than adding the missing <stdlib.h> include, I have changed the
atof() calls to osg::asciiToDouble().  This is the same as was done
throughout the other plugins recently, for locale independance.

I've attached updates to the svn trunk, the fix is also appropriate for
the 2.8.* branch."
2009-08-20 14:59:29 +00:00
Robert Osfield
fe8822e496 Added check against a minimual video size of 10x10 to prevent problems with swscale reporting errors and crashing on small video dimensionsline, and those below, will be ignored--
M    ffmpeg/FFmpegImageStream.cpp
2009-08-20 14:59:00 +00:00
Robert Osfield
850ea3de9f Added support for trimming the contents of parsed Xml graph 2009-08-19 15:36:23 +00:00
Robert Osfield
f3c20310d6 Added tabs to treatment as white space to skyWhiteSpace() 2009-08-18 13:38:17 +00:00
Robert Osfield
1241f8a0d6 Added check for space in option name parsing 2009-08-17 16:07:04 +00:00
Robert Osfield
2d77db3627 Added support for the TabBoxTrackballDragger 2009-08-17 15:46:22 +00:00
Robert Osfield
a1709abbee Changed the autorun keys to 'g' for go, and 'h' for halt. 2009-08-17 15:45:43 +00:00
Robert Osfield
321a404f05 Updated wrappers 2009-08-17 15:24:15 +00:00
Robert Osfield
804f7622cc Moved static string initialization into singleton method 2009-08-17 15:22:01 +00:00
Cedric Pinson
2916d9b7ea From Michael Platings,
Changes to allow osgAnimation::*CubicBezierChannel to be used
Added TemplateStepInterpolator class
2009-08-06 12:40:06 +00:00
Robert Osfield
c24e9330a0 Added support for selecting the TabBoxTrackballDragger using dragger="trackball-box" 2009-08-05 17:01:50 +00:00
Robert Osfield
589629cab8 Introduced TabBoxTrackballDragger 2009-08-05 16:02:44 +00:00
Robert Osfield
93996e6133 Added support for volume tags with properties:
dragger="box" or dragger="trackball"

and

    technique="light" or technique="isosurface" or technique="iso" or technique="mip"

and

    tf="transferfunctionfile.tf"

i.e.

         <volume dragger="box">CardiacCT</volume>
         <volume tf="colour.tf">CardiacCT</volume>
         <volume technique="isosurface">CardiacCT</volume>
2009-08-05 14:37:56 +00:00
Robert Osfield
5b81e1e76f Updated wrappers 2009-08-05 12:51:10 +00:00
Robert Osfield
df9385ac19 Moved the updating and expiry of the Registry object cache from DatabasePager into osgViewer::Viewer/CompositeViewer. 2009-08-05 11:06:53 +00:00
Cedric Pinson
d2af7efc61 From Cedric Pinson, Add UpdateMaterial callback to animate material\nUpdate LinkVisitor to traverse stateset\nUpdate ReaderWriter to read osgAnimation::UpdateMaterial Callback\nUpdate nathan.osg data file to demonstrate the MaterialAnimation 2009-08-03 09:48:12 +00:00
Robert Osfield
91f53369a3 From Terry Welsh, .osg and .ive support for new Text boxes 2009-07-28 06:00:03 +00:00
Robert Osfield
fcaec80dc9 Fixed bug in handling of stereo image pairs 2009-07-27 15:39:27 +00:00
Robert Osfield
e078aad61f Updated wrappers 2009-07-24 15:55:50 +00:00
Robert Osfield
6af1859bc4 From Jason Daly, "This set of changes reworks the BSP plugin to use TexEnvCombine instead of a GLSL program for doing the texture blending on displaced terrain geometry. After working with it a while, I found this method to be more scene graph friendly (at least until Wojtek gets his VirtualProgram scheme working ;-) )
Note that this technique will require ARB_texture_env_crossbar (or NV_texture_env_combine4), as it mixes two textures in the first texture unit, and just does the lighting in the second.  I doubt this will be a problem for any card that can already handle GLSL programs, though."
2009-07-24 15:09:37 +00:00
Robert Osfield
de9ce8a3c0 From Cory Riddell, "The spherical manipulator uses a middle drag event for panning. It was
panning for left-right drags, but was zooming for up-down drags. I
changed it to pan both directions as I believe that is the correct
behaviour. If the original combination pan-zoom behaviour was
intentional, please let me know."
2009-07-24 15:04:46 +00:00
Robert Osfield
31a947fda6 From Terry Welsh, "Okay, here are the mods I wrote for drawing a filled bounding box
behind osgText::Text.  I made it so the box would get drawn using
whichever BackdropImplementation was selected.  However, I did not
implement STENCIL_BUFFER.  In that case it defaults to drawing the
bounding box using POLYGON_OFFSET instead.

Also made it so the BOUNDINGBOX and FILLEDBOUNDINGBOX are drawn with a
settable color and margin size.

While I was at it I tightened up the values applied with DEPTH_RANGE
and POLYGON_OFFSET, not just for drawing the bounding box but also for
drawing backdrop text (these values must be coupled since the bounding
box has to be drawn deeper in Z than the backdrop text).  The values
in use before seemed like overkill and I was seeing some z-clipping
with my background scenery in the case of DEPTH_RANGE.  If there was a
good reason for the large values please let me know...."
2009-07-24 14:59:51 +00:00
Robert Osfield
773ae51a45 From Chris Hanson, typo and comment clean ups 2009-07-24 14:45:44 +00:00
Robert Osfield
68c459ea30 Updated wrappers 2009-07-24 14:45:09 +00:00
Cedric Pinson
5a73834cbe From Cedric Pinson, Store the linkvisitor to be able to configure it by user, like changing the nodemaskoverride, or use a custom LinkVisitor 2009-07-23 12:42:01 +00:00
Robert Osfield
48a1934ca8 From J.P. Delport, "attached a modified jpeg plugin that allows writing of grayscale images." 2009-07-17 07:47:48 +00:00
Robert Osfield
484d8e328a From Fabien Lavignotte,"When exporting some models to OpenFlight, i found a crash if the texture
unit does not contain a TexEnv object.
Here's the small fix, just a test on the pointer."
2009-07-16 12:09:47 +00:00
Robert Osfield
9d04b4d566 From Stephan Lamoliatte, "The vertical anchor is inverted in the osgWidget::Window::update function.
Here is a small patch to fix that."
2009-07-16 12:04:35 +00:00
Robert Osfield
c2c5a82b92 Fixed build. 2009-07-16 11:35:59 +00:00
Robert Osfield
7f1b0055bd Added .get() to fix build 2009-07-16 11:26:14 +00:00
Robert Osfield
9eb03d450d From Jason Daly, "These are some fixes to the mdl and bsp plugins to handle transparency and lighting better, plus a few other tweaks." 2009-07-16 11:21:02 +00:00
Robert Osfield
a232770161 From Colin MacDonald,"The Optimizer Merge Geometry visitor is always merging geometries,
even if they have had DataVariance DYNAMIC explicitly specified.  Then
when an application attempts to dynamically update the geometry in the
frame loop the primitive sets and data arrays are no longer as
expected, leading to display and/or memory corruption.

Attached is a simple fix. "

Note from Robert Osfield, tweaked Colin's changes to that it use != DYNAMIC as the the test rather than == STATIC.
2009-07-16 11:06:31 +00:00
Robert Osfield
3a93bd3fb5 Updated wrappers 2009-07-16 10:56:16 +00:00
Robert Osfield
5496e91f87 Added the ability to turn off the external paging in of PagedLOD children. 2009-07-16 10:13:41 +00:00
Robert Osfield
137605eba8 Added support for using PagedLOD to managing loading of presentation preview and then the main presentation in the background paging thread 2009-07-16 10:12:33 +00:00
Robert Osfield
956bf3e395 Quitened down debug info. 2009-07-15 15:28:19 +00:00
Robert Osfield
c491373698 Cleaned up indenting 2009-07-14 13:32:06 +00:00
Robert Osfield
adc68d79af Converted code to use osg::asciiToFloat() instead of relying upong the C libraries sscanf to read floats as the C library is locale sensitive. 2009-07-14 13:30:28 +00:00
Robert Osfield
65c8357f76 From Alexandre Amalric, "I'm using osg svn version 2.9.5 and I've apparently found a bug in osgPlugin logo.
When using more than one view logosCullCallback function is called without checking context ID from the cull visitor is equal to logo _contextID variable. It involves updating logo's viewport with different sizes.
So I made a fix well working, at least the way I use the plugin."

Note, from Robert Osfield, changed code to return true to signal culling of logo when being applied to a window that it wasn't assigned to.
2009-07-14 12:22:47 +00:00
Robert Osfield
cc37d7f439 Moved the getting of the ReaderWriter to do the actual model loading to later so that it only gets invoked when required. 2009-07-14 11:19:22 +00:00
Robert Osfield
424e892f99 Quietened down debug messages, and added early return when filename contains server address. 2009-07-14 11:18:11 +00:00
Robert Osfield
f9517fde6a Refactored the setup of the reading of the wrl file by allow reading from istreams, as well as nesting of filepaths using a local osgDB::Options to prevent threading issues.
Also fixed crash in parsing of the vrml data structures that occurred when no vrml material was assigned.
2009-07-14 10:37:31 +00:00
Robert Osfield
c690dfec50 Quitened down debug messages 2009-07-14 10:35:53 +00:00
Robert Osfield
148798137c Fixed the handling of compressed files 2009-07-14 10:04:18 +00:00
Robert Osfield
bedd22de23 From Cory Riddel based on suggestion from Robert Osfield, "I've been running with your suggested changes for a few days now and it
has been working perfectly. I'm still not entirely clear why adding a
slave/subgraph causes the problem."
2009-07-13 16:39:51 +00:00
Robert Osfield
9aa6d33980 From David Fries, "Comparing the win32 barrier to the pthread barrier, win32 puts the
while in an else clause.  When if is true the phase changes and the
while condition will always by false, so might as well put the while
in the else to skip the check.  There's also a benefit to having the
code logic similar between platforms.
"
2009-07-13 16:14:43 +00:00
Robert Osfield
3983f38f18 From David Fries, "Here is a fix for a deadlock seen under Windows using OpenThreads
Barrier operations.  The error is with atomic operations in the
win32 condition implementation.  The attached sample program will
reliably trigger with as few as three threads and a dual core system,
though sometimes it will take 65,000 iterations.

2.8.1 was the base for these changes

Win32ConditionPrivateData.h
Win32ConditionPrivateData::wait does two operations to decrement
waiters_ then read, when InterlockedDecrement decrements and returns
the value in one operation.  The two operations allows another thread
to also decrement with both getting 0 for an answer.

Win32ConditionPrivateData::broadcast is using waiters_ directly
instead of using the w value read earlier, if it was safe to use
waiters_ directly there would be no need for InterlockedGet or w.

overview of deadlock in barrier with three threads
one thread in broadcast, 2 threads in wait,
release semaphore 2, waits on waiters_done_
both threads wake, decrement waiters_, get 0 for w,
       <logic error here>
one calls set waiters_done_,
broadcast thread comes out of waiters_done_,
other thread calls waiters_done_, (which leaves waiters_done_ in the
signaled state)
       <sets the trap>
broadcast thread returns releases mutex, other threads get
mutex and also return,
next barrier, first two threads enter wait, one goes to broadcast, release
semaphore 2, skips waiters_done_ as it had been released last time
returns, processes, enters the barrier for the next barrier operation
and waits,
three threads are now in wait, two have the previous barrier phase,
one the current phase, there's one count left in the semaphore which a
thread gets, returns, enters the barrier as a waiter, sleeps, and the
deadlock is completed"
2009-07-13 16:05:57 +00:00
Robert Osfield
c47c0c2a26 From Stephan Huber, "ttached you'll find a small fix for the
GraphicsWindowCocoa-implementation, which enhances multithreaded
stability, it ensures that modifications to the size of an openglcontext
is done only from one thread.
"
2009-07-13 08:30:20 +00:00
Robert Osfield
6e6a7c960e Added Dragger::s/getActivationModKeyMask(..) and Dragger::s/getActivationKeyEvent(...) methods to make it possible to have draggers that only respond when you press a specified modified key or standard key.
Changed the optional dragger in osgvolume to require the shift key to be pressed for the dragger to become active.
2009-07-03 19:16:53 +00:00
Robert Osfield
cb1b874167 From and incorported the addition from Paul Fotheringham, addition of define VCL_CAN_STATIC_CONST_INIT_FLOAT to be zero to solve build error under Linux
From Robert Osfield, general cleaned up ITK side to CMakeList.txt.
2009-07-03 19:07:02 +00:00
Robert Osfield
1d320d3ca1 To the ITK code path added support for handling a whole directory of dicom files. 2009-07-03 18:58:01 +00:00
Robert Osfield
48d28aaf1a Updated wrappers 2009-07-03 10:27:58 +00:00
Robert Osfield
48dddc37b8 Introduced a Locator callback and associated usage of this callback to provide interactive updating of the volume bounds 2009-07-03 05:25:08 +00:00
Robert Osfield
a4dedc227b Refactored RayTracedTechnique to allow the position of the rendered part of the volume to be decoupled from the image data. 2009-07-02 18:49:59 +00:00
Robert Osfield
2232bd5ee5 From Byran Thrall, "The OpenFlight plugin doesn't handle unrecognized options or extra
whitespace in all cases, causing it to crash."
2009-07-01 15:39:06 +00:00
Robert Osfield
8107bd0540 Added osgGA to the dependency list 2009-07-01 14:04:46 +00:00
Robert Osfield
2525bb5d06 Completed refactor of osgManipulator, key changes are:
Selection is now just a typedef of osg::MatrixTransform, and is deprecated

   CommandManager is shell class that just sets values directly on Dragger, and is deprecated

   Dragger now has list of DraggerCallback that takes over the roll of tracking changes to the Dragger, and
   allows users to track the dragger in any way they wish.

   Dragger now has a convinience method making MatrixTransforms track a dragger.

   Selection and CommandManager are no longer required for use of osgManipulator and are kept around for backwards compatibility.
2009-07-01 14:01:09 +00:00
Cedric Pinson
4e305cf46b From Cedric Pinson, i miss to commit the file that contains the osgAnimation::StripAnimation::traverse 2009-07-01 09:30:44 +00:00
Robert Osfield
7904fe71a5 Simplified Command and CommandManager 2009-06-30 13:00:58 +00:00
Cedric Pinson
2c012faee4 From Cedric Pinson, Traverse StripAction instead of applying, this fix the execution of FrameCallback in BlendIn, BlendOut and AnimationAction\nFix warning of osgAnimation::StatsHandler\nFix crash when running example osganimationtimeline without nathan.osg in OSG_FILE_PATH or with bad file 2009-06-30 11:55:49 +00:00
Robert Osfield
a2ae370c8e Refactored osgManipulator so that CommandManager is no longer required, instead Dragger directly manages Constaints and associate Selections. 2009-06-30 11:39:39 +00:00
Robert Osfield
a73a403301 Updated wrappers 2009-06-30 07:33:16 +00:00
Robert Osfield
e30e4df30c Introduced event handling directly into osgManipulator::Dragger to allow it be used with a global event handler passing in events. 2009-06-29 21:32:10 +00:00
Robert Osfield
8aaedda982 Changed the definition of HAVE_CONFIG_H so that it's only defined when on a now windows system, so to allow the dcmtk/osconfig.h to include the correct header on unix vs widows. 2009-06-26 16:52:27 +00:00
Robert Osfield
063bc6e513 Added search in /usr/local/dicom for dcmtk. 2009-06-26 16:39:44 +00:00
Robert Osfield
85456b1ac1 Fixed warning 2009-06-26 08:16:03 +00:00
Robert Osfield
a58ea5c87c Fixed warning 2009-06-26 08:14:09 +00:00
Robert Osfield
214e1b81ed Simplified throw rate code, and add throw rate compensation into zoom in/out code. 2009-06-25 18:31:43 +00:00
Robert Osfield
b1a99ba25f From Lee Bulter, "I noticed that when "throwing" things the rate of motion once thrown was
dependent on the complexity of the geometry. For complex scenes this
meant that it looked like you were "throwing" the display into molasses.
For simple geometry things get over-excited once thrown.

The fix is to factor in the frame rendering time to the caluclated
motion. I've implemented this for rotation and panning.

Now when things are thrown they maintain a rate very close to what was
happening when the mouse button was released."
2009-06-25 18:11:29 +00:00
Robert Osfield
44a8e850f4 Fixed library definition 2009-06-25 18:03:30 +00:00
Robert Osfield
3a65636893 From Stephan Huber, fixes to Cocoa support 2009-06-25 16:12:58 +00:00
Robert Osfield
06abd75198 From Mathias Froehlich, "We are currently getting issues with locale settings and some osg plugins.
Therefore I have changed all the occurances of atof by asciiToFloat or
asciiToDouble.

I believe that it is safe to do so at least for all the plugins.
Included here are also asciiToFloat conversion of environment variables. One
might argue that these should be locale dependent. But IMO these should be
set and interpreted by osg independent of the current locale.
"
2009-06-25 16:07:49 +00:00
Robert Osfield
d167142a59 Fixed warnings and refactored FindFFmpeg.cmake and ffmpeg plugin CMakeLists.txt scripts to better handle different instation combinations 2009-06-25 16:02:23 +00:00