comparison button.mm @ 3:d346ddc50f70

Vectorised a few things. Fiddled with new mesh creator... not solved much.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Fri, 07 Dec 2012 19:20:57 +0000
parents c667dfe12d47
children
comparison
equal deleted inserted replaced
2:0aab7a1d3c77 3:d346ddc50f70
8 // button on screen either side of mesh 8 // button on screen either side of mesh
9 #include <iostream> 9 #include <iostream>
10 #include "button.h" 10 #include "button.h"
11 #include "globalUI.h" 11 #include "globalUI.h"
12 #include "globalForces.h" 12 #include "globalForces.h"
13 #include "scanpath.h"
14
13 extern GlobalUI globalUI; 15 extern GlobalUI globalUI;
14 extern GlobalForces globalForces; 16 extern GlobalForces globalForces;
17 extern ScanPath scanPath;
15 18
16 ControlButton::ControlButton(int abuttonId, int awidth,int aheight,int axpos,int aypos, string aname, Mesh *atheMeshPtr, ofColor acolor){ 19 ControlButton::ControlButton(int abuttonId, int awidth,int aheight,int axpos,int aypos, string aname, Mesh *atheMeshPtr, ofColor acolor){
17 width = awidth; 20 width = awidth;
18 height = aheight; 21 height = aheight;
19 xpos = axpos; 22 xpos = axpos;
127 } 130 }
128 if (name == "gravity"){ 131 if (name == "gravity"){
129 globalForces.gravityAmt = 4.0; 132 globalForces.gravityAmt = 4.0;
130 } 133 }
131 if(name == "scanmode"){ 134 if(name == "scanmode"){
132 theMesh->scanPath->scanMode = theMesh->scanPath->SPEED; 135 scanPath.scanMode = scanPath.SPEED;
133 } 136 }
134 pressed = true; 137 pressed = true;
135 } 138 }
136 139
137 void ControlButton::release(){ 140 void ControlButton::release(){
147 } 150 }
148 if (name == "gravity"){ 151 if (name == "gravity"){
149 globalForces.gravityAmt = 0.0; 152 globalForces.gravityAmt = 0.0;
150 } 153 }
151 if(name == "scanmode"){ 154 if(name == "scanmode"){
152 theMesh->scanPath->scanMode = theMesh->scanPath->DISPLACEMENT; 155 scanPath.scanMode = scanPath.DISPLACEMENT;
153 } 156 }
154 if (name == "freeAll"){ 157 if (name == "freeAll"){
155 theMesh->constrain(.0,.0,Mesh::CONSTRAIN_EDGES); 158 theMesh->constrain(.0,.0,Mesh::CONSTRAIN_EDGES);
156 } 159 }
157 pressed = false; 160 pressed = false;