Hello again, now I need your advice on RTTPicker. My goal is to use it without its' own dedicated view. Looking at the examples I came up with following initialization code:
viewer->stopThreading(); //still have no idea if that applies to my case
// Install the query tool.
picker = new RTTPicker();
pickerCallback = new OSGEPickerCallback(this);
viewer->addEventHandler( picker );
picker->addChild( rootNode );//have tried passing mapNode here with same effect
picker->setDefaultCallback( pickerCallback );
OSGEPickerCallback is basically callback class straight from examples. Only difference is that it just fires "hit" with id or "miss" on mouse release into the console.
And it only misses, though map clearly contains a FeatureLayer with CircleNode in it.
Maybe I did misunderstand its' use and forgot to pass something to the callback class...
Any help will be appreciated.
UPD: For some reason it fires "hit" message when clicking on earth's atmosphere halo effect...
Solution was to add node to the registry, so it then could be picked. Here's implementation that worked for me:
Can you please elaborate on "use it without its own dedicated view?" What does that mean?
Sure... In the example application a separate view is being constructed. It draws outlines of objects/features that RTTPicker "sees". Also As it seems the picker itself works through that secondary view rather then through the main view.
Probably not. I think this approach gives the developer more flexibility. For example, you might want to index the node to a Feature object, or another Node, or an application object. Data loaded from earth files it automatically tagged, but that makes sense since the developer has no direct access to it.