Changeset 6019


Ignore:
Timestamp:
Feb 16, 2016 2:00:54 AM (8 years ago)
Author:
ldelgass
Message:

Make layer name really optional in 'map layer visible...'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • geovis/trunk/RendererCmd.cpp

    r6002 r6019  
    24932493        return TCL_ERROR;
    24942494    }
    2495     char *name = Tcl_GetString(objv[4]);
    2496 
    2497     g_renderer->setImageLayerVisibility(name, visible);
    2498     g_renderer->setElevationLayerVisibility(name, visible);
    2499     g_renderer->setModelLayerVisibility(name, visible);
     2495
     2496    if (objc > 4) {
     2497        char *name = Tcl_GetString(objv[4]);
     2498        g_renderer->setImageLayerVisibility(name, visible);
     2499        g_renderer->setElevationLayerVisibility(name, visible);
     2500        g_renderer->setModelLayerVisibility(name, visible);
     2501    } else {
     2502        std::vector<std::string> layers;
     2503        g_renderer->getImageLayerNames(layers);
     2504        g_renderer->getElevationLayerNames(layers);
     2505        g_renderer->getModelLayerNames(layers);
     2506        for (std::vector<std::string>::iterator itr = layers.begin();
     2507             itr != layers.end(); ++itr) {
     2508            g_renderer->setImageLayerVisibility(itr->c_str(), visible);
     2509            g_renderer->setElevationLayerVisibility(itr->c_str(), visible);
     2510            g_renderer->setModelLayerVisibility(itr->c_str(), visible);
     2511        }
     2512    }
    25002513
    25012514    return TCL_OK;
     
    25072520    {"move",    1, MapLayerMoveOp,      5, 5, "pos name"},
    25082521    {"names",   1, MapLayerNamesOp,     3, 4, "?type?"},
    2509     {"opacity", 1, MapLayerOpacityOp,   5, 5, "opacity ?name?"},
    2510     {"visible", 1, MapLayerVisibleOp,   5, 5, "bool ?name?"},
     2522    {"opacity", 1, MapLayerOpacityOp,   5, 5, "opacity name"},
     2523    {"visible", 1, MapLayerVisibleOp,   4, 5, "bool ?name?"},
    25112524};
    25122525static int nMapLayerOps = NumCmdSpecs(mapLayerOps);
Note: See TracChangeset for help on using the changeset viewer.