1 #include "QnetPointGoodnessFilter.h" 34 QnetPointGoodnessFilter::QnetPointGoodnessFilter (
QnetNavTool *navTool,
37 m_greaterThanCB = NULL;
38 m_maxValueEdit = NULL;
39 m_minValueEdit = NULL;
42 m_lessThanCB =
new QCheckBox(
"Less than ");
43 m_maxValueEdit =
new QLineEdit();
44 m_greaterThanCB =
new QCheckBox(
"Greater than ");
45 m_minValueEdit =
new QLineEdit();
46 QLabel *pad =
new QLabel;
48 m_lessThanCB->setChecked(
false);
49 m_maxValueEdit->setEnabled(
false);
50 m_greaterThanCB->setChecked(
false);
51 m_minValueEdit->setEnabled(
false);
53 connect(m_lessThanCB,SIGNAL(clicked()),
this,SLOT(
clearEdit()));
54 connect(m_greaterThanCB,SIGNAL(clicked()),
this,SLOT(
clearEdit()));
57 QGridLayout *gridLayout =
new QGridLayout();
59 gridLayout->addWidget(m_lessThanCB,1,0,1,2);
60 gridLayout->addWidget(m_maxValueEdit,2,0);
61 gridLayout->addWidget(m_greaterThanCB,3,0,1,2);
62 gridLayout->addWidget(m_minValueEdit,4,0);
63 gridLayout->addWidget(pad,5,0);
64 gridLayout->setRowStretch(5,50);
65 this->setLayout(gridLayout);
84 if (controlNet() == NULL) {
85 QMessageBox::information((
QWidget *)parent(),
86 "Error",
"No points to filter");
91 if (m_lessThanCB->isChecked() && m_maxValueEdit->text() ==
"") {
92 QMessageBox::information((
QWidget *)parent(),
93 "Error",
"Maximum Goodness of Fit value must be entered");
96 if (m_greaterThanCB->isChecked() && m_minValueEdit->text() ==
"") {
97 QMessageBox::information((
QWidget *)parent(),
98 "Error",
"Minimum Goodness of Fit value must be entered");
103 double maxValue = m_maxValueEdit->text().toDouble();
104 double minValue = m_minValueEdit->text().toDouble();
108 for (
int i = filteredPoints().size()-1; i >= 0; i--) {
109 ControlPoint &cp = *(*controlNet())[filteredPoints()[i]];
110 int numMeasOutsideRange = 0;
112 for (
int j = 0; j < cp.GetNumMeasures(); j++) {
114 double goodnessOfFit = cp[j]->GetLogData(
116 if (goodnessOfFit ==
Null) {
117 numMeasOutsideRange++;
119 else if (m_lessThanCB->isChecked() && m_greaterThanCB->isChecked()) {
120 if (goodnessOfFit < maxValue && goodnessOfFit > minValue)
break;
121 else numMeasOutsideRange++;
123 else if (m_lessThanCB->isChecked()) {
124 if (goodnessOfFit < maxValue)
break;
125 else numMeasOutsideRange++;
127 else if (m_greaterThanCB->isChecked()) {
128 if (goodnessOfFit > minValue)
break;
129 else numMeasOutsideRange++;
133 if (cp.GetNumMeasures() == numMeasOutsideRange) {
134 filteredPoints().removeAt(i);
139 emit filteredListModified();
155 if (m_lessThanCB->isChecked()) {
156 m_maxValueEdit->setEnabled(
true);
159 m_maxValueEdit->clear();
160 m_maxValueEdit->setEnabled(
false);
162 if (m_greaterThanCB->isChecked()) {
163 m_minValueEdit->setEnabled(
true);
166 m_minValueEdit->clear();
167 m_minValueEdit->setEnabled(
false);
const double Null
Value for an Isis Null pixel.
virtual void filter()
Method overwrites parent method.
Namespace for the standard library.
void clearEdit()
Clears and disables the corresponding line edit if the "less than" or "greater than" checkBox is "un...
GoodnessOfFit is pointreg information for reference measures.
Namespace for ISIS/Bullet specific routines.