-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sketch.js
30 lines (24 loc) · 814 Bytes
/
Sketch.js
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
//Sketch.js
function Sketch(idIn, parentIn, parentDirtyListCallback, planeIn){
this.type = "Sketch";
this.usesRenderList = true;
this.id = idIn;
this.parent = parentIn;
this.passDirtyToParent = parentDirtyListCallback;
//this is the plane that the sketch sits on
this.plane = planeIn;
//this is the list of objects in the sketch
this.renderList = [];
this.dirtyList = [];
//every child of the sketch gets a local id number
this.idGen = new IdGenerator();
}
Sketch.prototype.addPoint = function(xIn, yIn, zIn, colorIn){
point = new Point(this.idGen.getId, this.id, this.dirtyListCallback.bind(this),
xIn, yIn, zIn, colorIn);
this.renderList.push(point);
this.passDirtyToParent(point);
};
Sketch.prototype.dirtyListCallback = function(dirtyObject){
this.passDirtyToParent(dirtyObject);
};