Re: [osg-users] C++11 with OSG

2013-11-22 Thread deniz diktas
Hi Sebastian,

Yes, I have to admit that my question was not clear enough. Actually I meant 
using C++11 in osg-based apps. The reason I asked is that I would like to write 
a high-level rendering engine based on osg (to be distributed to many users) 
and I was not sure if I should directly use C++11 or not. I wanted to know how 
many people are using C++11 in their osg-based apps. You are one of the and it 
is good to know that, +1  :)

So consider my question as a questionnaire.





SMesserschmidt wrote:
 Deniz,
 
 What do you mean?
 I've been using Visual Studio 2010, which has some major parts for C++11 
 integrated with OSG.
 Lambdas, move etc. are just working fine.
 I would not recommend to move the OSG core to c++11 too soon, as right 
 now there is a great variety of compiler targets for OSG. And some of 
 are not likely to see any update to C11.
 But you are free to use it in your OSG based applications :-)
 
 cheers
 Sebastian
 
  Hi,
  
  Just wondering how many of you use C++11 with OSG and what you think about 
  it.
  
  Thank you!
  
  Cheers,
  deniz
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=57376#57376
  
  
  
  
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
 
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
  --
 Post generated by Mail2Forum


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





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


Re: [osg-users] wrong graphics after removing geometry deprecated methods

2013-11-22 Thread Gianni Ambrosio
Thanks Robert, I fixed the problem on my viewer side getting the camera from 
the view.

Regards
Gianni

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





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


Re: [osg-users] C++11 with OSG

2013-11-22 Thread Sebastian Messerschmidt

Am 22.11.2013 10:23, schrieb deniz diktas:

Hi Sebastian,

Yes, I have to admit that my question was not clear enough. Actually I meant 
using C++11 in osg-based apps. The reason I asked is that I would like to write 
a high-level rendering engine based on osg (to be distributed to many users) 
and I was not sure if I should directly use C++11 or not. I wanted to know how 
many people are using C++11 in their osg-based apps. You are one of the and it 
is good to know that, +1  :)
I can only speak for VS2010, which is doing okay here. For everything 
I'm relying on boost. It abstracts most high level concepts clearly 
enough and allows for easy transition to C11 once the Compilers are 
standard-conforming.


cheers
Sebastian


So consider my question as a questionnaire.





SMesserschmidt wrote:

Deniz,

What do you mean?
I've been using Visual Studio 2010, which has some major parts for C++11
integrated with OSG.
Lambdas, move etc. are just working fine.
I would not recommend to move the OSG core to c++11 too soon, as right
now there is a great variety of compiler targets for OSG. And some of
are not likely to see any update to C11.
But you are free to use it in your OSG based applications :-)

cheers
Sebastian


Hi,

Just wondering how many of you use C++11 with OSG and what you think about it.

Thank you!

Cheers,
deniz

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





___
osg-users mailing list

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

  --
Post generated by Mail2Forum


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





___
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] C++11 with OSG

2013-11-22 Thread Olaf Razzoli
Hi Deniz

I am currently using OSG 3.2 in a source code using several C++11 features and 
everything works as expected. I am using Visual Studio 2012.
 OSG is very object oriented, while C++11 is more towards generic programming, 
so sometimes you need to adapt concepts.


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of deniz diktas
Sent: 22 November 2013 09:23
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] C++11 with OSG

Hi Sebastian,

Yes, I have to admit that my question was not clear enough. Actually I meant 
using C++11 in osg-based apps. The reason I asked is that I would like to write 
a high-level rendering engine based on osg (to be distributed to many users) 
and I was not sure if I should directly use C++11 or not. I wanted to know how 
many people are using C++11 in their osg-based apps. You are one of the and it 
is good to know that, +1  :)

So consider my question as a questionnaire.





SMesserschmidt wrote:
 Deniz,
 
 What do you mean?
 I've been using Visual Studio 2010, which has some major parts for 
 C++11 integrated with OSG.
 Lambdas, move etc. are just working fine.
 I would not recommend to move the OSG core to c++11 too soon, as right 
 now there is a great variety of compiler targets for OSG. And some of 
 are not likely to see any update to C11.
 But you are free to use it in your OSG based applications :-)
 
 cheers
 Sebastian
 
  Hi,
  
  Just wondering how many of you use C++11 with OSG and what you think about 
  it.
  
  Thank you!
  
  Cheers,
  deniz
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=57376#57376
  
  
  
  
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegrap
  h.org
  
 
 ___
 osg-users mailing list
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
 org
 
  --
 Post generated by Mail2Forum


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





