#include "stdafx.h"
#include <iostream>
#include "img.h"
#include "graphmap.h"
using namespace std;


int main()
{
	BMP img;
	cout << "Start read...";
	img.read("test29.bmp");//��������� ��������
	//img.write("output.bmp");
	cout << "End." << endl;

	cout << "Building tree...";
	Graph map(img); //������ ����� �� ���� ��������
	cout << "End." << endl;

	try 
	{ 
	 cout << "Drowing roud...";
	 map.calcdijkstra(Position(220, 220)); //������� ��� �������� �� ����� 220 220
	 BMP out = map.drowRoad(Position(860, 860)); //������������ ������� � ����� 860 860

	 out.write("output30.bmp"); //���������� ������������ ���������
	 cout << "End." << endl;
	}
	catch (char* error) // ���� ������� �� ������ ������� ������
	{
		cout << error <<endl;
	}
	system("pause");
	


	
	cout << "End." << endl;


	
	return 0;
}