- Timestamp:
- Feb 11, 2016 1:49:00 PM (8 years ago)
- Location:
- geovis/trunk
- Files:
-
- 6 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 -
geovis/trunk/Picker.h
r5938 r6002 35 35 bool accept(const osgGA::GUIEventAdapter& ea, const osgGA::GUIActionAdapter& aa); 36 36 37 void clearSelection();38 39 37 private: 40 38 Renderer *_renderer; -
geovis/trunk/RenderServer.h
r5118 r6002 21 21 class Stats; 22 22 23 #define GEOVIS_VERSION_STRING "0.7. 0"23 #define GEOVIS_VERSION_STRING "0.7.1" 24 24 25 25 #define MSECS_ELAPSED(t1, t2) \ -
geovis/trunk/Renderer.cpp
r5998 r6002 1530 1530 { 1531 1531 TRACE("Select layer '%s', num features: %u", layerName, featureIDs.size()); 1532 clearSelection(); 1532 1533 if (featureIDs.size() == 0) { 1533 1534 // clear selection … … 1564 1565 _needsRedraw = true; 1565 1566 } 1567 } 1568 1569 void Renderer::clearSelection() 1570 { 1571 clearHighlight(); 1572 clearSelectionAnnotationNodes(); 1573 clearBoxSelection(); 1574 _needsRedraw = true; 1575 } 1576 1577 /** 1578 * \brief Remove annotation nodes created during a pick/selection 1579 * 1580 * The primary purpose of this method is to take down the feature placard 1581 */ 1582 void Renderer::clearSelectionAnnotationNodes() 1583 { 1584 osg::Group *nodes = getAnnotations(); 1585 std::vector<osg::Node *> toRemove; 1586 for (unsigned int i = 0; i < nodes->getNumChildren(); i++) { 1587 osg::Node *node = nodes->getChild(i); 1588 // This can be Placard, PlacardLabel, Label, Place or Track Node 1589 if (dynamic_cast<osgEarth::Annotation::OrthoNode *>(node) != NULL) { 1590 toRemove.push_back(node); 1591 } 1592 } 1593 for (std::vector<osg::Node *>::iterator itr = toRemove.begin(); 1594 itr != toRemove.end(); ++itr) { 1595 nodes->removeChild(*itr); 1596 } 1597 _needsRedraw = true; 1566 1598 } 1567 1599 -
geovis/trunk/Renderer.h
r5944 r6002 519 519 void selectFeatures(std::vector<unsigned long>& featureIDs, const char *layerName); 520 520 521 void clearSelection(); 522 521 523 void addRhumbBox(double latMin, double latMax, double longMin, double longMax); 522 524 … … 569 571 570 572 void initAnnotations(); 573 574 void clearSelectionAnnotationNodes(); 571 575 572 576 void initViewer(); -
geovis/trunk/RendererCmd.cpp
r5976 r6002 3380 3380 3381 3381 static int 3382 SelectFeatureOp(ClientData clientData, Tcl_Interp *interp, int objc, 3382 SelectClearOp(ClientData clientData, Tcl_Interp *interp, int objc, 3383 Tcl_Obj *const *objv) 3384 { 3385 g_renderer->clearSelection(); 3386 return TCL_OK; 3387 } 3388 3389 static int 3390 SelectFeatureOp(ClientData clientData, Tcl_Interp *interp, int objc, 3383 3391 Tcl_Obj *const *objv) 3384 3392 { … … 3407 3415 3408 3416 static int 3409 SelectModeOp(ClientData clientData, Tcl_Interp *interp, int objc, 3417 SelectModeOp(ClientData clientData, Tcl_Interp *interp, int objc, 3410 3418 Tcl_Obj *const *objv) 3411 3419 { 3412 //const char *modeStr = Tcl_GetString(objv[2]);3420 const char *modeStr = Tcl_GetString(objv[2]); 3413 3421 // Parse mode string 3414 3422 //Renderer::SelectMode mode; … … 3418 3426 3419 3427 static CmdSpec selectOps[] = { 3428 {"clear", 1, SelectClearOp, 2, 2, ""}, 3420 3429 {"feature", 1, SelectFeatureOp, 4, 4, "idlist layerName"}, 3421 {"mode", 1, SelectModeOp, 3, 3, "mode"},3430 {"mode", 1, SelectModeOp, 3, 3, "mode"}, 3422 3431 }; 3423 3432 static int nSelectOps = NumCmdSpecs(selectOps);
Note: See TracChangeset
for help on using the changeset viewer.