#include #include #include #include #include using namespace std; typedef pair point; void Header(ofstream & file, int width, int height); void Footer(ofstream & file); void Line(ofstream & file, point a, point b); void FlakeIt(vector & data, int depth); int main(int argc, char * argv[]) { int width = 1000, height = 1000; vector data; point a,b,c,d; ofstream file; int depth = 15; if (argc > 1) { depth = atoi(argv[1]); } a.first = width*.30; a.second = height*.30; b.first = width*.70; b.second = height *.70; c.first = a.first; c.second = b.second; d.first = b.first; d.second = a.second; data.push_back(a); data.push_back(b); FlakeIt(data, depth); file.open("dragon.svg"); Header(file, width, height); for(int i = 0; i < data.size()-1;i++) { Line(file,data[i],data[i+1]); } /* int i; file << "" << endl; */ Footer(file); return 0; } void Header(ofstream & file, int width, int height){ file << "" << endl; file << "" << endl; return; } void Footer(ofstream & file){ file << "" << endl; return; } void Line(ofstream & file, point a, point b){ file << "" << endl; } void FlakeIt(vector & data, int depth){ int i; vector newData; point p; float vx, vy; float length, mx, my; if (depth != 0) { cout << "Depth = " << depth << endl; for(i=0;i