/*
 *  TnMapAnnotationData.h
 *  OpenGL Map Engine
 */

#ifndef TN_MAP_ANNOTATION_DATA_H
#define TN_MAP_ANNOTATION_DATA_H

#include <string>
#include <deque>

#include <foundation/SharedPtr.h>
#include <foundation/WeakPtr.h>

#include <foundation/TnTypes.h>

#include <foundation/Math/Matrix.hpp>

#include <RenderEngine/TnMapTileDataRequest.h>
#include <RenderEngine/TnMapAnnotationParams.h>


/*! Engine implements this and passes an instance to the client as an
 *  argument to the asynchronous request. The client populates the
 *  data and calls the appropriate method to complete the response. */


class TnMapAnnotationData : public TnMapTileDataRequest
{
public:  
    typedef Tn::Foundation::weak_ptr<TnMapAnnotationData> wptr;
    typedef Tn::Foundation::shared_ptr<TnMapAnnotationData> ptr;

    /*! CreateAnnotation API
     *  Hopefully the last Annotation API
     *  Utilizes the TnMapAnnotationParams class
     *  
     *  The TnMapAnnotationParams class holds all of the common API calls while
     *  also providing access to configuration based variables
     *
     *  Creating annotations for a given layer will automatically
     *  replace the annotations in that layer. However, this leaves no
     *  way to merely clear a layer without creating an
     *  annotation. Consequently, there is also a ClearAnnotationLayer
     *  function.
     *
     */
    
    bool m_lowDetail; //cheap flag, eventually won't be needed
    
    virtual void CreateAnnotation(TnMapAnnotationParams params,
                                  ITnMapEngine::Pickable::const_ptr const &
                                  pickable = ITnMapEngine::Pickable::const_ptr(),
                                  ITnMapEngine::GraphicId const &
                                  graphicId = ITnMapEngine::GraphicId()) = 0;
    
    // Factory method to get AnnotationParams variable from the implementation's config
    virtual TnMapAnnotationParams GetDefaultAnnotationParams(std::string const & style,
                                                             uint32_t zoomLevel) const = 0;

    virtual void ClearAnnotationLayer(eTnMapLayer layer) = 0;

    /*! This specifies the annotation layers that the proxy is being
     *  asked to provide. If the pointer is null, then the proxy is
     *  requested to provide ALL the annotation layers. */

    virtual TnMapLayerSet RequestedLayers() = 0;

protected:

    TnMapAnnotationData(bool lowDetail);
};

#endif
