- Timestamp:
- 10/28/11 11:37:19 (13 years ago)
- Location:
- trunk/FACT++/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/BasicGlCamera.cc
r12297 r12310 290 290 291 291 for (int i=0;i<1440;i++) 292 { 293 for (int j=0;j<6;j++) 294 neighbors[i][j] = -1; 292 295 updateNeighbors(i); 293 296 } 294 297 buildPatchesIndices(); 295 298 -
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r12302 r12310 49 49 if (first < 0) 50 50 first = 5; 51 // if (second > 5) 52 // second = 0; 51 53 first = neighbors[pixel][first]; 52 54 second = neighbors[pixel][second]; … … 70 72 glColor3fv(color); 71 73 } 74 void RawDataViewer::calcMidBlurColor(int pixel, int vertex) 75 { 76 GLfloat color[3]; 77 int first, second; 78 first = vertex-1; 79 if (first < 0) 80 first = 5; 81 first = neighbors[pixel][first]; 82 for (int i=0;i<3;i++) 83 color[i] = pixelsColor[pixel][i]; 84 float divide = 1; 85 if (first != -1) 86 { 87 divide++; 88 for (int i=0;i<3;i++) 89 color[i] += pixelsColor[first][i]; 90 } 91 for (int i=0;i<3;i++) 92 color[i] /= divide; 93 glColor3fv(color); 94 } 72 95 /************************************************************ 73 96 * DRAW BLURRY HEXAGON. draws a solid hexagon, with interpolated colours … … 75 98 void RawDataViewer::drawBlurryHexagon(int index) 76 99 { 100 //alternative mesh 101 /* GLfloat color1[3]; 102 GLfloat color2[3]; 103 GLfloat color3[3]; 104 for (int i=0;i<3;i++) 105 color1[i] = pixelsColor[index][i]; 106 glBegin(GL_TRIANGLES); 107 for (int i=0;i<6;i++) 108 { 109 int first = i; 110 int second = i+1; 111 if (second == 6) second = 0; 112 first = neighbors[index][first]; 113 second = neighbors[index][second]; 114 if (first == -1 || second == -1) continue; 115 for (int j=0;j<3;j++) 116 { 117 color2[j] = pixelsColor[first][j]; 118 color3[j] = pixelsColor[second][j]; 119 } 120 glColor3fv(color2); 121 glVertex2fv(pixelsCoords[first]); 122 glColor3fv(color1); 123 glVertex2fv(pixelsCoords[index]); 124 glColor3fv(color3); 125 glVertex2fv(pixelsCoords[second]); 126 } 127 glEnd(); 128 return;*/ 129 //per-pixel mesh 77 130 GLfloat color[3]; 78 131 for (int i=0;i<3;i++) … … 83 136 glColor3fv(color); 84 137 glVertex2fv(pixelsCoords[index]); 138 /* 139 calcMidBlurColor(index, 1); 140 glVertex2f((verticesList[verticesIndices[index][0]][0] + verticesList[verticesIndices[index][1]][0])/2.f, 141 (verticesList[verticesIndices[index][0]][1] + verticesList[verticesIndices[index][1]][1])/2.f); 142 glVertex2f((verticesList[verticesIndices[index][0]][0] + verticesList[verticesIndices[index][1]][0])/2.f, 143 (verticesList[verticesIndices[index][0]][1] + verticesList[verticesIndices[index][1]][1])/2.f); 144 glColor3fv(color); 145 glVertex2fv(pixelsCoords[index]); 146 */ 85 147 calcBlurColor(index, 1); 86 148 glVertex2fv(verticesList[verticesIndices[index][1]]); … … 89 151 glColor3fv(color); 90 152 glVertex2fv(pixelsCoords[index]); 153 /* 154 calcMidBlurColor(index, 2); 155 glVertex2f((verticesList[verticesIndices[index][1]][0] + verticesList[verticesIndices[index][2]][0])/2.f, 156 (verticesList[verticesIndices[index][1]][1] + verticesList[verticesIndices[index][2]][1])/2.f); 157 glVertex2f((verticesList[verticesIndices[index][1]][0] + verticesList[verticesIndices[index][2]][0])/2.f, 158 (verticesList[verticesIndices[index][1]][1] + verticesList[verticesIndices[index][2]][1])/2.f); 159 glColor3fv(color); 160 glVertex2fv(pixelsCoords[index]); 161 */ 91 162 calcBlurColor(index, 2); 92 163 glVertex2fv(verticesList[verticesIndices[index][2]]); … … 95 166 glColor3fv(color); 96 167 glVertex2fv(pixelsCoords[index]); 168 /* 169 calcMidBlurColor(index, 3); 170 glVertex2f((verticesList[verticesIndices[index][2]][0] + verticesList[verticesIndices[index][3]][0])/2.f, 171 (verticesList[verticesIndices[index][2]][1] + verticesList[verticesIndices[index][3]][1])/2.f); 172 glVertex2f((verticesList[verticesIndices[index][2]][0] + verticesList[verticesIndices[index][3]][0])/2.f, 173 (verticesList[verticesIndices[index][2]][1] + verticesList[verticesIndices[index][3]][1])/2.f); 174 glColor3fv(color); 175 glVertex2fv(pixelsCoords[index]); 176 */ 97 177 calcBlurColor(index, 3); 98 178 glVertex2fv(verticesList[verticesIndices[index][3]]); … … 101 181 glColor3fv(color); 102 182 glVertex2fv(pixelsCoords[index]); 183 /* 184 calcMidBlurColor(index, 4); 185 glVertex2f((verticesList[verticesIndices[index][3]][0] + verticesList[verticesIndices[index][4]][0])/2.f, 186 (verticesList[verticesIndices[index][3]][1] + verticesList[verticesIndices[index][4]][1])/2.f); 187 glVertex2f((verticesList[verticesIndices[index][3]][0] + verticesList[verticesIndices[index][4]][0])/2.f, 188 (verticesList[verticesIndices[index][3]][1] + verticesList[verticesIndices[index][4]][1])/2.f); 189 glColor3fv(color); 190 glVertex2fv(pixelsCoords[index]); 191 */ 103 192 calcBlurColor(index, 4); 104 193 glVertex2fv(verticesList[verticesIndices[index][4]]); … … 107 196 glColor3fv(color); 108 197 glVertex2fv(pixelsCoords[index]); 198 /* 199 calcMidBlurColor(index, 5); 200 glVertex2f((verticesList[verticesIndices[index][4]][0] + verticesList[verticesIndices[index][5]][0])/2.f, 201 (verticesList[verticesIndices[index][4]][1] + verticesList[verticesIndices[index][5]][1])/2.f); 202 glVertex2f((verticesList[verticesIndices[index][4]][0] + verticesList[verticesIndices[index][5]][0])/2.f, 203 (verticesList[verticesIndices[index][4]][1] + verticesList[verticesIndices[index][5]][1])/2.f); 204 glColor3fv(color); 205 glVertex2fv(pixelsCoords[index]); 206 */ 109 207 calcBlurColor(index, 5); 110 208 glVertex2fv(verticesList[verticesIndices[index][5]]); … … 113 211 glColor3fv(color); 114 212 glVertex2fv(pixelsCoords[index]); 213 /* 214 calcMidBlurColor(index, 0); 215 glVertex2f((verticesList[verticesIndices[index][5]][0] + verticesList[verticesIndices[index][0]][0])/2.f, 216 (verticesList[verticesIndices[index][5]][1] + verticesList[verticesIndices[index][0]][1])/2.f); 217 glVertex2f((verticesList[verticesIndices[index][5]][0] + verticesList[verticesIndices[index][0]][0])/2.f, 218 (verticesList[verticesIndices[index][5]][1] + verticesList[verticesIndices[index][0]][1])/2.f); 219 glColor3fv(color); 220 glVertex2fv(pixelsCoords[index]); 221 */ 115 222 calcBlurColor(index, 0); 116 223 glVertex2fv(verticesList[verticesIndices[index][0]]); … … 383 490 assignPixelMap(mypMap); 384 491 buildVerticesList(); 492 // for (int i=0;i<1440;i++) 493 // updateNeighbors(i); 385 494 386 495 for (int i=0;i<160;i++) … … 490 599 cy > bboxMax[1]) 491 600 return; 492 whichSlice = (cx - bboxMin[0])* 1024/(bboxMax[0] - bboxMin[0]);601 whichSlice = (cx - bboxMin[0])*nRoi/(bboxMax[0] - bboxMin[0]); 493 602 emit signalCurrentSlice(whichSlice); 494 603 } -
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h
r12302 r12310 112 112 // void buildPatchesIndices(); 113 113 void calcBlurColor(int pixel, int vertex); 114 void calcMidBlurColor(int pixel, int vertex); 114 115 void drawBlurryHexagon(int index); 115 116 int whichSlice;
Note:
See TracChangeset
for help on using the changeset viewer.