Re: [osg-users] osgQt + OSG 3.6.2 Status

2018-07-26 Thread Stuart Mentzer
Hi Andrew,

I had no luck despite trying many variations. I had to put this work aside for 
a while with the plan to circle back and check for osgQt updates now and then. 
But if someone adds some ideas here I'll try them.


To be honest I'm experimenting with Qt3D (feels a little dirty ;-). I know I 
won't get OSG performance out of it but the reduced Qt integration, Qt5, 
multithreading, and packaging hassles might make this a viable alternative 
soon. Qt3D has its own headaches, of course, and is still fairly immature. 
Maybe I can join a support group for OSG users with a wandering eye.


Cheers,
Stuart

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74396#74396





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgQt + OSG 3.6.2 Status

2018-07-26 Thread Andrew Cunningham
Hi Stuart,
If you resolve this please let us know. As a data point , I had a lot of 
trouble with OSG 3.4.1 and QT 5.7 and the "black" window problem. I only 
resolved it with some experimentation and I am still not sure why it worked. 

Andrew

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74395#74395





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [Crash issue] How to add drawable (geometry) property.

2018-07-26 Thread Jinh Tang
Hi Robert,
thanks a lot!  I tried single thread, but it can meet project requirement, 
as we may have 500+ meshes need to update. each mesh has 12000+ points. the 
main GUI thread will be blocked for 10+ seconds
   besides, I already set the viewer to use SingleThreaded. paste my code of 
initialization below:

 graphics_window_ = (new osgViewer::GraphicsWindowEmbedded(x, y, width, height) 
);
viewer_ = new osgViewer::Viewer;
scale_ = QApplication::desktop()->devicePixelRatio();
root_ = new osg::Group;

mouse_trans_ = new osg::PositionAttitudeTransform;
root_->addChild(mouse_trans_);

// init camera
camera_ = new osg::Camera();
//camera_ = viewer_->getCamera();
camera_->setClearMask(GL_DEPTH_BUFFER_BIT);
camera_->setClearMask(GL_COLOR_BUFFER_BIT);
camera_->setViewport(x, y, width, height);
camera_->setClearColor( osg::Vec4( 0.91f, 0.91f, 0.91f, 1.f ) );
float aspectRatio = static_cast(width) / static_cast(height);
camera_->setProjectionMatrixAsOrtho(-DEFAULT_ORTHO_RANGE * aspectRatio, 
DEFAULT_ORTHO_RANGE * aspectRatio, -DEFAULT_ORTHO_RANGE, DEFAULT_ORTHO_RANGE, 
-500.0, 500.0);
camera_->setGraphicsContext( graphics_window_ );

viewer_->setCamera(camera_);

camera_->addChild(root_);
viewer_->setSceneData(root_);

camera_manipulator_ = new MeshCameraManipulator(camera_, osg::Vec3(0, 0, 
100), osg::Vec3(0, 0, 0), osg::Vec3(0, 1, 0), mouse_trans_);
camera_manipulator_->Setup(this);
camera_manipulator_->SetWindowSize(width, height);
viewer_->setCameraManipulator(camera_manipulator_);
viewer_->setThreadingModel(osgViewer::Viewer::SingleThreaded);

viewer_->realize();

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74394#74394





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [Crash issue] How to add drawable (geometry) property.

2018-07-26 Thread Robert Osfield
Hi Jinh,

First thing I would try is to run your application single threaded.
If this fixes the crash then it would indicate a threading issue with
how you are going about adding/remove elements of the scene graph.

You don't describe any of details of what threads are doing what so I
can't speculate any further as to what you might be doing wrong.  As a
general guide, the OSG is designed for the main scene graph to be
updated only in the update and event phases/traversals where the scene
graph itself is being traversed single threaded.

