//
//  TMKOverlay.h
//  TnMapKit
//
//  Created by Holzhauer, James on 2/4/14.
//  Copyright (c) 2014 TeleNav. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "TMKEngineTypes.h"

@class CLLocation;

// Container of CLLocation points for use in constructing the shape.

@interface TMKMapPoints : NSObject

- (id)init;

// Add a single CLLocation point
- (void)addPoint:(CLLocation*)loc;

// Add a series of CLLocation points
- (void)addPoints:(NSArray*)points;

- (NSArray*)getPoints;

@end //TMKMapPoints

@interface TMKClientTexture : NSObject

- (id)init;

- (id)initWithData:(uint8_t*)data
          andWidth:(NSUInteger)width
         andHeight:(NSUInteger)height;

@property NSUInteger width;
@property NSUInteger height;
@property uint8_t* data;

@end

// A client loaded texture for use in a shape
@interface TMKMapShapeAttributes : NSObject

- (id)init;

// Color of shape, described using 0-255 for each channel in RGBA
// color format.  Default value is fully opaque black
// (R=0,G=0,B=0,A=255)

@property uint8_t colorR, colorG, colorB, colorA;

// Line width of shape.  Default value is 2

@property float lineWidth;

// Information required to look up and load a user specified texture
// Utilizing these parameters and the patterned property allows the
// shape to be drawn with detailed patterns, such as those used for
// rendering a cold front pattern in weather presentations
// @NOTE:Textures must be in the textures resource folder unless using TMKClientTexture

@property NSString* textureResourceName;
@property NSUInteger textureResourceWidth;
@property NSUInteger textureResourceHeight;
@property float stretchFactor;

@property BOOL patterned;

@property TMKClientTexture* clientTexture;

@end //TMKMapShapeAttributes

@interface TMKMapShape : NSObject

// The points the make up the shape
@property TMKMapPoints *points;

@property TMKMapShapeAttributes *attributes;

// The shape's type (as defined in TMKEngineTypes)
@property TMKShapeType type;

@end //TMKMapShape

@interface TMKMapPolyline : TMKMapShape

- (id)init;
- (id)initWithPoints:(TMKMapPoints*)points 
       andAttributes:(TMKMapShapeAttributes*)attr;

@end //TMKMapPolyline

@interface TMKMapPolygon : TMKMapShape

- (id)init;
- (id)initWithPoints:(TMKMapPoints*)points 
       andAttributes:(TMKMapShapeAttributes*)attr;

@end //TMKMapPolygon

@interface TMKOverlay : NSObject
- (id)init;

// Add a shape to the shape model.  Shapes are rendered in the order they were added to shape model.
- (void)addShape:(TMKMapShape*)shape;
- (NSArray*)getShapes;

@end // TMKOverlay
