Changeset 6496 for geovis


Ignore:
Timestamp:
Aug 22, 2016 2:55:32 PM (8 years ago)
Author:
ldelgass
Message:

Add basic model layer support, bump version

Location:
geovis/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • geovis/trunk/RenderServer.h

    r6347 r6496  
    2121class Stats;
    2222
    23 #define GEOVIS_VERSION_STRING "0.7.3"
     23#define GEOVIS_VERSION_STRING "0.7.4"
    2424
    2525#define MSECS_ELAPSED(t1, t2) \
  • geovis/trunk/RendererCmd.cpp

    r6489 r6496  
    4848#include <osgEarthDrivers/xyz/XYZOptions>
    4949#include <osgEarthDrivers/model_feature_geom/FeatureGeomModelOptions>
     50#include <osgEarthDrivers/model_simple/SimpleModelOptions>
    5051#include <osgEarthDrivers/feature_ogr/OGRFeatureOptions>
    5152#include <osgEarthDrivers/feature_tfs/TFSFeatureOptions>
     
    19691970        }
    19701971        g_renderer->addModelLayer(name, geomOpts, pos, cache, lighting, visible);
     1972    } else if (type[0] == 'm' && strcmp(type, "model") == 0) {
     1973        char *driver = Tcl_GetString(objv[5]);
     1974        if (strcmp(driver, "simple") != 0) {
     1975            return TCL_ERROR;
     1976        }
     1977        osgEarth::Drivers::SimpleModelOptions modelOpts;
     1978        std::string url;
     1979        if (objc > 6) {
     1980            char *urlIn = Tcl_GetString(objv[6]);
     1981            url = g_renderer->getCanonicalPath(std::string(urlIn));
     1982            if (url.empty()) {
     1983                Tcl_AppendResult(interp, "file not found: \"",
     1984                                 urlIn, "\"", (char*)NULL);
     1985                return TCL_ERROR;
     1986            }
     1987        }
     1988        modelOpts.url() = url;
     1989        double x, y, z;
     1990        x = y = z = 0.0;
     1991        if (objc > 8) {
     1992            if (Tcl_GetDoubleFromObj(interp, objv[7], &x) != TCL_OK ||
     1993                Tcl_GetDoubleFromObj(interp, objv[8], &y) != TCL_OK) {
     1994                return TCL_ERROR;
     1995            }
     1996        }
     1997        if (objc > 9) {
     1998            if (Tcl_GetDoubleFromObj(interp, objv[9], &z) != TCL_OK) {
     1999                return TCL_ERROR;
     2000            }
     2001        }
     2002        modelOpts.location() = osg::Vec3d(x, y, z);
     2003        //double rotx = 0.0, roty = 0.0, rotz = 0.0;
     2004        //modelOpts.orientation() = osg::Vec3d(rotx, roty, rotz);
     2005        modelOpts.paged() = false;
     2006        bool lighting = true;
     2007        g_renderer->addModelLayer(name, modelOpts, pos, cache, lighting, visible);
    19712008    } else if (type[0] == 'i' && strcmp(type, "icon") == 0) {
    19722009        char *driver = Tcl_GetString(objv[5]);
  • geovis/trunk/geovis_protocol.txt

    r6489 r6496  
    295295    <alignment> = left_top|left_center|left_bottom|center_top|center_center|center_bottom|right_top|right_center|right_bottom|left_baseline|center|baseline|right_baseline|left_bottom_baseline|center_bottom_baseline|right_bottom_baseline
    296296
     297map layer add <layerName> model simple <url> <x> <y> <?z?>
     298    <url> = Path to a 3D model file that OSG can load (e.g. .osg file)
     299    <x>,<y>,<z> = Map coordinates for placing the model
     300
    297301map layer delete <layerName>
    298302map layer opacity <opacity> <layerName>
Note: See TracChangeset for help on using the changeset viewer.