
#include <iostream.h>
#include <sstream>
#include <string>
#include <list>


#include "Conc.h"
#include "Function.h"
#include "Area.h"
#include "Point.h"

#include "Color.h"
#include "Position.h"
#include "UnderFunction.h"
#include "UnderArea.h"

#include "PicturMatrix.h"

int main()
{

stringstream strstr;
Point p1;

ifstream *stream=new ifstream("best_object.txt");

char ne='a';
while (true)
{
	(*stream)>>ne;
	cout<<ne;
	if ((ne==';')||(ne=='a')) {break;}
	strstr<<ne;
}


//insert her the object to restore
//strstr<<"p((1,0),(1))";

PicturObject *po=p1.restoreElementTyp(strstr);

list<double*> list;
po->restore(strstr,list);

unsigned long *sz=new unsigned long[4];
sz[0]=10;
sz[1]=10;
sz[2]=1;
sz[3]=1;
unsigned int ncc=1;
unsigned int* dep=new unsigned int[1];
dep[0]=2;

PicturMatrix picm=PicturMatrix(sz,ncc,dep);

po->makeMatrix(&picm);

unsigned long* sze=picm.getSize();
unsigned long pos[4]={0,0,0,0};
Color *col=0;
cout<<endl<<endl;
for (pos[0]=0;pos[0]<sze[0];pos[0]++ )
{
	cout<<endl;
	for (pos[1]=0;pos[1]<sze[1];pos[1]++ )
	{
		col=picm.getColorFrom(pos);
		cout<<(0!=(col->getValue(1)));
	}
}
cout<<endl<<endl;




}
