![]() |
WhirlyGlobe
1.2
A 3D interactive globe toolkit for iOS
|
#import <LabelLayer.h>
Public Member Functions | |
(id) | - initWithTexAtlasSize: |
(void) | - startWithThread:scene: |
Called in the layer thread. | |
(WhirlyGlobe::SimpleIdentity) | - addLabel:loc:desc: |
(WhirlyGlobe::SimpleIdentity) | - addLabel: |
(WhirlyGlobe::SimpleIdentity) | - addLabels:desc: |
(WhirlyGlobe::SimpleIdentity) | - addLabels:desc:cacheName: |
Add a group of labels and save them to a render cache. | |
(WhirlyGlobe::SimpleIdentity) | - addLabelsFromCache: |
Add a previously cached group of labels all at once. | |
(void) | - changeLabel:desc: |
(DrawCost *) | - getCost: |
(void) | - removeLabel: |
Remove the given label group by ID. | |
Protected Attributes | |
WhirlyGlobeLayerThread * | layerThread |
WhirlyGlobe::GlobeScene * | scene |
WhirlyGlobe::LabelSceneRepMap | labelReps |
Keep track of labels (or groups of labels) by ID for deletion. | |
unsigned int | textureAtlasSize |
Properties | |
WGSelectionLayer * | selectLayer |
If set, we register labels as selectable here. |
The Label Layer will represent and manage groups of labels. You can hand it a list of labels to display and it will group those in to associated drawables. You want to give it a group for speed. Labels are currently drawn in Quartz, compiled into texture atlases and drawn together. This will change in the future to use font textures.
When you add a group of labels you will get back a unique ID which can be used to modify or delete all those labels at once.
The label display can be controlled via the individual SingleLabel objects as well as overall look and feel with the label description dictionary. That dictionary can contain the following:
- WhirlyGlobe: | (SingleLabel *) | label |
Add a single label with the SingleLabel object. The desc dictionary in that object will specify the look
- WhirlyGlobe: | (NSString *) | str | |
loc: | (WhirlyGlobe::GeoCoord) | loc | |
desc: | (NSDictionary *) | desc | |
Create a label at the given coordinates, with the given look and feel. You get an ID for the label back so you can delete or modify it later. If you have more than one label, call addLabels instead.
- WhirlyGlobe: | (NSArray *) | labels | |
desc: | (NSDictionary *) | desc | |
Add a whole list of labels (represented by SingleLabel objects) with the given look and feel. You get the ID identifying the whole group for modification or deletion
- (void) changeLabel: | (WhirlyGlobe::SimpleIdentity) | labelID | |
desc: | (NSDictionary *) | dict | |
Change the display of a given label accordingly to the desc dictionary. Only minVis and maxVis are supported
- (DrawCost *) getCost: | (WhirlyGlobe::SimpleIdentity) | labelID |
Return the cost of a given label group (number of drawables and textures). Only call this in the layer thread
- (id) initWithTexAtlasSize: | (unsigned int) | textureAtlasSize |
Initialize the label layer with a size for texture atlases Needs to be a power of 2
- (WGSelectionLayer *) selectLayer [read, write, retain] |
If set, we register labels as selectable here.
Set this to enable selection for labels.