Robert.
On Thu, 26 Jul 2018 at 14:14, Jinh Tang  wrote:
>
> Hi,
> I am doing them real-time rendering application development with Qt + OSG.
> I created several threads to create new Geometry and in GUI - main threads, 
> try to remove the old one and add new ones.
>
> 1, already set node and geometry to user dynamic.
>  geometry->setDataVariance(osg::Object::DYNAMIC)
>  geode_->setDataVariance(osg::Object::DYNAMIC);
> 2,  already used osg smart point everywhere.
> 3,  geometry is created in other threads. and post to a global queue.
> 4, in Main thread. PaintGL event will add geometry in "autoAddRemove" 
> function.
> void OSGMeshRender::paintGL() {
> autoAddRemove();
> viewer_->frame();
>}
> 5,  the setup work for qt+osg is almost same like this blog, nothing speical.
>   vicrucann.github.io/tutorials/cmake-qt-osg-1/
>
>
> I got below crash sometimes when I add drawable.
>
> 082`873ba218 : nvoglv64+0x927b51
> 0075`2b19bf61 : osg156_osgrd!osg::GLBufferObject::deleteGLObject+0x69 
> [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\bufferobject.cpp @ 
> 253]
> 0075`2b19bf61 : 
> osg156_osgrd!osg::GLBufferObjectSet::flushDeletedGLBufferObjects+0x25e 
> [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\bufferobject.cpp @ 
> 554]
> 018c`3829dc50 : 
> osg156_osgrd!osg::GLBufferObjectManager::flushDeletedGLObjects+0x7e 
> [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\bufferobject.cpp @ 
> 984]
> *** WARNING: Unable to verify checksum for osg156-osgUtilrd.dll
> 018c`2e070d90 : osg156_osgrd!osg::ContextData::flushDeletedGLObjects+0x65 
> [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\contextdata.cpp @ 
> 88]
> *** WARNING: Unable to verify checksum for osg156-osgViewerrd.dll
> 018c`37fcbb60 : osg156_osgUtilrd!osgUtil::SceneView::draw+0xdb 
> [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osgutil\sceneview.cpp 
> @ 987]
> 018d`01da2350 : osg156_osgViewerrd!osgViewer::Renderer::cull_draw+0x309 
> [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osgviewer\renderer.cpp 
> @ 887]
> ` : osg156_osgrd!osg::GraphicsContext::runOperations+0x99 
> [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\graphicscontext.cpp
>  @ 696]
> `03f9 : 
> osg156_osgViewerrd!osgViewer::ViewerBase::renderingTraversals+0xc2d 
> [c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osgviewer\viewerbase.cpp
>  @ 8
> `03f9 :
> osg156_osgViewerrd!osgViewer::ViewerBase::frame
>
> attached windbg callstack.
>
>
> any suggestion? fully appreciate!!!
> ...
>
> Thank you!
>
> Cheers,
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=74388#74388
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgSim::MultiSwitch Serialization

2018-07-26 Thread Robert Osfield
HI David,

I'm don't have time to look at the code right now so will just provide
some general hints.  The serailizers have SO version built into them
so you can add or remove components of the serializer based on the SO
version of the OSG.  There are number of places in the OSG serailizers
that you can look at for inspiration, for instance
src/osgWrappers/serializers/Node.cpp has:

ADD_USER_SERIALIZER( Descriptions );  // _descriptions, deprecated
{
UPDATE_TO_VERSION_SCOPED( 77 )
REMOVE_SERIALIZER( Descriptions );
}

Have a search through the serializers to see the
UPDATE_TO_VERSION_SCOPED used in various ways.

Robert.


On Thu, 26 Jul 2018 at 13:57, David Stephan  wrote:
>
> osgSim::MultiSwitch and flt files support named switches, but the names 
> aren't saved. It seems like an easy fix, though I'm not sure how to mess with 
> the serializer in a backwards compatible way.
>
> relevant files:
> src/osgSim/MultiSwitch.cpp
> src/osgWrappers/serializers/osgSim/MultiSwitch.cpp
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=74385#74385
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Volume rendering issues...

2018-07-26 Thread Robert Osfield
Hi Tom.

My best guess would be that the ITK image data is being deleted prior
to the graphics thread gets a chance copy the data into OpenGL.  Try
either copying the data into the osg::Image and let osg::Image then
manage the lifetime of it's own data, or prevent the ITK image data
from getting deleted prior to the osg::Texture3D being used in the
graphics thread - for instance keeping the ITK image object around for
the lifetime of the app, or perhaps more elegantly assigning the ITK
image data via a adapter class that you write to assign it to the
osg:Image as user data.

