#include "Figura.h" #include "Ellipse.h" #include "Text.h" #include // to use the setprecision manipulator /********************************************* Constructores *********************************************/ Figura::Figura() { } Figura::Figura(ifstream & infile) { getline(infile,version); infile >> orientation >> justification >> units >> papersize; infile >> magnification; infile >> multiple_page; infile >> transparent_color >> resolution >> coord_system; while(!infile.eof()){ int type; type =0; infile >> type; switch(type) { case ELLIPSE_OBJECT_CODE: vforma.push_back(new Ellipse(infile)); break; case TEXT_OBJECT_CODE: vforma.push_back(new Text(infile)); break; default: cerr << "Tipo o clase de forma no esperado : " << type << endl; return; } } } /********************************************* Operaciones *********************************************/ void Figura::write(void) { cout << version << '\n'; cout << orientation << '\n'; cout << justification << '\n'; cout << units << '\n'; cout << papersize << '\n'; cout << magnification << '\n'; cout << multiple_page << '\n'; cout << transparent_color << '\n'; cout << resolution << ' ' << coord_system<<'\n'; for (int i=0; iwrite(); } //----------------------------------------------------- void Figura::mag(int x, int y, double f) { for (int i=0; imag(x,y,f); } //----------------------------------------------------- void Figura::trans(int x, int y) { for (int i=0; itrans(x,y); } //----------------------------------------------------- void Figura::rot(int x, int y, Sentido s) { for (int i=0; irot(x,y,s); }