1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
// Print Rectangle coordinates
ostream & poly1::operator<<(ostream &os, Rectangle &PointRectangle)
{
Matrix Temp1(2,1);
Matrix Temp2(2,1);
Matrix Temp3(2,1);
Matrix Temp4(2,1);
Temp1=PointRectangle.GetV1();
Temp2=PointRectangle.GetV2();
Temp3=PointRectangle.GetV3();
Temp4=PointRectangle.GetV4();
os<<"__________________________________________________________________________"<<endl;
os<<"Vertex\t1\t\t2\t\t3\t\t4"<<endl;
os<<"__________________________________________________________________________"<<endl;
os<<"\t"<<Temp1.GetMatrixData(1,1)<<"\t\t"<<Temp2.GetMatrixData(1,1)<<"\t\t"<<Temp3.GetMatrixData(1,1)<<"\t\t"<<Temp4.GetMatrixData(1,1)<<endl;
os<<"\t"<<Temp1.GetMatrixData(2,1)<<"\t\t"<<Temp2.GetMatrixData(2,1)<<"\t\t"<<Temp3.GetMatrixData(2,1)<<"\t\t"<<Temp4.GetMatrixData(2,1)<<endl;
os<<"__________________________________________________________________________"<<endl;
//==============================================
ofstream myfile;
myfile.open ("ShapeData.txt");
myfile << "Writing this to a file.\n";
myfile<<"__________________________________________________________________________"<<endl;
myfile<<"Vertex\t1\t\t2\t\t3"<<endl;
myfile<<"__________________________________________________________________________"<<endl;
myfile<<"\t"<<Temp1.GetMatrixData(1,1)<<"\t\t"<<Temp2.GetMatrixData(1,1)<<"\t\t"<<Temp3.GetMatrixData(1,1)<<endl;
myfile<<"\t"<<Temp1.GetMatrixData(2,1)<<"\t\t"<<Temp2.GetMatrixData(2,1)<<"\t\t"<<Temp3.GetMatrixData(2,1)<<endl;
myfile<<"__________________________________________________________________________"<<endl;
myfile.close();
//==============================================
return os;
}
|