Robert.
On Thu, 26 Jul 2018 at 14:04, Tom Williamson  wrote:
>
> Hi gang,
>
> Thanks for all the work on OSG, is rad. I'm currently having a problem with 
> the rendering of a volume, here's what I'm trying to do:
> - I'm using ITK to read a NIFTI file, (segmentation of a bone). The file 
> contains zeros (background) and ones (object), format is unsigned short.
> - I am then normalizing/scaling this and converting it to an osg::Image.
> - I am then attempting to convert this to an osgVolume and display an 
> iso-surface, or at this stage any kind of volume rendering.
> - All the reading, conversion etc. seems to work okay, but I'm getting a read 
> access violation on line 408 of Texture3d.cpp (specifically:Exception thrown 
> at 0x7FFE64D576B0 (ig9icd64.dll) in RobotSimulation.exe: 0xC005: 
> Access violation reading location 0x02F5732EE070.)
>
> I'm pretty sure I'm just forgetting something very obvious, but if anyone 
> could point out what it is that I'm doing wrong that would be much 
> appreciated. I've put a cut down example of the code below (pretty rough).
> I know that the data is definitely in the osg::image object (wrote it to 
> file, calculated min and max), so I don't necessarily think the conversion is 
> the problem (though could very well be wrong). I'm on a Windows 10 laptop, 
> with a built in Intel graphics card (Intel HD Graphics 620, drivers are up to 
> date), opengl is version 4.5.
> Thanks very much for the help, let me know if you need any other info. Cheers,
> Tom
>
> PS: I'm happy to provide some example data if needed, but I guess this would 
> be more or less the same for any data loaded through ITK and converted to OSG.
> PPS: I've left the code as normal text, it looked somewhat unreadable in the 
> preview, so sorry about that.
>
> [code]
> osg::ref_ptr getOsgVolume(std::string filename)
> {
> osg::ref_ptr osgImage = new osg::Image();
> itk::NiftiImageIOFactory::RegisterOneFactory();
> itk::ImageIOBase::Pointer imageIO = 
> itk::ImageIOFactory::CreateImageIO(filename.c_str(), 
> itk::ImageIOFactory::ReadMode);
> imageIO->SetFileName(filename);
> imageIO->ReadImageInformation();
> osg::ref_ptr volume = new osgVolume::Volume;
>
> std::cout << "numDimensions: " << imageIO->GetNumberOfDimensions() << 
> std::endl;
> std::cout << "component type: " << 
> imageIO->GetComponentTypeAsString(imageIO->GetComponentType()) << std::endl;
> std::cout << "pixel type: " << 
> imageIO->GetPixelTypeAsString(imageIO->GetPixelType()) << std::endl;
>
> if (imageIO->GetNumberOfDimensions() == 3) {
> typedef itk::Image  imType;
> typedef itk::ImageFileReader imTypeReader;
>
> imTypeReader::Pointer imageReader = imTypeReader::New();
> imageReader->SetFileName(imageIO->GetFileName());
> imageReader->Update();
>
> imType::RegionType region;
> imType::IndexType start;
> imType::SizeType size;
>
> for (int i = 0; i < imageIO->GetNumberOfDimensions(); ++i) {
> start[i] = 0;
> size[i] = imageIO->GetDimensions(i);
> }
>
> region.SetSize(size);
> region.SetIndex(start);
> typedef itk::MultiplyImageFilter< imType> miType;
> miType::Pointer mif = miType::New();
> mif->SetInput(imageReader->GetOutput());
> mif->SetConstant(pow(2, 16) - 1);
> mif->Update();
> imType::Pointer itkImage = mif->GetOutput();
> region = itkImage->GetBufferedRegion();
> size = region.GetSize();
> start = region.GetIndex();
>
> unsigned int width = size[0];
> unsigned int height = size[1];
> unsigned int depth = size[2];
>
> osg::RefMatrix* matrix = new osg::RefMatrix;
>
> std::cout << "width = " << width << " height = " << height << 
> " depth = " << depth << std::endl;
> for (unsigned int i = 0; i<3; ++i)
> {
> (*matrix)(i, i) = itkImage->GetSpacing()[i];
> }
>
> osgImage->setImage(width, height, depth, GL_LUMINANCE16, 
> 

[osg-users] [Crash issue] How to add drawable (geometry) property.

2018-07-26 Thread Jinh Tang
Hi,
I am doing them real-time rendering application development with Qt + OSG.
I created several threads to create new Geometry and in GUI - main threads, try 
to remove the old one and add new ones. 

1, already set node and geometry to user dynamic.
 geometry->setDataVariance(osg::Object::DYNAMIC)
 geode_->setDataVariance(osg::Object::DYNAMIC);
2,  already used osg smart point everywhere.
3,  geometry is created in other threads. and post to a global queue.
4, in Main thread. PaintGL event will add geometry in "autoAddRemove" 
function.
void OSGMeshRender::paintGL() {
autoAddRemove();
viewer_->frame();
   }
5,  the setup work for qt+osg is almost same like this blog, nothing speical. 
  vicrucann.github.io/tutorials/cmake-qt-osg-1/


I got below crash sometimes when I add drawable. 

082`873ba218 : nvoglv64+0x927b51
0075`2b19bf61 : osg156_osgrd!osg::GLBufferObject::deleteGLObject+0x69 
[c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\bufferobject.cpp @ 
253] 
0075`2b19bf61 : 
osg156_osgrd!osg::GLBufferObjectSet::flushDeletedGLBufferObjects+0x25e 
[c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\bufferobject.cpp @ 
554] 
018c`3829dc50 : 
osg156_osgrd!osg::GLBufferObjectManager::flushDeletedGLObjects+0x7e 
[c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\bufferobject.cpp @ 
984] 
*** WARNING: Unable to verify checksum for osg156-osgUtilrd.dll
018c`2e070d90 : osg156_osgrd!osg::ContextData::flushDeletedGLObjects+0x65 
[c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\contextdata.cpp @ 
88] 
*** WARNING: Unable to verify checksum for osg156-osgViewerrd.dll
018c`37fcbb60 : osg156_osgUtilrd!osgUtil::SceneView::draw+0xdb 
[c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osgutil\sceneview.cpp @ 
987] 
018d`01da2350 : osg156_osgViewerrd!osgViewer::Renderer::cull_draw+0x309 
[c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osgviewer\renderer.cpp @ 
887] 
` : osg156_osgrd!osg::GraphicsContext::runOperations+0x99 
[c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osg\graphicscontext.cpp 
@ 696] 
`03f9 : 
osg156_osgViewerrd!osgViewer::ViewerBase::renderingTraversals+0xc2d 
[c:\users\code\openscenegraph-openscenegraph-3.6.0\src\osgviewer\viewerbase.cpp 
@ 8
`03f9 : 
osg156_osgViewerrd!osgViewer::ViewerBase::frame

attached windbg callstack.


any suggestion? fully appreciate!!!
... 

Thank you!

Cheers,

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74388#74388





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Volume rendering issues...

2018-07-26 Thread Tom Williamson
Hi gang,

Thanks for all the work on OSG, is rad. I'm currently having a problem with the 
rendering of a volume, here's what I'm trying to do:
- I'm using ITK to read a NIFTI file, (segmentation of a bone). The file 
contains zeros (background) and ones (object), format is unsigned short. 
- I am then normalizing/scaling this and converting it to an osg::Image.
- I am then attempting to convert this to an osgVolume and display an 
iso-surface, or at this stage any kind of volume rendering.
- All the reading, conversion etc. seems to work okay, but I'm getting a read 
access violation on line 408 of Texture3d.cpp (specifically:Exception thrown at 
0x7FFE64D576B0 (ig9icd64.dll) in RobotSimulation.exe: 0xC005: Access 
violation reading location 0x02F5732EE070.)

I'm pretty sure I'm just forgetting something very obvious, but if anyone could 
point out what it is that I'm doing wrong that would be much appreciated. I've 
put a cut down example of the code below (pretty rough).
I know that the data is definitely in the osg::image object (wrote it to file, 
calculated min and max), so I don't necessarily think the conversion is the 
problem (though could very well be wrong). I'm on a Windows 10 laptop, with a 
built in Intel graphics card (Intel HD Graphics 620, drivers are up to date), 
opengl is version 4.5.
Thanks very much for the help, let me know if you need any other info. Cheers,
Tom

PS: I'm happy to provide some example data if needed, but I guess this would be 
more or less the same for any data loaded through ITK and converted to OSG.
PPS: I've left the code as normal text, it looked somewhat unreadable in the 
preview, so sorry about that.

[code]
osg::ref_ptr getOsgVolume(std::string filename)
{
osg::ref_ptr osgImage = new osg::Image();
itk::NiftiImageIOFactory::RegisterOneFactory();
itk::ImageIOBase::Pointer imageIO = 
itk::ImageIOFactory::CreateImageIO(filename.c_str(), 
itk::ImageIOFactory::ReadMode);
imageIO->SetFileName(filename);
imageIO->ReadImageInformation();
osg::ref_ptr volume = new osgVolume::Volume;

std::cout << "numDimensions: " << imageIO->GetNumberOfDimensions() << 
std::endl;
std::cout << "component type: " << 
imageIO->GetComponentTypeAsString(imageIO->GetComponentType()) << std::endl;
std::cout << "pixel type: " << 
imageIO->GetPixelTypeAsString(imageIO->GetPixelType()) << std::endl;

if (imageIO->GetNumberOfDimensions() == 3) {
typedef itk::Image  imType;
typedef itk::ImageFileReader imTypeReader;

imTypeReader::Pointer imageReader = imTypeReader::New();
imageReader->SetFileName(imageIO->GetFileName());
imageReader->Update();

imType::RegionType region;
imType::IndexType start;
imType::SizeType size;

for (int i = 0; i < imageIO->GetNumberOfDimensions(); ++i) {
start[i] = 0;
size[i] = imageIO->GetDimensions(i);
}

region.SetSize(size);
region.SetIndex(start);
typedef itk::MultiplyImageFilter< imType> miType;
miType::Pointer mif = miType::New();
mif->SetInput(imageReader->GetOutput());
mif->SetConstant(pow(2, 16) - 1);
mif->Update();
imType::Pointer itkImage = mif->GetOutput();
region = itkImage->GetBufferedRegion();
size = region.GetSize();
start = region.GetIndex();

unsigned int width = size[0];
unsigned int height = size[1];
unsigned int depth = size[2];

osg::RefMatrix* matrix = new osg::RefMatrix;

std::cout << "width = " << width << " height = " << height << " 
depth = " << depth << std::endl;
for (unsigned int i = 0; i<3; ++i)
{
(*matrix)(i, i) = itkImage->GetSpacing()[i];
}

osgImage->setImage(width, height, depth, GL_LUMINANCE16, 
GL_LUMINANCE, GL_UNSIGNED_SHORT, (BYTE*)itkImage->GetBufferPointer(), 
osg::Image::NO_DELETE, 1, width);

// Setup the transfer function
osg::ref_ptr transferFunction = new 
osg::TransferFunction1D;
transferFunction->setColor(0.0, osg::Vec4(1.0, 0.0, 0.0, 0.0));
transferFunction->setColor(0.5, osg::Vec4(1.0, 1.0, 0.0, 0.5));
transferFunction->setColor(1.0, osg::Vec4(0.0, 0.0, 1.0, 1.0));

// Setup the volume
osgVolume::ImageDetails* details = new osgVolume::ImageDetails;
details->setMatrix(matrix);
osgImage->setUserData(details);
matrix->preMult(osg::Matrix::scale(double(osgImage->s()), 
double(osgImage->t()), double(osgImage->r(;

[osg-users] osgSim::MultiSwitch Serialization

2018-07-26 Thread David Stephan
osgSim::MultiSwitch and flt files support named switches, but the names aren't 
saved. It seems like an easy fix, though I'm not sure how to mess with the 
serializer in a backwards compatible way.

relevant files:
src/osgSim/MultiSwitch.cpp
src/osgWrappers/serializers/osgSim/MultiSwitch.cpp

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74385#74385





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] maximizing qt widgets with maximumsize

2018-07-26 Thread Sebastian Schmidt
After creation of a GLWidget/QWidget i call setMaximumSize() with a resolution 
less than fullscreen.
When i click on the maximize button of the window bar my window is resized to 
maximum size but in frameless mode.

Dont know if this is a osg related bug, but i think in qt the maximize event is 
ignored.


OSG Version: 3.4.1
OS: OpenSuse Leap 42.1

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74390#74390





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] RayIntersector with KdTree causes a crash

2018-07-26 Thread Robert Osfield
Hi Ale,

The KdTree was refactored in 3.6.x to add support for points and lines
and PolytopeIntersector.  While there has been lots of internal
changes in it, it of course shouldn't crash.

At this point in time I don't have any idea where the issue stems
from.  Could you create a small example that reproduces the crash, I
or others can then step through what is happening and work out a fix.

Given this regression it looks like we'll have to make a 3.6.3 sooner
rather than later, but not before we fix the crash...

Cheers,
Robert.
On Thu, 26 Jul 2018 at 10:39, Ale Maro  wrote:
>
> Hi,
>
> we have a problem with OSG 3.6.2 and Visual Studio 2017
>
> We have a pick functionality in our software that uses RayIntersector.
> We enabled KdTrees for this use.
>
> When we apply the intersector to an object with a negative scale in the 
> MatrixTransform parent node (e.g. scale = (-1, 1, 1)), it crashes inside the 
> KdTree code.
>
> If we disable kdtree everything works fine.
> It also works with Visual Studio 2013 and OSG 3.4.0.
>
> Here is the call stack when crashed:
>
>
> >
> > > osg157-osgUtild.dll!std::vector > > int,std::allocator >::operator[](const unsigned __int64 
> > > _Pos) Line 1818 C++
> >
> > osg157-osgUtild.dll!osg::KdTree::intersect
> >  > 
> > >(osg::TemplatePrimitiveFunctor
> >  > & functor, const osg::KdTree::KdNode & node) Line 160  C++
> >
> > osg157-osgUtild.dll!osg::KdTree::intersect
> >  > 
> > >(osg::TemplatePrimitiveFunctor
> >  > & functor, const osg::KdTree::KdNode & node) Line 176  C++
> >
> > osg157-osgUtild.dll!osg::KdTree::intersect
> >  > 
> > >(osg::TemplatePrimitiveFunctor
> >  > & functor, const osg::KdTree::KdNode & node) Line 176  C++
> >
> > osg157-osgUtild.dll!osgUtil::LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor
> >  & iv, osg::Drawable * drawable, const osg::Vec3d & s, const osg::Vec3d & 
> > e) Line 540 C++
> >
> > osg157-osgUtild.dll!osgUtil::RayIntersector::intersect(osgUtil::IntersectionVisitor
> >  & iv, osg::Drawable * drawable) Line 122  C++
> >
> > osg157-osgUtild.dll!osgUtil::IntersectionVisitor::intersect(osg::Drawable * 
> > drawable) Line 282   C++
> >
> > osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Geode & geode) 
> > Line 240 C++
> >osg157-osgd.dll!osg::Geode::accept(osg::NodeVisitor & nv) 
> > Line 37 C++
> >osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> > Line 63  C++
> >
> > osg157-osgFXd.dll!osgFX::Effect::inherited_traverse(osg::NodeVisitor & nv) 
> > Line 213  C++
> >osg157-osgFXd.dll!osgFX::Effect::traverse(osg::NodeVisitor & 
> > nv) Line 51  C++
> >osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> > Line 278C++
> >
> > osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) 
> > Line 221   C++
> >osg157-osgFXd.dll!osgFX::Outline::accept(osg::NodeVisitor & 
> > nv) Line 54  C++
> >osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> > Line 63  C++
> >osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> > Line 278C++
> >
> > osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Transform & 
> > transform) Line 417  C++
> >osg157-osgd.dll!osg::NodeVisitor::apply(osg::MatrixTransform 
> > & node) Line 158  C++
> >
> > osg157-osgd.dll!osg::MatrixTransform::accept(osg::NodeVisitor & nv) Line 37 
> >C++
> >osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> > Line 63  C++
> >osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> > Line 278C++
> >
> > osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) 
> > Line 221   C++
> >osg157-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv) 
> > Line 38  C++
> >osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> > Line 63  C++
> >osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> > Line 278C++
> >
> > osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Transform & 
> > transform) Line 417  C++
> >osg157-osgd.dll!osg::NodeVisitor::apply(osg::MatrixTransform 
> > & node) Line 158  C++
> >
> > osg157-osgd.dll!osg::MatrixTransform::accept(osg::NodeVisitor & nv) Line 37 
> >C++
> >osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> > Line 63  C++
> >osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> > Line 278   

