Deep Copy OsgEarth Layer

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

Deep Copy OsgEarth Layer

How to Deep Copy OsgEarth Layer´╝č
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Deep Copy OsgEarth Layer

You cannot copy a Layer.
Glenn Waldron / Pelican Mapping
Blanky Blanky
Reply | Threaded
Open this post in threaded view
|

Re: Deep Copy OsgEarth Layer

In reply to this post by osgEarthVR
Can't you do this technically to get the same effect?:
osgEarth::ImageLayer* copyLayer = new osgEarth::ImageLayer(originalLayer->options());

Pretty sure it'll work with any type of layer that accepts the options() as a constructor argument.

I've been doing this to make a layer per camera/viewer and then cull the layer on a per camera basis through an osg userValue attribute for the given camera name and a callback I've installed on each constructed layer. This worked for me. But Glenn is right, there's no such thing as doing the osg::CopyOp::DEEP_COPY_ALL the way you normally would with nodes in the scene graph.

- Blanky
gangzou gangzou
Reply | Threaded
Open this post in threaded view
|

Re: Deep Copy OsgEarth Layer

  maybe create a new layer is easier