Changeset 6347
- Timestamp:
- May 17, 2016, 12:43:56 AM (8 years ago)
- Location:
- geovis/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/RenderServer.h
r6281 r6347 21 21 class Stats; 22 22 23 #define GEOVIS_VERSION_STRING "0.7. 2"23 #define GEOVIS_VERSION_STRING "0.7.3" 24 24 25 25 #define MSECS_ELAPSED(t1, t2) \ -
geovis/trunk/RendererCmd.cpp
r6319 r6347 93 93 SocketRead(char *bytes, size_t len) 94 94 { 95 if (len == 0) return true; 95 96 ReadBuffer::BufferStatus status; 96 97 status = g_inBufPtr->followingData((unsigned char *)bytes, len); … … 1705 1706 } 1706 1707 1708 long ssSize; 1709 if (Tcl_GetLongFromObj(interp, objv[10], &ssSize) != TCL_OK) { 1710 return TCL_ERROR; 1711 } 1712 1707 1713 bool lighting = true; 1708 1714 osgEarth::Drivers::FeatureGeomModelOptions geomOpts; 1709 osgEarth::Config styleConf("style", Tcl_GetString(objv[10])); 1715 char *styleSheetStr = (char *)malloc((size_t)ssSize); 1716 if (!SocketRead(styleSheetStr, ssSize)) { 1717 free(styleSheetStr); 1718 return TCL_ERROR; 1719 } 1720 osgEarth::Config styleConf("style", styleSheetStr); 1721 free(styleSheetStr); 1710 1722 styleConf.add("type", "text/css"); 1711 1723 TRACE("style CSS: %s", styleConf.value().c_str()); … … 1761 1773 1762 1774 if (objc > 11) { 1763 std::string scripts(Tcl_GetString(objv[11])); 1775 long scriptSize; 1776 if (Tcl_GetLongFromObj(interp, objv[11], &scriptSize) != TCL_OK) { 1777 return TCL_ERROR; 1778 } 1779 char *scriptStr = NULL; 1780 if (scriptSize > 0) { 1781 scriptStr = (char *)malloc((size_t)scriptSize); 1782 if (!SocketRead(scriptStr, scriptSize)) { 1783 free(scriptStr); 1784 return TCL_ERROR; 1785 } 1786 } 1787 std::string scripts(scriptStr, scriptSize); 1788 free(scriptStr); 1764 1789 if (!scripts.empty()) { 1765 1790 TRACE("script: %s", scripts.c_str()); … … 1772 1797 } 1773 1798 if (objc > 12) { 1799 long selectorsSize; 1800 if (Tcl_GetLongFromObj(interp, objv[12], &selectorsSize) != TCL_OK) { 1801 return TCL_ERROR; 1802 } 1803 char *selectorsStr = (char *)malloc((size_t)selectorsSize); 1804 if (!SocketRead(selectorsStr, selectorsSize)) { 1805 free(selectorsStr); 1806 return TCL_ERROR; 1807 } 1808 Tcl_Obj *selectorsObj = Tcl_NewStringObj(selectorsStr, selectorsSize); 1774 1809 int numSelectors; 1775 1810 Tcl_Obj **selectors; 1776 if (Tcl_ListObjGetElements(interp, objv[12], &numSelectors, &selectors) != TCL_OK) {1811 if (Tcl_ListObjGetElements(interp, selectorObj, &numSelectors, &selectors) != TCL_OK) { 1777 1812 return TCL_ERROR; 1778 1813 } … … 1828 1863 geomOpts.styles()->selectors().push_back(ss); 1829 1864 } 1865 Tcl_DecrRefCount(selectorsObj); 1830 1866 } 1831 1867 geomOpts.enableLighting() = lighting; -
geovis/trunk/geovis_protocol.txt
r6276 r6347 266 266 <clamptechnique> = drape|gpu|scene|map 267 267 268 map layer add <layerName> feature <driver> <format> <typeName> <url> <cache> <style> <?scripts?> <?selectors?> <?visibilityRangeMin?> <?visibilityRangeMax?> 269 <style> = CSS styles (see: 268 map layer add <layerName> feature <driver> <format> <typeName> <url> <cache> <styleLen> <?scriptLen?> <?selectorsLen?> <?visibilityRangeMin?> <?visibilityRangeMax?> 269 Data payload follows command: style, then script, then selectors 270 <styleLen> = Number of bytes in style sheet. Stylesheet payload consists of 271 CSS-formatted styles (see: 270 272 http://docs.osgearth.org/en/latest/user/features.html and 271 273 http://docs.osgearth.org/en/latest/references/symbology.html) 272 <scripts> = JavaScript (see references above) 273 <selectors> = List of name/value pairs 274 <scriptLen> = Number of bytes in scripts. Scripts payload consists of 275 JavaScript code (see references above) 276 <selectorsLen> = Number of bytes in selectors. Selectors payload consists 277 of a Tcl list of name/value pairs 274 278 map layer add <layerName> icon <driver> <format> <typeName> <url> <cache> <icon> <scale> <heading> <declutter> <placement> <alignment> <?visibilityRangeMin?> <?visibilityRangeMax?> 275 279 Add an icon feature layer from a file or URL
Note: See TracChangeset
for help on using the changeset viewer.