[osg-users] RayIntersector with KdTree causes a crash

2018-07-26 Thread Ale Maro
Hi,

we have a problem with OSG 3.6.2 and Visual Studio 2017

We have a pick functionality in our software that uses RayIntersector.
We enabled KdTrees for this use.

When we apply the intersector to an object with a negative scale in the 
MatrixTransform parent node (e.g. scale = (-1, 1, 1)), it crashes inside the 
KdTree code.

If we disable kdtree everything works fine. 
It also works with Visual Studio 2013 and OSG 3.4.0. 

Here is the call stack when crashed:


> 
> > osg157-osgUtild.dll!std::vector > int,std::allocator >::operator[](const unsigned __int64 _Pos) 
> > Line 1818 C++
>
> osg157-osgUtild.dll!osg::KdTree::intersect
>  > 
> >(osg::TemplatePrimitiveFunctor
>  > & functor, const osg::KdTree::KdNode & node) Line 160  C++
>
> osg157-osgUtild.dll!osg::KdTree::intersect
>  > 
> >(osg::TemplatePrimitiveFunctor
>  > & functor, const osg::KdTree::KdNode & node) Line 176  C++
>
> osg157-osgUtild.dll!osg::KdTree::intersect
>  > 
> >(osg::TemplatePrimitiveFunctor
>  > & functor, const osg::KdTree::KdNode & node) Line 176  C++
>
> osg157-osgUtild.dll!osgUtil::LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor
>  & iv, osg::Drawable * drawable, const osg::Vec3d & s, const osg::Vec3d & e) 
> Line 540 C++
>
> osg157-osgUtild.dll!osgUtil::RayIntersector::intersect(osgUtil::IntersectionVisitor
>  & iv, osg::Drawable * drawable) Line 122  C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::intersect(osg::Drawable * 
> drawable) Line 282   C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Geode & geode) 
> Line 240 C++
>osg157-osgd.dll!osg::Geode::accept(osg::NodeVisitor & nv) Line 
> 37 C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>
> osg157-osgFXd.dll!osgFX::Effect::inherited_traverse(osg::NodeVisitor & nv) 
> Line 213  C++
>osg157-osgFXd.dll!osgFX::Effect::traverse(osg::NodeVisitor & 
> nv) Line 51  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) 
> Line 221   C++
>osg157-osgFXd.dll!osgFX::Outline::accept(osg::NodeVisitor & 
> nv) Line 54  C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Transform & 
> transform) Line 417  C++
>osg157-osgd.dll!osg::NodeVisitor::apply(osg::MatrixTransform & 
> node) Line 158  C++
>osg157-osgd.dll!osg::MatrixTransform::accept(osg::NodeVisitor 
> & nv) Line 37C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) 
> Line 221   C++
>osg157-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv) Line 
> 38  C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Transform & 
> transform) Line 417  C++
>osg157-osgd.dll!osg::NodeVisitor::apply(osg::MatrixTransform & 
> node) Line 158  C++
>osg157-osgd.dll!osg::MatrixTransform::accept(osg::NodeVisitor 
> & nv) Line 37C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) 
> Line 221   C++
>osg157-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv) Line 
> 38  C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>
> osg157-osgShadowd.dll!osgShadow::ShadowedScene::traverse(osg::NodeVisitor & 
> nv) Line 69  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) 
> Line 221   C++
>
> osg157-osgShadowd.dll!osgShadow::ShadowedScene::accept(osg::NodeVisitor & nv) 
> Line 36 C++
>  

