1 #include "QnetCubeDistanceFilter.h" 10 #include <QRadioButton> 46 QLabel *label =
new QLabel(
"Filter by distance between points in cube");
47 QLabel *lessThan =
new QLabel(
"Contains points within ");
48 p_lineEdit =
new QLineEdit;
49 p_pixels =
new QRadioButton(
"pixels");
50 p_meters =
new QRadioButton(
"meters");
51 p_pixels->setChecked(
true);
52 QLabel *pad =
new QLabel();
55 QVBoxLayout *units =
new QVBoxLayout();
56 units->addWidget(p_pixels);
57 units->addWidget(p_meters);
60 QGridLayout *gridLayout =
new QGridLayout();
61 gridLayout->addWidget(label, 0, 0, 1, 2);
62 gridLayout->addWidget(lessThan, 1, 0);
63 gridLayout->addWidget(p_lineEdit, 1, 1);
64 gridLayout->addLayout(units, 1, 2);
65 gridLayout->addWidget(pad, 2, 0);
66 gridLayout->setRowStretch(2, 50);
67 this->setLayout(gridLayout);
90 if (serialNumberList() == NULL) {
91 QMessageBox::information((
QWidget *)parent(),
92 "Error",
"No cubes to filter");
97 if (p_lineEdit->text() ==
"") {
98 QMessageBox::information((
QWidget *)parent(),
99 "Error",
"Distance value must be entered");
104 int userEntered = p_lineEdit->text().toInt();
110 for (
int i = filteredImages().size() - 1; i >= 0; i--) {
113 for (
int cp1 = 0; cp1 < controlNet()->
GetNumPoints(); cp1++) {
117 for (
int cm1 = 0; cm1 < controlPt1.GetNumMeasures(); cm1++) {
119 if (controlPt1[cm1]->GetCubeSerialNumber() == serialNumberList()->
serialNumber(filteredImages()[i])) {
121 controlMeas1 = *controlPt1[cm1];
131 if (controlMeas1.GetSample() == 0 && controlMeas1.GetLine() == 0)
134 double rad = 0, lat1 = 0, lon1 = 0;
135 if (p_meters->isChecked()) {
137 cam1 = controlNet()->
Camera(filteredImages()[i]);
139 if (cam1->
SetImage(controlMeas1.GetSample(), controlMeas1.GetLine())) {
151 for (
int cp2 = (cp1 + 1); cp2 < controlNet()->
GetNumPoints(); cp2++) {
155 for (
int cm2 = 0; cm2 < controlPt2.GetNumMeasures(); cm2++) {
157 if (controlPt2[cm2]->GetCubeSerialNumber() == serialNumberList()->
serialNumber(filteredImages()[i])) {
159 controlMeas2 = *controlPt2[cm2];
168 if (controlMeas2.GetSample() == 0 && controlMeas2.GetLine() == 0)
173 if (p_pixels->isChecked()) {
174 double deltaSamp = controlMeas1.GetSample() - controlMeas2.GetSample();
175 double deltaLine = controlMeas1.GetLine() - controlMeas2.GetLine();
177 dist = sqrt((deltaSamp * deltaSamp) + (deltaLine * deltaLine));
183 double lat2 = 0, lon2 = 0;
185 cam2 = controlNet()->
Camera(filteredImages()[i]);
187 if (cam2->
SetImage(controlMeas2.GetSample(), controlMeas2.GetLine())) {
217 if (dist < userEntered) {
218 if (!temp.contains(filteredImages()[i])) {
220 temp.push_back(filteredImages()[i]);
223 if (temp.contains(filteredImages()[i])) {
231 if (temp.contains(filteredImages()[i])) {
241 qSort(temp.begin(), temp.end());
243 filteredImages() = temp;
246 emit filteredListModified();
This class defines a body-fixed surface point.
double meters() const
Get the distance in meters.
double UniversalLatitude() const
Returns the planetocentric latitude, in degrees, at the surface intersection point in the body fixed ...
Distance GetDistanceToPoint(const SurfacePoint &other) const
Computes and returns the distance between two surface points.
QString serialNumber(const QString &filename)
Return a serial number given a filename.
virtual void filter()
Filters a list of images for images that have points that are less than the user entered distance fro...
This class is designed to encapsulate the concept of a Latitude.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Distance measurement, usually in meters.
Distance LocalRadius() const
Returns the local radius at the intersection point.
bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
int GetNumPoints() const
Return the number of control points in the network.
This class is designed to encapsulate the concept of a Longitude.
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
QnetCubeDistanceFilter(QnetNavTool *navTool, QWidget *parent=0)
Contructor for the Cube Distance filter.
double UniversalLongitude() const
Returns the positive east, 0-360 domain longitude, in degrees, at the surface intersection point in t...
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Namespace for ISIS/Bullet specific routines.
Isis::Camera * Camera(int index)
Returns the camera list from the given image number.
The distance is being specified in meters.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.