osgEarth 2.1.1
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables

osgEarth Namespace Reference

Namespaces

namespace  Drivers
namespace  Features
namespace  Json
namespace  ShaderComp
namespace  Symbology
namespace  Threading
namespace  Util

Classes

class  CacheSeed
class  CacheOptions
class  DiskCacheOptions
class  TMSCacheOptions
struct  CacheSpec
class  Cache
class  MemCache
class  DiskCache
class  TMSCache
class  CacheDriver
class  CacheFactory
class  Capabilities
struct  optional
class  CompositeTileSourceOptions
class  CompositeTileSource
struct  Properties
class  Config
class  ConfigOptions
class  DriverConfigOptions
class  CubeUtils
class  CubeFaceLocator
class  CubeSpatialReference
class  UnifiedCubeProfile
class  DrapeableNode
struct  ECEF
struct  EGM96Geoid
class  ElevationLayerOptions
struct  ElevationLayerCallback
class  ElevationLayer
class  ElevationQuery
class  FindTopMostNodeOfTypeVisitor
class  Bounds
class  GeoExtent
class  DataExtent
class  GeoImage
class  GeoHeightField
class  Geoid
class  GeoMath
class  HeightFieldUtils
struct  CompositeValidValueOperator
struct  ReplaceInvalidDataOperator
struct  FillNoDataOperator
class  ProxySettings
class  HTTPRequest
class  HTTPResponse
class  HTTPClient
struct  StreamObject
class  ImageLayerOptions
struct  ImageLayerCallback
class  ImageLayerTileProcessor
class  ImageLayer
struct  TileImage
class  ImageMosaic
class  ImageToHeightFieldConverter
class  ImageUtils
class  Layer
class  LTPSpatialReference
class  GeoLocator
class  MercatorLocator
struct  MapModelChange
struct  MapCallback
class  Map
class  MapInfo
class  MapFrame
class  MapNode
class  MapNodeOptions
class  MapOptions
class  MaskLayerOptions
class  MaskLayer
class  MaskNode
class  MaskSourceOptions
class  MaskSource
class  MaskSourceDriver
class  MaskSourceFactory
class  ModelLayerOptions
struct  ModelLayerCallback
class  ModelLayer
class  ModelSourceOptions
class  ModelSource
class  ModelSourceDriver
class  ModelSourceFactory
struct  ClusterCullerFactory
class  RemoveEmptyGroupsVisitor
class  OverlayDecorator
class  ProfileOptions
class  Profile
class  ProgressCallback
class  ConsoleProgressCallback
class  Random
class  Registry
struct  Revision
class  Revisioned
class  ShaderFactory
class  VirtualProgram
class  UpdateLightingUniformsHelper
class  ArrayUniform
class  SpatialReference
class  StringTokenizer
struct  Stringify
class  TaskRequest
struct  ParallelTask
class  TaskRequestQueue
struct  TaskThread
class  TaskService
class  TaskServiceManager
class  TerrainEngineNode
class  TerrainEngineNodeFactory
class  TerrainDecorator
struct  TerrainEngineNodeCallbackProxy
class  TerrainLayerOptions
struct  TerrainLayerCallback
class  TerrainLayer
class  LoadingPolicy
class  TerrainOptions
class  TextureLayout
class  TextureCompositorTechnique
class  TextureCompositor
class  TextureCompositorMultiTexture
class  TileKey
class  TileSourceOptions
class  TileBlacklist
class  TileSource
class  TileSourceDriver
class  TileSourceFactory
class  TileFormat
class  TileSet
class  TileMap
class  TileMapReaderWriter
class  Units
class  qualified_double
struct  Linear
struct  Angular
struct  Temporal
struct  Speed
class  URIContext
class  URIStream
class  URI
class  CacheStats
class  LRUCache
struct  CullNodeByNormal
struct  CullDrawableByNormal
struct  CullNodeByHorizon
struct  CullNodeByFrameNumber
class  PixelAutoTransform
class  MixinVector
class  VerticalSpatialReference
class  XmlNode
class  XmlElement
class  XmlText
class  XmlDocument
class  Style
class  WMSCapabilities
class  WMSCapabilitiesReader

Typedefs

