A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
graphlib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hide protected methods in generated doc.
[graphlib.git]
/
test
/
hello.cpp
diff --git
a/test/hello.cpp
b/test/hello.cpp
index
8cc7b50
..
615b3ca
100644
(file)
--- a/
test/hello.cpp
+++ b/
test/hello.cpp
@@
-2,14
+2,14
@@
* Pour compiler
* =============
*
* Pour compiler
* =============
*
- * 1. Cr
é
er le fichier hello.pro :
- *
+------------------------------------------------------------+
- *
|TARGET = hello |
- *
|CONFIG += qt debug |
- *
|SOURCES += hello.cc |
- *
+------------------------------------------------------------+
+ * 1. Cr
é
er le fichier hello.pro :
+ *
,----
+ *
|TARGET = hello
+ *
|CONFIG += qt debug
+ *
|SOURCES += hello.cpp
+ *
`-----
*
*
- * 2. Cr
é
er le fichier Makefile avec la commande :
+ * 2. Cr
é
er le fichier Makefile avec la commande :
* $ qmake -makefile hello.pro
* ou tout simplement :
* $ qmake -makefile
* $ qmake -makefile hello.pro
* ou tout simplement :
* $ qmake -makefile
@@
-32,30
+32,25
@@
void flip(DrawingWindow &w)
int c = 0;
int y = 0;
int c = 0;
int y = 0;
-// int h = w.height;
-// int w = w.width;
int count = 50;//1 << 31;
while (1) {
int count = 50;//1 << 31;
while (1) {
-// std::cerr << "loooooooooooooooooooooop "
-// << y << " (" << c << ")\n";
w.setColor(c, c, c);
for (int yy = y; yy < y + 10; yy++) {
for (int x = 0; x < w.width; x++)
w.drawPoint(x, yy);
}
if ((y += 10) >= w.height) {
w.setColor(c, c, c);
for (int yy = y; yy < y + 10; yy++) {
for (int x = 0; x < w.width; x++)
w.drawPoint(x, yy);
}
if ((y += 10) >= w.height) {
+ w.sync();
y = 0;
c = !c;
if (!--count) break;
y = 0;
c = !c;
if (!--count) break;
-// std::cerr << "loooooooooooooooooooooop "
-// << y << " (" << c << ")\n";
}
}
}
void mandel(DrawingWindow &w)
{
}
}
}
void mandel(DrawingWindow &w)
{
- /* param
ètres par dé
faut */
+ /* param
ètres par dé
faut */
int larg = w.width;
int haut = w.height;
float Rmin = -2.05;
int larg = w.width;
int haut = w.height;
float Rmin = -2.05;
@@
-65,7
+60,7
@@
void mandel(DrawingWindow &w)
int maxiter = 100;
int maxiter = 100;
- int x, y; /* le pixel consid
éré
*/
+ int x, y; /* le pixel consid
éré
*/
float cr, ci; /* le complexe correspondant */
float zr, zi; /* pour calculer la suite */
float zr2, zi2;
float cr, ci; /* le complexe correspondant */
float zr, zi; /* pour calculer la suite */
float zr2, zi2;
@@
-94,7
+89,7
@@
void mandel(DrawingWindow &w)
zi = 2*zr*zi + ci;
zr = zr2 - zi2 + cr;
}
zi = 2*zr*zi + ci;
zr = zr2 - zi2 + cr;
}
- /* on est sorti trop t
ô
t du for(...):
+ /* on est sorti trop t
ô
t du for(...):
on affiche le pixel d'un couleur en fonction
de i */
if (i <= maxiter / 2) {
on affiche le pixel d'un couleur en fonction
de i */
if (i <= maxiter / 2) {
@@
-115,6
+110,8
@@
void mandel(DrawingWindow &w)
ci += pi;
}
cr += pr;
ci += pi;
}
cr += pr;
+// if (x % 10 == 0)
+// w.sync();
}
}
}
}
@@
-133,7
+130,8
@@
void lines(DrawingWindow &w)
int y2 = rand() % ymax;
w.setColor(r, g, b);
w.drawLine(x1, y1, x2, y2);
int y2 = rand() % ymax;
w.setColor(r, g, b);
w.drawLine(x1, y1, x2, y2);
- w.sync();
+ //if (n % 100 == 0)
+ w.sync();
}
}
}
}
@@
-150,16
+148,10
@@
void rectangles(DrawingWindow &w)
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
- const int w =
10
00;
+ const int w =
7
00;
const int h = 700;
QApplication application(argc, argv);
const int h = 700;
QApplication application(argc, argv);
- DrawingWindow dl(lines, w, h);
- dl.show();
-
- DrawingWindow dr(rectangles, w, h);
- dr.show();
-
const int nf = 1;
const int nm = 1;
DrawingWindow *dw[nf + nm];
const int nf = 1;
const int nm = 1;
DrawingWindow *dw[nf + nm];
@@
-172,5
+164,11
@@
int main(int argc, char *argv[])
for (int i = 0; i < nf + nm; ++i)
dw[i]->show();
for (int i = 0; i < nf + nm; ++i)
dw[i]->show();
+ DrawingWindow dr(rectangles, w, h);
+ dr.show();
+
+ DrawingWindow dl(lines, w, h);
+ dl.show();
+
return application.exec();
}
return application.exec();
}