Isis Developer Reference
ControlPoint.h
Go to the documentation of this file.
1#ifndef ControlPoint_h
2#define ControlPoint_h
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <bitset>
13
14#include <QObject>
15#include <QString>
16
17#include "ControlMeasure.h"
18#include "SurfacePoint.h"
19
20template< typename A, typename B > class QHash;
21
22class QStringList;
23
24namespace Isis {
25 class ControlNet;
26 class ControlPointFileEntryV0002;
27 class Latitude;
28 class Longitude;
29 class PBControlNet_PBControlPoint;
30 class PBControlNetLogData_Point;
31 class PvlObject;
32 class Statistics;
33
356 class ControlPoint : public QObject {
357
358 Q_OBJECT
359
360 friend class ControlNet;
361 public:
373 Fixed = 0,
386 Free = 2
387 };
388 static const int PointTypeCount = 3;
389
412
422
438
439 // This stuff input to jigsaw
440 // How did apriori source get computed??
451
462
463 ControlPoint();
464 ControlPoint(const ControlPoint &);
465 ControlPoint(const QString &id);
466 virtual ~ControlPoint();
467
468 ControlNet *Parent() { return parentNetwork; }
469
470 void Load(PvlObject &p);
471
472 void Add(ControlMeasure *measure);
473 int Delete(ControlMeasure *measure);
474 int Delete(QString serialNumber);
475 int Delete(int index);
477
478 const ControlMeasure *GetMeasure(QString serialNumber) const;
479 ControlMeasure *GetMeasure(QString serialNumber);
480
481 const ControlMeasure *GetMeasure(int index) const;
482 ControlMeasure *GetMeasure(int index);
483
484 bool HasRefMeasure() const;
485 const ControlMeasure *GetRefMeasure() const;
487
488 Status SetChooserName(QString name);
489 Status SetDateTime(QString newDateTime);
490 Status SetEditLock(bool editLock);
491 Status SetId(QString id);
493 Status SetRefMeasure(int index);
494 Status SetRefMeasure(QString sn);
495 Status SetRejected(bool rejected);
496 Status SetIgnored(bool newIgnoreStatus);
498 Status SetType(PointType newType);
499
501 Status SetAprioriRadiusSourceFile(QString sourceFile);
504 Status SetAprioriSurfacePointSourceFile(QString sourceFile);
505
506// Status UpdateSphericalPointCoordinates(const Latitude &lat, const Longitude &lon,
507// const Distance &radius);
508
512
514
516 QString GetChooserName() const;
517 QString GetDateTime() const;
518 bool IsEditLocked() const;
519 bool IsRejected() const;
520 QString GetId() const;
521 bool IsIgnored() const;
522 bool IsValid() const;
523 // Can we get rid of this? It doesn't appear to be used anywhere. *** ToDo ***
524 bool IsInvalid() const;
525 bool IsFree() const;
526 bool IsFixed() const;
528
529 bool IsConstrained();
530 bool IsCoord1Constrained();
531 bool IsCoord2Constrained();
532 bool IsCoord3Constrained();
534
535 static QString PointTypeToString(PointType type);
536 static PointType StringToPointType(QString pointTypeString);
537
538 QString GetPointTypeString() const;
539 PointType GetType() const;
540
541 static QString RadiusSourceToString(RadiusSource::Source source);
542 static RadiusSource::Source StringToRadiusSource(QString str);
543 QString GetRadiusSourceString() const;
546 QString GetSurfacePointSourceString() const;
548
550 bool HasAprioriRadiusSourceFile() const;
551 QString GetAprioriRadiusSourceFile() const;
554 QString GetAprioriSurfacePointSourceFile() const;
555
556 int GetNumMeasures() const;
557 int GetNumValidMeasures() const;
558 int GetNumLockedMeasures() const;
559 bool HasSerialNumber(QString serialNumber) const;
560 bool HasChooserName() const;
561 bool HasDateTime() const;
562 int IndexOf(ControlMeasure *, bool throws = true) const;
563 int IndexOf(QString sn, bool throws = true) const;
564 int IndexOfRefMeasure() const;
565 bool IsReferenceExplicit() const;
566 QString GetReferenceSN() const;
567 void emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType modType, QVariant oldValue, QVariant newValue);
568
569
570
571 Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const;
572 Statistics GetStatistic(long dataType) const;
573
574 QList< ControlMeasure * > getMeasures(bool excludeIgnored = false) const;
576
577 const ControlMeasure *operator[](QString serialNumber) const;
578 ControlMeasure *operator[](QString serialNumber);
579
580 const ControlMeasure *operator[](int index) const;
581 ControlMeasure *operator[](int index);
582
583 bool operator!=(const ControlPoint &pPoint) const;
584 bool operator==(const ControlPoint &pPoint) const;
585 const ControlPoint &operator=(const ControlPoint &pPoint);
586
587 // The next 7 methods are specifically to support BundleAdjust
589 void SetNumberOfRejectedMeasures(int numRejected);
590 int GetNumberOfRejectedMeasures() const;
591 double GetSampleResidualRms() const;
592 double GetLineResidualRms() const;
593 double GetResidualRms() const;
594 void ClearJigsawRejected();
595
596 protected:
597 void PointModified();
599 QHash< QString, ControlMeasure * > * measures;
600
601 private:
602 void SetExplicitReference(ControlMeasure *measure);
603 void ValidateMeasure(QString serialNumber) const;
604 void AddMeasure(ControlMeasure *measure);
605
606
607 ControlNet *parentNetwork;
608
609 QStringList *cubeSerials;
610
611 ControlMeasure *referenceMeasure;
612
618 QString id;
619
628 QString chooserName;
629
634 QString dateTime;
635
640 PointType type;
641
647 bool invalid;
648
653 bool editLock;
654
659 bool jigsawRejected;
660
665 std::bitset<3> constraintStatus;
666
673 bool referenceExplicitlySet;
674
679 bool ignore;
680
682 SurfacePointSource::Source aprioriSurfacePointSource;
683
685 QString aprioriSurfacePointSourceFile;
686
691 RadiusSource::Source aprioriRadiusSource;
692
696 QString aprioriRadiusSourceFile;
697
706 SurfacePoint aprioriSurfacePoint;
707
712 SurfacePoint adjustedSurfacePoint;
713
719 int numberOfRejectedMeasures;
720 };
721}
722
723#endif
a control measurement
Definition ControlMeasure.h:175
ModType
Control Measure Modification Types.
Definition ControlMeasure.h:232
a control network
Definition ControlNet.h:258
A single control point.
Definition ControlPoint.h:356
const ControlMeasure * GetRefMeasure() const
Get the reference control measure.
Definition ControlPoint.cpp:454
ControlNet * Parent()
Definition ControlPoint.h:468
static QString RadiusSourceToString(RadiusSource::Source source)
Obtain a string representation of a given RadiusSource.
Definition ControlPoint.cpp:1409
static SurfacePointSource::Source StringToSurfacePointSource(QString str)
Obtain a SurfacePoint::Source from a string.
Definition ControlPoint.cpp:1526
Status
This is a return status for many of the mutating (setter) method calls.
Definition ControlPoint.h:395
@ PointLocked
This is returned when the operation requires Edit Lock to be false but it is currently true.
Definition ControlPoint.h:410
@ Success
This is returned when the operation successfully took effect.
Definition ControlPoint.h:405
@ Failure
This is returned when an operation cannot be performed due to a problem such as the point is ignored ...
Definition ControlPoint.h:401
int NumberOfConstrainedCoordinates()
Return bool indicating if point is Constrained or not.
Definition ControlPoint.cpp:1657
bool IsEditLocked() const
Definition ControlPoint.cpp:1268
Status SetEditLock(bool editLock)
Set the EditLock state.
Definition ControlPoint.cpp:519
const ControlPoint & operator=(const ControlPoint &pPoint)
Definition ControlPoint.cpp:1999
bool IsFree() const
Return bool indicating if point is Free or not.
Definition ControlPoint.cpp:1590
static RadiusSource::Source StringToRadiusSource(QString str)
Obtain a RadiusSource::Source from a string.
Definition ControlPoint.cpp:1444
QString GetDateTime() const
Definition ControlPoint.cpp:1258
ConstraintStatus
This is a convenience member for checking number of constrained coordinates in the SurfacePoint.
Definition ControlPoint.h:417
@ Coord1Constrained
Definition ControlPoint.h:418
@ Coord3Constrained
Definition ControlPoint.h:420
@ Coord2Constrained
Definition ControlPoint.h:419
bool IsRejected() const
Definition ControlPoint.cpp:1273
bool operator==(const ControlPoint &pPoint) const
Compare two Control Points for equality.
Definition ControlPoint.cpp:1958
void ClearJigsawRejected()
Set jigsaw rejected flag for all measures to false and set the jigsaw rejected flag for the point its...
Definition ControlPoint.cpp:2184
Status SetAprioriSurfacePoint(SurfacePoint aprioriSP)
This updates the apriori surface point.
Definition ControlPoint.cpp:775
QString GetAprioriRadiusSourceFile() const
Definition ControlPoint.cpp:1672
ModType
Control Point Modification Types.
Definition ControlPoint.h:433
@ EditLockModified
Definition ControlPoint.h:434
@ TypeModified
Definition ControlPoint.h:436
@ IgnoredModified
Definition ControlPoint.h:435
Status SetId(QString id)
Sets the Id of the control point.
Definition ControlPoint.cpp:549
Status SetAprioriRadiusSource(RadiusSource::Source source)
This updates the source of the radius of the apriori surface point.
Definition ControlPoint.cpp:732
double GetResidualRms() const
Get rms of residuals.
Definition ControlPoint.cpp:2154
bool IsReferenceExplicit() const
Definition ControlPoint.cpp:1751
Status ComputeResiduals_Millimeters()
This method computes the residuals for a point.
Definition ControlPoint.cpp:1188
RadiusSource::Source GetAprioriRadiusSource() const
Definition ControlPoint.cpp:1567
virtual ~ControlPoint()
This destroys the current instance and cleans up any and all allocated memory.
Definition ControlPoint.cpp:146
bool HasDateTime() const
Returns true if the datetime is not empty.
Definition ControlPoint.cpp:1253
Status SetChooserName(QString name)
Set the point's chooser name.
Definition ControlPoint.cpp:484
SurfacePoint GetAprioriSurfacePoint() const
Definition ControlPoint.cpp:1562
bool HasRefMeasure() const
Checks to see if a reference measure is set.
Definition ControlPoint.cpp:444
int GetNumValidMeasures() const
Definition ControlPoint.cpp:1707
bool IsInvalid() const
Definition ControlPoint.cpp:1317
QList< QString > getCubeSerialNumbers() const
Definition ControlPoint.cpp:1883
int GetNumLockedMeasures() const
Returns the number of locked control measures.
Definition ControlPoint.cpp:1724
int GetNumMeasures() const
Definition ControlPoint.cpp:1698
int Delete(ControlMeasure *measure)
Remove a measurement from the control point, deleting reference measure is allowed.
Definition ControlPoint.cpp:352
Status SetRejected(bool rejected)
Set the jigsawRejected state.
Definition ControlPoint.cpp:536
void Add(ControlMeasure *measure)
Add a measurement to the control point, taking ownership of the measure in the process.
Definition ControlPoint.cpp:222
PointType GetType() const
Definition ControlPoint.cpp:1397
QString GetChooserName() const
Definition ControlPoint.cpp:1238
Status SetAdjustedSurfacePoint(SurfacePoint newSurfacePoint)
Set or update the surface point relating to this control point.
Definition ControlPoint.cpp:688
PointType
These are the valid 'types' of point.
Definition ControlPoint.h:366
@ Constrained
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
Definition ControlPoint.h:378
@ Free
A Free point is a Control Point that identifies common measurements between two or more cubes.
Definition ControlPoint.h:386
@ Fixed
A Fixed point is a Control Point whose lat/lon is well established and should not be changed.
Definition ControlPoint.h:373
Status SetType(PointType newType)
Updates the control point's type.
Definition ControlPoint.cpp:705
Status SetAprioriSurfacePointSourceFile(QString sourceFile)
This updates the filename of where the apriori surface point came from.
Definition ControlPoint.cpp:835
int IndexOfRefMeasure() const
Definition ControlPoint.cpp:1812
Status SetAprioriSurfacePointSource(SurfacePointSource::Source source)
This updates the source of the surface point.
Definition ControlPoint.cpp:817
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
Definition ControlPoint.cpp:413
double GetLineResidualRms() const
Get rms of line residuals.
Definition ControlPoint.cpp:2123
bool IsCoord2Constrained()
Return bool indicating if 2nd coordinate is Constrained or not.
Definition ControlPoint.cpp:1637
bool HasAprioriRadiusSourceFile() const
Checks to see if the radius source file has been set.
Definition ControlPoint.cpp:1667
bool IsCoord1Constrained()
Return bool indicating if 1st coordinate is Constrained or not.
Definition ControlPoint.cpp:1626
QString GetPointTypeString() const
Obtain a string representation of the PointType.
Definition ControlPoint.cpp:1388
double GetSampleResidualRms() const
Get rms of sample residuals.
Definition ControlPoint.cpp:2092
bool HasChooserName() const
Returns true if the choosername is not empty.
Definition ControlPoint.cpp:1248
Status SetIgnored(bool newIgnoreStatus)
Set whether to ignore or use control point.
Definition ControlPoint.cpp:649
Status SetDateTime(QString newDateTime)
Set the point's last modified time.
Definition ControlPoint.cpp:501
bool IsCoord3Constrained()
Return bool indicating if 3rd coordinate is Constrained or not.
Definition ControlPoint.cpp:1647
ControlPoint()
Construct a control point.
Definition ControlPoint.cpp:47
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:1836
SurfacePoint GetAdjustedSurfacePoint() const
Definition ControlPoint.cpp:1278
bool IsConstrained()
Return bool indicating if point is Constrained or not.
Definition ControlPoint.cpp:1610
void PointModified()
List of Control Measures.
Definition ControlPoint.cpp:2052
bool IsIgnored() const
Definition ControlPoint.cpp:1307
SurfacePointSource::Source GetAprioriSurfacePointSource() const
Definition ControlPoint.cpp:1678
bool HasAprioriCoordinates()
Definition ControlPoint.cpp:1573
static QString PointTypeToString(PointType type)
Obtain a string representation of a given PointType.
Definition ControlPoint.cpp:1329
static PointType StringToPointType(QString pointTypeString)
Obtain a PointType given a string representation of it.
Definition ControlPoint.cpp:1355
bool operator!=(const ControlPoint &pPoint) const
Compare two Control Points for inequality.
Definition ControlPoint.cpp:1945
Status ComputeResiduals()
This method computes the BundleAdjust residuals for a point.
Definition ControlPoint.cpp:1024
QString GetId() const
Return the Id of the control point.
Definition ControlPoint.cpp:1302
static QString SurfacePointSourceToString(SurfacePointSource::Source source)
Obtain a string representation of a given SurfacePointSource.
Definition ControlPoint.cpp:1488
QList< ControlMeasure * > getMeasures(bool excludeIgnored=false) const
Definition ControlPoint.cpp:1867
Status ResetApriori()
Reset all the Apriori info to defaults.
Definition ControlPoint.cpp:378
void ZeroNumberOfRejectedMeasures()
Initialize the number of rejected measures to 0.
Definition ControlPoint.cpp:2058
int GetNumberOfRejectedMeasures() const
Get the number of rejected measures on the control point.
Definition ControlPoint.cpp:2082
bool HasSerialNumber(QString serialNumber) const
Return true if given serial number exists in point.
Definition ControlPoint.cpp:1742
int IndexOf(ControlMeasure *, bool throws=true) const
Definition ControlPoint.cpp:1778
void SetNumberOfRejectedMeasures(int numRejected)
Set (update) the number of rejected measures for the control point.
Definition ControlPoint.cpp:2071
bool HasAprioriSurfacePointSourceFile() const
Checks to see if the surface point source file has been set.
Definition ControlPoint.cpp:1688
void Load(PvlObject &p)
Loads the PvlObject into a ControlPoint.
Definition ControlPoint.cpp:211
const ControlMeasure * operator[](QString serialNumber) const
Same as GetMeasure (provided for convenience)
Definition ControlPoint.cpp:1895
QHash< QString, ControlMeasure * > * measures
Definition ControlPoint.h:599
SurfacePoint GetBestSurfacePoint() const
Returns the adjusted surface point if it exists, otherwise returns the a priori surface point.
Definition ControlPoint.cpp:1287
Status SetRefMeasure(ControlMeasure *cm)
Set the point's reference measure.
Definition ControlPoint.cpp:567
Status ComputeApriori()
Computes a priori lat/lon/radius point coordinates by determining the average lat/lon/radius of all m...
Definition ControlPoint.cpp:895
bool IsValid() const
Definition ControlPoint.cpp:1312
bool IsFixed() const
Return bool indicating if point is Fixed or not.
Definition ControlPoint.cpp:1600
Status SetAprioriRadiusSourceFile(QString sourceFile)
This updates the filename of the DEM that the apriori radius came from.
Definition ControlPoint.cpp:751
QString GetAprioriSurfacePointSourceFile() const
Definition ControlPoint.cpp:1693
static const int PointTypeCount
Definition ControlPoint.h:388
QString GetRadiusSourceString() const
Obtain a string representation of the RadiusSource.
Definition ControlPoint.cpp:1476
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:339
QString GetReferenceSN() const
Definition ControlPoint.cpp:1759
QString GetSurfacePointSourceString() const
Obtain a string representation of the SurfacePointSource.
Definition ControlPoint.cpp:1557
Contains Pvl Groups and Pvl Objects.
Definition PvlObject.h:61
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:94
This class defines a body-fixed surface point.
Definition SurfacePoint.h:132
This is free and unencumbered software released into the public domain.
Definition ControlNet.h:32
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Definition ControlPoint.h:452
Source
Definition ControlPoint.h:453
@ None
Definition ControlPoint.h:454
@ User
Definition ControlPoint.h:455
@ AverageOfMeasures
Definition ControlPoint.h:456
@ DEM
Definition ControlPoint.h:458
@ Ellipsoid
Definition ControlPoint.h:457
@ BundleSolution
Definition ControlPoint.h:459
Definition ControlPoint.h:441
Source
Definition ControlPoint.h:442
@ None
Definition ControlPoint.h:443
@ AverageOfMeasures
Definition ControlPoint.h:445
@ Reference
Definition ControlPoint.h:446
@ BundleSolution
Definition ControlPoint.h:448
@ User
Definition ControlPoint.h:444
@ Basemap
Definition ControlPoint.h:447