function Tool(){ //tool constructor this.finished = false; this.hovering = false; this.dim = false; this.parents = new Array(); this.children = new Array(); this.deleted = false; this.constraints = { horizontal: false, horizontalTo: {}, vertical: false, verticalTo: {}, radius: false, radiusTo: {}, radiusDim: 0, length: false, lengthTo: {}, lengthDim: 0, fixed: false, fixedTo: {x:0, y:0} } this.addParent = function(p){ var alreadyParent = false; for (var i=0; i b) { return (c <= a && c >= b); } else { return (c <= b && c >= a); } } this.hover = function(){ this.hovering = true; } this.unhover = function(){ this.hovering = false; } //Functions specific to the tool this.show = function(){} this.isNear = function(){} this.select = function(){} this.deselect = function(){} this.isSelected = function(){} this.delete = function(){ this.deleted = true; console.log("base Tool delete"); } this.getVertexes = function(){} this.start = function(x,y){} this.step = function(x,y){} this.end = function(x,y){} this.hover = function(){ this.hovering = true; } this.unhover = function(){ this.hovering = false; } }