![]() |
WhirlyGlobe
1.2
A 3D interactive globe toolkit for iOS
|
#include <GlobeScene.h>
Public Types | |
typedef std::set< Drawable *, IdentifiableSorter > | DrawableSet |
typedef std::set< Texture *, IdentifiableSorter > | TextureSet |
typedef std::set< SubTexture > | SubTextureSet |
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 Cullable * | getCullable (unsigned int x, unsigned int y) |
Return a particular cullable. | |
const Cullable * | getCullables () |
Full list of cullables (for the renderer) | |
const GeneratorSet * | getGenerators () |
Full set of Generators. | |
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 | addSubTexture (const SubTexture &) |
void | addSubTextures (const std::vector< SubTexture > &) |
SubTexture | getSubTexture (SimpleIdentity subTexId) |
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. | |
Generator * | getGenerator (SimpleIdentity genId) |
Look for a Draw Generator by ID. | |
Drawable * | getDrawable (SimpleIdentity drawId) |
Look for a Drawable by ID. | |
Texture * | getTexture (SimpleIdentity texId) |
Look for a Texture by ID. | |
Public Attributes | |
GeneratorSet | generators |
All the drawable generators we've been handed, sorted by ID. | |
unsigned int | numX |
Cullable grid dimensions. | |
unsigned int | numY |
Cullable * | cullables |
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 |
SubTextureSet | subTextureMap |
Mappings from images to parts of texture atlases. | |
Friends | |
class | ChangeRequest |
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.
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
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
void WhirlyGlobe::GlobeScene::addSubTexture | ( | const SubTexture & | ) |
Add sub texture mappings. These are mappings from images to parts of texture atlases. They're here so we can use SimpleIdentity's to point into larger textures. Layer side only. The rendering engine doesn't use them.
GLuint WhirlyGlobe::GlobeScene::getGLTexture | ( | SimpleIdentity | texIdent | ) |
If it's missing, we probably won't draw the associated geometry.
Look for a valid texture
SubTexture WhirlyGlobe::GlobeScene::getSubTexture | ( | SimpleIdentity | subTexId | ) |
Return a sub texture by ID. The idea being we can use these the same way we use full texture IDs.
void WhirlyGlobe::GlobeScene::processChanges | ( | WhirlyGlobeView * | view | ) |
Process change requests Only the renderer should call this in the rendering thread
std::vector<ChangeRequest *> WhirlyGlobe::GlobeScene::changeRequests |
We keep a list of change requests to execute This can be accessed in multiple threads, so we lock it