-
Notifications
You must be signed in to change notification settings - Fork 0
/
p55Wall.pde
79 lines (72 loc) · 1.57 KB
/
p55Wall.pde
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import controlP5.*;
/*
* TODO:
* 1. Z-Buffer
* 2. selection:
* 3. Better XML
* 4. Sauvegarde
* 5. Multi-nodes
*
* rq: ameliorer interface
* utiliser arc de cercle pour faire de la bi-matiere
*
*/
ControlP5 controlP5;
GUICtrl aGUICtrl;
public boolean lPressed=false;
ObjHWCollection theHWList = new ObjHWCollection();
ObjHW selectedObj;
PGraphics backBuffer;
void setup() {
smooth();
size(800,400);
controlP5 = new ControlP5(this);
backBuffer = createGraphics(400,400,JAVA2D);
aGUICtrl = new GUICtrl(controlP5, this.g, backBuffer);
aGUICtrl.createInterface(controlP5);
theHWList.add(new ObjHW(aGUICtrl));
stroke(0,0,0);
}
void draw() {
ObjHW anObj;
int i;
//HWList.sort();
aGUICtrl.drawBackground();
for(i=0; i < theHWList.size(); i++) {
anObj = (ObjHW)theHWList.get(i);
anObj.drawObj();
anObj.drawObjInBuffer();
}
//image(backBuffer, 400, 0);
}
void mousePressed() {
ObjHW anObj;
lPressed = true;
int i;
println("HWList size:"+theHWList.size() );
for (i =0; i < theHWList.size(); i++ ) {
anObj = (ObjHW)theHWList.get(i);
if ( anObj.isSelected(mouseX,mouseY) ) {
println("selected & break");
selectedObj = anObj;
anObj.loadParametersUI();
}
else {
anObj.setUnselected();
}
}
}
void mouseReleased() {
ObjHW anObj;
int i=0;
println("mouse released");
lPressed = false;
while (i < theHWList.size() ) {
anObj = (ObjHW)theHWList.get(i);
anObj.setUnselected();
i++;
}
}
public void controlEvent(ControlEvent theEvent) {
aGUICtrl.dispatchEvent(theEvent);
}