Re: [osg-users] Android osgViewer input scaling in 3.3.1
Thanks for that solution, that does make sense. I will be using my method of setting the EventQueue of the window as that requires no changes to my picker and I can keep my code base between desktop and Android the same apart for the viewer code. I suggest that for the examples we add the Code: viewer-getEventQueue()-setMouseInputRange(x, y, x + width, y + height); line to make the examples usable again. Martin Siggel wrote: We also had that problem with the picker. We fixed that, by reimplementing the picking like this: // map pixel coordinates to [-1,1] (OpenGL Screen Coordinates) float xwindow = x/screenWidth * 2. - 1; float ywindow = -y/screenHeight * 2. + 1; osg::Camera* cam = viewer-getCamera(); osg::Matrixd m; m.preMult(cam-getProjectionMatrix()); m.preMult(cam-getViewMatrix()); // define intersection ray osg::Vec3d startPoint (xwindow, ywindow, -1000); osg::Vec3d endPoint(xwindow, ywindow, 1000); osg::Matrixd i; i.invert(m); osg::Vec3d wStart = startPoint * i; osg::Vec3d wEnd = endPoint * i; osg::ref_ptrosgUtil::LineSegmentIntersector picker = new osgUtil::LineSegmentIntersector(wStart, wEnd); 2014-05-05 13:43 GMT+02:00 Wouter Roos (): Martin Siggel wrote: You can also workaround this (instead of using the eventqueue) by telling OSG about the input range of your mouse after setting up your viewer: viewer-getEventQueue()-setMouseInputRange(x, y, x + width, y + height); Cheers, Martin Thanks for that method, that looks much better, and works for the android examples just as well. However it does not work when I use a picker, it still returns no intersections whereas using the Window's EventQueue does give me the correct results. Any ideas on why this might be? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59259#59259 (http://forum.openscenegraph.org/viewtopic.php?p=59259#59259) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Post generated by Mail2Forum [/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59270#59270 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenThreads, scheduling, etc ... policies
HI Nick, On 5 May 2014 20:07, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Curtis implemented the same code with pthreads (attached) which seam to work, so it is definitely a bug in OpenThreads (for linux only, Windows implementation seam to be working). Just FYI I am currently focused on some other complex work and don't really have spare brain capacity to add another item right now. Threading affinity used to work under Linux when OpenThreads was created, I guess something must have changed in the pthread implementation that has changed how things need to be managed or perhaps a regression has happened on the OSG side. As I don't have the capacity right now could others investigate further? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Running example code to calculate terrain height
Hi, Hi, I found a sample code in osg site which explains how to use / calculate terrain height. When I used the code and complied, I get too many errors. The code is from the site mentioned below : http://trac.openscenegraph.org/projects/osg//wiki/Support/Tutorials/Intersections A few errors are For the code line shrubQuad-addPrimitiveSet(new osg::DrawArrays osg::PrimitiveSet:: QUADS,0,4); The error is : syntax error : missing ')' before 'QUADS' For the code line osgProducer::Viewer viewer; Error : osgProducer' : is not a class or namespace name From the forum I found that osgProducer has been replaced with osgViewer. Is it just enough if I replace viewer in the code ? I request some help. I am using OSG 2.8 version Cheers, Srikanth -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59275#59275 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Running example code to calculate terrain height
Hi, if the sample code is using osgProducer I think it is very out of date - osgProducer is depricated for years and was replaced by osgViewer. There is an example of picking, osgpick I think is the example in the current trunk, where you will find current use of intersection classes and methods - have a look Nick On Tue, May 6, 2014 at 12:21 PM, Srikanth K P srika...@nal.res.in wrote: Hi, Hi, I found a sample code in osg site which explains how to use / calculate terrain height. When I used the code and complied, I get too many errors. The code is from the site mentioned below : http://trac.openscenegraph.org/projects/osg//wiki/Support/Tutorials/Intersections A few errors are For the code line shrubQuad-addPrimitiveSet(new osg::DrawArrays osg::PrimitiveSet:: QUADS,0,4); The error is : syntax error : missing ')' before 'QUADS' For the code line osgProducer::Viewer viewer; Error : osgProducer' : is not a class or namespace name From the forum I found that osgProducer has been replaced with osgViewer. Is it just enough if I replace viewer in the code ? I request some help. I am using OSG 2.8 version Cheers, Srikanth -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59275#59275 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] BUG: osgGA::GUIEventAdapter returns wrong mouse ranges on android
Dear OSG users, the methods GUIEventAdapter.getXmin, GUIEventAdapter.getXmax, GUIEventAdapter.getYmin, GUIEventAdapter.getYmax ... always return mouse input ranges of -1...1 instead of e.g. 0...1280, 0...800. Because of this bug, the standard picking handler is not working. The viewer is created by calling viewer-setUpViewerAsEmbeddedInWindow as done in the android demo. This also happens, even if eventQueue-setMouseInputRange is called with the appropriate screen dimensions. Is there another way to tell the eventqueue, what the input ranges are? Cheers, Martin ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Running example code to calculate terrain height
The first error line appears to be that the code is simply not correct, you are missing a (. It should be: shrubQuad-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet:: QUADS,0,4)); As for the other error, Nick covered that. From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Trajce Nikolov NICK Sent: Tuesday, May 06, 2014 6:23 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Running example code to calculate terrain height Hi, if the sample code is using osgProducer I think it is very out of date - osgProducer is depricated for years and was replaced by osgViewer. There is an example of picking, osgpick I think is the example in the current trunk, where you will find current use of intersection classes and methods - have a look Nick On Tue, May 6, 2014 at 12:21 PM, Srikanth K P srika...@nal.res.inmailto:srika...@nal.res.in wrote: Hi, Hi, I found a sample code in osg site which explains how to use / calculate terrain height. When I used the code and complied, I get too many errors. The code is from the site mentioned below : http://trac.openscenegraph.org/projects/osg//wiki/Support/Tutorials/Intersectionshttp://trac.openscenegraph.org/projects/osg/wiki/Support/Tutorials/Intersections A few errors are For the code line shrubQuad-addPrimitiveSet(new osg::DrawArrays osg::PrimitiveSet:: QUADS,0,4); The error is : syntax error : missing ')' before 'QUADS' For the code line osgProducer::Viewer viewer; Error : osgProducer' : is not a class or namespace name From the forum I found that osgProducer has been replaced with osgViewer. Is it just enough if I replace viewer in the code ? I request some help. I am using OSG 2.8 version Cheers, Srikanth -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59275#59275 ___ osg-users mailing list osg-users@lists.openscenegraph.orgmailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android osgViewer input scaling in 3.3.1
Hi wouter, I tried your code, but standard picking didn't work because the mouse input ranges of the event are wrong. How did you do the picking? Cheers, Martin Am 06.05.2014 08:55 schrieb Wouter Roos rooswou...@gmail.com: Thanks for that solution, that does make sense. I will be using my method of setting the EventQueue of the window as that requires no changes to my picker and I can keep my code base between desktop and Android the same apart for the viewer code. I suggest that for the examples we add the Code: viewer-getEventQueue()-setMouseInputRange(x, y, x + width, y + height); line to make the examples usable again. Martin Siggel wrote: We also had that problem with the picker. We fixed that, by reimplementing the picking like this: // map pixel coordinates to [-1,1] (OpenGL Screen Coordinates) float xwindow = x/screenWidth * 2. - 1; float ywindow = -y/screenHeight * 2. + 1; osg::Camera* cam = viewer-getCamera(); osg::Matrixd m; m.preMult(cam-getProjectionMatrix()); m.preMult(cam-getViewMatrix()); // define intersection ray osg::Vec3d startPoint (xwindow, ywindow, -1000); osg::Vec3d endPoint(xwindow, ywindow, 1000); osg::Matrixd i; i.invert(m); osg::Vec3d wStart = startPoint * i; osg::Vec3d wEnd = endPoint * i; osg::ref_ptrosgUtil::LineSegmentIntersector picker = new osgUtil::LineSegmentIntersector(wStart, wEnd); 2014-05-05 13:43 GMT+02:00 Wouter Roos (): Martin Siggel wrote: You can also workaround this (instead of using the eventqueue) by telling OSG about the input range of your mouse after setting up your viewer: viewer-getEventQueue()-setMouseInputRange(x, y, x + width, y + height); Cheers, Martin Thanks for that method, that looks much better, and works for the android examples just as well. However it does not work when I use a picker, it still returns no intersections whereas using the Window's EventQueue does give me the correct results. Any ideas on why this might be? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59259#59259 ( http://forum.openscenegraph.org/viewtopic.php?p=59259#59259) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org( http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Post generated by Mail2Forum [/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59270#59270 ___ 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] Android osgViewer input scaling in 3.3.1
Hi Martin, I simply use Code: osgUtil::LineSegmentIntersector::Intersections intersections; view-computeIntersections( ea.getX(), ea.getY(),intersections)); which is giving me correct results on Android and Windows, with using the EventQueue of the window(s) on Android. I was iirc getting the correct mouse ranges in Android, what version of osg are you using? I've tested with 3.3.1 Martin Siggel wrote: Hi wouter, I tried your code, but standard picking didn't work because the mouse input ranges of the event are wrong. How did you do the picking? Cheers, Martin Am 06.05.2014 08:55 schrieb Wouter Roos (): Thanks for that solution, that does make sense. I will be using my method of setting the EventQueue of the window as that requires no changes to my picker and I can keep my code base between desktop and Android the same apart for the viewer code. I suggest that for the examples we add the Code: viewer-getEventQueue()-setMouseInputRange(x, y, x + width, y + height); line to make the examples usable again. Martin Siggel wrote: We also had that problem with the picker. We fixed that, by reimplementing the picking like this: // map pixel coordinates to [-1,1] (OpenGL Screen Coordinates) float xwindow = x/screenWidth * 2. - 1; float ywindow = -y/screenHeight * 2. + 1; osg::Camera* cam = viewer-getCamera(); osg::Matrixd m; m.preMult(cam-getProjectionMatrix()); m.preMult(cam-getViewMatrix()); // define intersection ray osg::Vec3d startPoint (xwindow, ywindow, -1000); osg::Vec3d endPoint(xwindow, ywindow, 1000); osg::Matrixd i; i.invert(m); osg::Vec3d wStart = startPoint * i; osg::Vec3d wEnd = endPoint * i; osg::ref_ptrosgUtil::LineSegmentIntersector picker = new osgUtil::LineSegmentIntersector(wStart, wEnd); 2014-05-05 13:43 GMT+02:00 Wouter Roos (): Martin Siggel wrote: You can also workaround this (instead of using the eventqueue) by telling OSG about the input range of your mouse after setting up your viewer: viewer-getEventQueue()-setMouseInputRange(x, y, x + width, y + height); Cheers, Martin Thanks for that method, that looks much better, and works for the android examples just as well. However it does not work when I use a picker, it still returns no intersections whereas using the Window's EventQueue does give me the correct results. Any ideas on why this might be? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59259#59259 (http://forum.openscenegraph.org/viewtopic.php?p=59259#59259) (http://forum.openscenegraph.org/viewtopic.php?p=59259#59259 (http://forum.openscenegraph.org/viewtopic.php?p=59259#59259)) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)) -- Post generated by Mail2Forum [/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59270#59270 (http://forum.openscenegraph.org/viewtopic.php?p=59270#59270) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Post generated by Mail2Forum [/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59283#59283 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Android osgViewer input scaling in 3.3.1
I am using 3.2.1. The mouse values , e.g. ea.getX are correct, but getXMax are wrong. Xmax, Ymax is always 1 , whereas getX returns e.g. 600. Am 06.05.2014 14:33 schrieb Wouter Roos rooswou...@gmail.com: Hi Martin, I simply use Code: osgUtil::LineSegmentIntersector::Intersections intersections; view-computeIntersections( ea.getX(), ea.getY(),intersections)); which is giving me correct results on Android and Windows, with using the EventQueue of the window(s) on Android. I was iirc getting the correct mouse ranges in Android, what version of osg are you using? I've tested with 3.3.1 Martin Siggel wrote: Hi wouter, I tried your code, but standard picking didn't work because the mouse input ranges of the event are wrong. How did you do the picking? Cheers, Martin Am 06.05.2014 08:55 schrieb Wouter Roos (): Thanks for that solution, that does make sense. I will be using my method of setting the EventQueue of the window as that requires no changes to my picker and I can keep my code base between desktop and Android the same apart for the viewer code. I suggest that for the examples we add the Code: viewer-getEventQueue()-setMouseInputRange(x, y, x + width, y + height); line to make the examples usable again. Martin Siggel wrote: We also had that problem with the picker. We fixed that, by reimplementing the picking like this: // map pixel coordinates to [-1,1] (OpenGL Screen Coordinates) float xwindow = x/screenWidth * 2. - 1; float ywindow = -y/screenHeight * 2. + 1; osg::Camera* cam = viewer-getCamera(); osg::Matrixd m; m.preMult(cam-getProjectionMatrix()); m.preMult(cam-getViewMatrix()); // define intersection ray osg::Vec3d startPoint (xwindow, ywindow, -1000); osg::Vec3d endPoint(xwindow, ywindow, 1000); osg::Matrixd i; i.invert(m); osg::Vec3d wStart = startPoint * i; osg::Vec3d wEnd = endPoint * i; osg::ref_ptrosgUtil::LineSegmentIntersector picker = new osgUtil::LineSegmentIntersector(wStart, wEnd); 2014-05-05 13:43 GMT+02:00 Wouter Roos (): Martin Siggel wrote: You can also workaround this (instead of using the eventqueue) by telling OSG about the input range of your mouse after setting up your viewer: viewer-getEventQueue()-setMouseInputRange(x, y, x + width, y + height); Cheers, Martin Thanks for that method, that looks much better, and works for the android examples just as well. However it does not work when I use a picker, it still returns no intersections whereas using the Window's EventQueue does give me the correct results. Any ideas on why this might be? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59259#59259 ( http://forum.openscenegraph.org/viewtopic.php?p=59259#59259) ( http://forum.openscenegraph.org/viewtopic.php?p=59259#59259 ( http://forum.openscenegraph.org/viewtopic.php?p=59259#59259)) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org( http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org( http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org )) -- Post generated by Mail2Forum [/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59270#59270 ( http://forum.openscenegraph.org/viewtopic.php?p=59270#59270) ___ osg-users mailing list () http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org( http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) -- Post generated by Mail2Forum [/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59283#59283 ___ 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] OpenThreads, scheduling, etc ... policies
Hi Robert, I spent few hours on this and I have things to report. First, there are code mods I did to fix it actually, but, there is a comment like // Must protect linux from realtime., PThread.cpp around ln: 323. I have mods to submit but can not do that yet since there are issue with the config. Seam like these are not getting defined on my 64bit Ubuntu (I am not a config guru so I need help from others on this): __linux, __linux__, HAVE_THREE_PARAM_SCHED_SETAFFINITY, HAVE_TWO_PARAM_SCHED_SETAFFINITY ... etc. and all of these that should be set from the pthreads/CMakeLists.txt but are not. Also ALLOW_PRIORITY_SCHEDULING is not set at all. I had to hard code these defines to make it work but someone need to look in the configuration of pthread or at least give some hints so I can dig into Thanks for the time anyway you are showing on this topic Nick On Tue, May 6, 2014 at 10:21 AM, Robert Osfield robert.osfi...@gmail.comwrote: HI Nick, On 5 May 2014 20:07, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Curtis implemented the same code with pthreads (attached) which seam to work, so it is definitely a bug in OpenThreads (for linux only, Windows implementation seam to be working). Just FYI I am currently focused on some other complex work and don't really have spare brain capacity to add another item right now. Threading affinity used to work under Linux when OpenThreads was created, I guess something must have changed in the pthread implementation that has changed how things need to be managed or perhaps a regression has happened on the OSG side. As I don't have the capacity right now could others investigate further? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenThreads, scheduling, etc ... policies
Hi Nick, On 6 May 2014 16:25, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: I spent few hours on this and I have things to report. First, there are code mods I did to fix it actually, but, there is a comment like // Must protect linux from realtime., PThread.cpp around ln: 323. I have mods to submit but can not do that yet since there are issue with the config. Seam like these are not getting defined on my 64bit Ubuntu (I am not a config guru so I need help from others on this): __linux, __linux__, HAVE_THREE_PARAM_SCHED_SETAFFINITY, HAVE_TWO_PARAM_SCHED_SETAFFINITY ... etc. and all of these that should be set from the pthreads/CMakeLists.txt but are not. Also ALLOW_PRIORITY_SCHEDULING is not set at all. I had to hard code these defines to make it work but someone need to look in the configuration of pthread or at least give some hints so I can dig into CMake should be automatically detecting these features, the following OpenSceneGraph/src/OpenThreads/pthreads/CMakeLists.txt portion should be doing this: CHECK_FUNCTION_EXISTS(pthread_yield HAVE_PTHREAD_YIELD) .. CHECK_FUNCTION_EXISTS(pthread_getconcurrency HAVE_PTHREAD_GETCONCURRENCY) .. CHECK_FUNCTION_EXISTS(pthread_setconcurrency HAVE_PTHREAD_SETCONCURRENCY) .. CHECK_FUNCTION_EXISTS(pthread_setaffinity_np HAVE_PTHREAD_SETAFFINITY_NP) For these to pass then functions pthread_yield, pthread_getconcurrency, pthread_setconcurrency and pthread_setaffinity_np will need to be present in the system pthreads.h header. If you run make VERBOSE=1 you should see the -D entries assocated with these cmake variables. What I see on my system when I do this is: Building CXX object src/OpenThreads/pthreads/CMakeFiles/OpenThreads.dir/__/common/Atomic.o cd /home/robert/OpenSceneGraph/src/OpenThreads/pthreads /usr/bin/c++ -DHAVE_PTHREAD_CANCEL -DHAVE_PTHREAD_SETCANCELSTATE -DHAVE_PTHREAD_TESTCANCEL -DHAVE_SCHED_YIELD -DHAVE_THREE_PARAM_SCHED_SETAFFINITY -DOPENTHREADS_EXPORTS -DOpenThreads_EXPORTS -D_GNU_SOURCE -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -O3 -DNDEBUG -fPIC -I/home/robert/OpenSceneGraph/include -o CMakeFiles/OpenThreads.dir/__/common/Atomic.o -c /home/robert/OpenSceneGraph/src/OpenThreads/common/Atomic.cpp Linking CXX shared library ../../../lib/libOpenThreads.so What do you get if you do a build with VEROSE=1? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenThreads, scheduling, etc ... policies
Hi Robert, My first problem was that I had selected the option to build OpenThreads with QT in cmake for some reason. So I rebuilt with this option off.. My apologies on that issue... At least it is now using the pthreads section properly. However, as Nick stated in his post, the openthreads code to allow me to select a scheduling policy other than OTHER has been ifdef'd out for __linux__ even though these options are available on Linux. This is also affecting the ability to set a proper thread priority value. So while Nick and I can fix this by removing the __linux__ checks, I would like to see if anyone knows why this was put in there in the first place so that we do not possibly break something else as we are attempting to fix the issues that we are seeing. ... Thank you! Cheers, Curtis -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59289#59289 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenThreads, scheduling, etc ... policies
Hi Robert, here is the log cd /home/ubuntu/OpenSceneGraph/src/OpenThreads/pthreads /usr/bin/c++ -DHAVE_PTHREAD_CANCEL -DHAVE_PTHREAD_SETCANCELSTATE -DHAVE_PTHREAD_TESTCANCEL -DHAVE_SCHED_YIELD -DHAVE_THREE_PARAM_SCHED_SETAFFINITY -DOPENTHREADS_EXPORTS -DOpenThreads_EXPORTS -D_GNU_SOURCE -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -O3 -DNDEBUG -fPIC -I/home/ubuntu/OpenSceneGraph/include As I mentioned earlier ALLOW_PRIORITY_SCHEDULING is not set anywhere - I examined the CMakeLists.txt for pthreads. But it is used in the code right in places where the priority is set. Also these __linux and __linux__ .. are these system wide defined by default? I am using QT Creator as an editor and seeing these grayed out Thanks again Nick On Tue, May 6, 2014 at 6:08 PM, Curtis Rubel cru...@compro.net wrote: Hi Robert, My first problem was that I had selected the option to build OpenThreads with QT in cmake for some reason. So I rebuilt with this option off.. My apologies on that issue... At least it is now using the pthreads section properly. However, as Nick stated in his post, the openthreads code to allow me to select a scheduling policy other than OTHER has been ifdef'd out for __linux__ even though these options are available on Linux. This is also affecting the ability to set a proper thread priority value. So while Nick and I can fix this by removing the __linux__ checks, I would like to see if anyone knows why this was put in there in the first place so that we do not possibly break something else as we are attempting to fix the issues that we are seeing. ... Thank you! Cheers, Curtis -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59289#59289 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenThreads, scheduling, etc ... policies
Hi Nick, On 6 May 2014 17:26, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: Hi Robert, here is the log cd /home/ubuntu/OpenSceneGraph/src/OpenThreads/pthreads /usr/bin/c++ -DHAVE_PTHREAD_CANCEL -DHAVE_PTHREAD_SETCANCELSTATE -DHAVE_PTHREAD_TESTCANCEL -DHAVE_SCHED_YIELD -DHAVE_THREE_PARAM_SCHED_SETAFFINITY -DOPENTHREADS_EXPORTS -DOpenThreads_EXPORTS -D_GNU_SOURCE -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused -O3 -DNDEBUG -fPIC -I/home/ubuntu/OpenSceneGraph/include This mean CMake is detecting the features. As I mentioned earlier ALLOW_PRIORITY_SCHEDULING is not set anywhere - I examined the CMakeLists.txt for pthreads. But it is used in the code right in places where the priority is set. Also these __linux and __linux__ .. are these system wide defined by default? I am using QT Creator as an editor and seeing these grayed out Curious. I did a quick search and came across the page: sourceforge.net/p/predef/wiki/OperatingSystems/ The suggests __linux is obsolete, so __linux__ should be the one we should use. I replaced the one instance where __linux was used with the __linux__ version and checked this in to svn/trunk. The ALLOW_PRIORITY_SCHEDULING one is more odd. I can't find a reference in the ALLOW_PRIORITY_SCHEDULING in anywhere in the OpenThreads code base apart from where it's used in OpenThreads/pthreads, so it's used by not defined. I seems like Cmake should be added this option via another -D entry but isn't. I don't recall the submission that introduced this, it might be worth stepping back through the svn logs to see the author of this specific addition and bring them into the discussion. It could be that this was missed with integration of Cmake or similar changes. FYI, I'm not the author of OpenThreads, just ended up the defacto caretaker as the original author stepped back. This means I'm similar situation to others - I read the code, work out what it supposed to do and make correction or merge fixes that look appropriate. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenThreads, scheduling, etc ... policies
Nick, __linux__ is defined someplace in the gcc compiler as it finds the current arch and os, etc., installed. you can: cpp -dM /dev/null and see all the gcc defines output. I see that __linux is still there as well, at least for the time being. ALLOW_PRIORITY_SCHEDULING, however seems to be an OpenThreads specific define. ... Thank you! Cheers, Curtis -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59293#59293 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenThreads, scheduling, etc ... policies
interesting ... my ubuntu has __unix and __unix__ instead of linux. Nick On Tue, May 6, 2014 at 7:01 PM, Curtis Rubel cru...@compro.net wrote: Nick, __linux__ is defined someplace in the gcc compiler as it finds the current arch and os, etc., installed. you can: cpp -dM /dev/null and see all the gcc defines output. I see that __linux is still there as well, at least for the time being. ALLOW_PRIORITY_SCHEDULING, however seems to be an OpenThreads specific define. ... Thank you! Cheers, Curtis -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=59293#59293 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenThreads, scheduling, etc ... policies
Hi Nick, On 6 May 2014 18:11, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: interesting ... my ubuntu has __unix and __unix__ instead of linux. I have 64bit Kubuntu 14.04 installed here and when I follow Curtis's suggestion I get: $ cpp -dM /dev/null | grep __linux #define __linux 1 #define __linux__ 1 Which version of Ubunutu are you using? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenThreads, scheduling, etc ... policies
Ubuntu 13.04 raring got it from the store installed on the laptop I bought in a rush :-) Nick On Tue, May 6, 2014 at 7:17 PM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Nick, On 6 May 2014 18:11, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: interesting ... my ubuntu has __unix and __unix__ instead of linux. I have 64bit Kubuntu 14.04 installed here and when I follow Curtis's suggestion I get: $ cpp -dM /dev/null | grep __linux #define __linux 1 #define __linux__ 1 Which version of Ubunutu are you using? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OpenSceneGraph BOF at SIGGRAPH 2014
Greetings and Salutations, Birds of a Feather Session Title: OpenSceneGraph BOF Date: Wednesday, August 13 Location: Vancouver Convention Centre Time: 10:00 am - 11:00 am Be there or be OSG::SQUARE [US slang] I leave one slot for Robert's Planned features report That leaves 3 or 4 other show off your stuff slots.. First come first served. John F. Richardson ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org