FACT++  1.0
void RawDataViewer::drawCamera ( bool  alsoWire)
protectedvirtual

Reimplemented from BasicGlCamera.

Definition at line 156 of file RawEventsViewer.cc.

References ACTUAL_NUM_PIXELS, color(), and i.

Referenced by getCurrentPixel(), and paintGL().

157 {
158  glLoadIdentity();
159  if (!drawImpulse)
160  {
161  glTranslatef(0,-0.44,0);
162  glRotatef(cameraRotation, 0,0,-1);
163  if (cameraRotation == 90)
164  {
165  glTranslatef(-0.45,-0.45,0);
166  }
167  if (cameraRotation == -90)
168  {
169  glTranslatef(0.45,-0.45,0);
170  }
171  glScalef(1.5,1.5,1);
172  }
173  else
174  {
175  glRotatef(cameraRotation, 0,0,-1);
176  if (cameraRotation == 90)
177  {
178  glTranslatef(-0.45/1.5,-0.45/1.5,0);
179  }
180  if (cameraRotation == -90)
181  {
182  glTranslatef(0.45/1.5,-0.45/1.5,0);
183  }
184  }
185  glColor3f(0.5,0.5,0.5);
186  glLineWidth(1.0);
187  float color;
188 
189  for (int i=0;i<ACTUAL_NUM_PIXELS;i++)
190  {
191  if (!nRoi)
192  color = (float)(i)/(float)(ACTUAL_NUM_PIXELS);
193  else
194 
195 // if (_softwareOrdering)
196 // color = float(eventData[nRoi*i + whichSlice] + (VALUES_SPAN/2))/(float)(VALUES_SPAN-1);
197 // else
198  color = float(eventData[nRoi*hardwareMapping[i] + whichSlice]+(VALUES_SPAN/2))/(float)(VALUES_SPAN-1);
199  if (logScale)
200  {
201  color *= 9;
202  color += 1;
203  color = log10(color);
204  }
205 
206  if (color < ss[0])
207  {
211  continue;
212  }
213  if (color > ss[4])
214  {
218  continue;
219  }
220  int index = 0;
221  while (ss[index] < color && index < 4)
222  index++;
223  index--;
224  if (index < 0) index = 0;
225  float weight0 = (color-ss[index]) / (ss[index+1]-ss[index]);
226  if (weight0 > 1.0f) weight0 = 1.0f;
227  if (weight0 < 0.0f) weight0 = 0.0f;
228  float weight1 = 1.0f-weight0;
229  pixelsColor[i][0] = weight1*rr[index] + weight0*rr[index+1];
230  pixelsColor[i][1] = weight1*gg[index] + weight0*gg[index+1];
231  pixelsColor[i][2] = weight1*bb[index] + weight0*bb[index+1];
232  }
233 
234  for (int i=0;i<ACTUAL_NUM_PIXELS;i++)
235  {
236 
237  glColor3fv(pixelsColor[i]);
238  glLoadName(i);
239 if (drawBlur)
241 else
242  drawHexagon(i,true);
243 
244  }
245  if (!alsoWire)
246  return;
247  glTranslatef(0,0,0.1f);
248  glColor3f(0.0f,0.0f,0.0f);
249  for (int i=0;i<ACTUAL_NUM_PIXELS;i++)
250  {
251 
252  drawHexagon(i, false);
253  }
254 
255 }
#define ACTUAL_NUM_PIXELS
int i
Definition: db_dim_client.c:21
void drawBlurryHexagon(int index)
GLfloat tooLowValueCoulour[3]
Definition: BasicGlCamera.h:71
GLfloat pixelsColor[NPIX][3]
void drawHexagon(int index, bool solid)
GLfloat tooHighValueCoulour[3]
Definition: BasicGlCamera.h:70
function color(col)
Definition: color.js:31
static int hardwareMapping[NPIX]

+ Here is the call graph for this function:

+ Here is the caller graph for this function: