Isis 3 Programmer Reference
MatrixOptions.cpp
1 #include "MatrixOptions.h"
2 
3 #include <QColor>
4 #include <QString>
5 #include <QList>
6 
7 #include "CorrelationMatrix.h"
8 #include "MatrixSceneWidget.h"
9 #include "MatrixOptionsDialog.h"
10 
11 namespace Isis {
15  MatrixOptions::MatrixOptions(CorrelationMatrix parent, MatrixSceneWidget *scene) { // give parent? MatrixSceneWidget
16  m_parentMatrix = new CorrelationMatrix(parent);
17  //Color Options
18  m_tolerance = false; // if tolerance is false then we use gradient
19  m_goodColor = Qt::cyan;
20  m_badColor = Qt::magenta;
21  m_colorTolerance = 0.2;
22 
23  // Focus Options
24  m_focusOption = MatrixOptions::Tolerance;
25 
26  // Specific Parameters
27  m_image1 = "Specific Img1";
28  m_parameter1 = "Specific Param1";
29  m_image2 = "Specific Img2";
30  m_parameter2 = "Specific Param2";
31 // m_imagesAndParameters = parentMatrix->imagesAndParameters(); // pointer the the one in correlation matrix?
32 
33  // Tolerance
34  m_focusTolSelectedElement = 1.0;
35  m_goodElements = QList<double>();
36  m_badElements = QList<double>();
37 
38  for (int i = 0; i < 10; i++) {
39  m_goodElements.append(i);
40  m_badElements.append(i + 10);
41  }
42 
43  // Current Correlation Information
44  m_currentValue = 0.0;
45  m_currentImg1 = "Current Image 1";
46  m_currentParam1 = "Current Parameter 1";
47  m_currentImg2 = "Current Image 2";
48  m_currentParam2 = "Current Parameter 2";
49 
50  MatrixOptionsDialog *optionsDialog = new MatrixOptionsDialog(this, scene);
51  optionsDialog->setAttribute(Qt::WA_DeleteOnClose);
52  optionsDialog->show();
53 
54  connect(optionsDialog, SIGNAL( optionsUpdated() ),
55  this, SIGNAL( optionsUpdated() ) );
56  }
57 
58 
59 
63 // MatrixOptions::MatrixOptions(CorrelationMatrix *parent) { // give parent? MatrixSceneWidget
64 // }
65 
66 
67 
72  }
73 
74 
75 
76  // Color Options
83  return m_goodColor;
84  }
85 
86 
87 
94  return m_badColor;
95  }
96 
97 
98 
105  return m_colorTolerance;
106  }
107 
108 
109 
117  return m_tolerance; // if tolerance is false then we use gradient
118  }
119 
120 
121 
126  void MatrixOptions::setColorScheme(bool tolerance) {
127  m_tolerance = tolerance;
128  }
129 
130 
131 
136  void MatrixOptions::setColorTolerance(double tolerance) {
137  m_colorTolerance = tolerance;
138  }
139 
140 
141 
147  m_goodColor = color;
148  }
149 
150 
151 
157  m_badColor = color;
158  }
159 
160 
161  // Focus Options
166  MatrixOptions::FocusOption MatrixOptions::focusOption() {
167  return m_focusOption;
168  }
169 
170 
171 
179  return m_focusTolSelectedElement;
180  } // best, worst, the one selected from tolerance?
181 
182 
183 
188  return m_image1;
189  }
190 
191 
192 
197  return m_parameter1;
198  }
199 
200 
201 
206  return m_image2;
207  }
208 
209 
210 
215  return m_parameter2;
216  }
217 
218 
219 
224  return m_badElements;
225  }
226 
227 
228 
233  return m_goodElements;
234  }
235 
236 
237 
241  void MatrixOptions::setFocusOption(FocusOption option) {
242  m_focusOption = option;
243  }
244 
245 
246 
250  void MatrixOptions::setFocusValue(double value) {
251  m_focusTolSelectedElement = value;
252  }
253 
254 
255 
260  m_goodElements = goodElements;
261  }
262 
263 
264 
269  m_badElements = badElements;
270  }
271 
272 
273 
274  // Current Correlation Information
275 
276 
277 
282  return m_currentValue;
283  }
284 
285 
286 
291  return m_currentImg1;
292  }
293 
294 
295 
300  return m_currentParam1;
301  }
302 
303 
304 
309  return m_currentImg2;
310  }
311 
312 
313 
318  return m_currentParam2;
319  }
320 
321 
322 
327  m_currentValue = value;
328  }
329 
330 
331 
335  void MatrixOptions::setCurrentImage1(QString current) {
336  m_currentImg1 = current;
337  }
338 
339 
340 
344  void MatrixOptions::setCurrentParameter1(QString current) {
345  m_currentParam1= current;
346  }
347 
348 
349 
353  void MatrixOptions::setCurrentImage2(QString current) {
354  m_currentImg2 = current;
355  }
356 
357 
358 
362  void MatrixOptions::setCurrentParameter2(QString current) {
363  m_currentParam2 = current;
364  }
365 
366 
367 
368  //Slots
372 // void MatrixOptions::updateCurrentCorrData(QString currentData) {
373 // // update "current" values
374 // emit changedCurrentCorrData();
375 // }
376 
377 
378 
384  return *m_parentMatrix->imagesAndParameters();
385  }
386 
387 
388 
393  CorrelationMatrix *MatrixOptions::parentMatrix() {
394  return m_parentMatrix;
395  }
396 };
QList< double > badElements()
QMap< QString, QStringList > matrixImgsAndParams()
This slot will be called when a matrix element is clicked on.
void setBadElements(QList< double > badElements)
This widget allows the user to modify the matrix display.
This is a container for the correlation matrix that comes from a bundle adjust.
double colorTolerance()
Threshold for what is considered a bad correlation.
void setColorTolerance(double tolerance)
void setCurrentParameter2(QString current)
void setFocusValue(double value)
This widget encompasses the entire matrixDisplay scene.
void setCurrentImage1(QString current)
void setGoodElements(QList< double > goodElements)
double focusValue()
The value of the spot on the matrix that we need to focus on.
void setBadCorrelationColor(QColor color)
QColor badCorrelationColor()
The color selected for the correlation values that are above the given threshold. ...
~MatrixOptions()
Constructor that sets up all the variables.
void setCurrentImage2(QString current)
MatrixOptions(CorrelationMatrix parent, MatrixSceneWidget *scene)
Default Constructor.
void setGoodCorrelationColor(QColor color)
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
void setFocusOption(FocusOption option)
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void setCurrentCorrelation(double value)
bool colorScheme()
Use the green-red gradient if false.
void setColorScheme(bool tolerance)
QList< double > goodElements()
void setCurrentParameter1(QString current)
FocusOption focusOption()
QColor goodCorrelationColor()
The color selected for the correlation values that are below the given threshold. ...
QMap< QString, QStringList > * imagesAndParameters()
Public access for the qmap of images and parameters.