Isis 3 Programmer Reference
ControlPoint.cpp
1 #include "IsisDebug.h"
2 #include "ControlPoint.h"
3 
4 #include <boost/numeric/ublas/symmetric.hpp>
5 #include <boost/numeric/ublas/io.hpp>
6 
7 #include <QDebug>
8 #include <QHash>
9 #include <QString>
10 #include <QStringList>
11 
12 #include "Application.h"
13 #include "CameraDetectorMap.h"
14 #include "CameraDistortionMap.h"
15 #include "CameraFocalPlaneMap.h"
16 #include "CameraGroundMap.h"
17 #include "ControlMeasure.h"
18 #include "ControlMeasureLogData.h"
19 #include "ControlNet.h"
20 #include "Cube.h"
21 #include "IString.h"
22 #include "Latitude.h"
23 #include "Longitude.h"
24 #include "PvlObject.h"
25 #include "SerialNumberList.h"
26 #include "SpecialPixel.h"
27 #include "Statistics.h"
28 
29 using boost::numeric::ublas::symmetric_matrix;
30 using boost::numeric::ublas::upper;
31 using namespace std;
32 
33 namespace Isis {
40  ControlPoint::ControlPoint() : invalid(false) {
41  measures = NULL;
42  cubeSerials = NULL;
43 
45  cubeSerials = new QStringList;
46 
47  type = Free;
48  dateTime = "";
49  editLock = false;
50  ignore = false;
51  jigsawRejected = false;
52  referenceExplicitlySet = false;
53  aprioriSurfacePointSource = SurfacePointSource::None;
54  aprioriRadiusSource = RadiusSource::None;
55  parentNetwork = NULL;
56  referenceMeasure = NULL;
58  constraintStatus.reset();
59  }
60 
61 
68  measures = NULL;
69  cubeSerials = NULL;
70  referenceMeasure = NULL;
71  parentNetwork = NULL;
72 
73  editLock = false;
74 
76  cubeSerials = new QStringList;
77 
78  QListIterator<QString> i(*other.cubeSerials);
79  while (i.hasNext()) {
80  QString sn = i.next();
81 
82  const ControlMeasure *otherCm = other.GetMeasure(sn);
83  ControlMeasure *newMeasure = new ControlMeasure(*otherCm);
84  AddMeasure(newMeasure);
85 
86  if (other.referenceMeasure == otherCm) {
87  SetRefMeasure(newMeasure);
88  }
89  }
90 
91  id = other.id;
92  chooserName = other.chooserName;
93  dateTime = other.dateTime;
94  type = other.type;
95  invalid = other.invalid;
96  editLock = other.editLock;
99  ignore = other.ignore;
108  }
109 
110 
116  ControlPoint::ControlPoint(const QString &newId) : invalid(false) {
117  parentNetwork = NULL;
118  measures = NULL;
119  referenceMeasure = NULL;
121  measures = new QHash< QString, ControlMeasure * >;
122  cubeSerials = new QStringList;
123 
124  id = newId;
125  type = Free;
126  editLock = false;
127  jigsawRejected = false;
128  referenceExplicitlySet = false;
129  ignore = false;
130  aprioriSurfacePointSource = SurfacePointSource::None;
131  aprioriRadiusSource = RadiusSource::None;
132  constraintStatus.reset();
133  }
134 
140  if (measures != NULL) {
141  QList< QString > keys = measures->keys();
142  for (int i = 0; i < keys.size(); i++) {
143  delete(*measures)[keys[i]];
144  (*measures)[keys[i]] = NULL;
145  }
146 
147  delete measures;
148  measures = NULL;
149  }
150 
151  if (cubeSerials) {
152  delete cubeSerials;
153  cubeSerials = NULL;
154  }
155 
156  referenceMeasure = NULL;
157  }
158 
205 
206  }
207 
208 
216  PointModified();
217  AddMeasure(measure);
218  }
219 
220 
226  // Make sure measure is unique
227  foreach(ControlMeasure * m, measures->values()) {
228  if (m->GetCubeSerialNumber() == measure->GetCubeSerialNumber()) {
229  QString msg = "The SerialNumber is not unique. A measure with "
230  "serial number [" + measure->GetCubeSerialNumber() + "] already "
231  "exists for ControlPoint [" + GetId() + "]";
233  }
234  }
235 
236  if (!measures->size()) {
237  ASSERT(!HasRefMeasure());
238  referenceMeasure = measure;
239  }
240  else if (referenceMeasure->IsIgnored() && !measure->IsIgnored() &&
241  !IsReferenceExplicit() && !IsEditLocked()) {
242  // The current "implicit" reference is ignored, but this new measure
243  // isn't, and the point is not edit locked, so make this measure the new
244  // reference
245  referenceMeasure = measure;
246  }
247 
248  measure->parentPoint = this;
249  QString newSerial = measure->GetCubeSerialNumber();
250  measures->insert(newSerial, measure);
251  cubeSerials->append(newSerial);
252 
253  // notify parent network if we have one
254  if (parentNetwork) {
255  parentNetwork->measureAdded(measure);
257  }
258  }
259 
260 
268  void ControlPoint::ValidateMeasure(QString serialNumber) const {
269  if (!measures->contains(serialNumber)) {
270  QString msg = "No measure with serial number [" + serialNumber +
271  "] is owned by this point";
273  }
274  }
275 
276 
283  int ControlPoint::Delete(QString serialNumber) {
284  ValidateMeasure(serialNumber);
285  ControlMeasure *cm = (*measures)[serialNumber];
286 
287  // notify parent network of the change
288  if (parentNetwork) {
290 
291  if (!IsIgnored() && !cm->IsIgnored()) {
293  }
294  }
295 
296  if (cm->IsEditLocked()) {
297  return ControlMeasure::MeasureLocked;
298  }
299 
300  // remove measure from the point's data structures
301  measures->remove(serialNumber);
302  cubeSerials->removeAt(cubeSerials->indexOf(serialNumber));
303 
304  // update the reference measure
305  if (cubeSerials->size()) {
306  if (referenceMeasure == cm) {
307  referenceMeasure = (*measures)[cubeSerials->at(0)];
308  referenceExplicitlySet = false;
309  }
310  }
311  else {
312  referenceMeasure = NULL;
313  }
314 
315  delete cm;
316  cm = NULL;
317 
318  PointModified();
319 
320  return ControlMeasure::Success;
321  }
322 
323 
333  void ControlPoint::emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType modType, QVariant oldValue, QVariant newValue) {
334  if (parentNetwork) {
335  parentNetwork->emitMeasureModified(measure, modType, oldValue, newValue);
336  }
337  }
338 
339 
347  ASSERT(measure);
348  return Delete(measure->GetCubeSerialNumber());
349  }
350 
351 
358  int ControlPoint::Delete(int index) {
359  if (index < 0 || index >= cubeSerials->size()) {
360  QString msg = "index [" + QString(index) + "] out of bounds";
362  }
363 
364  return Delete(cubeSerials->at(index));
365  }
366 
367 
374  if (IsEditLocked()) {
375  return PointLocked;
376  }
377 
378  aprioriSurfacePointSource = SurfacePointSource::None;
380  aprioriRadiusSource = RadiusSource::None;
382 
384  constraintStatus.reset();
385 
386  return Success;
387  }
388 
389 
396  ControlMeasure *ControlPoint::GetMeasure(QString serialNumber) {
397  ValidateMeasure(serialNumber);
398  return (*measures)[serialNumber];
399  }
400 
401 
408  const ControlMeasure *ControlPoint::GetMeasure(QString serialNumber) const {
409  ValidateMeasure(serialNumber);
410  return measures->value(serialNumber);
411  }
412 
413 
414  const ControlMeasure *ControlPoint::GetMeasure(int index) const {
415  if (index < 0 || index >= cubeSerials->size()) {
416  QString msg = "Index [" + toString(index) + "] out of range";
418  }
419 
420  return GetMeasure(cubeSerials->at(index));
421  }
422 
423 
424  ControlMeasure *ControlPoint::GetMeasure(int index) {
425  if (index < 0 || index >= cubeSerials->size()) {
426  QString msg = "Index [" + toString(index) + "] out of range";
427  throw IException(IException::Programmer, msg, _FILEINFO_);
428  }
429 
430  return GetMeasure(cubeSerials->at(index));
431  }
432 
433 
440  return !(referenceMeasure == NULL);
441  }
442 
443 
450  if (!HasRefMeasure()) {
451  QString msg = "Control point [" + GetId() + "] has no reference measure!";
453  }
454 
455  return referenceMeasure;
456  }
457 
458 
463  if (!HasRefMeasure()) {
464  QString msg = "Control point [" + GetId() + "] has no reference measure!";
466  }
467 
468  return referenceMeasure;
469  }
470 
471 
480  if (editLock) {
481  return PointLocked;
482  }
483  chooserName = name;
484  return Success;
485  }
486 
487 
497  if (editLock) {
498  return PointLocked;
499  }
500  dateTime = newDateTime;
501  return Success;
502  }
503 
504 
515  if (parentNetwork) {
516  parentNetwork->emitPointModified(this, ControlPoint::EditLockModified, editLock, lock);
517  }
518  editLock = lock;
519  return Success;
520  }
521 
522 
532  jigsawRejected = reject;
533  return Success;
534  }
535 
536 
545  if (editLock) {
546  return PointLocked;
547  }
548  QString oldId = id;
549  id = newId;
550  if (parentNetwork) {
551  parentNetwork->UpdatePointReference(this, oldId);
552  }
553  return Success;
554  }
555 
556 
563  if (editLock) {
564  return PointLocked;
565  }
566 
567  ASSERT(cm);
569  return Success;
570  }
571 
572 
579  if (editLock) {
580  return PointLocked;
581  }
582 
583  if (index < 0 || index >= cubeSerials->size()) {
584  QString msg = "Index [";
585  msg += toString(index) + "] out of range";
587  }
588 
589  SetExplicitReference((*measures)[cubeSerials->at(index)]);
590  return Success;
591  }
592 
593 
600  if (editLock) {
601  return PointLocked;
602  }
603 
604  if (!cubeSerials->contains(sn)) {
605  QString msg = "Point [" + id + "] has no measure with serial number [" +
606  sn + "]";
608  }
609 
610  SetExplicitReference((*measures)[sn]);
611  return Success;
612  }
613 
614 
634  referenceExplicitlySet = true;
635  referenceMeasure = measure;
636  }
637 
638 
646  if (editLock) {
647  return PointLocked;
648  }
649 
650  bool oldStatus = ignore;
651  ignore = newIgnoreStatus;
652 
653  // only update if there was a change in status
654  if (oldStatus != ignore) {
655  PointModified();
656  if (parentNetwork) {
657  if (ignore) {
659  }
660  else {
662  }
663  parentNetwork->emitPointModified(this, ControlPoint::IgnoredModified, oldStatus, ignore);
664  }
665  }
666 
667  return Success;
668  }
669 
670 
685  SurfacePoint newSurfacePoint) {
686 
687  PointModified();
688  adjustedSurfacePoint = newSurfacePoint;
689  return Success;
690  }
691 
692 
702  if (type != Fixed && type != Free && type != Constrained) {
703  QString msg = "Invalid Point Enumeration, [" + QString(type) + "], for "
704  "Control Point [" + GetId() + "]";
706  }
707 
708  if (editLock) {
709  return PointLocked;
710  }
711  if (parentNetwork) {
712  parentNetwork->emitPointModified(this, ControlPoint::TypeModified, type, newType);
713  }
714 
715  PointModified();
716  type = newType;
717  return Success;
718  }
719 
720 
729  RadiusSource::Source source) {
730  if (editLock) {
731  return PointLocked;
732  }
733  PointModified();
734  aprioriRadiusSource = source;
735  return Success;
736  }
737 
738 
748  QString sourceFile) {
749  if (editLock) {
750  return PointLocked;
751  }
752  PointModified();
753  aprioriRadiusSourceFile = sourceFile;
754  return Success;
755  }
756 
757 
772  SurfacePoint aprioriSP) {
774  if (parentNetwork) {
775  coordType = parentNetwork->GetCoordType();
776  }
777  if (editLock) {
778  return PointLocked;
779  }
780  // ***TBD*** Does it make sense to try to do a generic check here? The
781  // data types are different (angles vs distance) so for now do a switch.
782  switch (coordType) {
784  if (aprioriSP.GetLatSigma().isValid())
785  constraintStatus.set(Coord1Constrained);
786  if (aprioriSP.GetLonSigma().isValid())
787  constraintStatus.set(Coord2Constrained);
788  if (aprioriSP.GetLocalRadiusSigma().isValid())
789  constraintStatus.set(Coord3Constrained);
790  break;
792  if (aprioriSP.GetXSigma().isValid())
793  constraintStatus.set(Coord1Constrained);
794  if (aprioriSP.GetYSigma().isValid())
795  constraintStatus.set(Coord2Constrained);
796  if (aprioriSP.GetZSigma().isValid())
797  constraintStatus.set(Coord3Constrained);
798  }
799 
800  PointModified();
801  aprioriSurfacePoint = aprioriSP;
802  return Success;
803  }
804 
805 
814  SurfacePointSource::Source source) {
815  if (editLock) {
816  return PointLocked;
817  }
818  PointModified();
819  aprioriSurfacePointSource = source;
820  return Success;
821  }
822 
823 
832  QString sourceFile) {
833  if (editLock) {
834  return PointLocked;
835  }
836  PointModified();
837  aprioriSurfacePointSourceFile = sourceFile;
838  return Success;
839  }
840 
841 
892  // TODO (KLE): where should call this go? Also, what's the point? The method has no description.
893  PointModified();
894 
895  // if point is fixed or constrained, ensure valid a priori point coordinates exist
896  if ( (IsFixed() || IsConstrained()) && !aprioriSurfacePoint.Valid() ) {
897  QString msg = "In method ControlPoint::ComputeApriori(). ControlPoint [" + GetId() + "] is ";
898  msg += "fixed or constrained and requires a priori coordinates";
900  }
901 
902  double xB = 0.0; // body-fixed x
903  double yB = 0.0; // body-fixed y
904  double zB = 0.0; // body-fixed z
905  double r2B = 0.0; // radius squared in body-fixed
906  int goodMeasures = 0;
907  double pB[3];
908 
909  // loop over measures to ...
910  // 1) set focal plane x,y coordinates for all unignored measures;
911  // 2) sum latitude, longitude, and radius coordinates in preparation for computing a priori
912  // coordinates by averaging.
913  for (int i = 0; i < cubeSerials->size(); i++) {
914  ControlMeasure *m = GetMeasure(i);
915  if (m->IsIgnored()) {
916  continue;
917  }
918 
919  Camera *cam = m->Camera();
920  if (cam == NULL) {
921  QString cubeSN = m->GetCubeSerialNumber();
922  QString msg = "in method ControlPoint::ComputeApriori(). Camera has not been set in ";
923  msg += "measure for cube serial number [" + cubeSN + "], Control Point id ";
924  msg += "[" + GetId() + "]. Camera must be set prior to calculating a priori coordinates";
926  }
927 
928  bool setImageSuccess = cam->SetImage(m->GetSample(), m->GetLine());
931 
932  // TODO: Seems like we should be able to skip this computation if point is fixed or
933  // constrained in any coordinate. Currently we are always summing coordinates here. We could
934  // save time by not doing this for fixed or constrained points.
935  if (setImageSuccess) {
936  goodMeasures++;
937  cam->Coordinate(pB);
938  xB += pB[0];
939  yB += pB[1];
940  zB += pB[2];
941  r2B += pB[0]*pB[0] + pB[1]*pB[1] + pB[2]*pB[2];
942  }
943  }
944 
945  // if point is Fixed or Constrained in any number of coordinates, initialize adjusted surface
946  // point to a priori coordinates (set in e.g. qnet or cneteditor) and exit
947  if( IsFixed() || IsConstrained()) {
949  return Success;
950  }
951 
952  // if point is Free, we continue to compute a priori coordinates
953 
954  // if no good measures, we're done
955  // TODO: is the message true/meaningful?
956  if (goodMeasures == 0) {
957  QString msg = "in method ControlPoint::ComputeApriori(). ControlPoint [" + GetId() + "] has ";
958  msg += "no measures which project to the body";
960  }
961 
962  // Compute the averages if all coordinates are free
963  // TODO: confirm if this "if" statement is necessary
964  if (GetType() == Free || NumberOfConstrainedCoordinates() == 0) {
965  double avgX = xB / goodMeasures;
966  double avgY = yB / goodMeasures;
967  double avgZ = zB / goodMeasures;
968  double avgR2 = r2B / goodMeasures;
969  double scale = sqrt(avgR2/(avgX*avgX+avgY*avgY+avgZ*avgZ));
970 
972  Displacement((avgX*scale), Displacement::Kilometers),
973  Displacement((avgY*scale), Displacement::Kilometers),
974  Displacement((avgZ*scale), Displacement::Kilometers));
975  }
976 
978  SetAprioriSurfacePointSource(SurfacePointSource::AverageOfMeasures);
979  SetAprioriRadiusSource(RadiusSource::AverageOfMeasures);
980 
981  return Success;
982  }
983 
984 
1014  if (IsIgnored()) {
1015  return Failure;
1016  }
1017 
1018  PointModified();
1019 
1020  // Loop for each measure to compute the error
1021  QList<QString> keys = measures->keys();
1022 
1023  for (int j = 0; j < keys.size(); j++) {
1024  ControlMeasure *m = (*measures)[keys[j]];
1025  if (m->IsIgnored()) {
1026  continue;
1027  }
1028  // The following lines actually check for Candidate measures
1029  // Commented out on 2011-03-24 by DAC
1030 // if (!m->IsMeasured()) {
1031 // continue;
1032 
1033  // TODO: Should we use crater diameter?
1034  Camera *cam = m->Camera();
1035 
1036  double cuSamp;
1037  double cuLine;
1038  CameraFocalPlaneMap *fpmap = m->Camera()->FocalPlaneMap();
1039 
1040  // Map the coordinates of the control point through the Spice of the
1041  // measurement sample/line to get the computed sample/line. This must be
1042  // done manually because the camera will compute a new time for line scanners,
1043  // instead of using the measured time.
1045 
1046  if (cam->GetCameraType() != Isis::Camera::Radar) {
1047 
1048  // Now things get tricky. We want to produce errors in pixels not mm
1049  // but some of the camera maps could fail. One that won't is the
1050  // FocalPlaneMap which takes x/y to detector s/l. We will bypass the
1051  // distortion map and have residuals in undistorted pixels.
1052  if (!fpmap->SetFocalPlane(m->GetFocalPlaneComputedX(), m->GetFocalPlaneComputedY())) {
1053  QString msg = "Sanity check #1 for ControlPoint [" + GetId() +
1054  "], ControlMeasure [" + m->GetCubeSerialNumber() + "]";
1056  // This error shouldn't happen but check anyways
1057  }
1058 
1059  cuSamp = fpmap->DetectorSample();
1060  cuLine = fpmap->DetectorLine();
1061  }
1062 
1063  else {
1064  // For radar line is calculated from time in the camera. Use the
1065  // closest line to scale the focal plane y (doppler shift) to image line
1066  // for computing the line residual. Get a local ratio
1067  // measureLine = adjacentLine
1068  // ------------ -------------- in both cases, doppler shift
1069  // dopplerMLine dopplerAdjLine is calculated using SPICE
1070  // at the time of the measurement
1071  //
1072  // 1. Get the surface point mapped to by an adjacent pixel above (if
1073  // doppler is < 0) or below (if doppler is > 0) the measured pixel
1074  // 2. Set image to the measured sample/line to load the SPICE for the
1075  // time of the measurement.
1076  // 3. Map the surface point from the adjacent pixel through the SPICE
1077  // into the image plane to get a scale for mapping from doppler
1078  // shift to line. Apply the scale to get the line residual
1079  double sample = m->GetSample();
1080  double computedY = m->GetFocalPlaneComputedY();
1081  double computedX = m->GetFocalPlaneComputedX();
1082  double adjLine;
1083 
1084  // Step 1. What happens if measured line is 1??? TODO
1085  if (computedY < 0) {
1086  adjLine = m->GetLine() - 1.;
1087  }
1088  else {
1089  adjLine = m->GetLine() + 1.;
1090  }
1091 
1092  cam->SetImage(sample, adjLine);
1093  SurfacePoint sp = cam->GetSurfacePoint();
1094 
1095  // Step 2.
1096  cam->SetImage(sample, m->GetLine());
1097  double focalplaneX;
1098  double scalingY;
1099 
1100  // Step 3.
1101  // The default bool value will come from CameraGroundMap instead of
1102  // RadarGroundMap so be explicit to turn off back-of-planet test.
1103  cam->GroundMap()->GetXY(sp, &focalplaneX, &scalingY, false);
1104  double deltaLine;
1105 
1106  if (computedY < 0) {
1107  deltaLine = -computedY/scalingY;
1108  }
1109  else {
1110  deltaLine = computedY/scalingY;
1111  }
1112 
1113  // Now map through the camera steps to take X from slant range to ground
1114  // range to pixels. Y just tracks through as 0.
1115  if (cam->DistortionMap()->SetUndistortedFocalPlane(computedX,
1116  computedY)){
1117  double focalPlaneX = cam->DistortionMap()->FocalPlaneX();
1118  double focalPlaneY = cam->DistortionMap()->FocalPlaneY();
1119  fpmap->SetFocalPlane(focalPlaneX,focalPlaneY);
1120  }
1121  cuSamp = fpmap->DetectorSample();
1122  cuLine = m->GetLine() + deltaLine;
1123  }
1124 
1125  double muSamp;
1126  double muLine;
1127 
1128  if (cam->GetCameraType() != Isis::Camera::Radar) {
1129  // Again we will bypass the distortion map and have residuals in undistorted pixels.
1130  if (!fpmap->SetFocalPlane(m->GetFocalPlaneMeasuredX(), m->GetFocalPlaneMeasuredY())) {
1131  QString msg = "Sanity check #2 for ControlPoint [" + GetId() +
1132  "], ControlMeasure [" + m->GetCubeSerialNumber() + "]";
1134  // This error shouldn't happen but check anyways
1135  }
1136  muSamp = fpmap->DetectorSample();
1137  muLine = fpmap->DetectorLine();
1138  }
1139  else {
1140  muSamp = m->GetSample();
1141  muLine = m->GetLine();
1142  }
1143 
1144  // The units are in detector sample/lines. We will apply the instrument
1145  // summing mode to get close to real pixels. Note however we are in
1146  // undistorted pixels except for radar instruments.
1147  double sampResidual = muSamp - cuSamp;
1148  double lineResidual = muLine - cuLine;
1149  m->SetResidual(sampResidual, lineResidual);
1150  }
1151 
1152  return Success;
1153  }
1154 
1174  if (IsIgnored()) {
1175  return Failure;
1176  }
1177 
1178  PointModified();
1179 
1180  // Loop for each measure to compute the error
1181  QList<QString> keys = measures->keys();
1182 
1183  for (int j = 0; j < keys.size(); j++) {
1184  ControlMeasure *m = (*measures)[keys[j]];
1185  if (m->IsIgnored()) {
1186  continue;
1187  }
1188  // The following lines actually check for Candidate measures
1189  // Commented out on 2011-03-24 by DAC
1190 // if (!m->IsMeasured()) {
1191 // continue;
1192 
1193  // TODO: Should we use crater diameter?
1194  Camera *cam = m->Camera();
1195  double cudx, cudy;
1196 
1197  // Map the coordinates of the control point through the Spice of the
1198  // measurement sample/line to get the computed undistorted focal plane
1199  // coordinates (mm if not radar). This works for radar too because in
1200  // the undistorted focal plane, y has not been set to 0 (set to 0 when
1201  // going to distorted focal plane or ground range in this case), so we
1202  // can hold the Spice to calculate residuals in undistorted focal plane
1203  // coordinates.
1204  if (cam->GetCameraType() != 0) { // no need to call setimage for framing camera
1205  cam->SetImage(m->GetSample(), m->GetLine());
1206  }
1207 
1208  // The default bool value is true. Turn back-of-planet test off for bundle adjustment.
1209  cam->GroundMap()->GetXY(GetAdjustedSurfacePoint(), &cudx, &cudy, false);
1210  // double mudx = m->GetFocalPlaneMeasuredX();
1211  // double mudy = m->GetFocalPlaneMeasuredY();
1212 
1213  m->SetFocalPlaneComputed(cudx, cudy);
1214 
1215  // This is wrong. The stored residual is in pixels (sample,line), not x and y
1216  // m->SetResidual(mudx - cudx, mudy - cudy);
1217  }
1218 
1219  return Success;
1220  }
1221 
1222  QString ControlPoint::GetChooserName() const {
1223  if (chooserName != "") {
1224  return chooserName;
1225  }
1226  else {
1227  return FileName(Application::Name()).name();
1228  }
1229  }
1230 
1233  return !chooserName.isEmpty();
1234  }
1235 
1238  return !dateTime.isEmpty();
1239  }
1240 
1241 
1242  QString ControlPoint::GetDateTime() const {
1243  if (dateTime != "") {
1244  return dateTime;
1245  }
1246  else {
1247  return Application::DateTime();
1248  }
1249  }
1250 
1251 
1252  bool ControlPoint::IsEditLocked() const {
1253  return editLock;
1254  }
1255 
1256 
1257  bool ControlPoint::IsRejected() const {
1258  return jigsawRejected;
1259  }
1260 
1261 
1262  SurfacePoint ControlPoint::GetAdjustedSurfacePoint() const {
1263  return adjustedSurfacePoint;
1264  }
1265 
1266 
1272  if (adjustedSurfacePoint.Valid()) {
1273  return adjustedSurfacePoint;
1274  }
1275  else {
1276  return aprioriSurfacePoint;
1277  }
1278  }
1279 
1280 
1286  QString ControlPoint::GetId() const {
1287  return id;
1288  }
1289 
1290 
1291  bool ControlPoint::IsIgnored() const {
1292  return ignore;
1293  }
1294 
1295 
1296  bool ControlPoint::IsValid() const {
1297  return !invalid;
1298  }
1299 
1300 
1301  bool ControlPoint::IsInvalid() const {
1302  return invalid;
1303  }
1304 
1305 
1314  QString str;
1315 
1316  switch (pointType) {
1317  case Fixed:
1318  str = "Fixed";
1319  break;
1320  case Constrained:
1321  str = "Constrained";
1322  break;
1323  case Free:
1324  str = "Free";
1325  break;
1326  }
1327 
1328  return str;
1329  }
1330 
1331 
1340  QString pointTypeString) {
1341 
1342  // On failure assume Free
1344 
1345  QString errMsg = "There is no PointType that has a string representation"
1346  " of \"";
1347  errMsg += pointTypeString;
1348  errMsg += "\".";
1349 
1350  if (pointTypeString == "Fixed") {
1352  }
1353  else if (pointTypeString == "Constrained") {
1355  }
1356  else if (pointTypeString == "Free") {
1358  }
1359  else {
1361  }
1362 
1363  return type;
1364  }
1365 
1366 
1373  return PointTypeToString(GetType());
1374  }
1375 
1376 
1382  return type;
1383  }
1384 
1385 
1393  QString ControlPoint::RadiusSourceToString(RadiusSource::Source source) {
1394  QString str;
1395 
1396  switch (source) {
1397  case RadiusSource::None:
1398  str = "None";
1399  break;
1400  case RadiusSource::User:
1401  str = "User";
1402  break;
1403  case RadiusSource::AverageOfMeasures:
1404  str = "AverageOfMeasures";
1405  break;
1406  case RadiusSource::Ellipsoid:
1407  str = "Ellipsoid";
1408  break;
1409  case RadiusSource::DEM:
1410  str = "DEM";
1411  break;
1412  case RadiusSource::BundleSolution:
1413  str = "BundleSolution";
1414  break;
1415  }
1416 
1417  return str;
1418  }
1419 
1420 
1428  ControlPoint::RadiusSource::Source ControlPoint::StringToRadiusSource(
1429  QString str) {
1430 
1431  str = str.toLower();
1432  RadiusSource::Source source = RadiusSource::None;
1433 
1434  if (str == "user") {
1435  source = RadiusSource::User;
1436  }
1437  else if (str == "averageofmeasures") {
1438  source = RadiusSource::AverageOfMeasures;
1439  }
1440  else if (str == "ellipsoid") {
1441  source = RadiusSource::Ellipsoid;
1442  }
1443  else if (str == "dem") {
1444  source = RadiusSource::DEM;
1445  }
1446  else if (str == "bundlesolution") {
1447  source = RadiusSource::BundleSolution;
1448  }
1449 
1450  return source;
1451  }
1452 
1453 
1454 
1462  }
1463 
1464 
1473  SurfacePointSource::Source source) {
1474 
1475  QString str;
1476 
1477  switch (source) {
1478  case SurfacePointSource::None:
1479  str = "None";
1480  break;
1481  case SurfacePointSource::User:
1482  str = "User";
1483  break;
1484  case SurfacePointSource::AverageOfMeasures:
1485  str = "AverageOfMeasures";
1486  break;
1487  case SurfacePointSource::Reference:
1488  str = "Reference";
1489  break;
1490  case SurfacePointSource::Basemap:
1491  str = "Basemap";
1492  break;
1493  case SurfacePointSource::BundleSolution:
1494  str = "BundleSolution";
1495  break;
1496  }
1497 
1498  return str;
1499  }
1500 
1501 
1509  ControlPoint::SurfacePointSource::Source
1511  QString str) {
1512 
1513  str = str.toLower();
1514  SurfacePointSource::Source source = SurfacePointSource::None;
1515 
1516  if (str == "user") {
1517  source = SurfacePointSource::User;
1518  }
1519  else if (str == "averageofmeasures") {
1520  source = SurfacePointSource::AverageOfMeasures;
1521  }
1522  else if (str == "reference") {
1523  source = SurfacePointSource::Reference;
1524  }
1525  else if (str == "basemap") {
1526  source = SurfacePointSource::Basemap;
1527  }
1528  else if (str == "bundlesolution") {
1529  source = SurfacePointSource::BundleSolution;
1530  }
1531 
1532  return source;
1533  }
1534 
1535 
1543  }
1544 
1545 
1546  SurfacePoint ControlPoint::GetAprioriSurfacePoint() const {
1547  return aprioriSurfacePoint;
1548  }
1549 
1550 
1551  ControlPoint::RadiusSource::Source ControlPoint::GetAprioriRadiusSource()
1552  const {
1553  return aprioriRadiusSource;
1554  }
1555 
1556 
1557  bool ControlPoint::HasAprioriCoordinates() {
1558  if (aprioriSurfacePoint.GetX().isValid() &&
1559  aprioriSurfacePoint.GetY().isValid() &&
1560  aprioriSurfacePoint.GetZ().isValid()) {
1561  return true;
1562  }
1563 
1564  return false;
1565  // return aprioriSurfacePoint.Valid(); ???
1566  }
1567 
1568 
1574  bool ControlPoint::IsFree() const {
1575  return (type != Fixed && type != Constrained);
1576  }
1577 
1578 
1584  bool ControlPoint::IsFixed() const {
1585  return (type == Fixed);
1586  }
1587 
1588 
1595  // if point type is Free, we ignore any a priori sigmas on the coordinates
1596  if (type == Free) {
1597  return false;
1598  }
1599 
1600  return constraintStatus.any();
1601  }
1602 
1603 
1611  return constraintStatus[Coord1Constrained];
1612  }
1613 
1614 
1622  return constraintStatus[Coord2Constrained];
1623  }
1624 
1632  return constraintStatus[Coord3Constrained];
1633  }
1634 
1635 
1642  return constraintStatus.count();
1643  }
1644 
1645 
1652  return !( aprioriRadiusSourceFile.isEmpty() || aprioriRadiusSourceFile.isNull() );
1653  }
1654 
1655 
1656  QString ControlPoint::GetAprioriRadiusSourceFile() const {
1657  return aprioriRadiusSourceFile;
1658  }
1659 
1660 
1661  ControlPoint::SurfacePointSource::Source
1662  ControlPoint::GetAprioriSurfacePointSource() const {
1664  }
1665 
1666 
1673  return !( aprioriSurfacePointSourceFile.isEmpty() || aprioriSurfacePointSourceFile.isNull() );
1674  }
1675 
1676 
1677  QString ControlPoint::GetAprioriSurfacePointSourceFile() const {
1679  }
1680 
1681 
1682  int ControlPoint::GetNumMeasures() const {
1683  return measures->size();
1684  }
1685 
1686 
1692  int size = 0;
1693  QList<QString> keys = measures->keys();
1694  for (int cm = 0; cm < keys.size(); cm++) {
1695  if (!(*measures)[keys[cm]]->IsIgnored()) {
1696  size++;
1697  }
1698  }
1699  return size;
1700  }
1701 
1702 
1709  int size = 0;
1710  QList<QString> keys = measures->keys();
1711  for (int cm = 0; cm < keys.size(); cm++) {
1712  if ((*measures)[keys[cm]]->IsEditLocked()) {
1713  size++;
1714  }
1715  }
1716  return size;
1717  }
1718 
1719 
1726  bool ControlPoint::HasSerialNumber(QString serialNumber) const {
1727  return cubeSerials->contains(serialNumber);
1728  }
1729 
1730 
1736  return referenceExplicitlySet;
1737  }
1738 
1739 
1744  if (!HasRefMeasure()) {
1745  QString msg = "There is no reference measure set in the ControlPoint [" +
1746  GetId() + "]";
1748  }
1749 
1750  return referenceMeasure->GetCubeSerialNumber();
1751  }
1752 
1753 
1762  int ControlPoint::IndexOf(ControlMeasure *cm, bool throws) const {
1763  ASSERT(cm);
1764  return IndexOf(cm->GetCubeSerialNumber(), throws);
1765  }
1766 
1767 
1776  int ControlPoint::IndexOf(QString sn, bool throws) const {
1777  int index = cubeSerials->indexOf(sn);
1778 
1779  if (throws && index == -1) {
1780  QString msg = "ControlMeasure [" + sn + "] does not exist in point [" +
1781  id + "]";
1783  }
1784 
1785  return index;
1786  }
1787 
1788 
1798  if (!HasRefMeasure()) {
1799  QString msg = "There is no reference measure for point [" + id + "]."
1800  " This also means of course that the point is empty!";
1802  }
1803 
1804  int index = cubeSerials->indexOf(referenceMeasure->GetCubeSerialNumber());
1805  ASSERT(index != -1)
1806 
1807  return index;
1808  }
1809 
1810 
1823  double(ControlMeasure::*statFunc)() const) const {
1824  Statistics stats;
1825  foreach(ControlMeasure * cm, *measures) {
1826  if (!cm->IsIgnored()) {
1827  stats.AddData((cm->*statFunc)());
1828  }
1829  }
1830 
1831  return stats;
1832  }
1833 
1834 
1835  Statistics ControlPoint::GetStatistic(long dataType) const {
1836  Statistics stats;
1837  foreach(ControlMeasure * cm, *measures) {
1838  if (!cm->IsIgnored()) {
1839  stats.AddData(cm->GetLogData(dataType).GetNumericalValue());
1840  }
1841  }
1842 
1843  return stats;
1844  }
1845 
1846 
1854  bool excludeIgnored) const {
1855  QList< ControlMeasure * > orderedMeasures;
1856  for (int i = 0; i < cubeSerials->size(); i++) {
1857  ControlMeasure *measure = measures->value((*cubeSerials)[i]);
1858  if (!excludeIgnored || !measure->IsIgnored()) {
1859  orderedMeasures.append(measures->value((*cubeSerials)[i]));
1860  }
1861  }
1862  return orderedMeasures;
1863  }
1864 
1865 
1870  return *cubeSerials;
1871  }
1872 
1873 
1881  const ControlMeasure *ControlPoint::operator[](QString serialNumber) const {
1882  return GetMeasure(serialNumber);
1883  }
1884 
1885 
1893  ControlMeasure *ControlPoint::operator[](QString serialNumber) {
1894  return GetMeasure(serialNumber);
1895  }
1896 
1897 
1906  const ControlMeasure *ControlPoint::operator[](int index) const {
1907  return GetMeasure(index);
1908  }
1909 
1910 
1920  return GetMeasure(index);
1921  }
1922 
1923 
1931  bool ControlPoint::operator!=(const ControlPoint &other) const {
1932  return !(*this == other);
1933  }
1934 
1935 
1944  bool ControlPoint::operator==(const ControlPoint &other) const {
1945  return other.GetNumMeasures() == GetNumMeasures() &&
1946  other.id == id &&
1947  other.type == type &&
1948  other.chooserName == chooserName &&
1949  other.editLock == editLock &&
1950  other.ignore == ignore &&
1957  other.invalid == invalid &&
1958  other.measures == measures &&
1959  other.dateTime == dateTime &&
1960  other.jigsawRejected == jigsawRejected &&
1964  other.cubeSerials == cubeSerials &&
1965  other.referenceMeasure == referenceMeasure;
1966  }
1967 
1968 
1986 
1987  if (this != &other) {
1988  bool oldLock = editLock;
1989  editLock = false;
1990  for (int i = cubeSerials->size() - 1; i >= 0; i--) {
1991  (*measures)[cubeSerials->at(i)]->SetEditLock(false);
1992  Delete(cubeSerials->at(i));
1993  }
1994 
1995  //measures->clear(); = new QHash< QString, ControlMeasure * >;
1996 
1997  QHashIterator< QString, ControlMeasure * > i(*other.measures);
1998  while (i.hasNext()) {
1999  i.next();
2000  ControlMeasure *newMeasure = new ControlMeasure;
2001  *newMeasure = *i.value();
2002  AddMeasure(newMeasure);
2003  if (other.referenceMeasure == i.value()) {
2004  SetRefMeasure(newMeasure);
2005  }
2006  }
2007 
2008  invalid = other.invalid;
2012 
2013  SetId(other.id);
2014  SetChooserName(other.chooserName);
2015  SetDateTime(other.dateTime);
2016  SetType(other.type);
2017  SetRejected(other.jigsawRejected);
2018  SetIgnored(other.ignore);
2025 
2026  // Set edit lock last so the it doesn't interfere with copying the other fields over.
2027  editLock = oldLock;
2028  SetEditLock(other.editLock);
2029  }
2030 
2031  return *this;
2032  }
2033 
2034 
2040  dateTime = "";
2041  }
2042 
2043 
2046 
2047  {
2049  }
2050 
2051 
2059  numberOfRejectedMeasures = numRejected;
2060  }
2061 
2062 
2070  return numberOfRejectedMeasures;
2071  }
2072 
2080  int nmeasures = measures->size();
2081  if ( nmeasures <= 0 ) {
2082  return 0.0;
2083  }
2084 
2085  Statistics stats;
2086 
2087  for( int i = 0; i < nmeasures; i++) {
2088  const ControlMeasure* m = GetMeasure(i);
2089  if ( !m ) {
2090  continue;
2091  }
2092 
2093  if ( !m->IsIgnored() || m->IsRejected() ) {
2094  continue;
2095  }
2096 
2097  stats.AddData(m->GetSampleResidual());
2098  }
2099 
2100  return stats.Rms();
2101  }
2102 
2103 
2111  int nmeasures = measures->size();
2112  if ( nmeasures <= 0 ) {
2113  return 0.0;
2114  }
2115 
2116  Statistics stats;
2117 
2118  for( int i = 0; i < nmeasures; i++) {
2119  const ControlMeasure* m = GetMeasure(i);
2120  if ( !m ) {
2121  continue;
2122  }
2123 
2124  if ( !m->IsIgnored() || m->IsRejected() ) {
2125  continue;
2126  }
2127 
2128  stats.AddData(m->GetLineResidual());
2129  }
2130 
2131  return stats.Rms();
2132  }
2133 
2134 
2142  int nmeasures = measures->size();
2143  if ( nmeasures <= 0 ) {
2144  return 0.0;
2145  }
2146 
2147  Statistics stats;
2148 
2149  for( int i = 0; i < nmeasures; i++) {
2150  const ControlMeasure* m = GetMeasure(i);
2151  if ( !m ) {
2152  continue;
2153  }
2154 
2155  if ( m->IsIgnored() || m->IsRejected() ) {
2156  continue;
2157  }
2158 
2159  stats.AddData(m->GetSampleResidual());
2160  stats.AddData(m->GetLineResidual());
2161  }
2162 
2163  return stats.Rms();
2164  }
2165 
2172  int nmeasures = measures->size();
2173  if ( nmeasures <= 0 ) {
2174  return;
2175  }
2176 
2177  for( int i = 0; i < nmeasures; i++) {
2178  ControlMeasure* m = GetMeasure(i);
2179  if ( !m ) {
2180  continue;
2181  }
2182 
2183  m->SetRejected(false);
2184  }
2185 
2186  SetRejected(false);
2187  }
2188 
2189 }
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:148
Status SetAprioriSurfacePointSource(SurfacePointSource::Source source)
This updates the source of the surface point.
void Coordinate(double p[3]) const
Returns the x,y,z of the surface intersection in BodyFixed km.
Definition: Sensor.cpp:211
bool HasSerialNumber(QString serialNumber) const
Return true if given serial number exists in point.
virtual CameraType GetCameraType() const =0
Returns the type of camera that was created.
void UpdatePointReference(ControlPoint *point, QString oldId)
Updates the key reference (poind Id) from the old one to what the point id was changet to...
Definition: ControlNet.cpp:733
void ZeroNumberOfRejectedMeasures()
Initialize the number of rejected measures to 0.
bool IsReferenceExplicit() const
The distance is being specified in kilometers.
Definition: Displacement.h:54
bool editLock
This stores the edit lock state.
Definition: ControlPoint.h:666
void emitNetworkStructureModified()
This method is a wrapper to emit the networkStructureModified() signal.
Definition: ControlNet.cpp:861
void SetNumberOfRejectedMeasures(int numRejected)
Set (update) the number of rejected measures for the control point.
void Add(ControlMeasure *measure)
Add a measurement to the control point, taking ownership of the measure in the process.
double GetSampleResidualRms() const
Get rms of sample residuals.
SurfacePoint aprioriSurfacePoint
The apriori surface point.
Definition: ControlPoint.h:719
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
Definition: ControlPoint.h:391
A Fixed point is a Control Point whose lat/lon is well established and should not be changed...
Definition: ControlPoint.h:386
Status ComputeApriori()
Computes a priori lat/lon/radius point coordinates by determining the average lat/lon/radius of all ...
bool IsFixed() const
Return bool indicating if point is Fixed or not.
QString id
This is the control point ID.
Definition: ControlPoint.h:631
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
Definition: Camera.cpp:2838
Status SetAprioriRadiusSourceFile(QString sourceFile)
This updates the filename of the DEM that the apriori radius came from.
bool IsCoord3Constrained()
Return bool indicating if 3rd coordinate is Constrained or not.
virtual bool SetFocalPlane(const double dx, const double dy)
Compute detector position (sample,line) from focal plane coordinates.
int GetNumberOfRejectedMeasures() const
Get the number of rejected measures on the control point.
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube&#39;s serial number.
Status SetIgnored(bool newIgnoreStatus)
Set whether to ignore or use control point.
ModType
Control Measure Modification Types.
void ClearJigsawRejected()
Set jigsaw rejected flag for all measures to false and set the jigsaw rejected flag for the point its...
ControlPoint * parentPoint
Pointer to parent ControlPoint, may be null.
bool jigsawRejected
This stores the jigsaw rejected state.
Definition: ControlPoint.h:672
PointType
These are the valid &#39;types&#39; of point.
Definition: ControlPoint.h:379
Status ComputeResiduals_Millimeters()
This method computes the residuals for a point.
QString GetReferenceSN() const
bool isValid() const
Test if this displacement has been initialized or not.
bool HasAprioriSurfacePointSourceFile() const
Checks to see if the surface point source file has been set.
Namespace for the standard library.
ControlNet * parentNetwork
List of Control Measures.
Definition: ControlPoint.h:617
QString GetRadiusSourceString() const
Obtain a string representation of the RadiusSource.
QString dateTime
This is the last modified date and time.
Definition: ControlPoint.h:647
void emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType type, QVariant oldValue, QVariant newValue)
This method is a wrapper to emit the measureModified() signal and is called whenever a change is made...
Definition: ControlNet.cpp:145
SurfacePoint GetBestSurfacePoint() const
Returns the adjusted surface point if it exists, otherwise returns the a priori surface point...
Status SetChooserName(QString name)
Set the point&#39;s chooser name.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:226
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:162
static QString Name()
Returns the name of the application.
Status SetEditLock(bool editLock)
Set the EditLock state.
ControlPoint()
Construct a control point.
int GetNumValidMeasures() const
Status SetRejected(bool rejected)
Set "jigsaw" rejected flag for a measure.
double GetResidualRms() const
Get rms of residuals.
void measureDeleted(ControlMeasure *measure)
Updates the node for this measure&#39;s serial number to reflect the deletion.
Definition: ControlNet.cpp:746
bool HasAprioriRadiusSourceFile() const
Checks to see if the radius source file has been set.
void measureAdded(ControlMeasure *measure)
Updates the ControlNet graph for the measure&#39;s serial number to reflect the addition.
Definition: ControlNet.cpp:572
Status SetAdjustedSurfacePoint(SurfacePoint newSurfacePoint)
Set or update the surface point relating to this control point.
Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const
This function will call a given method on every control measure that this point has.
A Free point is a Control Point that identifies common measurements between two or more cubes...
Definition: ControlPoint.h:399
Radar Camera.
Definition: Camera.h:374
static QString SurfacePointSourceToString(SurfacePointSource::Source source)
Obtain a string representation of a given SurfacePointSource.
Planetocentric latitudinal (lat/lon/rad) coordinates.
Definition: SurfacePoint.h:156
SurfacePoint adjustedSurfacePoint
This is the calculated, or aposterori, surface point.
Definition: ControlPoint.h:725
static QString RadiusSourceToString(RadiusSource::Source source)
Obtain a string representation of a given RadiusSource.
bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
Definition: Camera.cpp:170
bool operator!=(const ControlPoint &pPoint) const
Compare two Control Points for inequality.
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:107
void pointIgnored(ControlPoint *point)
Update the ControlNet&#39;s internal structure when a ControlPoint is ignored.
Definition: ControlNet.cpp:771
Status SetAprioriSurfacePointSourceFile(QString sourceFile)
This updates the filename of where the apriori surface point came from.
double GetLineResidualRms() const
Get rms of line residuals.
void emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType modType, QVariant oldValue, QVariant newValue)
This method is a wrapper to emit the measureModified() signal in the parent network is called wheneve...
Status SetResidual(double sampResidual, double lineResidual)
Set the BundleAdjust Residual of the coordinate.
double FocalPlaneY() const
Gets the y-value in the focal plane coordinate system.
QString GetSurfacePointSourceString() const
Obtain a string representation of the SurfacePointSource.
int GetNumLockedMeasures() const
Returns the number of locked control measures.
Convert between distorted focal plane and detector coordinates.
QString GetId() const
Return the Id of the control point.
const ControlMeasure * operator[](QString serialNumber) const
Same as GetMeasure (provided for convenience)
static RadiusSource::Source StringToRadiusSource(QString str)
Obtain a RadiusSource::Source from a string.
CameraGroundMap * GroundMap()
Returns a pointer to the CameraGroundMap object.
Definition: Camera.cpp:2868
virtual bool SetUndistortedFocalPlane(double ux, double uy)
Compute distorted focal plane x/y.
Status SetDateTime(QString newDateTime)
Set the point&#39;s last modified time.
static QString DateTime(time_t *curtime=0)
Returns the date and time as a QString.
bool IsCoord2Constrained()
Return bool indicating if 2nd coordinate is Constrained or not.
QList< QString > getCubeSerialNumbers() const
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
std::bitset< 3 > constraintStatus
This stores the constraint status of the a priori SurfacePoint.
Definition: ControlPoint.h:678
Status SetRefMeasure(ControlMeasure *cm)
Set the point&#39;s reference measure.
bool IsFree() const
Return bool indicating if point is Free or not.
bool HasChooserName() const
Returns true if the choosername is not empty.
A type of error that could only have occurred due to a mistake on the user&#39;s part (e...
Definition: IException.h:142
Status SetAprioriSurfacePoint(SurfacePoint aprioriSP)
This updates the apriori surface point.
virtual bool GetXY(const SurfacePoint &spoint, double *cudx, double *cudy, bool test=true)
Compute undistorted focal plane coordinate from ground position using current Spice from SetImage cal...
QList< ControlMeasure *> getMeasures(bool excludeIgnored=false) const
bool IsCoord1Constrained()
Return bool indicating if 1st coordinate is Constrained or not.
void pointUnIgnored(ControlPoint *point)
Update the ControlNet&#39;s internal structure when a ControlPoint is un-ignored.
Definition: ControlNet.cpp:629
This is returned when an operation cannot be performed due to a problem such as the point is ignored ...
Definition: ControlPoint.h:414
A single control point.
Definition: ControlPoint.h:369
bool referenceExplicitlySet
This indicates if a program has explicitely set the reference in this point or the implicit reference...
Definition: ControlPoint.h:686
double Rms() const
Computes and returns the rms.
Definition: Statistics.cpp:378
bool isValid() const
Test if this distance has been initialized or not.
Definition: Distance.cpp:204
const ControlPoint & operator=(const ControlPoint &pPoint)
Body-fixed rectangular x/y/z coordinates.
Definition: SurfacePoint.h:157
bool ignore
True if we should preserve but ignore the entire control point and its measures.
Definition: ControlPoint.h:692
bool invalid
If we forced a build that we would normally have thrown an exception for then this is set to true...
Definition: ControlPoint.h:660
SurfacePoint::CoordinateType GetCoordType()
Get the control point coordinate type (see the available types in SurfacePoint.h).
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
Definition: SurfacePoint.h:155
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
Definition: Camera.cpp:2848
~ControlPoint()
This destroys the current instance and cleans up any and all allocated memory.
Status SetRejected(bool rejected)
Set the jigsawRejected state.
Status SetType(PointType newType)
Updates the control point&#39;s type.
PointType type
What this control point is tying together.
Definition: ControlPoint.h:653
Status SetId(QString id)
Sets the Id of the control point.
static SurfacePointSource::Source StringToSurfacePointSource(QString str)
Obtain a SurfacePoint::Source from a string.
const ControlMeasure * GetRefMeasure() const
Get the reference control measure.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Status
This is a return status for many of the mutating (setter) method calls.
Definition: ControlPoint.h:408
SurfacePointSource::Source aprioriSurfacePointSource
Where the apriori surface point originated from.
Definition: ControlPoint.h:695
void Load(PvlObject &p)
Loads the PvlObject into a ControlPoint.
void SetExplicitReference(ControlMeasure *measure)
Explicitly defines a new reference measure by pointer.
int numberOfRejectedMeasures
This parameter is used and maintained by BundleAdjust for the jigsaw application. ...
Definition: ControlPoint.h:732
QString chooserName
This is the user name of the person who last modified this control point.
Definition: ControlPoint.h:641
Status SetFocalPlaneMeasured(double x, double y)
Set the focal plane x/y for the measured line/sample.
bool HasRefMeasure() const
Checks to see if a reference measure is set.
QString aprioriRadiusSourceFile
The name of the file that derives the apriori surface point&#39;s radius.
Definition: ControlPoint.h:709
QString aprioriSurfacePointSourceFile
FileName where the apriori surface point originated from.
Definition: ControlPoint.h:698
int IndexOfRefMeasure() const
Displacement is a signed length, usually in meters.
Definition: Displacement.h:43
int IndexOf(ControlMeasure *, bool throws=true) const
Isis exception class.
Definition: IException.h:107
SurfacePoint GetSurfacePoint() const
Returns the surface point (most efficient accessor).
Definition: Sensor.cpp:270
QString GetPointTypeString() const
Obtain a string representation of the PointType.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
bool IsEditLocked() const
Return value for p_editLock or implicit lock on reference measure.
a control measurement
bool IsConstrained()
Return bool indicating if point is Constrained or not.
Status ResetApriori()
Reset all the Apriori info to defaults.
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
void AddMeasure(ControlMeasure *measure)
Do the actual work of adding a measure to this point, without changing any extra data.
bool isValid() const
This indicates whether we have a legitimate angle stored or are in an unset, or invalid, state.
Definition: Angle.cpp:110
double GetNumericalValue() const
Get the value associated with this log data.
bool HasDateTime() const
Returns true if the datetime is not empty.
void emitPointModified(ControlPoint *point, ControlPoint::ModType type, QVariant oldValue, QVariant newValue)
This method is a wrapper to emit the pointModified() signal and is called whenever a change is made t...
Definition: ControlNet.cpp:159
PointType GetType() const
int NumberOfConstrainedCoordinates()
Return bool indicating if point is Constrained or not.
double UndistortedFocalPlaneY() const
Gets the y-value in the undistorted focal plane coordinate system.
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Definition: Statistics.cpp:154
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
void ValidateMeasure(QString serialNumber) const
Throws an exception if none of the point&#39;s measures have the given serial number. ...
static QString PointTypeToString(PointType type)
Obtain a string representation of a given PointType.
double UndistortedFocalPlaneX() const
Gets the x-value in the undistorted focal plane coordinate system.
Status SetAprioriRadiusSource(RadiusSource::Source source)
This updates the source of the radius of the apriori surface point.
bool operator==(const ControlPoint &pPoint) const
Compare two Control Points for equality.
Status ComputeResiduals()
This method computes the BundleAdjust residuals for a point.
Status SetFocalPlaneComputed(double x, double y)
Set the computed focal plane x/y for the apriori lat/lon.
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
This is returned when the operation successfully took effect.
Definition: ControlPoint.h:418
static PointType StringToPointType(QString pointTypeString)
Obtain a PointType given a string representation of it.
void SetRectangular(const Displacement &x, const Displacement &y, const Displacement &z, const Distance &xSigma=Distance(), const Distance &ySigma=Distance(), const Distance &zSigma=Distance())
Set surface point in rectangular body-fixed coordinates wtih optional sigmas.
void PointModified()
What the heck is the point of this?
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
double FocalPlaneX() const
Gets the x-value in the focal plane coordinate system.
This is returned when the operation requires Edit Lock to be false but it is currently true...
Definition: ControlPoint.h:423
RadiusSource::Source aprioriRadiusSource
Where the apriori surface point&#39;s radius originated from, most commonly used by jigsaw.
Definition: ControlPoint.h:704