FACT++  1.0
BasicGlCamera::BasicGlCamera ( QWidget *  parent = 0)

1.44;//(double)(i)/(double)(ACTUAL_NUM_PIXELS);

Definition at line 43 of file BasicGlCamera.cc.

References autoRefresh, buildVerticesList(), calculatePixelsCoords(), cameraRotation, colorGroup, colorPaletteLabel, dataText, fcSlice, fData, fMax, fMin, fPixelStride, fScaleLimit, fTextEnabled, fTextSize, fWhite, fWhitePatch, glowingPaletteButton, glowingPalettePlease(), greyScalePaletteButton, greyScalePalettePlease(), hexRadius, hexTolerance, highlightedPatchesCoulour, highlightedPixelsCoulour, i, linearButton, linearScalePlease(), logButton, logScale, logScalePlease(), minus90RotationButton, minus90RotationPlease(), NPIX, patchesCoulour, pixelContourColour, plus90Rotationbutton, plus90RotationPlease(), prettyPaletteButton, prettyPalettePlease(), regularPaletteButton, regularPalettePlease(), rotationGroup, rotationLabel, scaleGroup, scaleLabel, signalUpdateCamera(), timedUpdate(), titleText, unitsText, viewSize, zeroRotationButton, and zeroRotationPlease().

