osgEarth 2.1.1
Classes | Functions | Variables

/home/cube/sources/osgearth/src/applications/osgearth_tilesource/osgearth_tilesource.cpp File Reference

#include <osg/Image>
#include <osgGA/StateSetManipulator>
#include <osgViewer/Viewer>
#include <osgViewer/ViewerEventHandlers>
#include <osgEarth/Map>
#include <osgEarth/MapNode>
#include <osgEarth/Registry>
#include <osgEarthSymbology/Geometry>
#include <osgEarthSymbology/GeometryRasterizer>
#include <osgEarthUtil/EarthManipulator>
#include <osgEarthUtil/AutoClipPlaneHandler>
Include dependency graph for osgearth_tilesource.cpp:

Go to the source code of this file.

Classes

class  CustomTileSource

Functions

int main (int argc, char **argv)

Variables

static osg::Vec4 colors [4]

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 77 of file osgearth_tilesource.cpp.

{
    osg::ArgumentParser arguments(&argc,argv);

    osgViewer::Viewer viewer(arguments);

    // Start by creating the map:
    Map* map = new Map();

    // Create out image layer with a custom tile source.
    ImageLayerOptions options( "custom" );
    map->addImageLayer( new ImageLayer(options, new CustomTileSource()) );

    // That's it, the map is ready; now create a MapNode to render the Map:
    MapNode* mapNode = new MapNode( map );

    viewer.setSceneData( mapNode );
    viewer.setCameraManipulator( new EarthManipulator() );

    // add some stock OSG handlers:
    viewer.addEventHandler(new osgViewer::StatsHandler());
    viewer.addEventHandler(new osgViewer::WindowSizeHandler());
    viewer.addEventHandler(new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()));

    return viewer.run();
}

Here is the call graph for this function:


Variable Documentation

osg::Vec4 colors[4] [static]
Initial value:
 {
    osg::Vec4(1,0,0,1),
    osg::Vec4(0,1,0,1),
    osg::Vec4(0,0,1,1),
    osg::Vec4(0,0,0,1)
}

This sample demonstrated how to create a custom TileSource.

Definition at line 39 of file osgearth_tilesource.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines