WhirlyGlobe  1.1
A 3D interactive globe toolkit for ios
WhirlyGlobe::GlobeScene Class Reference

#include <GlobeScene.h>

List of all members.

Public Types

typedef std::set< Drawable
*, IdentifiableSorter
DrawableSet
typedef std::set< Texture
*, IdentifiableSorter
TextureSet

Public Member Functions

 GlobeScene (unsigned int numX, unsigned int numY)
 The earth will be divided up into these pieces.
void getCullableSize (unsigned int &numX, unsigned int &numY)
 Get the cullable grid size.
const CullablegetCullable (unsigned int x, unsigned int y)
 Return a particular cullable.
const CullablegetCullables ()
 Full list of cullables (for the renderer)
void addChangeRequest (ChangeRequest *newChange)
 If you have more than one, don't iterate, use the other version.
void addChangeRequests (const std::vector< ChangeRequest * > &newchanges)
GLuint getGLTexture (SimpleIdentity texIdent)
 If it's missing, we probably won't draw the associated geometry.
void processChanges (WhirlyGlobeView *view)
void overlapping (GeoMbr geoMbr, std::vector< Cullable * > &cullables)
 Given a geo mbr, return all the overlapping cullables.
void removeFromCullables (Drawable *drawable)
 Remove the given drawable from the cullables.
DrawablegetDrawable (SimpleIdentity drawId)
 Look for a Drawable by ID.
TexturegetTexture (SimpleIdentity texId)
 Look for a Texture by ID.

Public Attributes

unsigned int numX
 Cullable grid dimensions.
unsigned int numY
Cullablecullables
 Array of active cullables. Static after construction for now.
DrawableSet drawables
 All the drawables we've been handed, sorted by ID.
TextureSet textures
 Textures, sorted by ID.
pthread_mutex_t changeRequestLock
std::vector< ChangeRequest * > changeRequests

Friends

class ChangeRequest

Detailed Description

GlobeScene is the top level scene object. It keeps track of the drawables by sorting them into cullables and it handles the change requests, which consist of pretty much everything that can happen.

The developer never interacts with this.


Constructor & Destructor Documentation

WhirlyGlobe::GlobeScene::GlobeScene ( unsigned int  numX,
unsigned int  numY 
)

The earth will be divided up into these pieces.

Construct with the grid size of the cullables


Member Function Documentation

void WhirlyGlobe::GlobeScene::addChangeRequest ( ChangeRequest newChange)

If you have more than one, don't iterate, use the other version.

Add a single change request. You can call this from any thread, it locks.

void WhirlyGlobe::GlobeScene::addChangeRequests ( const std::vector< ChangeRequest * > &  newchanges)

Add a list of change requets. You can call this from any thread. This is the faster option if you have more than one change request

GLuint WhirlyGlobe::GlobeScene::getGLTexture ( SimpleIdentity  texIdent)

If it's missing, we probably won't draw the associated geometry.

Look for a valid texture

void WhirlyGlobe::GlobeScene::processChanges ( WhirlyGlobeView view)

Process change requests Only the renderer should call this in the rendering thread


Member Data Documentation

We keep a list of change requests to execute This can be accessed in multiple threads, so we lock it


The documentation for this class was generated from the following file: