37 m_greaterThanCB = NULL;
38 m_lessErrorEdit = NULL;
39 m_greaterErrorEdit = NULL;
42 QLabel *label =
new QLabel(
"Registration Pixel Errors");
43 m_lessThanCB =
new QCheckBox(
"Less than");
44 m_lessErrorEdit =
new QLineEdit();
45 m_greaterThanCB =
new QCheckBox(
"Greater than");
46 m_greaterErrorEdit =
new QLineEdit();
47 QLabel *pixels =
new QLabel(
"pixels");
48 QLabel *pad =
new QLabel();
50 m_lessThanCB->setChecked(
false);
51 m_lessErrorEdit->setEnabled(
false);
52 m_greaterThanCB->setChecked(
true);
53 m_greaterErrorEdit->setEnabled(
true);
55 connect(m_lessThanCB, SIGNAL(clicked()),
this, SLOT(
clearEdit()));
56 connect(m_greaterThanCB, SIGNAL(clicked()),
this, SLOT(
clearEdit()));
59 QGridLayout *gridLayout =
new QGridLayout();
60 gridLayout->addWidget(label, 0, 0, 1, 2);
61 gridLayout->addWidget(m_lessThanCB, 1, 0, 1, 2);
62 gridLayout->addWidget(m_lessErrorEdit, 2, 0);
63 gridLayout->addWidget(pixels, 2, 1);
64 gridLayout->addWidget(m_greaterThanCB, 3, 0, 1, 2);
65 gridLayout->addWidget(m_greaterErrorEdit, 4, 0);
66 gridLayout->addWidget(pixels, 4, 1);
67 gridLayout->addWidget(pad, 5, 0);
68 gridLayout->setRowStretch(5, 50);
69 this->setLayout(gridLayout);
94 if (controlNet() == NULL) {
95 QMessageBox::information((
QWidget *)parent(),
96 "Error",
"No points to filter");
101 double lessNum = -1.;
102 if (m_lessThanCB->isChecked() && m_lessErrorEdit->text() ==
"") {
103 QMessageBox::information((
QWidget *)parent(),
104 "Error",
"Error value must be entered");
107 double greaterNum = -1.;
108 if (m_greaterThanCB->isChecked() && m_greaterErrorEdit->text() ==
"") {
109 QMessageBox::information((
QWidget *)parent(),
110 "Error",
"Error value must be entered");
115 lessNum = m_lessErrorEdit->text().toDouble();
116 greaterNum = m_greaterErrorEdit->text().toDouble();
118 QMultiMap <double, int> pointMap;
123 for (
int i = filteredPoints().size() - 1; i >= 0; i--) {
124 ControlPoint &cp = *(*controlNet())[filteredPoints()[i]];
126 double maxPixelError =
128 if (m_lessThanCB->isChecked() && m_greaterThanCB->isChecked()) {
129 if (maxPixelError < lessNum && maxPixelError > greaterNum) {
130 pointMap.insert(maxPixelError, filteredPoints()[i]);
134 filteredPoints().removeAt(i);
136 else if (m_lessThanCB->isChecked()) {
137 if (maxPixelError < lessNum) {
138 pointMap.insert(maxPixelError, filteredPoints()[i]);
142 filteredPoints().removeAt(i);
144 else if (m_greaterThanCB->isChecked()) {
145 if (maxPixelError > greaterNum) {
146 pointMap.insert(maxPixelError, filteredPoints()[i]);
150 filteredPoints().removeAt(i);
154 int filteredIndex = 0;
155 QMultiMap<double, int>::const_iterator i = pointMap.constEnd();
156 while (i != pointMap.constBegin()) {
158 filteredPoints()[filteredIndex] = i.value();
162 emit filteredListModified();
181 if (m_lessThanCB->isChecked()) {
182 m_lessErrorEdit->setEnabled(
true);
185 m_lessErrorEdit->clear();
186 m_lessErrorEdit->setEnabled(
false);
188 if (m_greaterThanCB->isChecked()) {
189 m_greaterErrorEdit->setEnabled(
true);
192 m_greaterErrorEdit->clear();
193 m_greaterErrorEdit->setEnabled(
false);