Changeset 6281
- Timestamp:
- Apr 20, 2016, 3:20:44 PM (9 years ago)
- Location:
- geovis/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/Picker.cpp
r6253 r6281 179 179 180 180 SelectCallback::SelectCallback(Renderer *renderer) : 181 _renderer(renderer) 181 _renderer(renderer), 182 _modifier(false) 182 183 { 183 184 installHighlighter(renderer->getMapNode()->getOrCreateStateSet(), … … 202 203 } 203 204 } 204 TRACE("Hit featureID: %lu (of %d) layer: %s", feature->getFID(), index->size(), layerName.c_str());205 TRACE("Hit FID: %lu (of %d) layer: %s", feature->getFID(), index->size(), layerName.c_str()); 205 206 206 207 std::vector<unsigned long> fids; 207 208 fids.push_back(feature->getFID()); 208 _renderer->selectFeatures(fids, layerName.c_str(), true);209 _renderer->selectFeatures(fids, layerName.c_str(), !_modifier); 209 210 _renderer->addPlacard(_pickPoint, feature, layerName.c_str()); 210 211 211 212 char mesg[256]; 212 snprintf(mesg, sizeof(mesg), "nv>select feature %u %lu %d {%s}\n", id, feature->getFID(), index->size(), layerName.c_str()); 213 if (_modifier) { 214 // Check if already selected 215 snprintf(mesg, sizeof(mesg), "nv>select feature add {%lu} {%s}\n", feature->getFID(), layerName.c_str()); 216 } else { 217 snprintf(mesg, sizeof(mesg), "nv>select feature set {%lu} {%s}\n", feature->getFID(), layerName.c_str()); 218 } 213 219 size_t length = strlen(mesg); 214 220 queueResponse(mesg, length, Response::VOLATILE, Response::DATA); … … 220 226 TRACE("Hit AnnotationNode: %p, \"%s\"", anno, anno->getName().c_str()); 221 227 char mesg[256]; 222 snprintf(mesg, sizeof(mesg), "nv>select annotation %u {%s}\n", id, anno->getName().c_str());228 snprintf(mesg, sizeof(mesg), "nv>select annotation {%s}\n", anno->getName().c_str()); 223 229 size_t length = strlen(mesg); 224 230 queueResponse(mesg, length, Response::VOLATILE, Response::DATA); … … 248 254 _x = ea.getX(); 249 255 _y = ea.getY(); 256 // Modifier-click? 257 _modifier = (ea.getModKeyMask() & osgGA::GUIEventAdapter::MODKEY_CTRL) != 0; 250 258 return false; 251 259 } else if (ea.getEventType() == ea.RELEASE) { -
geovis/trunk/Picker.h
r6013 r6281 38 38 Renderer *_renderer; 39 39 float _x, _y; 40 bool _modifier; 40 41 osgEarth::GeoPoint _pickPoint; 41 42 }; -
geovis/trunk/RenderServer.h
r6002 r6281 21 21 class Stats; 22 22 23 #define GEOVIS_VERSION_STRING "0.7. 1"23 #define GEOVIS_VERSION_STRING "0.7.2" 24 24 25 25 #define MSECS_ELAPSED(t1, t2) \
Note: See TracChangeset
for help on using the changeset viewer.