___
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] wrong graphics after removing geometry deprecated methods

2013-11-22 Thread Gianni Ambrosio
Hi Robert, do you have any idea regarding the strange effect I have with 
osgWidgets? I try to repeat my issue.

You can see my viewer code I posted above (now fixed getting the camera of the 
view). The viewer inherits from osgQt::GLWidget and osgViewer::CompositeViewer 
and I set the camera graphic context as follows:

iCamera-setGraphicsContext(new osgQt::GraphicsWindowQt(this));

I also override the qt resize event (to update a cross axes HUD) but I call the 
GLWidget implementation in it:

void ViewerWidget::resizeEvent(QResizeEvent* iEvent)
{
   GLWidget::resizeEvent(iEvent);
...
}

Now, if I run my application without resizing the viewer widget and I insert an 
osgWidget::Window to the osgWidget::WindowManager I can see it stretched to a 
small size.
Then I resize the viewer interactively, the code falls into the handled 
resizeEvent and the GLWidget::resizeEvent(iEvent) call makes the widget to be 
shown correctly. It seems there's something related to the GraphicsWindowQt* 
_gw size of GLWidget or the way I create it but I can't get the point.

Thanks for your help,
Gianni

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





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


Re: [osg-users] wrong graphics after removing geometry deprecated methods

2013-11-22 Thread Robert Osfield
Hi Gianni,

I'll have to defer to Jeremy Moles on osgWidget support.

Robert.


On 22 November 2013 10:41, Gianni Ambrosio ga...@vi-grade.com wrote:

 Hi Robert, do you have any idea regarding the strange effect I have with
 osgWidgets? I try to repeat my issue.

 You can see my viewer code I posted above (now fixed getting the camera of
 the view). The viewer inherits from osgQt::GLWidget and
 osgViewer::CompositeViewer and I set the camera graphic context as follows:

 iCamera-setGraphicsContext(new osgQt::GraphicsWindowQt(this));

 I also override the qt resize event (to update a cross axes HUD) but I
 call the GLWidget implementation in it:

 void ViewerWidget::resizeEvent(QResizeEvent* iEvent)
 {
GLWidget::resizeEvent(iEvent);
 ...
 }

 Now, if I run my application without resizing the viewer widget and I
 insert an osgWidget::Window to the osgWidget::WindowManager I can see it
 stretched to a small size.
 Then I resize the viewer interactively, the code falls into the handled
 resizeEvent and the GLWidget::resizeEvent(iEvent) call makes the widget to
 be shown correctly. It seems there's something related to the
 GraphicsWindowQt* _gw size of GLWidget or the way I create it but I can't
 get the point.

 Thanks for your help,
 Gianni

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





 ___
 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


[osg-users] Wrong size of osgWidgets before resizing (was: wrong graphics after removing geometry deprecated methods)

2013-11-22 Thread Alberto Luaces
Gianni Ambrosio writes:

 Now, if I run my application without resizing the viewer widget and I
 insert an osgWidget::Window to the osgWidget::WindowManager I can see
 it stretched to a small size.  Then I resize the viewer interactively,
 the code falls into the handled resizeEvent and the
 GLWidget::resizeEvent(iEvent) call makes the widget to be shown
 correctly.

Initially osgWidgets relies on the size you specify when you create the
WindowManager, and it can be different than the actual size of your
rendering context.  OSG doesn't send a RESIZE event at window creation
time, so you have to check this for yourself.

-- 
Alberto

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


Re: [osg-users] wrong graphics after removing geometry deprecated methods

2013-11-22 Thread Gianni Ambrosio

Alberto Luaces wrote:
 Initially osgWidgets relies on the size you specify when you create the
 WindowManager, and it can be different than the actual size of your
 rendering context.  OSG doesn't send a RESIZE event at window creation
 time, so you have to check this for yourself.
 

Alberto, but building against osg 3.0.1 it works fine. How could you explain 
that?

Regards
Gianni

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





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


