Re: [osg-users] How to get all visible nodes

2015-09-30 Thread Robert Osfield
HI Artem,

Just write a NodeVisitor that has it's traversal mode set to
TRAVERSE_ALL_CHILDREN i.e.

class FindAllNodes : public osg::NodeVisitor
{
public:
FindAllNodes():
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHIILDREN) {}

   void apply(osg::Node& node)
   {
std::cout<<"Visiting node "std::endl;
traverse(node);
   }
};

...

FindAllNodes findAllNodes;
viewer.getSceneData()->accept(findAllnodes));


Robert.


..



On 29 September 2015 at 14:52, Artem Ivanov 
wrote:

> Hi,
>
> I'm new to OSG, so I think I have simple question, but I cannot find
> answer for it.
> Actually I'm working with osgEarth and have some osgEarth::PlaceNodes on
> the terrain, some models and so on.
> So, I have lots of views.
>
> For some needs, I need a mechanism which will allow me to get all the
> views inside a screen
> (I mean which are visible to me at the moment and which are inside my
> screen).
> I didn't find any information about the way I can implement this.
>
> I'm sure that I've missed something.
> I would appreciate any help with this.
>
> Thank you!
>
> Cheers,
> Artem
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=65244#65244
>
>
>
>
>
> ___
> 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] How to get all visible nodes

2015-09-29 Thread Artem Ivanov
Hi,

I'm new to OSG, so I think I have simple question, but I cannot find answer for 
it.
Actually I'm working with osgEarth and have some osgEarth::PlaceNodes on the 
terrain, some models and so on.
So, I have lots of views.

For some needs, I need a mechanism which will allow me to get all the views 
inside a screen 
(I mean which are visible to me at the moment and which are inside my screen). 
I didn't find any information about the way I can implement this.

I'm sure that I've missed something. 
I would appreciate any help with this. 

Thank you!

Cheers,
Artem

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





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