typedef int UID
typedef std::list< class ConfigConfigSet
typedef void(ElevationLayerCallback::* ElevationLayerCallbackMethodPtr )(class ElevationLayer *layer)
typedef std::list
< osg::ref_ptr
< ElevationLayerCallback > > 
ElevationLayerCallbackList
typedef std::vector
< osg::ref_ptr< ElevationLayer > > 
ElevationLayerVector
typedef std::vector< DataExtentDataExtentList
typedef std::vector< GeoImageGeoImageVector
typedef std::vector
< GeoHeightField
GeoHeightFieldVector
typedef void(ImageLayerCallback::* ImageLayerCallbackMethodPtr )(ImageLayer *layer)
typedef std::list
< osg::ref_ptr
< ImageLayerCallback > > 
ImageLayerCallbackList
typedef std::vector
< osg::ref_ptr< ImageLayer > > 
ImageLayerVector
typedef std::list
< osg::ref_ptr< MapCallback > > 
MapCallbackList
typedef std::vector
< osg::ref_ptr< MaskLayer > > 
MaskLayerVector
typedef void(ModelLayerCallback::* ModelLayerCallbackMethodPtr )(ModelLayer *layer)
typedef std::list
< osg::ref_ptr
< ModelLayerCallback > > 
ModelLayerCallbackList
typedef std::vector
< osg::ref_ptr< ModelLayer > > 
ModelLayerVector
typedef std::vector< std::string > StringVector
typedef std::list
< osg::ref_ptr< TaskRequest > > 
TaskRequestList
typedef std::vector
< osg::ref_ptr< TaskRequest > > 
TaskRequestVector
typedef std::multimap< float,
osg::ref_ptr< TaskRequest > > 
TaskRequestPriorityMap
typedef void(TerrainLayerCallback::* TerrainLayerCallbackMethodPtr )(TerrainLayer *layer)
typedef std::vector
< osg::ref_ptr< TerrainLayer > > 
TerrainLayerVector
typedef std::vector
< TileSourceOptions
TileSourceOptionsVector
typedef std::vector
< osg::ref_ptr< TileSource > > 
TileSourceVector
typedef std::vector
< osg::ref_ptr< XmlNode > > 
XmlNodeList
typedef std::map< std::string,
std::string > 
XmlAttributes
typedef std::vector
< osg::ref_ptr< XmlElement > > 
XmlElementList
typedef std::stack
< osg::ref_ptr< XmlElement > > 
XmlElementStack
typedef std::stack< XmlElement * > XmlElementNoRefStack

Enumerations

enum  GeoInterpolation { GEOINTERP_GREAT_CIRCLE, GEOINTERP_RHUMB_LINE }

Functions

OSGEARTH_EXPORT bool isRelativePath (const std::string &fileName)
OSGEARTH_EXPORT std::string getFullPath (const std::string &relativeTo, const std::string &relativePath)
OSGEARTH_EXPORT bool isZipPath (const std::string &path)
template<typename T >
T * findTopMostNodeOfType (osg::Node *node)
template<typename T >
T * findFirstParentOfType (osg::Node *node)
template<typename T >
T * findRelativeNodeOfType (osg::Node *node)
static size_t StreamObjectReadCallback (void *ptr, size_t size, size_t nmemb, void *data)
OSGEARTH_EXPORT void setNotifyLevel (osg::NotifySeverity severity)
OSGEARTH_EXPORT osg::NotifySeverity getNotifyLevel ()
OSGEARTH_EXPORT bool isNotifyEnabled (osg::NotifySeverity severity)
OSGEARTH_EXPORT bool initNotifyLevel ()
OSGEARTH_EXPORT std::ostream & notify (const osg::NotifySeverity severity)
std::ostream & notify (void)
static std::string & replaceIn (std::string &s, const std::string &sub, const std::string &other)
static std::string trim (const std::string &in)
static bool startsWith (const std::string &ref, const std::string &pattern)
static bool endsWith (const std::string &ref, const std::string &pattern)
static std::string joinStrings (const StringVector &input, char delim)
static std::string toLower (const std::string &input)
static osg::Vec4ub stringToColor (const std::string &str, osg::Vec4ub default_value)
static std::string colorToString (const osg::Vec4ub &c)
static osg::Vec3f stringToVec3f (const std::string &str, const osg::Vec3f &default_value)
static std::string vec3fToString (const osg::Vec3f &v)
static osg::Vec4f htmlColorToVec4f (const std::string &html)
static std::string vec4fToHtmlColor (const osg::Vec4f &c)
static unsigned int hashString (const std::string &input)
template<typename T >
as (const std::string &str, const T &default_value)
template<>
bool as< bool > (const std::string &str, const bool &default_value)
template<>
osg::Vec3f as< osg::Vec3f > (const std::string &str, const osg::Vec3f &default_value)
template<>
std::string as< std::string > (const std::string &str, const std::string &default_value)
template<typename T >
std::string toString (const T &value)
template<>
std::string toString< bool > (const bool &value)
template<>
std::string toString< osg::Vec3f > (const osg::Vec3f &value)
OSGEARTH_EXPORT int computeLoadingThreads (const LoadingPolicy &policy)
OSGEARTH_EXPORT void removeEventHandler (osgViewer::View *view, osgGA::GUIEventHandler *handler)