Re: [osg-users] PagedLOD and IntersectionVisitor

2013-11-22 Thread Olivier Tournaire
Hi Robert,

Thank you for your answer. Unfortunately, I cannot share the model ...
However, I can share the code.

Here it is:

// Building a osgUtil::PolytopeIntersector from a CONCAVE planar polygon

/* 1) split the concave polygon in its convex rings */
/* 2) iterate over each convex ring to build a convex osg::Polyope
*/

// Begin loop over convex rings
osg::Polytope currentBuildingPolytope;
for(int j=0;jring.getNumPoints()-1;++j)
{
osg::Vec3d A( ring.getX(j),   ring.getY(j),   ring.getZ(j)   );
osg::Vec3d B( ring.getX(j+1), ring.getY(j+1), ring.getZ(j+1) );
osg::Vec3d C( ring.getX(j+1), ring.getY(j+1), ring.getZ(j+1)+delta
); // delta  0.

osg::Vec3d AB = B-A; AB.normalize();
osg::Vec3d BC = C-B; BC.normalize();
osg::Vec3d n = BC^AB; n.normalize();

osg::Plane p(n,A);
currentBuildingPolytope.add(p);
}
osg::ref_ptrosgUtil::PolytopeIntersector
currentPolytopeIntersector = new
osgUtil::PolytopeIntersector(currentBuildingPolytope);

currentPolytopeIntersector-setDimensionMask(osgUtil::PolytopeIntersector::DimTwo);
// End loop over convex rings

/* 3) add the convex osg::Polytope to a vector
ref_ptrosgUtil::PolytopeIntersector  */
_polytopeIntersectors.push_back(currentPolytopeIntersector);

/* 4) Find intersections of the model with the previously build
osgUtil::PolytopeIntersectors */
bool hasIntersections = false;
for(unsigned int i=0;i_polytopeIntersectors.size();++i)
{
osgUtil::IntersectionVisitor
visitor(_polytopeIntersectors[i].get());
osg::ref_ptrosgSim::DatabaseCacheReadCallback _readCallback =
new osgSim::DatabaseCacheReadCallback;
visitor.setReadCallback(_readCallback);
model-accept(visitor); // model contains one triangle per
Drawable

if(_polytopeIntersectors[i]-containsIntersections())
{
hasIntersections = true;
_numIntersections +=
_polytopeIntersectors[i]-getIntersections().size();
// ...
}
// ...
}

If you see anything wrong, please let me know.

As I tols in my first post, the reader callback works quite well (my DB
model contains around 150 files). Debugging my application, the method
IntersectionVisitor::apply(osg::PagedLOD plod) exits on the first line
only if _intersectorStack.back()-enter(node); returns false. This happen
in LineSegmentIntersector::intersects(const osg::BoundingSphere bs),
because of this line:
 if (d0.0) return false;
which seems to mean that the bounding sphere of the current PagedLOD is not
intersected by the line.

Hope this give you more :)

Regards,

Olivier


