Information about picked Feature

classic Classic list List threaded Threaded
3 messages Options
Tension Tension
Reply | Threaded
Open this post in threaded view
|

Information about picked Feature

Hi!

I have a RTTPicker callback where i process hits on ObjectID's. Besides annotations and featurenodes i process data from FeatureModelLayer like that:

FeatureIndex* index = Registry::objectIndex()->get<FeatureIndex>(id);
Feature* feature = index ? index->getFeature(id) : 0;

Is there way to know somehow which featuremodellayer (or featuresource used in this layer) corresponds to picked feature?

The only way i see right now is put some additional metadata to attributes or to osg::Object userdata, but maybe there is another way that I have not thought of?

Thanks.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Information about picked Feature

You should be able to dynamic_cast the FeatureIndex* to a FeatureSourceIndex*, and then call getFeatureSource() on that object.
Glenn Waldron / Pelican Mapping
Tension Tension
Reply | Threaded
Open this post in threaded view
|

Re: Information about picked Feature

Thanks! That's exactly what i was looking for.