Isis 3.0 Programmer Reference
Back | Home
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 "SurfacePoint.h"
33 
34 template< typename A, typename B > class QHash;
35 
36 class QStringList;
37 
38 namespace Isis {
39  class ControlMeasure;
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 
339  class ControlPoint : public QObject {
340 
341  Q_OBJECT
342 
343  friend class ControlNet;
344  public:
349  enum PointType {
356  Fixed = 0,
369  Free = 2
370  };
371  static const int PointTypeCount = 3;
372 
378  enum Status {
394  };
395 
408  LongitudeConstrained = 1,
409  RadiusConstrained = 2,
410 // XConstrained = 3,
411 // YConstrained = 4,
412 // ZConstrained = 5;
413  };
414 
415  // This stuff input to jigsaw
416  // How did apriori source get computed??
418  enum Source {
419  None,
420  User,
421  AverageOfMeasures,
422  Reference,
423  Basemap,
424  BundleSolution
425  };
426  };
427 
428  struct RadiusSource {
429  enum Source {
430  None,
431  User,
432  AverageOfMeasures,
433  Ellipsoid,
434  DEM,
435  BundleSolution
436  };
437  };
438 
439  ControlPoint();
440  ControlPoint(const ControlPoint &);
441  ControlPoint(const QString &id);
442  ControlPoint(const ControlPointFileEntryV0002 &fileEntry,
443  const Distance &majorRad, const Distance &minorRad,
444  const Distance &polarRad);
445  ~ControlPoint();
446 
447  ControlNet *Parent() { return parentNetwork; }
448 
449  void Load(PvlObject &p);
450 
451  void Add(ControlMeasure *measure);
452  int Delete(ControlMeasure *measure);
453  int Delete(QString serialNumber);
454  int Delete(int index);
456 
457  const ControlMeasure *GetMeasure(QString serialNumber) const;
458  ControlMeasure *GetMeasure(QString serialNumber);
459 
460  const ControlMeasure *GetMeasure(int index) const;
461  ControlMeasure *GetMeasure(int index);
462 
463  const ControlMeasure *GetRefMeasure() const;
465 
466  Status SetChooserName(QString name);
467  Status SetDateTime(QString newDateTime);
469  Status SetId(QString id);
471  Status SetRefMeasure(int index);
472  Status SetRefMeasure(QString sn);
473  Status SetRejected(bool rejected);
474  Status SetIgnored(bool newIgnoreStatus);
476  Status SetType(PointType newType);
477 
478  Status SetAprioriRadiusSource(RadiusSource::Source source);
479  Status SetAprioriRadiusSourceFile(QString sourceFile);
481  Status SetAprioriSurfacePointSource(SurfacePointSource::Source source);
482  Status SetAprioriSurfacePointSourceFile(QString sourceFile);
483 
484 // Status UpdateSphericalPointCoordinates(const Latitude &lat, const Longitude &lon,
485 // const Distance &radius);
486 
490 
491  SurfacePoint GetAdjustedSurfacePoint() const;
493  QString GetChooserName() const;
494  QString GetDateTime() const;
495  bool IsEditLocked() const;
496  bool IsRejected() const;
497  QString GetId() const;
498  bool IsIgnored() const;
499  bool IsValid() const;
500  bool IsInvalid() const;
501  bool IsFixed() const;
502 
503  bool HasAprioriCoordinates();
504  bool IsConstrained();
505  bool IsLatitudeConstrained();
506  bool IsLongitudeConstrained();
507  bool IsRadiusConstrained();
508  int NumberOfConstrainedCoordinates();
509 
510  static QString PointTypeToString(PointType type);
511  static PointType StringToPointType(QString pointTypeString);
512 
513  QString GetPointTypeString() const;
514  PointType GetType() const;
515 
516  static QString RadiusSourceToString(RadiusSource::Source source);
517  static RadiusSource::Source StringToRadiusSource(QString str);
518  QString GetRadiusSourceString() const;
519  static QString SurfacePointSourceToString(SurfacePointSource::Source source);
520  static SurfacePointSource::Source StringToSurfacePointSource(QString str);
521  QString GetSurfacePointSourceString() const;
522 
523  SurfacePoint GetAprioriSurfacePoint() const;
524  RadiusSource::Source GetAprioriRadiusSource() const;
525  QString GetAprioriRadiusSourceFile() const;
526  SurfacePointSource::Source GetAprioriSurfacePointSource() const;
527  QString GetAprioriSurfacePointSourceFile() const;
528 
529  int GetNumMeasures() const;
530  int GetNumValidMeasures() const;
531  int GetNumLockedMeasures() const;
532  bool HasSerialNumber(QString serialNumber) const;
533  int IndexOf(ControlMeasure *, bool throws = true) const;
534  int IndexOf(QString sn, bool throws = true) const;
535  int IndexOfRefMeasure() const;
536  bool IsReferenceExplicit() const;
537  QString GetReferenceSN() const;
538 
539  Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const;
540  Statistics GetStatistic(long dataType) const;
541 
542  QList< ControlMeasure * > getMeasures(bool excludeIgnored = false) const;
544 
545  const ControlMeasure *operator[](QString serialNumber) const;
546  ControlMeasure *operator[](QString serialNumber);
547 
548  const ControlMeasure *operator[](int index) const;
549  ControlMeasure *operator[](int index);
550 
551  bool operator!=(const ControlPoint &pPoint) const;
552  bool operator==(const ControlPoint &pPoint) const;
553  const ControlPoint &operator=(const ControlPoint &pPoint);
554 
555  // The next 7 methods are specifically to support BundleAdjust
557  void SetNumberOfRejectedMeasures(int numRejected);
558  int GetNumberOfRejectedMeasures() const;
559  double GetSampleResidualRms() const;
560  double GetLineResidualRms() const;
561  double GetResidualRms() const;
562  void ClearJigsawRejected();
563 
564  ControlPointFileEntryV0002 ToFileEntry() const;
565 
566  private:
567  void SetExplicitReference(ControlMeasure *measure);
568  void ValidateMeasure(QString serialNumber) const;
569  void AddMeasure(ControlMeasure *measure);
570  void PointModified();
571 
572 
573  private:
575 
578 
579  QStringList *cubeSerials;
580 
581  ControlMeasure *referenceMeasure;
582 
588  QString id;
589 
598  QString chooserName;
599 
604  QString dateTime;
605 
611 
617  bool invalid;
618 
623  bool editLock;
624 
630 
635  std::bitset<6> constraintStatus;
636 
644 
649  bool ignore;
650 
652  SurfacePointSource::Source aprioriSurfacePointSource;
653 
656 
661  RadiusSource::Source aprioriRadiusSource;
662 
667 
677 
683 
690  };
691 }
692 
693 #endif
This class defines a body-fixed surface point.
Definition: SurfacePoint.h:86
double GetSampleResidualRms() const
Get rms of sample residuals.
Status SetAprioriSurfacePointSource(SurfacePointSource::Source source)
This updates the source of the surface point.
PointType GetType() const
void ZeroNumberOfRejectedMeasures()
Initialize the number of rejected measures to 0.
bool editLock
This stores the edit lock state.
Definition: ControlPoint.h:623
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.
SurfacePoint aprioriSurfacePoint
The apriori surface point.
Definition: ControlPoint.h:676
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
Definition: ControlPoint.h:361
A Fixed point is a Control Point whose lat/lon is well established and should not be changed...
Definition: ControlPoint.h:356
Status ComputeApriori()
This method computes the apriori lat/lon for a point.
QString id
This is the control point ID.
Definition: ControlPoint.h:588
Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const
This function will call a given method on every control measure that this point has.
Status SetAprioriRadiusSourceFile(QString sourceFile)
This updates the filename of the DEM that the apriori radius came from.
Status SetIgnored(bool newIgnoreStatus)
Set whether to ignore or use control point.
void ClearJigsawRejected()
Set jigsaw rejected flag for all measures to false and set the jigsaw rejected flag for the point its...
bool jigsawRejected
This stores the jigsaw rejected state.
Definition: ControlPoint.h:629
QString GetPointTypeString() const
Obtain a string representation of the PointType.
PointType
These are the valid &#39;types&#39; of point.
Definition: ControlPoint.h:349
Status ComputeResiduals_Millimeters()
This method computes the residuals for a point.
int GetNumValidMeasures() const
const ControlMeasure * operator[](QString serialNumber) const
Same as GetMeasure (provided for convenience)
ControlNet * parentNetwork
List of Control Measures.
Definition: ControlPoint.h:574
QString dateTime
This is the last modified date and time.
Definition: ControlPoint.h:604
Status SetChooserName(QString name)
Set the point&#39;s chooser name.
Status SetEditLock(bool editLock)
Set the EditLock state.
ControlPoint()
Construct a control point.
const ControlMeasure * GetRefMeasure() const
Get the reference control measure.
Distance measurement, usually in meters.
Definition: Distance.h:47
ConstraintStatus
This is a convenience member for checking number of constrained coordinates in the SurfacePoint...
Definition: ControlPoint.h:400
QString GetReferenceSN() const
Status SetAdjustedSurfacePoint(SurfacePoint newSurfacePoint)
Set or update the surface point relating to this control point.
A Free point is a Control Point that identifies common measurements between two or more cubes...
Definition: ControlPoint.h:369
static QString SurfacePointSourceToString(SurfacePointSource::Source source)
Obtain a string representation of a given SurfacePointSource.
bool HasSerialNumber(QString serialNumber) const
Return true if given serial number exists in point.
SurfacePoint adjustedSurfacePoint
This is the calculated, or aposterori, surface point.
Definition: ControlPoint.h:682
static QString RadiusSourceToString(RadiusSource::Source source)
Obtain a string representation of a given RadiusSource.
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:109
Status SetAprioriSurfacePointSourceFile(QString sourceFile)
This updates the filename of where the apriori surface point came from.
QString GetRadiusSourceString() const
Obtain a string representation of the RadiusSource.
a control network
Definition: ControlNet.h:207
QString GetId() const
Return the Id of the control point.
static RadiusSource::Source StringToRadiusSource(QString str)
Obtain a RadiusSource::Source from a string.
Status SetDateTime(QString newDateTime)
Set the point&#39;s last modified time.
Status SetRefMeasure(ControlMeasure *cm)
Set the point&#39;s reference measure.
Status SetAprioriSurfacePoint(SurfacePoint aprioriSP)
This updates the apriori surface point.
SurfacePoint GetBestSurfacePoint() const
Returns the adjusted surface point if it exists, otherwise returns the a priori surface point...
This is returned when an operation cannot be performed due to a problem such as the point is ignored ...
Definition: ControlPoint.h:384
A single control point.
Definition: ControlPoint.h:339
bool referenceExplicitlySet
This indicates if a program has explicitely set the reference in this point or the implicit reference...
Definition: ControlPoint.h:643
int IndexOf(ControlMeasure *, bool throws=true) const
const ControlPoint & operator=(const ControlPoint &pPoint)
bool IsReferenceExplicit() const
bool ignore
True if we should preserve but ignore the entire control point and its measures.
Definition: ControlPoint.h:649
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:617
~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:610
Status SetId(QString id)
Sets the Id of the control point.
static SurfacePointSource::Source StringToSurfacePointSource(QString str)
Obtain a SurfacePoint::Source from a string.
void ValidateMeasure(QString serialNumber) const
Throws an exception if none of the point&#39;s measures have the given serial number. ...
Status
This is a return status for many of the mutating (setter) method calls.
Definition: ControlPoint.h:378
SurfacePointSource::Source aprioriSurfacePointSource
Where the apriori surface point originated from.
Definition: ControlPoint.h:652
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:689
QString chooserName
This is the user name of the person who last modified this control point.
Definition: ControlPoint.h:598
double GetResidualRms() const
Get rms of residuals.
QString aprioriRadiusSourceFile
The name of the file that derives the apriori surface point&#39;s radius.
Definition: ControlPoint.h:666
bool operator==(const ControlPoint &pPoint) const
Compare two Control Points for equality.
QString aprioriSurfacePointSourceFile
FileName where the apriori surface point originated from.
Definition: ControlPoint.h:655
int GetNumberOfRejectedMeasures() const
Get the number of rejected measures on the control point.
QList< ControlMeasure * > getMeasures(bool excludeIgnored=false) const
bool operator!=(const ControlPoint &pPoint) const
Compare two Control Points for inequality.
a control measurement
Status ResetApriori()
Reset all the Apriori info to defaults.
int GetNumLockedMeasures() const
Returns the number of locked control measures.
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.
QString GetSurfacePointSourceString() const
Obtain a string representation of the SurfacePointSource.
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube&#39;s serial number.
QList< QString > getCubeSerialNumbers() const
static QString PointTypeToString(PointType type)
Obtain a string representation of a given PointType.
int IndexOfRefMeasure() const
std::bitset< 6 > constraintStatus
This stores the constraint status of the a priori SurfacePoint.
Definition: ControlPoint.h:635
Status SetAprioriRadiusSource(RadiusSource::Source source)
This updates the source of the radius of the apriori surface point.
Status ComputeResiduals()
This method computes the BundleAdjust residuals for a point.
double GetLineResidualRms() const
Get rms of line residuals.
This is returned when the operation successfully took effect.
Definition: ControlPoint.h:388
This is the status of constrained coordinates in the SurfacePoint.
Definition: ControlPoint.h:407
static PointType StringToPointType(QString pointTypeString)
Obtain a PointType given a string representation of it.
This is returned when the operation requires Edit Lock to be false but it is currently true...
Definition: ControlPoint.h:393
RadiusSource::Source aprioriRadiusSource
Where the apriori surface point&#39;s radius originated from, most commonly used by jigsaw.
Definition: ControlPoint.h:661

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:16:40