/*
 *  TnMapPickableTypes.h
 *  GLEngine
 *
 *  Concrete implementations of some Engine-provided
 *  ITnMapEngine::Pickable-derived pickable objects
 */

#ifndef TN_MAP_PICKABLE_TYPES_H
#define TN_MAP_PICKABLE_TYPES_H

#include <foundation/SharedPtr.h>

#include <RenderEngine/ITnMapEngine.h>
#include <foundation/Math/Matrix.hpp>

class TnMapPickableTile : public ITnMapEngine::Pickable
{
public:
    enum eTileStatus
    {
        eTileStatus_Loading,
        eTileStatus_Ready,
        eTileStatus_NA,
    };

public:
    TnMapPickableTile(TnMapPickableTile::eTileStatus status);

    TnMapPickableTile::eTileStatus Status() const;

private:
    eTileStatus m_status;
};

class TnMapPickableLatLon : public ITnMapEngine::Pickable
{
public:
    TnMapPickableLatLon(double latitude, double longitude, int id = 0);
    
    double Latitude() const;
    double Longitude() const;
    
private:
    double m_latitude;
    double m_longitude;
};

class TnMapPickableTrafficIncident : public ITnMapEngine::Pickable
{
public:
    // Shared ptr
    typedef Tn::Foundation::shared_ptr<const TnMapPickableTrafficIncident> const_ptr;
    
    // Constructor
    TnMapPickableTrafficIncident(int32_t severity, 
                                 bool laneClosed, 
                                 std::string incidentType, 
                                 eTnMapLayer layer, 
                                 const std::string& crossStreet1,
								 const std::string& crossStreet2,
                                 const std::string& message,
                                 int id = 0);
    
    int32_t Severity() const;
    bool LaneClosed() const;
    const std::string & IncidentType() const;
    const std::string& FirstCrossStreet() const;
	const std::string& SecondCrossStreet() const;
    const std::string& Message() const;
    eTnMapLayer Layer() const;
private:
    int32_t m_severity;
    bool m_laneClosed;
    std::string m_incidentType;
    eTnMapLayer m_layer;
    std::string m_firstCrossStreet;
	std::string m_secondCrossStreet;
    std::string m_message;
};


class TnMapPickableGroupIcon : public ITnMapEngine::Pickable
{
public:
    typedef Tn::Foundation::shared_ptr<const TnMapPickableGroupIcon> const_ptr;
    typedef Tn::Foundation::shared_ptr<TnMapPickableGroupIcon> ptr;
    
    TnMapPickableGroupIcon();
    
    bool Expanded() const;

    void ClearMembers();
    void AddPickable(ITnMapEngine::Pickable::const_ptr const &);
    
    void ExpandGroup();
    void CollapseGroup();
    

    std::vector<ITnMapEngine::Pickable::const_ptr> const & GetMembers() const;

private:

    std::vector<ITnMapEngine::Pickable::const_ptr> m_members;
    
    bool m_expanded;
};

class TnMapPickableRoute : public ITnMapEngine::Pickable
{
public:
    TnMapPickableRoute(std::string const & routeName);
    
    std::string const & RouteName() const { return m_routeName; }

private:
    std::string m_routeName;
};

#endif

