Ignore:
Timestamp:
Feb 11, 2016, 1:49:00 PM (9 years ago)
Author:
ldelgass
Message:

Add 'select clear' protocol command, clear previous selection on 'select
feature...' command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • geovis/trunk/Picker.cpp

    r5969 r6002  
    201201        INFO("Hit feature ID: %lu (of %d) layer: %s", feature->getFID(), index->size(), layerName.c_str());
    202202
    203         clearSelection();
     203        _renderer->clearSelection();
    204204
    205205        const osgEarth::Features::AttributeTable &attrs = feature->getAttrs();
     
    218218        queueResponse(mesg, length, Response::VOLATILE, Response::DATA);
    219219    } else {
    220         clearSelection();
     220        _renderer->clearSelection();
    221221        osgEarth::Annotation::AnnotationNode* anno =
    222222            osgEarth::Registry::objectIndex()->get<osgEarth::Annotation::AnnotationNode>(id);
     
    236236{
    237237    INFO("Select miss");
    238     clearSelection();
     238    _renderer->clearSelection();
    239239    clearHighlight();
    240240
     
    244244
    245245    _renderer->eventuallyRender();
    246 }
    247 
    248 void SelectCallback::clearSelection()
    249 {
    250     osg::Group *nodes = _renderer->getAnnotations();
    251     std::vector<osg::Node *> toRemove;
    252     for (unsigned int i = 0; i < nodes->getNumChildren(); i++) {
    253         osg::Node *node = nodes->getChild(i);
    254         if (dynamic_cast<osgEarth::Annotation::OrthoNode *>(node) != NULL) {
    255             toRemove.push_back(node);
    256         }
    257     }
    258     for (std::vector<osg::Node *>::iterator itr = toRemove.begin();
    259          itr != toRemove.end(); ++itr) {
    260         nodes->removeChild(*itr);
    261     }
    262246}
    263247
Note: See TracChangeset for help on using the changeset viewer.