MaplyQuadTracker

@interface MaplyQuadTracker : NSObject

The quad tracker keeps track of quad tree nodes.

This object tracks quad tree nodes as they’re added to and removed from an internal quad tree that tracks them by screen importance. This version is intended for use in Objective-C and is much simpler than the internal version.

All the methods are thread safe.

  • Coordinate system for the quad tiles we’re tracking

    Declaration

    Objective-C

    @property (readwrite, strong, nonatomic, nullable)
        MaplyCoordinateSystem *coordSys;

    Swift

    var coordSys: MaplyCoordinateSystem? { get set }
  • Init with a globe view controller

    Initialize with a globe view controller. Only valid for globe at the moment.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithViewC:
        (WhirlyGlobeViewController *_Nonnull)viewC;

    Swift

    init(viewC: WhirlyGlobeViewController)
  • The minimum level to consider.

    Set this if you’re starting loading at a level higher than 0. 0 is the default.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) int minLevel;

    Swift

    var minLevel: Int32 { get set }
  • Query the quad tracker for tiles and locations within them for a group of points.

    This is a bulk query for points within the tiles being tracked.

    Declaration

    Objective-C

    - (void)tiles:(MaplyQuadTrackerPointReturn *_Nonnull)tilesInfo
        forPoints:(int)numPts;

    Swift

    func tiles(_ tilesInfo: UnsafeMutablePointer

    Parameters

    tilesInfo

    This is both an input and output parameter. Fill in the screenU and screenV values and you’ll get back tileID and tileU and tileV. tileID.level will be -1 if there was no hit for that point.

    numPts

    The number of points in the tilesInfo array.

  • Add a tile to track.

    Declaration

    Objective-C

    - (void)addTile:(MaplyTileID)tileID;

    Swift

    func addTile(_ tileID: MaplyTileID)
  • Remove a tile from tracking

    Declaration

    Objective-C

    - (void)removeTile:(MaplyTileID)tileID;

    Swift

    func removeTile(_ tileID: MaplyTileID)
  • Return the number of tiles contained in the quad tracker.

    Declaration

    Objective-C

    - (int)numTiles;

    Swift

    func numTiles() -> Int32