#include "WimaController.h"
#include "MissionController.h"

WimaController::WimaController(QObject *parent) :
    QObject(parent)
  ,_planView(true)

{

}

void WimaController::setMasterController(PlanMasterController *masterC)
{
    _masterController = masterC;
    emit masterControllerChanged();
}

void WimaController::setMissionController(MissionController *missionC)
{
    _missionController = missionC;
    emit missionControllerChanged();
}

void WimaController::addGlobalMeasurementArea()
{
    WimaGlobalMeasurementPolygon* poly = new WimaGlobalMeasurementPolygon(this);
    _visualItems.append(poly);

    emit visualItemsChanged();
}

void WimaController::removeArea(int index)
{
    if(index > 0 && index < _visualItems.size()){
        _visualItems.removeAt(index);

        emit visualItemsChanged();
    }else{
        qWarning("Index out of bounds!");
    }

}

void WimaController::addServiceArea()
{
    WimaServicePolygon* poly = new WimaServicePolygon(this);
    _visualItems.append(poly);

    emit visualItemsChanged();
}

void WimaController::recalcVehicleCorridor()
{

}



