1#include "QnetPointDistanceFilter.h"
10#include "ControlMeasure.h"
11#include "ControlNet.h"
12#include "ControlPoint.h"
16#include "QnetNavTool.h"
17#include "SerialNumberList.h"
18#include "SurfacePoint.h"
36 QWidget *parent) : QnetFilter(navTool, parent) {
40 QLabel *label =
new QLabel(
"Filter points that are within given distance of another point.");
41 QLabel *lessThan =
new QLabel(
"Distance to another point is less than");
42 m_lineEdit =
new QLineEdit;
43 QLabel *meters =
new QLabel(
"meters");
44 QLabel *pad =
new QLabel;
47 QGridLayout *gridLayout =
new QGridLayout();
48 gridLayout->addWidget(label, 0, 0, 1, 2);
49 gridLayout->addWidget(lessThan, 1, 0);
50 gridLayout->addWidget(m_lineEdit, 1, 1);
51 gridLayout->addWidget(meters, 1, 2);
52 gridLayout->addWidget(pad, 2, 0);
53 gridLayout->setRowStretch(2, 50);
54 this->setLayout(gridLayout);
81 if (controlNet() == NULL) {
82 QMessageBox::information((
QWidget *)parent(),
83 "Error",
"No points to filter");
88 if (m_lineEdit->text() ==
"") {
89 QMessageBox::information((
QWidget *)parent(),
90 "Error",
"Distance value must be entered");
94 double userEntered = m_lineEdit->text().toDouble();
100 for (
int i = filteredPoints().size() - 1; i >= 0; i--) {
101 ControlPoint &cp1 = *(*controlNet())[filteredPoints()[i]];
116 cam1 = controlNet()->
Camera(camIndex1);
117 cam1->
SetImage(cm1.GetSample(), cm1.GetLine());
122 for (
int j = 0; j < controlNet()->GetNumPoints(); j++) {
123 if (j == filteredPoints()[i]) {
136 cam2 = controlNet()->
Camera(camIndex2);
137 cam2->
SetImage(cm2.GetSample(), cm2.GetLine());
145 if (dist < userEntered) {
146 if (!temp.contains(filteredPoints()[i])) {
147 temp.push_back(filteredPoints()[i]);
155 std::sort(temp.begin(), temp.end());
157 filteredPoints() = temp;
160 emit filteredListModified();
Camera(Cube &cube)
Constructs the Camera object.
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
const ControlMeasure * GetRefMeasure() const
Get the reference control measure.
SurfacePoint GetBestSurfacePoint() const
Returns the adjusted surface point if it exists, otherwise returns the a priori surface point.
double meters() const
Get the distance in meters.
QnetPointDistanceFilter(QnetNavTool *navTool, QWidget *parent=0)
Contructor for the Point Distance filter.
virtual void filter()
Filters a list of points for points that are less than the user entered distance from another point i...
virtual SurfacePoint GetSurfacePoint() const
Returns the surface point (most efficient accessor).
This class defines a body-fixed surface point.
Distance GetDistanceToPoint(const SurfacePoint &other) const
Computes and returns the distance between two surface points.
Distance GetLocalRadius() const
Return the radius of the surface point.
This is free and unencumbered software released into the public domain.