- Timestamp:
- Aug 30, 2016, 9:06:42 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/RendererCmd.cpp
r6496 r6510 47 47 #include <osgEarthDrivers/wms/WMSOptions> 48 48 #include <osgEarthDrivers/xyz/XYZOptions> 49 #include <osgEarthDrivers/mask_feature/FeatureMaskOptions> 49 50 #include <osgEarthDrivers/model_feature_geom/FeatureGeomModelOptions> 50 51 #include <osgEarthDrivers/model_simple/SimpleModelOptions> … … 1970 1971 } 1971 1972 g_renderer->addModelLayer(name, geomOpts, pos, cache, lighting, visible); 1973 } else if (type[0] == 'm' && strcmp(type, "mask") == 0) { 1974 char *driver = Tcl_GetString(objv[5]); 1975 char *format = Tcl_GetString(objv[6]); 1976 if (format && strlen(format) > 0 && 1977 strcmp(format, "json") != 0 && strcmp(format, "gml") != 0) { 1978 Tcl_AppendResult(interp, "unknown format \"", format, 1979 "\": should be 'json' or 'gml'", (char*)NULL); 1980 return TCL_ERROR; 1981 } 1982 char *typeName = Tcl_GetString(objv[7]); 1983 osgEarth::Drivers::FeatureMaskOptions maskOpts; 1984 std::string url; 1985 if (objc > 8) { 1986 char *urlIn = Tcl_GetString(objv[8]); 1987 url = g_renderer->getCanonicalPath(std::string(urlIn)); 1988 if (url.empty()) { 1989 Tcl_AppendResult(interp, "file not found: \"", 1990 urlIn, "\"", (char*)NULL); 1991 return TCL_ERROR; 1992 } 1993 } 1994 if (driver[0] == 'o' && strcmp(driver, "ogr") == 0) { 1995 osgEarth::Drivers::OGRFeatureOptions maskBoundaryOpts; 1996 maskBoundaryOpts.url() = url; 1997 maskOpts.featureOptions() = maskBoundaryOpts; 1998 } else { 1999 Tcl_AppendResult(interp, "unknown mask driver \"", driver, 2000 "\": should be 'db', 'ogr', 'tfs', or 'wfs'", (char*)NULL); 2001 return TCL_ERROR; 2002 } 2003 int minLOD = 0; 2004 if (objc > 9) { 2005 if (Tcl_GetIntFromObj(interp, objv[9], &minLOD) != TCL_OK) { 2006 return TCL_ERROR; 2007 } 2008 } 2009 g_renderer->addTerrainMaskLayer(name, maskOpts, (unsigned)minLOD); 1972 2010 } else if (type[0] == 'm' && strcmp(type, "model") == 0) { 1973 2011 char *driver = Tcl_GetString(objv[5]); … … 2600 2638 g_renderer->removeImageLayer(name); 2601 2639 g_renderer->removeElevationLayer(name); 2640 g_renderer->removeTerrainMaskLayer(name); 2602 2641 g_renderer->removeModelLayer(name); 2603 2642 } else { … … 2657 2696 g_renderer->getImageLayerNames(layers); 2658 2697 g_renderer->getElevationLayerNames(layers); 2698 g_renderer->getTerrainMaskLayerNames(layers); 2659 2699 g_renderer->getModelLayerNames(layers); 2660 2700 } else { … … 2664 2704 } else if (type[0] == 'e' && strcmp(type, "elevation") == 0) { 2665 2705 g_renderer->getElevationLayerNames(layers); 2706 } else if (type[0] == 'm' && strcmp(type, "mask") == 0) { 2707 g_renderer->getTerrainMaskLayerNames(layers); 2666 2708 } else if (type[0] == 'm' && strcmp(type, "model") == 0) { 2667 2709 g_renderer->getModelLayerNames(layers); 2668 2710 } else { 2669 2711 Tcl_AppendResult(interp, "uknown type \"", type, 2670 "\": must be image, elevation or model", (char*)NULL); 2712 "\": must be image, elevation, mask or model", 2713 (char*)NULL); 2671 2714 return TCL_ERROR; 2672 2715 }
Note: See TracChangeset
for help on using the changeset viewer.