One mapnode multiple viewers, cull layers

classic Classic list List threaded Threaded
4 messages Options
Josiah425 Josiah425
Reply | Threaded
Open this post in threaded view
|

One mapnode multiple viewers, cull layers

This post was updated on .
I have a mapnode that is shared between multiple viewers, and I would like to update the brightness and contrast of each viewer individually.  When I install the brightness contrast color filter and manipulate these values, it updates both viewers because the layers are shared between them.

I was hoping to install multiple earth layers on top of each other (1 set for each viewer) in the scenegraph and cull the layers not specific to the viewer.  However, culling layers is different from culling nodes in a scenegraph and I'm having difficulty figuring out how to do it.

I noticed from other threads on the forums that you can generate a node from the map layers, however when I do that, I get null values.  I know that if I could make my map layers into nodes, I could simply just install a Callback to ignore the traversal.

I've noticed there are LayerCallbacks for the VisibleLayer but I've played around with it and haven't found a way to generate the calls to the functions I'm overriding.

How can I cull layers per viewer?



This post is similar to what I'm trying to do, and it was answered back in 2012.  I was wondering if there was any update on this.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: One mapnode multiple viewers, cull layers

Josiah,
In osgEarth 2.10 there is a method called Layer::setCullCallback that might help you.
Glenn Waldron / Pelican Mapping
Josiah425 Josiah425
Reply | Threaded
Open this post in threaded view
|

Re: One mapnode multiple viewers, cull layers

Hey Glenn,

I don't know why, but I don't see that function in the layer header file.  I realize on GitHub, the Layer::setCullCallback exists, but in my layer header on my machine I don't see it anywhere and can't access it through a layer object.  This is not the first time this has happened to me with functions appearing in the codebase, but not on my machine.  I am definitely using osgEarth 2.10.  Has osgEarth 2.10 been updated since 6 months ago?  If so, how often would I have to pull the version to ensure I have it up-to-date?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: One mapnode multiple viewers, cull layers

Not sure. I believe that method is indeed in the 2.10 tag. Try going into your repository folder and running these:

git status
git log -1

to verify that you have the code you think you have.
Glenn Waldron / Pelican Mapping