Variables

const double MERC_MINX = -2.00375e+007
const double MERC_MINY = -2.00375e+007
const double MERC_MAXX = 2.00375e+007
const double MERC_MAXY = 2.00375e+007
const double MERC_WIDTH = MERC_MAXX - MERC_MINX
const double MERC_HEIGHT = MERC_MAXY - MERC_MINY
class OSGEARTH_EXPORT GeoLocator

Detailed Description

osgEarth core

A collection of utilities for creating geometric features

Controls - A simple 2D UI toolkit.

Controls are 2D interface components that automatically layout to fit their containers. The support layout containers, margins and padding, alignment/justification, and docking. Controls are a quick and easy way to add "HUD" components to a scene. Just create a ControlSurface and add it to a View's scene. Then create and add Controls to that surface.


Typedef Documentation

typedef std::list<class Config> osgEarth::ConfigSet

Definition at line 36 of file Config.

typedef std::vector< DataExtent > osgEarth::DataExtentList

Definition at line 228 of file GeoData.

Definition at line 65 of file ElevationLayer.

typedef void(ElevationLayerCallback::* osgEarth::ElevationLayerCallbackMethodPtr)(class ElevationLayer *layer)

Definition at line 63 of file ElevationLayer.

typedef std::vector< osg::ref_ptr<ElevationLayer> > osgEarth::ElevationLayerVector

Definition at line 135 of file ElevationLayer.

Definition at line 412 of file GeoData.

typedef std::vector<GeoImage> osgEarth::GeoImageVector

Definition at line 332 of file GeoData.

typedef std::list< osg::ref_ptr<ImageLayerCallback> > osgEarth::ImageLayerCallbackList

Definition at line 129 of file ImageLayer.

typedef void(ImageLayerCallback::* osgEarth::ImageLayerCallbackMethodPtr)(ImageLayer *layer)

Definition at line 127 of file ImageLayer.

typedef std::vector< osg::ref_ptr<ImageLayer> > osgEarth::ImageLayerVector

Definition at line 233 of file ImageLayer.

typedef std::list< osg::ref_ptr<MapCallback> > osgEarth::MapCallbackList

Definition at line 105 of file Map.

typedef std::vector< osg::ref_ptr<MaskLayer> > osgEarth::MaskLayerVector

Definition at line 115 of file MaskLayer.

typedef std::list< osg::ref_ptr<ModelLayerCallback> > osgEarth::ModelLayerCallbackList

Definition at line 100 of file ModelLayer.

typedef void(ModelLayerCallback::* osgEarth::ModelLayerCallbackMethodPtr)(ModelLayer *layer)

Definition at line 98 of file ModelLayer.

typedef std::vector< osg::ref_ptr<ModelLayer> > osgEarth::ModelLayerVector

Definition at line 200 of file ModelLayer.

typedef std::vector<std::string> osgEarth::StringVector

Definition at line 34 of file StringUtils.

typedef std::list< osg::ref_ptr<TaskRequest> > osgEarth::TaskRequestList

Definition at line 91 of file TaskService.

typedef std::multimap< float, osg::ref_ptr<TaskRequest> > osgEarth::TaskRequestPriorityMap

Definition at line 95 of file TaskService.

typedef std::vector< osg::ref_ptr<TaskRequest> > osgEarth::TaskRequestVector

Definition at line 93 of file TaskService.

typedef void(TerrainLayerCallback::* osgEarth::TerrainLayerCallbackMethodPtr)(TerrainLayer *layer)

Definition at line 189 of file TerrainLayer.

typedef std::vector<osg::ref_ptr<TerrainLayer> > osgEarth::TerrainLayerVector

Definition at line 320 of file TerrainLayer.

