X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/graphlib.git/blobdiff_plain/2ecf02eeb3c25c56ad5de3a340fd7fd8ebdfa679..49b1adec952c57fc84dceea41933b7a3cad97ec3:/exemple.cpp diff --git a/exemple.cpp b/exemple.cpp index 46e3510..d4722e7 100644 --- a/exemple.cpp +++ b/exemple.cpp @@ -1,29 +1,29 @@ /* - * Pour compiler et exécuter + * Pour compiler et exécuter * ========================= * - * 1. Créer le fichier exemple.pro : - * +------------------------------------------------------------+ - * |TEMPLATE = app | - * |TARGET = hello | - * |CONFIG += qt | - * |CONFIG += debug | - * |HEADERS += DrawingWindow.h | - * |SOURCES += DrawingWindow.cpp | - * |SOURCES += exemple.cc | - * +------------------------------------------------------------+ + * 1. Créer le fichier exemple.pro : + * ,---- + * |TEMPLATE = app + * |TARGET = exemple + * |CONFIG += qt + * |CONFIG += debug + * |HEADERS += DrawingWindow.h + * |SOURCES += DrawingWindow.cpp + * |SOURCES += exemple.cpp + * `---- * - * 2. Créer le fichier Makefile avec la commande : + * 2. Créer le fichier Makefile avec la commande : * $ qmake-qt4 exemple.pro * ou tout simplement : * $ qmake-qt4 * * 3. Compiler avec la commande : * $ make exemple - * ou tou simplement : + * ou tout simplement : * $ make * - * 4. Exécuter le programme avec la commande : + * 4. Exécuter le programme avec la commande : * $ ./exemple */ @@ -37,7 +37,7 @@ float frand() return rand() / (float )RAND_MAX; } -void exemple1(DrawingWindow &w) +void exemple1(DrawingWindow& w) { const int cx = w.width / 2; const int cy = w.height / 2; @@ -52,7 +52,7 @@ void exemple1(DrawingWindow &w) } } -void exemple2(DrawingWindow &w) +void exemple2(DrawingWindow& w) { int width = std::min(w.width, w.height) / 2; for (int z = 0; z <= width; z++) { @@ -78,7 +78,7 @@ void exemple2(DrawingWindow &w) } } -void exemple3(DrawingWindow &w) +void exemple3(DrawingWindow& w) { while (1) { int x1 = rand() % w.width;