Changeset 6276 for geovis/trunk
- Timestamp:
- Apr 19, 2016, 1:48:41 PM (8 years ago)
- Location:
- geovis/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/Renderer.cpp
r6275 r6276 1841 1841 _sceneRoot->accept(spnv); 1842 1842 _needsRedraw = true; 1843 } 1844 1845 void Renderer::getBoxSelection(double *latMin, double *latMax, double *longMin, double *longMax) 1846 { 1847 osgEarth::Annotation::FeatureNode *node = _selectionBox.get(); 1848 if (node == NULL) 1849 return; 1850 osgEarth::Symbology::Geometry *geom = node->getFeature()->getGeometry(); 1851 if (geom == NULL) 1852 return; 1853 *latMin = (*geom)[0].y(); 1854 *latMax = (*geom)[2].y(); 1855 *longMin = (*geom)[1].x(); 1856 *longMax = (*geom)[0].x(); 1843 1857 } 1844 1858 -
geovis/trunk/Renderer.h
r6254 r6276 549 549 void initBoxSelection(int x, int y); 550 550 void updateBoxSelection(int x, int y); 551 void getBoxSelection(double *latMin, double *latMax, double *longMin, double *longMax); 551 552 void clearBoxSelection(); 552 553 -
geovis/trunk/RendererCmd.cpp
r6254 r6276 1177 1177 1178 1178 static int 1179 MapBox InitOp(ClientData clientData, Tcl_Interp *interp, int objc,1180 1179 MapBoxEndOp(ClientData clientData, Tcl_Interp *interp, int objc, 1180 Tcl_Obj *const *objv) 1181 1181 { 1182 1182 int x, y; … … 1185 1185 return TCL_ERROR; 1186 1186 } 1187 g_renderer->initBoxSelection(x, y); 1188 return TCL_OK; 1189 } 1190 1191 static int 1192 MapBoxUpdateOp(ClientData clientData, Tcl_Interp *interp, int objc, 1193 Tcl_Obj *const *objv) 1187 g_renderer->updateBoxSelection(x, y); 1188 1189 // Notify client of selected region 1190 double latMin, latMax, longMin, longMax; 1191 latMin = latMax = longMin = longMax = 0; 1192 g_renderer->getBoxSelection(&latMin, &latMax, &longMin, &longMax); 1193 1194 std::ostringstream oss; 1195 oss << "nv>select region " 1196 << longMin << " " 1197 << latMin << " " 1198 << longMax << " " 1199 << latMax << "\n"; 1200 std::string ostr = oss.str(); 1201 size_t len = ostr.size(); 1202 queueResponse(ostr.c_str(), len, Response::VOLATILE); 1203 return TCL_OK; 1204 } 1205 1206 static int 1207 MapBoxInitOp(ClientData clientData, Tcl_Interp *interp, int objc, 1208 Tcl_Obj *const *objv) 1194 1209 { 1195 1210 int x, y; … … 1198 1213 return TCL_ERROR; 1199 1214 } 1215 g_renderer->initBoxSelection(x, y); 1216 return TCL_OK; 1217 } 1218 1219 static int 1220 MapBoxUpdateOp(ClientData clientData, Tcl_Interp *interp, int objc, 1221 Tcl_Obj *const *objv) 1222 { 1223 int x, y; 1224 if (Tcl_GetIntFromObj(interp, objv[3], &x) != TCL_OK || 1225 Tcl_GetIntFromObj(interp, objv[4], &y) != TCL_OK) { 1226 return TCL_ERROR; 1227 } 1200 1228 g_renderer->updateBoxSelection(x, y); 1201 1229 return TCL_OK; … … 1204 1232 static CmdSpec mapBoxOps[] = { 1205 1233 {"clear", 1, MapBoxClearOp, 3, 3, ""}, 1234 {"end", 1, MapBoxEndOp, 5, 5, "x y"}, 1206 1235 {"init", 1, MapBoxInitOp, 5, 5, "x y"}, 1207 1236 {"update", 1, MapBoxUpdateOp, 5, 5, "x y"}, -
geovis/trunk/geovis_protocol.txt
r6255 r6276 355 355 nv>select clear 356 356 nv>select feature <guid> <featureIDList> <numFeatures> <layerName> 357 nv>select region <xmin> <ymin> <xmax> <ymax> 357 358 nv>ok -token <seqnum> 358 359 Reply indicated commands through <seqnum> (numbered beginning at 0) have been
Note: See TracChangeset
for help on using the changeset viewer.