Definition at line 139 of file TileSource.

typedef std::vector< osg::ref_ptr<TileSource> > osgEarth::TileSourceVector

Definition at line 388 of file TileSource.

typedef int osgEarth::UID

Definition at line 44 of file Common.

typedef std::map<std::string,std::string> osgEarth::XmlAttributes

Definition at line 53 of file XmlUtils.

typedef std::vector<osg::ref_ptr<XmlElement> > osgEarth::XmlElementList

Definition at line 105 of file XmlUtils.

Definition at line 109 of file XmlUtils.

typedef std::stack<osg::ref_ptr<XmlElement> > osgEarth::XmlElementStack

Definition at line 107 of file XmlUtils.

typedef std::vector<osg::ref_ptr<XmlNode> > osgEarth::XmlNodeList

Definition at line 51 of file XmlUtils.


Enumeration Type Documentation

Types of interpolation between two geodetic locations.

Enumerator:
GEOINTERP_GREAT_CIRCLE 
GEOINTERP_RHUMB_LINE 

Definition at line 32 of file GeoMath.


Function Documentation

template<typename T >
T osgEarth::as ( const std::string &  str,
const T &  default_value 
) [inline]

Definition at line 286 of file StringUtils.

    {
        T temp = default_value;
        std::istringstream strin( str );
        if ( !strin.eof() ) strin >> temp;
        return temp;
    }
template<>
bool osgEarth::as< bool > ( const std::string &  str,
const bool &  default_value 
) [inline]

Definition at line 296 of file StringUtils.

    {
        std::string temp = str;
        std::transform( temp.begin(), temp.end(), temp.begin(), ::tolower );
        return
            temp == "true" || temp == "yes" || temp == "on" ? true :
            temp == "false" || temp == "no" || temp == "off" ? false :
            default_value;
    }

Here is the caller graph for this function:

template<>
osg::Vec3f osgEarth::as< osg::Vec3f > ( const std::string &  str,
const osg::Vec3f &  default_value 
) [inline]

Definition at line 307 of file StringUtils.

    {
        return stringToVec3f(str, default_value);
    }

Here is the call graph for this function:

template<>
std::string osgEarth::as< std::string > ( const std::string &  str,
const std::string &  default_value 
) [inline]

Definition at line 314 of file StringUtils.

    {
        return str;
    }
static std::string osgEarth::colorToString ( const osg::Vec4ub &  c) [static]

Creates a string in the form "255 255 255 255" (r g b a [0..255]) from a color

Definition at line 167 of file StringUtils.

    {
        std::stringstream ss;
        ss << (int)c.r() << " " << (int)c.g() << " " << (int)c.b() << " " << (int)c.a();
        std::string ssStr;
        ssStr = ss.str();
        return ssStr;
    }

Here is the caller graph for this function:

int osgEarth::computeLoadingThreads ( const LoadingPolicy policy)

Definition at line 68 of file TerrainOptions.cpp.