2013/11/21 Robert Osfield robert.osfi...@gmail.com

 Hi Oliver,

 I have looked at the OSG code and can't see a specific cause, but then I
 don't have your code or models so it's all just guessing.

 Does LineOfSight work fine for you?  If so I'd recommend stepping through
 to see what happening and then compare it with your own usage.

 Robert.


 On 19 November 2013 19:58, Olivier Tournaire olit...@gmail.com wrote:

 Hi all,

 Sorry for the noise, but, as I did not receive any answer, I am
 interested if someone has an idea on the topic.

 Regards,

 Olivier


 2013/11/15 Olivier Tournaire olit...@gmail.com

 Hi,

 I am currently trying to retrieve some specific triangles in a PagedLOD
 model. To do so, I use a PolytopeIntersector with an IntersectionVisitor.
 As my model is a PagedLOD, I have set up a reader callback, directly taken
 from osgSim::LineOfSight.

 The intersector works, but not as expected: it gives me the triangles at
 the lowest resolution, whereas I would expect to have them at the finest
 LOD. Debugging my program showed me that the void
 IntersectionVisitor::apply(osg::PagedLOD plod) method goes where it has to
 (i.e., it traverses correctly all childs until the best resolution).

 As the IntersectionVisitor sets up by default to use
 the USE_HIGHEST_LEVEL_OF_DETAIL flag, I am wondering if I am missing
 something and if you could give some pointers on how to achieve triangles
 extraction at the finest LOD.

 The header root file is:

 osg::PagedLOD {
   UniqueID 1
   Name Tile_+001_+006.osgb
   CenterMode USER_DEFINED_CENTER
   UserCenter -741.555 904.039 94.1168 213.403
   RangeMode PIXEL_SIZE_ON_SCREEN
   RangeList 2 {
 0 106.702
 106.702 1e+030
   }
   DatabasePath FALSE
   RangeDataList 2 {
 
 Tile_+001_+006_L15_0.osgb
   }
   PriorityList 2 {
 0 1
 0 1
   }

 The header of the child file (Tile_+001_+006_L15_0.osgb) is:

 osg::PagedLOD {
   UniqueID 1
   Name Tile_+001_+006_L15_0.osgb
   CenterMode USER_DEFINED_CENTER
   UserCenter -741.869 906.466 94.7166 206.312
   RangeMode PIXEL_SIZE_ON_SCREEN
   RangeList 2 {
 0 206.312
 206.312 1e+030
   }
   DatabasePath FALSE
   RangeDataList 2 {
 
 

Re: [osg-users] wrong graphics after removing geometry deprecated methods

2013-11-22 Thread Alberto Luaces
Gianni Ambrosio writes:

 Alberto Luaces wrote:
 Initially osgWidgets relies on the size you specify when you create the
 WindowManager, and it can be different than the actual size of your
 rendering context.  OSG doesn't send a RESIZE event at window creation
 time, so you have to check this for yourself.
 

 Alberto, but building against osg 3.0.1 it works fine. How could you explain 
 that?

I don't really know what is happening with your code :-) What I said was
what I found inspecting and debugging my own code.  Besides that, all
the OSG examples work that way.  That is the reason why all osgWidget
examples run in windowed mode at the beginning, because the
WindowManagers and the windows are set to the same size.

It could be nice if you could extract a minimal test case to try it out...

-- 
Alberto

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


Re: [osg-users] PagedLOD and IntersectionVisitor

2013-11-22 Thread Robert Osfield
Hi Olivier,

It sounds like the next thing to investigate would be the size of the
bounding sphere that it's testing against, perhaps there is an error in the
bounding sphere settings that is resulting in the traversal being culled
prematurely.

Robert.


On 22 November 2013 14:03, Olivier Tournaire olit...@gmail.com wrote:

 Hi Robert,

 Thank you for your answer. Unfortunately, I cannot share the model ...
 However, I can share the code.

 Here it is:

 // Building a osgUtil::PolytopeIntersector from a CONCAVE planar polygon

 /* 1) split the concave polygon in its convex rings */
 /* 2) iterate over each convex ring to build a convex osg::Polyope
 */

 // Begin loop over convex rings
 osg::Polytope currentBuildingPolytope;
 for(int j=0;jring.getNumPoints()-1;++j)
 {
 osg::Vec3d A( ring.getX(j),   ring.getY(j),   ring.getZ(j)   );
 osg::Vec3d B( ring.getX(j+1), ring.getY(j+1), ring.getZ(j+1) );
 osg::Vec3d C( ring.getX(j+1), ring.getY(j+1), ring.getZ(j+1)+delta
 ); // delta  0.

 osg::Vec3d AB = B-A; AB.normalize();
 osg::Vec3d BC = C-B; BC.normalize();
 osg::Vec3d n = BC^AB; n.normalize();

 osg::Plane p(n,A);
 currentBuildingPolytope.add(p);
 }
 osg::ref_ptrosgUtil::PolytopeIntersector
 currentPolytopeIntersector = new
 osgUtil::PolytopeIntersector(currentBuildingPolytope);

 currentPolytopeIntersector-setDimensionMask(osgUtil::PolytopeIntersector::DimTwo);
 // End loop over convex rings

 /* 3) add the convex osg::Polytope to a vector
 ref_ptrosgUtil::PolytopeIntersector  */
 _polytopeIntersectors.push_back(currentPolytopeIntersector);

 /* 4) Find intersections of the model with the previously build
 osgUtil::PolytopeIntersectors */
 bool hasIntersections = false;
 for(unsigned int i=0;i_polytopeIntersectors.size();++i)
 {
 osgUtil::IntersectionVisitor
 visitor(_polytopeIntersectors[i].get());
 osg::ref_ptrosgSim::DatabaseCacheReadCallback _readCallback
 = new osgSim::DatabaseCacheReadCallback;
 visitor.setReadCallback(_readCallback);
 model-accept(visitor); // model contains one triangle per
 Drawable

 if(_polytopeIntersectors[i]-containsIntersections())
 {
 hasIntersections = true;
 _numIntersections +=
 _polytopeIntersectors[i]-getIntersections().size();
 // ...
 }
 // ...
 }

 If you see anything wrong, please let me know.

 As I tols in my first post, the reader callback works quite well (my DB
 model contains around 150 files). Debugging my application, the method
 IntersectionVisitor::apply(osg::PagedLOD plod) exits on the first line
 only if _intersectorStack.back()-enter(node); returns false. This happen
 in LineSegmentIntersector::intersects(const osg::BoundingSphere bs),
 because of this line:
  if (d0.0) return false;
 which seems to mean that the bounding sphere of the current PagedLOD is
 not intersected by the line.

 Hope this give you more :)

 Regards,

 Olivier


 2013/11/21 Robert Osfield robert.osfi...@gmail.com

 Hi Oliver,

 I have looked at the OSG code and can't see a specific cause, but then I
 don't have your code or models so it's all just guessing.

 Does LineOfSight work fine for you?  If so I'd recommend stepping through
 to see what happening and then compare it with your own usage.

 Robert.


 On 19 November 2013 19:58, Olivier Tournaire olit...@gmail.com wrote:

 Hi all,

 Sorry for the noise, but, as I did not receive any answer, I am
 interested if someone has an idea on the topic.

 Regards,

 Olivier


 2013/11/15 Olivier Tournaire olit...@gmail.com

 Hi,

 I am currently trying to retrieve some specific triangles in a PagedLOD
 model. To do so, I use a PolytopeIntersector with an IntersectionVisitor.
 As my model is a PagedLOD, I have set up a reader callback, directly taken
 from osgSim::LineOfSight.

 The intersector works, but not as expected: it gives me the triangles
 at the lowest resolution, whereas I would expect to have them at the finest
 LOD. Debugging my program showed me that the void
 IntersectionVisitor::apply(osg::PagedLOD plod) method goes where it has to
 (i.e., it traverses correctly all childs until the best resolution).

 As the IntersectionVisitor sets up by default to use
 the USE_HIGHEST_LEVEL_OF_DETAIL flag, I am wondering if I am missing
 something and if you could give some pointers on how to achieve triangles
 extraction at the finest LOD.

 The header root file is:

 osg::PagedLOD {
   UniqueID 1
   Name Tile_+001_+006.osgb
   CenterMode USER_DEFINED_CENTER
   UserCenter -741.555 904.039 94.1168 213.403
   RangeMode PIXEL_SIZE_ON_SCREEN
   RangeList 2 {
 0 106.702
 106.702 1e+030
   }
   DatabasePath FALSE
   RangeDataList 2 {
 
 Tile_+001_+006_L15_0.osgb
   }
   PriorityList 2 {
  

Re: [osg-users] Crash from loading assets in worker thread

2013-11-22 Thread Bradley Baker Searles
Hi Robert-

I agree the osgDB::readRef*File() functions are safe. I was only noting that 
the osgDB::readRef*File() functions that return raw pointers are used in more 
than just Input.cpp and the deprecated wrappers as you'd mentioned.

As for whether using the take methods invalidate the reference count, I think 
we're arguing semantics. I do not consider a reference counted object to be 
properly reference counted if there are raw pointers to it being kept and used 
(performance critical situations excepted).

I'm looking forward to a less intrusive tweak, that'd be great.

Thanks for the responses!

Baker

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





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


Re: [osg-users] Crash from loading assets in worker thread

2013-11-22 Thread Robert Osfield
Hi Baker,

On 22 November 2013 15:55, Bradley Baker Searles bakersear...@gmail.comwrote:

 I agree the osgDB::readRef*File() functions are safe. I was only noting
 that the osgDB::readRef*File() functions that return raw pointers are used
 in more than just Input.cpp and the deprecated wrappers as you'd mentioned.


I think you mean read*File() there :-)



 As for whether using the take methods invalidate the reference count, I
 think we're arguing semantics. I do not consider a reference counted object
 to be properly reference counted if there are raw pointers to it being kept
 and used (performance critical situations excepted).


Absolutely not semantics.  I'm talking specifically about the reference
count value in osg::Referenced, the ref_ptr::release() decrements the
reference count, resets the ref_ptr to 0 so keeps it self consistent.

Raw pointers don't invalidate any reference count, they are simply raw
pointers and it's important to remember that that using them has no effect
on the reference counting and no guaranteed memory safety with it.  Use C
pointers and you really need to be careful.

Code like Input.cpp and any other parts of the OSG that use the thread
unsafe read*File() really need to be updated.  Tackling this is probably
best done collectively as it's quite sweeping work across plugins.

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


Re: [osg-users] C++11 with OSG

2013-11-22 Thread deniz diktas
Thank you guys,

This is helpful, I can see it is best to stick to vs2010 and use boost for 
missing c++11 features, which I have been doing in my regular work anyway. Good 
to see we are on the same page here. 

Any other opinions or suggestions are welcome.

-deniz

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





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


[osg-users] Bit OT: building OSG on Windows 8?

2013-11-22 Thread Raymond de Vries

Hi guys,

It's OT but I do like to ask your help with building the OSG on Windows 
8. I was wondering if anyone can give me a hand with building the OSG on 
Windows 8. I have build OSG numerous times on any other platform but now 
I am trying to build the OSG (3.1.1 but that does not matter) on Windows 
8 using cmake 2.8.12.1 + VS2010 + WinSDK 7.1 (x86).


No matter what I try to do (disable UAC, take ownership, set ACL to Full 
Control), I keep getting Access is denied. for mt.exe. This is driving 
me pretty crazy...


Anyone else been in this situation and fixed it?

Thanks a lot,
Raymond

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


Re: [osg-users] Bit OT: building OSG on Windows 8?

2013-11-22 Thread Torben Dannhauer
Hi,

Im compiling various projects including OSG on windows 8 with VS 2012 and 
VS2013 - I have no problem with such an error. Is your computer integrated into 
a AD domain?


Cheers,
Torben

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





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


Re: [osg-users] Bit OT: building OSG on Windows 8?

2013-11-22 Thread Raymond de Vries

Hi,

No, I am using a local account. It's a fresh installation. Did you 
change any settings for your account?


cheers
Raymond


On 11/22/2013 10:42 PM, Torben Dannhauer wrote:

Hi,

Im compiling various projects including OSG on windows 8 with VS 2012 and 
VS2013 - I have no problem with such an error. Is your computer integrated into 
a AD domain?


Cheers,
Torben

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





___
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


[osg-users] MFCViewer and MS Visual Studio 2013 = problem

2013-11-22 Thread Torben Dannhauer
Hi,

I'm currently working on the Windows 3rdParty precompiled dependency package 
for Visual Studio 2013.

During my test compilations with OSG trunk I discovered that Microsoft droppen 
MB support for MFC in VS2013. This is used by OSG's MFCViewer example.

I tried to switch the project ot unicode, but I was not able to get it working.
Ihave to admit that I'm not very competent in that unicode/Multibyte /string 
encoding stuff.

Is there a competent Windows software developer out there you could help me to 
enhance the Example by converting it into a unicode project?

Or should we disable the example for MSVC 2013?

I would appreciate your feedback to make OSG fully compatible to Visual Studio 
2013!

Thanks,
Torben

Thank you!

Cheers,
Torben

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





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


Re: [osg-users] MFCViewer and MS Visual Studio 2013 = problem

2013-11-22 Thread Robert Osfield
On 22 November 2013 21:52, Torben Dannhauer tor...@dannhauer.info wrote:

 Or should we disable the example for MSVC 2013


Or get rid of it completely?  Is MFC not deprecated now?

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


[osg-users] [ANN] 3rdParty Package released for Visual Studio 2013 RTM (v120)

2013-11-22 Thread Torben Dannhauer
Hello dear OSG-community,

Sorry again for my long absence:
PhD finished: check
Married: check
 - now it's time to dive into OSG again :)

As Visual Studio 2012 's C++ compiler is even after Update 4 quite buggy, I 
switchted to VS2013 asap, since there are (at least) my annoying VC bugs fixed 
by MS.

Therefore I am pleased to present my precompiled 3rdParty Packages for Visual 
Studio 2013 :)

As always, I compiled the libraries in 32 and 64 bit and used platform toolset 
v120, the default of VS2013. It is not compatible with Windows XP, please use 
Windows Vista and above for this package.

The precompiled 3rdParty package is provided in 2 flavors again: small and 
full. 
The small one contains the (in my opinion) most common dependencies, the full 
package contains some additional. For a list of content and further details, 
please visit http://www.osgvisual.org/projects/osgvisual/wiki/Downloads .

You can download it at 
http://www.openscenegraph.org/index.php/download-section/dependencies
or directly at http://www.osgvisual.org/projects/osgvisual/wiki/Downloads .

Currently only the small package is finished and tested, I hope to provide the 
full package in the end of November, but who knows..

If you have further questions or bug reports, please contact me.

Best regards,
Torben

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





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


Re: [osg-users] MFCViewer and MS Visual Studio 2013 = problem

2013-11-22 Thread Torben Dannhauer
Hi, Robert,

it is not deprecated per se,

but as stated here:  
http://blogs.msdn.com/b/vcblog/archive/2013/07/08/mfc-support-for-mbcs-deprecated-in-visual-studio-2013.aspx
 , 
they had to maintain/install/deploy too many flavors of MFC.
To optimize it they decided to put multibyte support in a seperate package and 
maybe it will be dropped in one of the following VS versions.

However, MFC with unicode is still possible out of the box, but I wasn't able 
to convert the MFC viewer to compile with unicode.

Thank you!

Cheers,
Torben

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





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


Re: [osg-users] C++11 with OSG

2013-11-22 Thread Sebastian Messerschmidt

Deniz,

What do you mean?
I've been using Visual Studio 2010, which has some major parts for C++11 
integrated with OSG.

Lambdas, move etc. are just working fine.
I would not recommend to move the OSG core to c++11 too soon, as right 
now there is a great variety of compiler targets for OSG. And some of 
are not likely to see any update to C11.

But you are free to use it in your OSG based applications :-)

cheers
Sebastian

Hi,

Just wondering how many of you use C++11 with OSG and what you think about it.

Thank you!

Cheers,
deniz

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





___
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] Crash from loading assets in worker thread

