20 for (
unsigned int x = 0; x < nodeID.
locs.size(); x++)
22 for (
unsigned int y = 0; y < nodeID.
locs.size(); y++)
24 if (nodeID.
locs[x] == y)
56 for (
int x = 0; x <
node.locs.size(); x++)
58 int up =
node.locs[x];
59 if (up == -1)
return false;
63 for (
int y = 1; y <
node.locs.size(); y++)
68 if ((x-y < 0) && (x+y >=
node.locs.size()))
71 if ((x+y <
node.locs.size()) &&
72 ((
node.locs[x+y] == up) ||
73 (
node.locs[x+y] == down) ||
74 (
node.locs[x+y] == middle)))
79 ((
node.locs[x-y] == up) ||
80 (
node.locs[x-y] == down) ||
81 (
node.locs[x-y] == middle)))
91 if (row >
node.locs.size())
105 for (
int y = 1; y <
node.locs.size(); y++)
110 if ((x-y < 0) && (x+y >=
node.locs.size()))
113 if (x+y <
node.locs.size())
115 if (
node.locs[x+y] == up) count++;
116 if (
node.locs[x+y] == down) count++;
117 if (
node.locs[x+y] == middle) count++;
121 if (
node.locs[x-y] == up) count++;
122 if (
node.locs[x-y] == down) count++;
123 if (
node.locs[x-y] == middle) count++;
133 if (row >
node.locs.size())
138 int up =
node.locs[x];
147 for (
int y = 1; y <
node.locs.size(); y++)
152 if ((x-y < 0) && (x+y >=
node.locs.size()))
155 if (x+y <
node.locs.size())
157 if (
node.locs[x+y] == up) count++;
158 if (
node.locs[x+y] == down) count++;
159 if (
node.locs[x+y] == middle) count++;
163 if (
node.locs[x-y] == up) count++;
164 if (
node.locs[x-y] == down) count++;
165 if (
node.locs[x-y] == middle) count++;
175 for (
int x = 0; x <
node.locs.size(); x++)
177 int up =
node.locs[x];
186 for (
int y = 1; y <
node.locs.size(); y++)
191 if ((x-y < 0) && (x+y >=
node.locs.size()))
194 if (x+y <
node.locs.size())
196 if (
node.locs[x+y] == up) count++;
197 if (
node.locs[x+y] == down) count++;
198 if (
node.locs[x+y] == middle) count++;
202 if (
node.locs[x-y] == up) count++;
203 if (
node.locs[x-y] == down) count++;
204 if (
node.locs[x-y] == middle) count++;
220 glVertex3d(-1.0, 1.0, 0.01);
221 glVertex3d(-1.0, -1.0, 0.01);
222 glVertex3d( 1.0, -1.0, 0.01);
223 glVertex3d( 1.0, 1.0, 0.01);
229 double fract = s.
locs.size();
233 glVertex3d(-1.0+firstRow*fract, 1, 0);
234 glVertex3d(-1.0+firstRow*fract, -1, 0);
235 glVertex3d(-1.0+lastRow*fract, -1, 0);
236 glVertex3d(-1.0+lastRow*fract, 1, 0);
243 double fract = s.
locs.size();
246 glColor3f(1.0, 1.0, 1.0);
247 for (
unsigned int x = 0; x <= s.
locs.size(); x++)
249 glVertex3d(-1.0+x*fract, -1, 0);
250 glVertex3d(-1.0+x*fract, 1, 0);
252 glVertex3d(-1, -1.0+x*fract, 0);
253 glVertex3d( 1, -1.0+x*fract, 0);
257 for (
unsigned int x = 0; x < s.
locs.size(); x++)
261 glColor3f(0.2, 1.0, 0.2);
263 glColor3f(1.0, 0.1, 0.1);
264 glVertex3d(-1.0+x*fract, -1.0+s.
locs[x]*fract, 0.0);
265 glVertex3d(-1.0+x*fract, -1.0+(1+s.
locs[x])*fract, 0.0);
266 glVertex3d(-1.0+(x+1)*fract, -1.0+(1+s.
locs[x])*fract, 0.0);
267 glVertex3d(-1.0+(x+1)*fract, -1.0+s.
locs[x]*fract, 0.0);
273 glColor3f(1.0, 0, 0);
276 for (
int x = 0; x < s.
locs.size(); x++)
279 if (up == -1)
continue;
281 for (
int y = 1; y < s.
locs.size(); y++)
289 glVertex3d(-1.0+x*fract+fract*0.5+(y-1)*fract, -1.0+s.
locs[x]*fract+fract*0.5, 0.0);
291 glVertex3d(-1.0+x*fract+fract*0.5+y*fract, -1.0+s.
locs[x]*fract+fract*0.5, 0.0);
294 glVertex3d(-1.0+x*fract+fract*0.5-(y-1)*fract, -1.0+s.
locs[x]*fract+fract*0.5, 0.0);
296 glVertex3d(-1.0+x*fract+fract*0.5-y*fract, -1.0+s.
locs[x]*fract+fract*0.5, 0.0);
299 glVertex3d(-1.0+x*fract+fract*0.5-(y-1)*fract, -1.0+(up+1)*fract+fract*0.5, 0.0);
301 glVertex3d(-1.0+x*fract+fract*0.5-y*fract, -1.0+up*fract+fract*0.5, 0.0);
304 glVertex3d(-1.0+x*fract+fract*0.5-(y-1)*fract, -1.0+(down-1)*fract+fract*0.5, 0.0);
306 glVertex3d(-1.0+x*fract+fract*0.5-y*fract, -1.0+down*fract+fract*0.5, 0.0);
309 glVertex3d(-1.0+x*fract+fract*0.5+(y-1)*fract, -1.0+(up+1)*fract+fract*0.5, 0.0);
311 glVertex3d(-1.0+x*fract+fract*0.5+y*fract, -1.0+up*fract+fract*0.5, 0.0);
314 glVertex3d(-1.0+x*fract+fract*0.5+(y-1)*fract, -1.0+(down-1)*fract+fract*0.5, 0.0);
316 glVertex3d(-1.0+x*fract+fract*0.5+y*fract, -1.0+down*fract+fract*0.5, 0.0);
327 for (
unsigned int x = 0; x < s.
locs.size(); x++)
333 for (
int y = 0; y < s.
locs.size(); y++)
345 glDisable(GL_LIGHTING);
346 glEnable(GL_LINE_SMOOTH);
347 glDisable(GL_DEPTH_TEST);
350 int w = (int)s.
locs.size();
351 int h = (int)s.
locs.size();
353 glColor3f(1.0, 1.0, 1.0);
354 glTranslatef(x*2.0/w-1.0, (1+y)*2.0/h-1.0, -0.001);
355 glScalef(1.0/(w*120.0), 1.0/(h*120.0), 1);
356 glRotatef(180, 0.0, 0.0, 1.0);
357 glRotatef(180, 0.0, 1.0, 0.0);
367 glEnable(GL_DEPTH_TEST);
368 glEnable(GL_LIGHTING);
369 glDisable(GL_LINE_SMOOTH);