[osg-users] RayIntersector with KdTree causes a crash

2018-07-26 Thread Ale Maro
Hi,

we have a problem with OSG 3.6.2 and Visual Studio 2017

We have a pick functionality in our software that uses RayIntersector.
We enabled KdTrees for this use.

When we apply the intersector to an object with a negative scale in the 
MatrixTransform parent node (e.g. scale = (-1, 1, 1)), it crashes inside the 
KdTree code.

If we disable kdtree everything works fine. 
It also works with Visual Studio 2013 and OSG 3.4.0. 

Here is the call stack when crashed:


> 
> > osg157-osgUtild.dll!std::vector > int,std::allocator >::operator[](const unsigned __int64 _Pos) 
> > Line 1818 C++
>
> osg157-osgUtild.dll!osg::KdTree::intersect
>  > 
> >(osg::TemplatePrimitiveFunctor
>  > & functor, const osg::KdTree::KdNode & node) Line 160  C++
>
> osg157-osgUtild.dll!osg::KdTree::intersect
>  > 
> >(osg::TemplatePrimitiveFunctor
>  > & functor, const osg::KdTree::KdNode & node) Line 176  C++
>
> osg157-osgUtild.dll!osg::KdTree::intersect
>  > 
> >(osg::TemplatePrimitiveFunctor
>  > & functor, const osg::KdTree::KdNode & node) Line 176  C++
>
> osg157-osgUtild.dll!osgUtil::LineSegmentIntersector::intersect(osgUtil::IntersectionVisitor
>  & iv, osg::Drawable * drawable, const osg::Vec3d & s, const osg::Vec3d & e) 
> Line 540 C++
>
> osg157-osgUtild.dll!osgUtil::RayIntersector::intersect(osgUtil::IntersectionVisitor
>  & iv, osg::Drawable * drawable) Line 122  C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::intersect(osg::Drawable * 
> drawable) Line 282   C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Geode & geode) 
> Line 240 C++
>osg157-osgd.dll!osg::Geode::accept(osg::NodeVisitor & nv) Line 
> 37 C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>
> osg157-osgFXd.dll!osgFX::Effect::inherited_traverse(osg::NodeVisitor & nv) 
> Line 213  C++
>osg157-osgFXd.dll!osgFX::Effect::traverse(osg::NodeVisitor & 
> nv) Line 51  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) 
> Line 221   C++
>osg157-osgFXd.dll!osgFX::Outline::accept(osg::NodeVisitor & 
> nv) Line 54  C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Transform & 
> transform) Line 417  C++
>osg157-osgd.dll!osg::NodeVisitor::apply(osg::MatrixTransform & 
> node) Line 158  C++
>osg157-osgd.dll!osg::MatrixTransform::accept(osg::NodeVisitor 
> & nv) Line 37C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) 
> Line 221   C++
>osg157-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv) Line 
> 38  C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Transform & 
> transform) Line 417  C++
>osg157-osgd.dll!osg::NodeVisitor::apply(osg::MatrixTransform & 
> node) Line 158  C++
>osg157-osgd.dll!osg::MatrixTransform::accept(osg::NodeVisitor 
> & nv) Line 37C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) 
> Line 221   C++
>osg157-osgd.dll!osg::Group::accept(osg::NodeVisitor & nv) Line 
> 38  C++
>osg157-osgd.dll!osg::Group::traverse(osg::NodeVisitor & nv) 
> Line 63  C++
>
> osg157-osgShadowd.dll!osgShadow::ShadowedScene::traverse(osg::NodeVisitor & 
> nv) Line 69  C++
>osg157-osgd.dll!osg::NodeVisitor::traverse(osg::Node & node) 
> Line 278C++
>
> osg157-osgUtild.dll!osgUtil::IntersectionVisitor::apply(osg::Group & group) 
> Line 221   C++
>
> osg157-osgShadowd.dll!osgShadow::ShadowedScene::accept(osg::NodeVisitor & nv) 
> Line 36 C++
>