{
    const char* env_numTaskServiceThreads = getenv("OSGEARTH_NUM_PREEMPTIVE_LOADING_THREADS");
    if ( env_numTaskServiceThreads )
    {
        return ::atoi( env_numTaskServiceThreads );
    }
    else if ( policy.numLoadingThreads().isSet() )
    {
        return osg::maximum( 1, policy.numLoadingThreads().get() );
    }
    else
    {
        return (int)osg::maximum( 1.0f, policy.numLoadingThreadsPerCore().get()
                                  * (float)OpenThreads::GetNumberOfProcessors() );
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static bool osgEarth::endsWith ( const std::string &  ref,
const std::string &  pattern 
) [static]

True is "ref" ends with "pattern"

Definition at line 85 of file StringUtils.

    {
        return ref.find( pattern ) == ref.length()-pattern.length();
    }

Here is the caller graph for this function:

template<typename T >
T* osgEarth::findFirstParentOfType ( osg::Node *  node)

Searchs the scene graph upward starting at [node] and returns the first node found that matches the template parameter type.

Definition at line 74 of file FindNode.

    {
        if (!node) return 0;

        FindTopMostNodeOfTypeVisitor<T> fnotv;
        fnotv.setTraversalMode(osg::NodeVisitor::TRAVERSE_PARENTS);
        node->accept(fnotv);

        return fnotv._foundNode;
    }
template<typename T >
T* osgEarth::findRelativeNodeOfType ( osg::Node *  node)

Searchs the scene graph starting at [node] and returns the first node found that matches the template parameter type. First searched upward, then downward.

Definition at line 90 of file FindNode.

    {
        if ( !node ) return 0;
        T* result = findFirstParentOfType<T>( node );
        if ( !result )
            result = findTopMostNodeOfType<T>( node );
        return result;
    }
template<typename T >
T* osgEarth::findTopMostNodeOfType ( osg::Node *  node)

Searchs the scene graph downward starting at [node] and returns the first node found that matches the template parameter type.

Definition at line 58 of file FindNode.

    {
        if (!node) return 0;

        FindTopMostNodeOfTypeVisitor<T> fnotv;
        fnotv.setTraversalMode(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN);
        node->accept(fnotv);

        return fnotv._foundNode;
    }    
std::string osgEarth::getFullPath ( const std::string &  relativeTo,
const std::string &  relativePath 
)

Gets the full path of a file relative to a file For example, getFullPath("c:\images\vacation.jpg", "..") would return "c:\images". If relativePath is an absolute path, it is returned

Parameters:
relativeToThe name of the file to make the path relative to
relativePathThe path relative to relativeTo
Returns:
The full path

Definition at line 48 of file FileUtils.cpp.

{
        if (!isRelativePath(relativePath) || relativeTo.empty())
    {
        //OE_NOTICE << relativePath << " is not a relative path " << std::endl;
        return relativePath;
    }

    //If they didn't specify a relative path, just return the relativeTo
    if (relativePath.empty()) return relativeTo;


    //Note:  Modified from VPB

    //Concatinate the paths together
    std::string filename;
    if ( !osgDB::containsServerAddress( relativeTo ) )
        filename = osgDB::concatPaths( osgDB::getFilePath( osgDB::getRealPath( relativeTo )), relativePath);
    else
        filename = osgDB::concatPaths( osgDB::getFilePath( relativeTo ), relativePath);


    std::list<std::string> directories;
    int start = 0;
    for (unsigned int i = 0; i < filename.size(); ++i)
    {
        if (filename[i] == '\\' || filename[i] == '/')
        {
            //Get the current directory
            std::string dir = filename.substr(start, i-start);

            if (dir != "..")
            {
                if (dir != ".")
                {
                  directories.push_back(dir);
                }
            }
            else if (!directories.empty())
            {
                directories.pop_back();
            }
            start = i + 1;
        }
    }

    std::string path;
    for (std::list<std::string>::iterator itr = directories.begin();
         itr != directories.end();
         ++itr)
    {
        path += *itr;
        path += "/";
    }

    path += filename.substr(start, std::string::npos);

    //OE_NOTICE << "FullPath " << path << std::endl;
    return path;
}

Here is the call graph for this function:

Here is the caller graph for this function:

osg::NotifySeverity osgEarth::getNotifyLevel ( )

get the notify level.

Definition at line 54 of file Notify.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned int osgEarth::hashString ( const std::string &  input) [static]

MurmurHash 2.0 (http://sites.google.com/site/murmurhash/)

Definition at line 246 of file StringUtils.

    {
            const unsigned int m = 0x5bd1e995;
            const int r = 24;
        unsigned int len = input.length();
        const char* data = input.c_str();
            unsigned int h = m ^ len; // using "m" as the seed.

            while(len >= 4)
            {
                    unsigned int k = *(unsigned int *)data;
                    k *= m; 
                    k ^= k >> r; 
                    k *= m;                     
                    h *= m; 
                    h ^= k;
                    data += 4;
                    len -= 4;
            }
        
            switch(len)
            {
            case 3: h ^= data[2] << 16;
            case 2: h ^= data[1] << 8;
            case 1: h ^= data[0];
                    h *= m;
            };

            h ^= h >> 13;
            h *= m;
            h ^= h >> 15;

            return h;
    }

Here is the caller graph for this function:

static osg::Vec4f osgEarth::htmlColorToVec4f ( const std::string &  html) [static]

Parses an HTML color ("#rrggbb" or "#rrggbbaa") into an OSG color.

Definition at line 208 of file StringUtils.

    {
        std::string t = html;
        std::transform( t.begin(), t.end(), t.begin(), ::tolower );
        osg::Vec4ub c(0,0,0,255);
        if ( t.length() >= 7 ) {
            c.r() |= t[1]<='9' ? (t[1]-'0')<<4 : (10+(t[1]-'a'))<<4;
            c.r() |= t[2]<='9' ? (t[2]-'0')    : (10+(t[2]-'a'));
            c.g() |= t[3]<='9' ? (t[3]-'0')<<4 : (10+(t[3]-'a'))<<4;
            c.g() |= t[4]<='9' ? (t[4]-'0')    : (10+(t[4]-'a'));
            c.b() |= t[5]<='9' ? (t[5]-'0')<<4 : (10+(t[5]-'a'))<<4;
            c.b() |= t[6]<='9' ? (t[6]-'0')    : (10+(t[6]-'a'));
            if ( t.length() == 9 ) {
                c.a() = 0;
                c.a() |= t[7]<='9' ? (t[7]-'0')<<4 : (10+(t[7]-'a'))<<4;
                c.a() |= t[8]<='9' ? (t[8]-'0')    : (10+(t[8]-'a'));
            }
        }
        return osg::Vec4f( ((float)c.r())/255.0f, ((float)c.g())/255.0f, ((float)c.b())/255.0f, ((float)c.a())/255.0f );
    }

Here is the caller graph for this function:

bool osgEarth::initNotifyLevel ( )

initialize notify level.

Definition at line 61 of file Notify.cpp.

{
    static bool s_NotifyInit = false;

    if (s_NotifyInit) return true;
    
    // g_NotifyLevel
    // =============

    osgearth_g_NotifyLevel = osg::NOTICE; // Default value

    char* OSGNOTIFYLEVEL=getenv("OSGEARTH_NOTIFY_LEVEL");
    if (!OSGNOTIFYLEVEL) OSGNOTIFYLEVEL=getenv("OSGEARTHNOTIFYLEVEL");
    if(OSGNOTIFYLEVEL)
    {

        std::string stringOSGNOTIFYLEVEL(OSGNOTIFYLEVEL);

        // Convert to upper case
        for(std::string::iterator i=stringOSGNOTIFYLEVEL.begin();
            i!=stringOSGNOTIFYLEVEL.end();
            ++i)
        {
            *i=toupper(*i);
        }

        if(stringOSGNOTIFYLEVEL.find("ALWAYS")!=std::string::npos)          osgearth_g_NotifyLevel=osg::ALWAYS;
        else if(stringOSGNOTIFYLEVEL.find("FATAL")!=std::string::npos)      osgearth_g_NotifyLevel=osg::FATAL;
        else if(stringOSGNOTIFYLEVEL.find("WARN")!=std::string::npos)       osgearth_g_NotifyLevel=osg::WARN;
        else if(stringOSGNOTIFYLEVEL.find("NOTICE")!=std::string::npos)     osgearth_g_NotifyLevel=osg::NOTICE;
        else if(stringOSGNOTIFYLEVEL.find("DEBUG_INFO")!=std::string::npos) osgearth_g_NotifyLevel=osg::DEBUG_INFO;
        else if(stringOSGNOTIFYLEVEL.find("DEBUG_FP")!=std::string::npos)   osgearth_g_NotifyLevel=osg::DEBUG_FP;
        else if(stringOSGNOTIFYLEVEL.find("DEBUG")!=std::string::npos)      osgearth_g_NotifyLevel=osg::DEBUG_INFO;
        else if(stringOSGNOTIFYLEVEL.find("INFO")!=std::string::npos)       osgearth_g_NotifyLevel=osg::INFO;
        else std::cout << "Warning: invalid OSG_NOTIFY_LEVEL set ("<<stringOSGNOTIFYLEVEL<<")"<<std::endl;
 
    }

    s_NotifyInit = true;

    return true;

}

Here is the caller graph for this function:

bool osgEarth::isNotifyEnabled ( osg::NotifySeverity  severity)

is notification enabled, given the current setNotifyLevel() setting?

Definition at line 106 of file Notify.cpp.

{
    return severity<=getNotifyLevel();
}

Here is the call graph for this function:

bool osgEarth::isRelativePath ( const std::string &  fileName)

Determines whether a given filename is a relative path

Definition at line 27 of file FileUtils.cpp.

{
    //If it is a URL, it is not relative
    if (osgDB::containsServerAddress( fileName ) ) return false;

    std::string native = osgDB::convertFileNameToNativeStyle(fileName);
#if defined(WIN32)  && !defined(__CYGWIN__)
    //Check to see if the path begins with a drive letter like "C:\data"
    if (native.size() >= 3 && native[1] == ':' && native[2] == '\\') return false;

    //Check to see if the path is network path like "\\server1\data"
    if (native.size() >= 2 && native[0] == '\\' && native[1] == '\\') return false;

    //The path must be relative
    return true;
#else
    //Absolute paths in Unix will start with a '/'
    return !(fileName.size() >= 1 && fileName[0] == '/');
#endif
}

Here is the caller graph for this function:

bool osgEarth::isZipPath ( const std::string &  path)

Gets whether or not the given path contains a zip file within the path

Definition at line 109 of file FileUtils.cpp.

{
    return (path.find(".zip") != std::string::npos);
}

Here is the caller graph for this function:

static std::string osgEarth::joinStrings ( const StringVector &  input,
char  delim 
) [static]

Definition at line 127 of file StringUtils.

    {
        std::stringstream buf;
        for( StringVector::const_iterator i = input.begin(); i != input.end(); ++i )
        {
            buf << *i;
            if ( (i+1) != input.end() ) buf << delim;
        }
        std::string result = buf.str();
        return result;
    }
std::ostream & osgEarth::notify ( const osg::NotifySeverity  severity)

Definition at line 134 of file Notify.cpp.

{
    // set up global notify null stream for inline notify
    static NullStream s_NotifyNulStream;

    static bool initialized = false;
    if (!initialized) 
    {
        std::cerr<<""; // dummy op to force construction of cerr, before a reference is passed back to calling code.
        std::cout<<""; // dummy op to force construction of cout, before a reference is passed back to calling code.
        initialized = osgEarth::initNotifyLevel();
    }

    if (severity<=osgearth_g_NotifyLevel)
    {
        if (severity<=osg::WARN) return std::cerr;
        else return std::cout;
    }
    return s_NotifyNulStream;
}

Here is the call graph for this function:

Here is the caller graph for this function:

std::ostream& osgEarth::notify ( void  ) [inline]

Definition at line 44 of file Notify.

{ return osgEarth::notify(osg::INFO); }

Here is the call graph for this function:

void osgEarth::removeEventHandler ( osgViewer::View *  view,
osgGA::GUIEventHandler *  handler 
)

Removes the given event handler from the view. This is the equivalent of osgViewer::View::removeEventHandler which is not available in older versions of OSG

Definition at line 27 of file Utils.cpp.

{
    osgViewer::View::EventHandlers::iterator itr = std::find(view->getEventHandlers().begin(), view->getEventHandlers().end(), handler);
    if (itr != view->getEventHandlers().end())
    {
        view->getEventHandlers().erase(itr);
    }
}

Here is the caller graph for this function:

static std::string& osgEarth::replaceIn ( std::string &  s,
const std::string &  sub,
const std::string &  other 
) [static]

Replaces all the instances of "sub" with "other" in "s".

Definition at line 38 of file StringUtils.

    {
        if ( sub.empty() ) return s;
        size_t b=0;
        for( ; ; )
        {
            b = s.find( sub, b );
            if ( b == s.npos ) break;
            s.replace( b, sub.size(), other );
            b += other.size();
        }
        return s;
    }

Here is the caller graph for this function:

void osgEarth::setNotifyLevel ( osg::NotifySeverity  severity)

set the notify level, overriding the default or the value set by the environmental variable OSGNOTIFYLEVEL.

Definition at line 47 of file Notify.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static bool osgEarth::startsWith ( const std::string &  ref,
const std::string &  pattern 
) [static]

True is "ref" starts with "pattern"

Definition at line 76 of file StringUtils.

    {
        return ref.find( pattern ) == 0;
    }

Here is the caller graph for this function:

static size_t osgEarth::StreamObjectReadCallback ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  data 
) [static]

Definition at line 95 of file HTTPClient.cpp.

    {
        size_t realsize = size* nmemb;
        StreamObject* sp = (StreamObject*)data;
        sp->write((const char*)ptr, realsize);
        return realsize;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

static osg::Vec4ub osgEarth::stringToColor ( const std::string &  str,
osg::Vec4ub  default_value 
) [static]

Parses a color string in the form "255 255 255 255" (r g b a [0..255]) into an OSG color.

Definition at line 150 of file StringUtils.

    {
        osg::Vec4ub color = default_value;
        std::istringstream strin(str);
        int r, g, b, a;
        if (strin >> r && strin >> g && strin >> b && strin >> a)
        {
            color.r() = (unsigned char)r;
            color.g() = (unsigned char)g;
            color.b() = (unsigned char)b;
            color.a() = (unsigned char)a;
        }
        return color;
    }

Here is the caller graph for this function:

static osg::Vec3f osgEarth::stringToVec3f ( const std::string &  str,
const osg::Vec3f &  default_value 
) [static]

Converts a string to a vec3f

Definition at line 178 of file StringUtils.

    {
        std::stringstream buf(str);
        osg::Vec3f out = default_value;
        buf >> out.x();
        if ( !buf.eof() ) {
            buf >> out.y() >> out.z();
        }
        else {
            out.y() = out.x();
            out.z() = out.x();
        }
        return out;
    }

Here is the caller graph for this function:

static std::string osgEarth::toLower ( const std::string &  input) [static]

Returns a lower-case version of the input string.

Definition at line 141 of file StringUtils.

    {
        std::string output = input;
        std::transform( output.begin(), output.end(), output.begin(), ::tolower );
        return output;
    }

Here is the caller graph for this function:

template<typename T >
std::string osgEarth::toString ( const T &  value) [inline]

Definition at line 322 of file StringUtils.

    {
        std::stringstream out;
                out << std::setprecision(20) << std::fixed << value;
        std::string outStr;
        outStr = out.str();
        return outStr;
    }

Here is the caller graph for this function:

template<>
std::string osgEarth::toString< bool > ( const bool &  value) [inline]

Definition at line 333 of file StringUtils.

    {
        return value ? "true" : "false";
    }
template<>
std::string osgEarth::toString< osg::Vec3f > ( const osg::Vec3f &  value) [inline]

Definition at line 339 of file StringUtils.

    {
        return vec3fToString(value);
    }

Here is the call graph for this function:

std::string osgEarth::trim ( const std::string &  in) [static]

Trims whitespace from the ends of a string. by Rodrigo C F Dias http://www.codeproject.com/KB/stl/stdstringtrim.aspx

Definition at line 58 of file StringUtils.

    {
        std::string whitespace (" \t\f\v\n\r");
        std::string str = in;
        std::string::size_type pos = str.find_last_not_of( whitespace );
        if(pos != std::string::npos) {
            str.erase(pos + 1);
            pos = str.find_first_not_of( whitespace );
            if(pos != std::string::npos) str.erase(0, pos);
        }
        else str.erase(str.begin(), str.end());
        return str;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

static std::string osgEarth::vec3fToString ( const osg::Vec3f &  v) [static]

Converts a vec3f to a string

Definition at line 195 of file StringUtils.

    {
        std::stringstream buf;
        buf << std::setprecision(6)
            << v.x() << " " << v.y() << " " << v.z()
            << std::endl;
        std::string result;
        result = buf.str();
        return result;
    }

Here is the caller graph for this function:

static std::string osgEarth::vec4fToHtmlColor ( const osg::Vec4f &  c) [static]

Makes an HTML color ("#rrggbb" or "#rrggbbaa") from an OSG color.

Definition at line 231 of file StringUtils.

    {
        std::stringstream buf;
        buf << "#";
        buf << std::hex << std::setw(2) << std::setfill('0') << (int)(c.r()*255.0f);
        buf << std::hex << std::setw(2) << std::setfill('0') << (int)(c.g()*255.0f);
        buf << std::hex << std::setw(2) << std::setfill('0') << (int)(c.b()*255.0f);
        if ( c.a() < 1.0f )
            buf << std::hex << std::setw(2) << std::setfill('0') << (int)(c.a()*255.0f);
        std::string ssStr = buf.str();
        return ssStr;
    }

Here is the caller graph for this function:


Variable Documentation

class OSGEARTH_EXPORT osgEarth::GeoLocator

Definition at line 40 of file SpatialReference.

Definition at line 37 of file SpatialReference.

const double osgEarth::MERC_MAXX = 2.00375e+007

Definition at line 34 of file SpatialReference.

const double osgEarth::MERC_MAXY = 2.00375e+007

Definition at line 35 of file SpatialReference.

const double osgEarth::MERC_MINX = -2.00375e+007

Definition at line 32 of file SpatialReference.

const double osgEarth::MERC_MINY = -2.00375e+007

Definition at line 33 of file SpatialReference.

Definition at line 36 of file SpatialReference.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines