| Diploma Thesis Percolation Simulation C++ Sourcecode Documentation |
Compounds | |
| class | circle |
| class | rect |
| class | RGBcolor |
| class | shape |
| class | svg |
Functions | |
| void | delete_objects (std::list< shape * > &listofelements) |
| void | finddebug () |
| void | svg_test () |
| string | real2string (REAL arg) |
| void | svg_circles (COORDFLOAT L, NUMBER N, REAL R) |
Variables | |
| const string | XML_HEADER_1 = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \n\"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">" |
| const string | SVG_PARAMETER_0 = "" |
| const string | SVG_PARAMETER_2 = "width=\"12cm\" height=\"3.5cm\"" |
| const string | SVG_PARAMETER_1 = "width=\"12cm\" height=\"3.5cm\" viewBox=\"0 0 1200 350\"" |
|
|
Definition at line 163 of file svg.h. Referenced by svg_circles().
00163 {
00164 std::list<shape*>::iterator e;
00165 for (e=listofelements.begin();e!=listofelements.end();e++){
00166 delete (*e);
00167 }
00168 }
|
|
|
Definition at line 198 of file svg.h.
00198 {
00199 cout <<"founddebug"<<endl;
00200 }
|
|
|
Definition at line 239 of file svg.h. References REAL, and real2string(). Referenced by real2string(), and svg_circles().
00239 {
00240 ostrstream temp;
00241 temp<<arg;
00242 temp <<'\0';
00243 return temp.str();
00244 }
|
|
||||||||||||||||
|
Definition at line 247 of file svg.h. References graphics::svg::append2Body(), graphics::svg::choose_header(), graphics::svg::choose_parameters(), COORDFLOAT, delete_objects(), FILEHEAD2, long_random(), NUMBER, REAL, real2string(), graphics::svg::setBody(), graphics::RGBcolor::svg(), and svg_circles(). Referenced by svg_circles(), and frontend::svg_frontend().
00247 {
00248
00249 std::list<shape*> objects;
00250 shape* object;
00251
00252 RGBcolor color1=RGBcolor(80,0,0);
00253 RGBcolor color2=RGBcolor(0,0,0);
00254 RGBcolor color3=RGBcolor(0,0,100);
00255
00256 int i=N;
00257 for(i; i>0; i--){
00258 object= new circle (long_random(L),long_random(L), R, color3, color2, 0.7);
00259 objects.push_back(object);
00260 }
00261 svg myPicture;
00262 myPicture.choose_header(1);
00263 myPicture.choose_parameters(0);
00264 myPicture.setBody(rect (0,0,L, L,color1,color2, 0.8).svg(true, true, true));
00265
00266 string group="";
00267 group+="<g style=\"fill:"+color3.svg()+"; ";
00268 group+="stroke-width:"+real2string(R/40)+"; stroke:" + color2.svg() + "\">\n";
00269
00270 // idea: don't keep the huge string,
00271 // but directly write it into a file
00272
00273 myPicture.append2Body(group);
00274 myPicture.append2Body(objects, false, false, true);
00275 myPicture.append2Body("</g>");
00276
00277 string filename=FILEHEAD2;
00278 ostrstream temp2;
00279 temp2<<"random_N"<<N<<"_L"<<L<<"_R"<<R<<".svg";
00280 temp2 <<'\0';
00281 filename+=temp2.str();
00282 myPicture.write2file(filename);
00283 cout <<"Written the file "<<filename<<". \nPlease watch it using a SVG plugin."<<endl;
00284 delete_objects(objects);
00285 }
|
|
|
Definition at line 223 of file svg.h. References graphics::svg::append2Body(), graphics::svg::choose_header(), graphics::svg::choose_parameters(), FILEHEAD2, graphics::svg::setBody(), and svg_test(). Referenced by frontend::svg_frontend(), and svg_test().
00223 {
00224 svg myPicture;
00225 myPicture.choose_header(1);
00226 myPicture.choose_parameters(0);
00227 myPicture.setBody("");
00228 RGBcolor color1=RGBcolor(100,0,0);
00229 RGBcolor color2=RGBcolor(0,0,80);
00230 RGBcolor color3=RGBcolor(0,100,0);
00231 myPicture.append2Body(rect (0,0,1000, 1000,color1,color2, 1).svg(true, true, true));
00232 myPicture.append2Body(circle (300,300,50,color2,color3, 0.5).svg(true, true, true));
00233 myPicture.append2Body(circle (330,300,50,color2,color3, 0.5).svg(true, true, true));
00234 string filename=FILEHEAD2; filename+="test.svg";
00235 myPicture.write2file(filename);
00236 cout <<"Written the file "<<filename<<". \nPlease watch it using a SVG plugin."<<endl;
00237 }
|
|
|
Definition at line 180 of file svg.h. Referenced by graphics::svg::choose_parameters(). |
|
|
Definition at line 182 of file svg.h. Referenced by graphics::svg::choose_parameters(). |
|
|
Definition at line 181 of file svg.h. Referenced by graphics::svg::choose_parameters(). |
|
|
Definition at line 170 of file svg.h. Referenced by graphics::svg::choose_header(). |
| Diploma Thesis Sourcecode
Documentation check out the text and the executable binaries |