2013-11-22 Thread Robert Osfield
Hi Baker,


On 21 November 2013 20:57, Bradley Baker Searles bakersear...@gmail.comwrote:

 I am not sure I understand your last paragraph. I believe every
 osgDB::read*File() function would need to be changed to not use the take
 functions. They all pose a multi-threaded risk with the object cache (and
 potentially other code). Even if they're returned into a ref_ptr (as some
 are), there is still a small window where the object being pointed to is
 not properly refcounted.


I agree that the osgDB::read*File() functions are not thread safe when used
in conjunction with the object cache.  However, the osgDB::readRef*File()
will be - you say there is small window where the object is not being ref
counted but I have just reviewed the code and can't see any issue with.  If
you believe there is a problem with readRef*File() then please be specific.

As a general note the osgDB::read*File() functions pre-date multi-threading
and the object cache being introduced to the OSG, so we keep them around
for backwards compatibility and ease of use and for majority users they
won't ever require the multi-threaded loaded.




 These functions seem to be used in a *lot* of places, not just the
 deprecated loading code and Input module.

 My inclination would be to get rid of the take functions at the core if
 this issue in osgDB::ReaderWriter::ReadResult if at all possible. Having
 invalid refcounts seems to defeat the purpose of ref_ptr.


The take methods in ReadResult doesn't invalidate the reference count,
please have a look at what the ref_ptr::release() implementation does, it
decrements the reference count but doesn't delete the object if the
reference count goes to zero.


 I'm going to attach a patch file in case anyone stumbles across this
 problem before a proper fix happens. It lets the object cache hold onto
 these objects for the set expiry time (default is 10 seconds), which
 smooths over the issue in all of our cases. It's a hack, but if you have
 legacy OSG files (our customers have many) and you need to render/load
 concurrently it should do the trick.


I've had a look at your change and it will affect the ABI so I'll have a
look at the management of the cache to see if there a less intrusive tweak.

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