Commit 691fa079986b614df9558f258472ed3a4f5bdfd9
1 parent
d8e684dc
initial pass adapting NetMets to work with the new cylinder class
Showing
1 changed file
with
13 additions
and
34 deletions
Show diff stats
main.cu
@@ -122,30 +122,11 @@ void glut_render_modelview(){ | @@ -122,30 +122,11 @@ void glut_render_modelview(){ | ||
122 | //draws the network(s) | 122 | //draws the network(s) |
123 | void glut_render(void) { | 123 | void glut_render(void) { |
124 | 124 | ||
125 | - if(ind == 0){ | ||
126 | - if(num_nets == 1){ //if a single network is loaded | ||
127 | - glut_render_single_projection(); //fill the entire viewport | ||
128 | - glut_render_modelview(); //set up the modelview matrix with camera details | ||
129 | - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen | ||
130 | - GT.glCenterline0(); //render the GT network (the only one loaded) | ||
131 | - } | ||
132 | - | ||
133 | - if(num_nets == 2){ //if two networks are loaded | ||
134 | - | ||
135 | - glut_render_left_projection(); //set up a projection for the left half of the window | ||
136 | - glut_render_modelview(); //set up the modelview matrix using camera details | ||
137 | - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen | ||
138 | - | ||
139 | - glEnable(GL_TEXTURE_1D); //enable texture mapping | ||
140 | - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color | ||
141 | - glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map | ||
142 | - | ||
143 | - GT.glCenterline(GT.nmags() - 1); //render the GT network | ||
144 | - | ||
145 | - glut_render_right_projection(); //set up a projection for the right half of the window | ||
146 | - glut_render_modelview(); //set up the modelview matrix using camera details | ||
147 | - T.glCenterline(T.nmags() - 1); //render the T network | ||
148 | - } | 125 | + if(num_nets == 1){ //if a single network is loaded |
126 | + glut_render_single_projection(); //fill the entire viewport | ||
127 | + glut_render_modelview(); //set up the modelview matrix with camera details | ||
128 | + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen | ||
129 | + GT.glCenterline(); //render the GT network (the only one loaded) | ||
149 | } | 130 | } |
150 | else{ | 131 | else{ |
151 | if(num_nets == 1){ //if a single network is loaded | 132 | if(num_nets == 1){ //if a single network is loaded |
@@ -162,19 +143,17 @@ void glut_render(void) { | @@ -162,19 +143,17 @@ void glut_render(void) { | ||
162 | glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color | 143 | glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); //texture map will be used as the network color |
163 | glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map | 144 | glBindTexture(GL_TEXTURE_1D, cmap_tex); //bind the Brewer texture map |
164 | 145 | ||
165 | - _GT.glCenterline(_GT.nmags() - 1); //render the GT network | 146 | + _GT.glCenterline(); //render the GT network |
166 | 147 | ||
167 | glut_render_right_projection(); //set up a projection for the right half of the window | 148 | glut_render_right_projection(); //set up a projection for the right half of the window |
168 | glut_render_modelview(); //set up the modelview matrix using camera details | 149 | glut_render_modelview(); //set up the modelview matrix using camera details |
169 | - _T.glCenterline(_T.nmags() - 1); //render the T network | 150 | + _T.glCenterline(); //render the T network |
170 | 151 | ||
171 | - } | ||
172 | - else{ | ||
173 | - glut_render_left_projection(); //set up a projection for the left half of the window | ||
174 | - glut_render_modelview(); //set up the modelview matrix using camera details | ||
175 | - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //clear the screen | 152 | + GT.glCenterline(); //render the GT network |
176 | 153 | ||
177 | - _GT.glRandColorCenterlineGT(dlist1, _gt_t, colormap); | 154 | + glut_render_right_projection(); //set up a projection for the right half of the window |
155 | + glut_render_modelview(); //set up the modelview matrix using camera details | ||
156 | + T.glCenterline(); //render the T network | ||
178 | 157 | ||
179 | glut_render_right_projection(); //set up a projection for the right half of the window | 158 | glut_render_right_projection(); //set up a projection for the right half of the window |
180 | glut_render_modelview(); //set up the modelview matrix using camera details | 159 | glut_render_modelview(); //set up the modelview matrix using camera details |
@@ -375,8 +354,8 @@ void compare(float sigma, int device){ | @@ -375,8 +354,8 @@ void compare(float sigma, int device){ | ||
375 | T = T.compare(GT, sigma, device); //compare the test case to the ground truth - store errors in T | 354 | T = T.compare(GT, sigma, device); //compare the test case to the ground truth - store errors in T |
376 | 355 | ||
377 | //calculate the metrics | 356 | //calculate the metrics |
378 | - float FPR = GT.average(0); //calculate the metrics | ||
379 | - float FNR = T.average(0); | 357 | + float FPR = GT.average(); //calculate the metrics |
358 | + float FNR = T.average(); | ||
380 | 359 | ||
381 | std::cout << "FNR: " << FPR << std::endl; //print false alarms and misses | 360 | std::cout << "FNR: " << FPR << std::endl; //print false alarms and misses |
382 | std::cout << "FPR: " << FNR << std::endl; | 361 | std::cout << "FPR: " << FNR << std::endl; |