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 };
Isis::MatrixOptions::setFocusValue
void setFocusValue(double value)
Definition: MatrixOptions.cpp:250
Isis::MatrixOptions::setBadElements
void setBadElements(QList< double > badElements)
Definition: MatrixOptions.cpp:268
Isis::MatrixOptions::setCurrentImage1
void setCurrentImage1(QString current)
Definition: MatrixOptions.cpp:335
Isis::MatrixOptions::colorScheme
bool colorScheme()
Use the green-red gradient if false.
Definition: MatrixOptions.cpp:116
QList< double >
Isis::MatrixOptions::focusOption
FocusOption focusOption()
Definition: MatrixOptions.cpp:166
Isis::MatrixOptions::badElements
QList< double > badElements()
Definition: MatrixOptions.cpp:232
Isis::MatrixOptions::setCurrentParameter1
void setCurrentParameter1(QString current)
Definition: MatrixOptions.cpp:344
Isis::MatrixOptions::setGoodElements
void setGoodElements(QList< double > goodElements)
Definition: MatrixOptions.cpp:259
Isis::MatrixOptions::goodCorrelationColor
QColor goodCorrelationColor()
The color selected for the correlation values that are below the given threshold.
Definition: MatrixOptions.cpp:82
Isis::MatrixOptions::colorTolerance
double colorTolerance()
Threshold for what is considered a bad correlation.
Definition: MatrixOptions.cpp:104
Isis::MatrixOptions::focusImage2
QString focusImage2()
Definition: MatrixOptions.cpp:205
Isis::MatrixOptions::currentParameter1
QString currentParameter1()
Definition: MatrixOptions.cpp:299
Isis::MatrixOptions::focusParameter1
QString focusParameter1()
Definition: MatrixOptions.cpp:196
Isis::MatrixOptions::setCurrentImage2
void setCurrentImage2(QString current)
Definition: MatrixOptions.cpp:353
Isis::MatrixOptions::setCurrentParameter2
void setCurrentParameter2(QString current)
Definition: MatrixOptions.cpp:362
Isis::MatrixOptions::MatrixOptions
MatrixOptions(CorrelationMatrix parent, MatrixSceneWidget *scene)
Default Constructor.
Definition: MatrixOptions.cpp:15
Isis::CorrelationMatrix
This is a container for the correlation matrix that comes from a bundle adjust.
Definition: CorrelationMatrix.h:61
Isis::MatrixOptions::setBadCorrelationColor
void setBadCorrelationColor(QColor color)
Definition: MatrixOptions.cpp:156
Isis::MatrixOptions::focusImage1
QString focusImage1()
Definition: MatrixOptions.cpp:187
Isis::MatrixOptions::currentCorrelation
double currentCorrelation()
Definition: MatrixOptions.cpp:281
Isis::MatrixOptions::setCurrentCorrelation
void setCurrentCorrelation(double value)
Definition: MatrixOptions.cpp:326
Isis::MatrixOptions::setColorTolerance
void setColorTolerance(double tolerance)
Definition: MatrixOptions.cpp:136
Isis::MatrixOptions::setColorScheme
void setColorScheme(bool tolerance)
Definition: MatrixOptions.cpp:126
Isis::MatrixOptions::currentImage2
QString currentImage2()
Definition: MatrixOptions.cpp:308
Isis::MatrixOptions::currentParameter2
QString currentParameter2()
Definition: MatrixOptions.cpp:317
Isis::MatrixOptions::focusValue
double focusValue()
The value of the spot on the matrix that we need to focus on.
Definition: MatrixOptions.cpp:178
Isis::MatrixSceneWidget
This widget encompasses the entire matrixDisplay scene.
Definition: MatrixSceneWidget.h:51
Isis::MatrixOptionsDialog
This widget allows the user to modify the matrix display.
Definition: MatrixOptionsDialog.h:38
Isis::MatrixOptions::~MatrixOptions
~MatrixOptions()
Constructor that sets up all the variables.
Definition: MatrixOptions.cpp:71
Isis::MatrixOptions::currentImage1
QString currentImage1()
Definition: MatrixOptions.cpp:290
Isis::MatrixOptions::focusParameter2
QString focusParameter2()
Definition: MatrixOptions.cpp:214
Isis::MatrixOptions::setGoodCorrelationColor
void setGoodCorrelationColor(QColor color)
Definition: MatrixOptions.cpp:146
Isis::MatrixOptions::goodElements
QList< double > goodElements()
Definition: MatrixOptions.cpp:223
Isis::MatrixOptions::matrixImgsAndParams
QMap< QString, QStringList > matrixImgsAndParams()
This slot will be called when a matrix element is clicked on.
Definition: MatrixOptions.cpp:383
QMap< QString, QStringList >
Isis::MatrixOptions::badCorrelationColor
QColor badCorrelationColor()
The color selected for the correlation values that are above the given threshold.
Definition: MatrixOptions.cpp:93
Isis::CorrelationMatrix::imagesAndParameters
QMap< QString, QStringList > * imagesAndParameters()
Public access for the qmap of images and parameters.
Definition: CorrelationMatrix.cpp:417
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::MatrixOptions::setFocusOption
void setFocusOption(FocusOption option)
Definition: MatrixOptions.cpp:241