Isis 3 Developer Reference
ControlPoint.h
Go to the documentation of this file.
1 #ifndef ControlPoint_h
2 #define ControlPoint_h
3 
27 #include <bitset>
28 
29 #include <QObject>
30 #include <QString>
31 
32 #include "ControlMeasure.h"
33 #include "SurfacePoint.h"
34 
35 template< typename A, typename B > class QHash;
36 
37 class QStringList;
38 
39 namespace Isis {
40  class ControlNet;
41  class ControlPointFileEntryV0002;
42  class Latitude;
43  class Longitude;
44  class PBControlNet_PBControlPoint;
45  class PBControlNetLogData_Point;
46  class PvlObject;
47  class Statistics;
48 
369  class ControlPoint : public QObject {
370 
371  Q_OBJECT
372 
373  friend class ControlNet;
374  public:
379  enum PointType {
386  Fixed = 0,
399  Free = 2
400  };
401  static const int PointTypeCount = 3;
402 
408  enum Status {
424  };
425 
434  };
435 
446  enum ModType {
450  };
451 
452  // This stuff input to jigsaw
453  // How did apriori source get computed??
455  enum Source {
462  };
463  };
464 
465  struct RadiusSource {
466  enum Source {
473  };
474  };
475 
476  ControlPoint();
477  ControlPoint(const ControlPoint &);
478  ControlPoint(const QString &id);
479  ~ControlPoint();
480 
481  ControlNet *Parent() { return parentNetwork; }
482 
483  void Load(PvlObject &p);
484 
485  void Add(ControlMeasure *measure);
486  int Delete(ControlMeasure *measure);
487  int Delete(QString serialNumber);
488  int Delete(int index);
490 
491  const ControlMeasure *GetMeasure(QString serialNumber) const;
492  ControlMeasure *GetMeasure(QString serialNumber);
493 
494  const ControlMeasure *GetMeasure(int index) const;
495  ControlMeasure *GetMeasure(int index);
496 
497  bool HasRefMeasure() const;
498  const ControlMeasure *GetRefMeasure() const;
500 
501  Status SetChooserName(QString name);
502  Status SetDateTime(QString newDateTime);
503  Status SetEditLock(bool editLock);
504  Status SetId(QString id);
506  Status SetRefMeasure(int index);
507  Status SetRefMeasure(QString sn);
508  Status SetRejected(bool rejected);
509  Status SetIgnored(bool newIgnoreStatus);
511  Status SetType(PointType newType);
512 
514  Status SetAprioriRadiusSourceFile(QString sourceFile);
517  Status SetAprioriSurfacePointSourceFile(QString sourceFile);
518 
519 // Status UpdateSphericalPointCoordinates(const Latitude &lat, const Longitude &lon,
520 // const Distance &radius);
521 
525 
527 
529  QString GetChooserName() const;
530  QString GetDateTime() const;
531  bool IsEditLocked() const;
532  bool IsRejected() const;
533  QString GetId() const;
534  bool IsIgnored() const;
535  bool IsValid() const;
536  // Can we get rid of this? It doesn't appear to be used anywhere. *** ToDo ***
537  bool IsInvalid() const;
538  bool IsFree() const;
539  bool IsFixed() const;
540  bool HasAprioriCoordinates();
541 
542  bool IsConstrained();
543  bool IsCoord1Constrained();
544  bool IsCoord2Constrained();
545  bool IsCoord3Constrained();
547 
548  static QString PointTypeToString(PointType type);
549  static PointType StringToPointType(QString pointTypeString);
550 
551  QString GetPointTypeString() const;
552  PointType GetType() const;
553 
554  static QString RadiusSourceToString(RadiusSource::Source source);
555  static RadiusSource::Source StringToRadiusSource(QString str);
556  QString GetRadiusSourceString() const;
559  QString GetSurfacePointSourceString() const;
561 
563  bool HasAprioriRadiusSourceFile() const;
564  QString GetAprioriRadiusSourceFile() const;
567  QString GetAprioriSurfacePointSourceFile() const;
568 
569  int GetNumMeasures() const;
570  int GetNumValidMeasures() const;
571  int GetNumLockedMeasures() const;
572  bool HasSerialNumber(QString serialNumber) const;
573  bool HasChooserName() const;
574  bool HasDateTime() const;
575  int IndexOf(ControlMeasure *, bool throws = true) const;
576  int IndexOf(QString sn, bool throws = true) const;
577  int IndexOfRefMeasure() const;
578  bool IsReferenceExplicit() const;
579  QString GetReferenceSN() const;
580  void emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType modType, QVariant oldValue, QVariant newValue);
581 
582 
583 
584  Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const;
585  Statistics GetStatistic(long dataType) const;
586 
587  QList< ControlMeasure * > getMeasures(bool excludeIgnored = false) const;
589 
590  const ControlMeasure *operator[](QString serialNumber) const;
591  ControlMeasure *operator[](QString serialNumber);
592 
593  const ControlMeasure *operator[](int index) const;
594  ControlMeasure *operator[](int index);
595 
596  bool operator!=(const ControlPoint &pPoint) const;
597  bool operator==(const ControlPoint &pPoint) const;
598  const ControlPoint &operator=(const ControlPoint &pPoint);
599 
600  // The next 7 methods are specifically to support BundleAdjust
602  void SetNumberOfRejectedMeasures(int numRejected);
603  int GetNumberOfRejectedMeasures() const;
604  double GetSampleResidualRms() const;
605  double GetLineResidualRms() const;
606  double GetResidualRms() const;
607  void ClearJigsawRejected();
608 
609  private:
610  void SetExplicitReference(ControlMeasure *measure);
611  void ValidateMeasure(QString serialNumber) const;
612  void AddMeasure(ControlMeasure *measure);
613  void PointModified();
614 
615 
616  private:
617  ControlNet *parentNetwork;
618 
621 
622  QStringList *cubeSerials;
623 
624  ControlMeasure *referenceMeasure;
625 
631  QString id;
632 
641  QString chooserName;
642 
647  QString dateTime;
648 
653  PointType type;
654 
660  bool invalid;
661 
666  bool editLock;
667 
672  bool jigsawRejected;
673 
678  std::bitset<3> constraintStatus;
679 
686  bool referenceExplicitlySet;
687 
692  bool ignore;
693 
695  SurfacePointSource::Source aprioriSurfacePointSource;
696 
698  QString aprioriSurfacePointSourceFile;
699 
704  RadiusSource::Source aprioriRadiusSource;
705 
709  QString aprioriRadiusSourceFile;
710 
719  SurfacePoint aprioriSurfacePoint;
720 
725  SurfacePoint adjustedSurfacePoint;
726 
732  int numberOfRejectedMeasures;
733  };
734 }
735 
736 #endif
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.
Definition: ControlPoint.cpp:813
bool HasSerialNumber(QString serialNumber) const
Return true if given serial number exists in point.
Definition: ControlPoint.cpp:1726
void ZeroNumberOfRejectedMeasures()
Initialize the number of rejected measures to 0.
Definition: ControlPoint.cpp:2045
SurfacePoint GetAdjustedSurfacePoint() const
Definition: ControlPoint.cpp:1262
bool IsReferenceExplicit() const
Definition: ControlPoint.cpp:1735
void SetNumberOfRejectedMeasures(int numRejected)
Set (update) the number of rejected measures for the control point.
Definition: ControlPoint.cpp:2058
void Add(ControlMeasure *measure)
Add a measurement to the control point, taking ownership of the measure in the process.
Definition: ControlPoint.cpp:215
double GetSampleResidualRms() const
Get rms of sample residuals.
Definition: ControlPoint.cpp:2079
Source
Definition: ControlPoint.h:466
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 ...
Definition: ControlPoint.cpp:891
QString GetChooserName() const
Definition: ControlPoint.cpp:1222
bool IsFixed() const
Return bool indicating if point is Fixed or not.
Definition: ControlPoint.cpp:1584
Definition: ControlPoint.h:432
SurfacePoint GetAprioriSurfacePoint() const
Definition: ControlPoint.cpp:1546
Status SetAprioriRadiusSourceFile(QString sourceFile)
This updates the filename of the DEM that the apriori radius came from.
Definition: ControlPoint.cpp:747
bool IsCoord3Constrained()
Return bool indicating if 3rd coordinate is Constrained or not.
Definition: ControlPoint.cpp:1631
int GetNumberOfRejectedMeasures() const
Get the number of rejected measures on the control point.
Definition: ControlPoint.cpp:2069
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube&#39;s serial number.
Definition: ControlPoint.cpp:408
Definition: ControlPoint.h:433
int GetNumMeasures() const
Definition: ControlPoint.cpp:1682
Status SetIgnored(bool newIgnoreStatus)
Set whether to ignore or use control point.
Definition: ControlPoint.cpp:645
ModType
Control Measure Modification Types.
Definition: ControlMeasure.h:246
Source
Definition: ControlPoint.h:455
void ClearJigsawRejected()
Set jigsaw rejected flag for all measures to false and set the jigsaw rejected flag for the point its...
Definition: ControlPoint.cpp:2171
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.
Definition: ControlPoint.cpp:1173
QString GetReferenceSN() const
Definition: ControlPoint.cpp:1743
bool HasAprioriSurfacePointSourceFile() const
Checks to see if the surface point source file has been set.
Definition: ControlPoint.cpp:1672
QString GetRadiusSourceString() const
Obtain a string representation of the RadiusSource.
Definition: ControlPoint.cpp:1460
bool IsEditLocked() const
Definition: ControlPoint.cpp:1252
SurfacePoint GetBestSurfacePoint() const
Returns the adjusted surface point if it exists, otherwise returns the a priori surface point...
Definition: ControlPoint.cpp:1271
bool HasAprioriCoordinates()
Definition: ControlPoint.cpp:1557
Status SetChooserName(QString name)
Set the point&#39;s chooser name.
Definition: ControlPoint.cpp:479
Definition: ControlPoint.h:465
SurfacePointSource::Source GetAprioriSurfacePointSource() const
Definition: ControlPoint.cpp:1662
Status SetEditLock(bool editLock)
Set the EditLock state.
Definition: ControlPoint.cpp:514
ControlPoint()
Construct a control point.
Definition: ControlPoint.cpp:40
int GetNumValidMeasures() const
Definition: ControlPoint.cpp:1691
double GetResidualRms() const
Get rms of residuals.
Definition: ControlPoint.cpp:2141
bool HasAprioriRadiusSourceFile() const
Checks to see if the radius source file has been set.
Definition: ControlPoint.cpp:1651
ConstraintStatus
This is a convenience member for checking number of constrained coordinates in the SurfacePoint...
Definition: ControlPoint.h:430
Status SetAdjustedSurfacePoint(SurfacePoint newSurfacePoint)
Set or update the surface point relating to this control point.
Definition: ControlPoint.cpp:684
Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const
This function will call a given method on every control measure that this point has.
Definition: ControlPoint.cpp:1822
A Free point is a Control Point that identifies common measurements between two or more cubes...
Definition: ControlPoint.h:399
QString GetDateTime() const
Definition: ControlPoint.cpp:1242
static QString SurfacePointSourceToString(SurfacePointSource::Source source)
Obtain a string representation of a given SurfacePointSource.
Definition: ControlPoint.cpp:1472
static QString RadiusSourceToString(RadiusSource::Source source)
Obtain a string representation of a given RadiusSource.
Definition: ControlPoint.cpp:1393
bool operator!=(const ControlPoint &pPoint) const
Compare two Control Points for inequality.
Definition: ControlPoint.cpp:1931
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:107
Status SetAprioriSurfacePointSourceFile(QString sourceFile)
This updates the filename of where the apriori surface point came from.
Definition: ControlPoint.cpp:831
bool IsInvalid() const
Definition: ControlPoint.cpp:1301
double GetLineResidualRms() const
Get rms of line residuals.
Definition: ControlPoint.cpp:2110
QString GetAprioriRadiusSourceFile() const
Definition: ControlPoint.cpp:1656
Definition: ControlPoint.h:456
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...
Definition: ControlPoint.cpp:333
a control network
Definition: ControlNet.h:271
QString GetSurfacePointSourceString() const
Obtain a string representation of the SurfacePointSource.
Definition: ControlPoint.cpp:1541
int GetNumLockedMeasures() const
Returns the number of locked control measures.
Definition: ControlPoint.cpp:1708
QString GetId() const
Return the Id of the control point.
Definition: ControlPoint.cpp:1286
Definition: ControlPoint.h:470
const ControlMeasure * operator[](QString serialNumber) const
Same as GetMeasure (provided for convenience)
Definition: ControlPoint.cpp:1881
static RadiusSource::Source StringToRadiusSource(QString str)
Obtain a RadiusSource::Source from a string.
Definition: ControlPoint.cpp:1428
RadiusSource::Source GetAprioriRadiusSource() const
Definition: ControlPoint.cpp:1551
Status SetDateTime(QString newDateTime)
Set the point&#39;s last modified time.
Definition: ControlPoint.cpp:496
bool IsCoord2Constrained()
Return bool indicating if 2nd coordinate is Constrained or not.
Definition: ControlPoint.cpp:1621
QList< QString > getCubeSerialNumbers() const
Definition: ControlPoint.cpp:1869
Status SetRefMeasure(ControlMeasure *cm)
Set the point&#39;s reference measure.
Definition: ControlPoint.cpp:562
bool IsFree() const
Return bool indicating if point is Free or not.
Definition: ControlPoint.cpp:1574
bool HasChooserName() const
Returns true if the choosername is not empty.
Definition: ControlPoint.cpp:1232
Status SetAprioriSurfacePoint(SurfacePoint aprioriSP)
This updates the apriori surface point.
Definition: ControlPoint.cpp:771
QList< ControlMeasure *> getMeasures(bool excludeIgnored=false) const
Definition: ControlPoint.cpp:1853
static const int PointTypeCount
Definition: ControlPoint.h:401
bool IsCoord1Constrained()
Return bool indicating if 1st coordinate is Constrained or not.
Definition: ControlPoint.cpp:1610
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
Definition: ControlPoint.h:454
const ControlPoint & operator=(const ControlPoint &pPoint)
Definition: ControlPoint.cpp:1985
~ControlPoint()
This destroys the current instance and cleans up any and all allocated memory.
Definition: ControlPoint.cpp:139
Status SetRejected(bool rejected)
Set the jigsawRejected state.
Definition: ControlPoint.cpp:531
Status SetType(PointType newType)
Updates the control point&#39;s type.
Definition: ControlPoint.cpp:701
ModType
Control Point Modification Types.
Definition: ControlPoint.h:446
Status SetId(QString id)
Sets the Id of the control point.
Definition: ControlPoint.cpp:544
Definition: ControlPoint.h:457
static SurfacePointSource::Source StringToSurfacePointSource(QString str)
Obtain a SurfacePoint::Source from a string.
Definition: ControlPoint.cpp:1510
const ControlMeasure * GetRefMeasure() const
Get the reference control measure.
Definition: ControlPoint.cpp:449
Status
This is a return status for many of the mutating (setter) method calls.
Definition: ControlPoint.h:408
void Load(PvlObject &p)
Loads the PvlObject into a ControlPoint.
Definition: ControlPoint.cpp:204
Definition: ControlPoint.h:471
bool IsRejected() const
Definition: ControlPoint.cpp:1257
bool HasRefMeasure() const
Checks to see if a reference measure is set.
Definition: ControlPoint.cpp:439
ControlNet * Parent()
Definition: ControlPoint.h:481
Definition: ControlPoint.h:447
int IndexOfRefMeasure() const
Definition: ControlPoint.cpp:1797
int IndexOf(ControlMeasure *, bool throws=true) const
Definition: ControlPoint.cpp:1762
Definition: ControlPoint.h:449
QString GetPointTypeString() const
Obtain a string representation of the PointType.
Definition: ControlPoint.cpp:1372
QString GetAprioriSurfacePointSourceFile() const
Definition: ControlPoint.cpp:1677
Definition: BoxcarCachingAlgorithm.h:29
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
a control measurement
Definition: ControlMeasure.h:189
Definition: ControlPoint.h:467
bool IsConstrained()
Return bool indicating if point is Constrained or not.
Definition: ControlPoint.cpp:1594
Status ResetApriori()
Reset all the Apriori info to defaults.
Definition: ControlPoint.cpp:373
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
Definition: ControlPoint.cpp:346
bool HasDateTime() const
Returns true if the datetime is not empty.
Definition: ControlPoint.cpp:1237
bool IsIgnored() const
Definition: ControlPoint.cpp:1291
PointType GetType() const
Definition: ControlPoint.cpp:1381
int NumberOfConstrainedCoordinates()
Return bool indicating if point is Constrained or not.
Definition: ControlPoint.cpp:1641
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
bool IsValid() const
Definition: ControlPoint.cpp:1296
static QString PointTypeToString(PointType type)
Obtain a string representation of a given PointType.
Definition: ControlPoint.cpp:1313
Status SetAprioriRadiusSource(RadiusSource::Source source)
This updates the source of the radius of the apriori surface point.
Definition: ControlPoint.cpp:728
Definition: ControlPoint.h:468
bool operator==(const ControlPoint &pPoint) const
Compare two Control Points for equality.
Definition: ControlPoint.cpp:1944
Status ComputeResiduals()
This method computes the BundleAdjust residuals for a point.
Definition: ControlPoint.cpp:1013
Definition: ControlPoint.h:431
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.
Definition: ControlPoint.cpp:1339
Definition: ControlPoint.h:448
Definition: ControlNet.h:46
This is returned when the operation requires Edit Lock to be false but it is currently true...
Definition: ControlPoint.h:423