Changeset 6002 for geovis/trunk/Picker.cpp
- Timestamp:
- Feb 11, 2016, 1:49:00 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/Picker.cpp
r5969 r6002 201 201 INFO("Hit feature ID: %lu (of %d) layer: %s", feature->getFID(), index->size(), layerName.c_str()); 202 202 203 clearSelection();203 _renderer->clearSelection(); 204 204 205 205 const osgEarth::Features::AttributeTable &attrs = feature->getAttrs(); … … 218 218 queueResponse(mesg, length, Response::VOLATILE, Response::DATA); 219 219 } else { 220 clearSelection();220 _renderer->clearSelection(); 221 221 osgEarth::Annotation::AnnotationNode* anno = 222 222 osgEarth::Registry::objectIndex()->get<osgEarth::Annotation::AnnotationNode>(id); … … 236 236 { 237 237 INFO("Select miss"); 238 clearSelection();238 _renderer->clearSelection(); 239 239 clearHighlight(); 240 240 … … 244 244 245 245 _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 }262 246 } 263 247
Note: See TracChangeset
for help on using the changeset viewer.