44  : QGLWidget(QGLFormat(QGL::DoubleBuffer |
45  QGL::DepthBuffer /*|
46  QGL::IndirectRendering*/),cParent)
47  {
48  QGL::setPreferredPaintEngine(QPaintEngine::OpenGL);
49  fWhite = -1;
50  fWhitePatch = -1;
51  fMin = -1;
52  fMax = -1;
53  fScaleLimit = -0.5;
54  fTextSize = 0;
55  autoRefresh = false;
56  logScale = false;
57  cameraRotation = +90;
58  fTextEnabled = true;
59  unitsText = "";
60  titleText = "";
61  dataText = "";
62  pixelContourColour[0] = 0.1f;
63  pixelContourColour[1] = 0.1f;
64  pixelContourColour[2] = 0.1f;
65  patchesCoulour[0] = 0.1f;
66  patchesCoulour[1] = 0.1f;
67  patchesCoulour[2] = 0.1f;
68  highlightedPatchesCoulour[0] = 0.6f;
69  highlightedPatchesCoulour[1] = 0.6f;
70  highlightedPatchesCoulour[2] = 0.6f;
71  highlightedPixelsCoulour[0] = 0.8f;
72  highlightedPixelsCoulour[1] = 0.8f;
73  highlightedPixelsCoulour[2] = 0.8f;
74 
76 
77 
78  hexRadius = 0.015f;
79  hexTolerance = hexRadius/100.0f;
80  viewSize = 1.0f;
82 
84 /*
85  ifstream fin1("Trigger-Patches.txt");
86  if (!fin1.is_open())
87  {
88  cout << "Error: file \"Trigger-Patches.txt\" missing. Aborting." << endl;
89  exit(-1);
90  }
91  l=0;
92  while (getline(fin1, buf, '\n'))
93  {
94  buf = Tools::Trim(buf);
95  if (buf[0]=='#')
96  continue;
97 
98  stringstream str(buf);
99  for (int i=0; i<9; i++)
100  {
101  unsigned int n;
102  str >> n;
103 
104  if (n>=1440)
105  continue;
106 
107  patches[l][i] = hardwareMapping[n];
108  }
109  l++;
110  }
111 
112  //now construct the correspondance between pixels and patches
113  for (int i=0;i<NTMARK;i++)
114  for (int j=0;j<9;j++)
115  pixelsPatch[softwareMapping[patches[i][j]]] = i;
116 
117  for (int i=0;i<1440;i++)
118  updateNeighbors(i);
119 
120  buildPatchesIndices();
121 */
122  regularPalettePlease(true);
123 // ss[0] = 0; ss[1] = 0.25f; ss[2] = 0.5f; ss[3] = 0.75f; ss[4] = 1.0f;
124 // rr[0] = 0.15; rr[1] = 0; rr[2] = 0; rr[3] = 1.0f; rr[4] = 0.85f;
125 // gg[0] = 0.15; gg[1] = 0; gg[2] = 1; gg[3] = 0; gg[4] = 0.85f;
126 // bb[0] = 0.15; bb[1] = 1; bb[2] = 0; bb[3] = 0; bb[4] = 0.85f;
127 
128  fPixelStride = 1;
129  fcSlice = 0;
130  fData.resize(1440);
131  for (int i=0;i<NPIX;i++)
132  fData[i] = (double)i;
133 
134 // setFont(QFont("Arial", 8));
135  int buttonShift=0;
136  scaleLabel = new QLabel("Scale", this);
137 // buttonShift += scaleLabel->height();
138 
139  linearButton = new QRadioButton("Linear", this);
140  linearButton->move(scaleLabel->width(), buttonShift);
141  buttonShift += linearButton->height();
142 
143  logButton = new QRadioButton("Log", this);
144  logButton->move(scaleLabel->width(), buttonShift);
145  buttonShift += logButton->height()*1.1f;
146 
147  colorPaletteLabel = new QLabel("Colour\nPalette", this);
148  colorPaletteLabel->move(0, buttonShift);
149  // buttonShift += colorPaletteLabel->height();
150 
151  regularPaletteButton = new QRadioButton("Regular", this);
152  regularPaletteButton->move(colorPaletteLabel->width(), buttonShift);
153  buttonShift += regularPaletteButton->height();
154 
155  prettyPaletteButton = new QRadioButton("Pretty", this);
156  prettyPaletteButton->move(colorPaletteLabel->width(), buttonShift);
157  buttonShift += prettyPaletteButton->height();
158 
159  greyScalePaletteButton = new QRadioButton("Grey Scale", this);
160  greyScalePaletteButton->move(colorPaletteLabel->width(), buttonShift);
161  buttonShift += greyScalePaletteButton->height();
162 
163  glowingPaletteButton = new QRadioButton("Glowing", this);
164  glowingPaletteButton->move(colorPaletteLabel->width(), buttonShift);
165  buttonShift += glowingPaletteButton->height()*1.1f;
166 
167  rotationLabel = new QLabel("Camera\nRotation", this);
168  rotationLabel->move(0, buttonShift);
169  // buttonShift += rotationLabel->height();
170 
171  unsigned short utf16Array;
172  utf16Array = 0x00b0;
173  QString degreeSymbol(QString::fromUtf16(&utf16Array, 1));
174  QString zerostr("0" + degreeSymbol);
175  zeroRotationButton = new QRadioButton(zerostr, this);
176  zeroRotationButton->move(rotationLabel->width(), buttonShift);
177  buttonShift += zeroRotationButton->height();
178  QString minus90str("+90" + degreeSymbol);
179  minus90RotationButton = new QRadioButton(minus90str, this);
180  minus90RotationButton->move(rotationLabel->width(), buttonShift);
181  buttonShift += minus90RotationButton->height();
182  QString plus90str("-90"+degreeSymbol);
183  plus90Rotationbutton = new QRadioButton(plus90str, this);
184  plus90Rotationbutton->move(rotationLabel->width(), buttonShift);
185 
186 
187  scaleGroup = new QButtonGroup(this);
188  colorGroup = new QButtonGroup(this);
189  rotationGroup = new QButtonGroup(this);
190  scaleGroup->addButton(linearButton);
191  scaleGroup->addButton(logButton);
192  colorGroup->addButton(regularPaletteButton);
193  colorGroup->addButton(prettyPaletteButton);
195  colorGroup->addButton(glowingPaletteButton);
196  rotationGroup->addButton(zeroRotationButton);
199 
200  linearButton->setChecked(true);
201  regularPaletteButton->setChecked(true);
202 // zeroRotationButton->setChecked(true);
203  minus90RotationButton->setChecked(true);
204 // linearButton->palette.setColor();
205 
206  linearButton->setAutoFillBackground(true);
207  logButton->setAutoFillBackground(true);
208  regularPaletteButton->setAutoFillBackground(true);
209  prettyPaletteButton->setAutoFillBackground(true);
210  greyScalePaletteButton->setAutoFillBackground(true);
211  glowingPaletteButton->setAutoFillBackground(true);
212  zeroRotationButton->setAutoFillBackground(true);
213  minus90RotationButton->setAutoFillBackground(true);
214  plus90Rotationbutton->setAutoFillBackground(true);
215  scaleLabel->setAutoFillBackground(true);
216  colorPaletteLabel->setAutoFillBackground(true);
217  rotationLabel->setAutoFillBackground(true);
218 
219  linearButton->hide();
220  logButton->hide();
221  regularPaletteButton->hide();
222  prettyPaletteButton->hide();
223  greyScalePaletteButton->hide();
224  glowingPaletteButton->hide();
225  zeroRotationButton->hide();
226  minus90RotationButton->hide();
227  plus90Rotationbutton->hide();
228  scaleLabel->hide();
229  colorPaletteLabel->hide();
230  rotationLabel->hide();
231 
232  connect(linearButton, SIGNAL(toggled(bool)),
233  this, SLOT(linearScalePlease(bool)));
234  connect(logButton, SIGNAL(toggled(bool)),
235  this, SLOT(logScalePlease(bool)));
236  connect(regularPaletteButton, SIGNAL(toggled(bool)),
237  this, SLOT(regularPalettePlease(bool)));
238  connect(prettyPaletteButton, SIGNAL(toggled(bool)),
239  this, SLOT(prettyPalettePlease(bool)));
240  connect(greyScalePaletteButton, SIGNAL(toggled(bool)),
241  this, SLOT(greyScalePalettePlease(bool)));
242  connect(glowingPaletteButton, SIGNAL(toggled(bool)),
243  this, SLOT(glowingPalettePlease(bool)));
244  connect(zeroRotationButton, SIGNAL(toggled(bool)),
245  this, SLOT(zeroRotationPlease(bool)));
246  connect(minus90RotationButton, SIGNAL(toggled(bool)),
247  this, SLOT(plus90RotationPlease(bool)));
248  connect(plus90Rotationbutton, SIGNAL(toggled(bool)),
249  this, SLOT(minus90RotationPlease(bool)));
250 
251  connect(this, SIGNAL(signalUpdateCamera()),
252  this, SLOT(timedUpdate()));
253  }
QRadioButton * minus90RotationButton
QButtonGroup * colorGroup
GLfloat highlightedPatchesCoulour[3]
Definition: BasicGlCamera.h:68
GLfloat highlightedPixelsCoulour[3]
Definition: BasicGlCamera.h:69
QRadioButton * linearButton
void linearScalePlease(bool)
GLfloat pixelContourColour[3]
Definition: BasicGlCamera.h:66
int i
Definition: db_dim_client.c:21
QRadioButton * glowingPaletteButton
void zeroRotationPlease(bool)
QLabel * rotationLabel
void glowingPalettePlease(bool)
GLfloat patchesCoulour[3]
Definition: BasicGlCamera.h:67
void greyScalePalettePlease(bool)
std::string dataText
Definition: BasicGlCamera.h:73
void calculatePixelsCoords()
QRadioButton * logButton
QRadioButton * zeroRotationButton
std::vector< double > fData
void regularPalettePlease(bool)
std::string titleText
Definition: BasicGlCamera.h:75
QLabel * scaleLabel
#define NPIX
Definition: BasicGlCamera.h:5
void signalUpdateCamera()
QButtonGroup * scaleGroup
void logScalePlease(bool)
void prettyPalettePlease(bool)
QLabel * colorPaletteLabel
QRadioButton * regularPaletteButton
QButtonGroup * rotationGroup
void minus90RotationPlease(bool)
void buildVerticesList()
QRadioButton * prettyPaletteButton
QRadioButton * greyScalePaletteButton
void plus90RotationPlease(bool)
QRadioButton * plus90Rotationbutton
std::string unitsText
Definition: BasicGlCamera.h:74

+ Here is the call graph for this function: