Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis 3 Programmer Reference
ControlPoint.h
1#ifndef ControlPoint_h
2#define ControlPoint_h
3
9
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
22namespace Isis {
23 class ControlNet;
24 class ControlPointFileEntryV0002;
25 class Latitude;
26 class Longitude;
27 class PBControlNet_PBControlPoint;
28 class PBControlNetLogData_Point;
29 class PvlObject;
30 class Statistics;
31
354 class ControlPoint : public QObject {
355
356 Q_OBJECT
357
358 friend class ControlNet;
359 public:
371 Fixed = 0,
385 };
386 static const int PointTypeCount = 3;
387
410
416 Coord1Constrained = 0,
417 Coord2Constrained = 1,
418 Coord3Constrained = 2
419 };
420
431 enum ModType {
432 EditLockModified,
433 IgnoredModified,
434 TypeModified
435 };
436
437 // This stuff input to jigsaw
438 // How did apriori source get computed??
440 enum Source {
441 None,
442 User,
443 AverageOfMeasures,
444 Reference,
445 Basemap,
446 BundleSolution
447 };
448 };
449
451 enum Source {
452 None,
453 User,
454 AverageOfMeasures,
455 Ellipsoid,
456 DEM,
457 BundleSolution
458 };
459 };
460
461 ControlPoint();
462 ControlPoint(const ControlPoint &);
463 ControlPoint(const QString &id);
464 virtual ~ControlPoint();
465
466 ControlNet *Parent() { return parentNetwork; }
467
468 void Load(PvlObject &p);
469
470 void Add(ControlMeasure *measure);
471 int Delete(ControlMeasure *measure);
472 int Delete(QString serialNumber);
473 int Delete(int index);
475
476 const ControlMeasure *GetMeasure(QString serialNumber) const;
477 ControlMeasure *GetMeasure(QString serialNumber);
478
479 const ControlMeasure *GetMeasure(int index) const;
480 ControlMeasure *GetMeasure(int index);
481
482 bool HasRefMeasure() const;
483 const ControlMeasure *GetRefMeasure() const;
485
486 Status SetChooserName(QString name);
487 Status SetDateTime(QString newDateTime);
489 Status SetId(QString id);
491 Status SetRefMeasure(int index);
492 Status SetRefMeasure(QString sn);
493 Status SetRejected(bool rejected);
494 Status SetIgnored(bool newIgnoreStatus);
496 Status SetType(PointType newType);
497
498 Status SetAprioriRadiusSource(RadiusSource::Source source);
499 Status SetAprioriRadiusSourceFile(QString sourceFile);
501 Status SetAprioriSurfacePointSource(SurfacePointSource::Source source);
502 Status SetAprioriSurfacePointSourceFile(QString sourceFile);
503
504// Status UpdateSphericalPointCoordinates(const Latitude &lat, const Longitude &lon,
505// const Distance &radius);
506
510
511 SurfacePoint GetAdjustedSurfacePoint() const;
512
514 QString GetChooserName() const;
515 QString GetDateTime() const;
516 bool IsEditLocked() const;
517 bool IsRejected() const;
518 QString GetId() const;
519 bool IsIgnored() const;
520 bool IsValid() const;
521 // Can we get rid of this? It doesn't appear to be used anywhere. *** ToDo ***
522 bool IsInvalid() const;
523 bool IsFree() const;
524 bool IsFixed() const;
525 bool HasAprioriCoordinates();
526
527 bool IsConstrained();
528 bool IsCoord1Constrained();
529 bool IsCoord2Constrained();
530 bool IsCoord3Constrained();
532
533 static QString PointTypeToString(PointType type);
534 static PointType StringToPointType(QString pointTypeString);
535
536 QString GetPointTypeString() const;
537 PointType GetType() const;
538
539 static QString RadiusSourceToString(RadiusSource::Source source);
540 static RadiusSource::Source StringToRadiusSource(QString str);
541 QString GetRadiusSourceString() const;
542 static QString SurfacePointSourceToString(SurfacePointSource::Source source);
543 static SurfacePointSource::Source StringToSurfacePointSource(QString str);
544 QString GetSurfacePointSourceString() const;
545 SurfacePoint GetAprioriSurfacePoint() const;
546
547 RadiusSource::Source GetAprioriRadiusSource() const;
548 bool HasAprioriRadiusSourceFile() const;
549 QString GetAprioriRadiusSourceFile() const;
550 SurfacePointSource::Source GetAprioriSurfacePointSource() const;
552 QString GetAprioriSurfacePointSourceFile() const;
553
554 int GetNumMeasures() const;
555 int GetNumValidMeasures() const;
556 int GetNumLockedMeasures() const;
557 bool HasSerialNumber(QString serialNumber) const;
558 bool HasChooserName() const;
559 bool HasDateTime() const;
560 int IndexOf(ControlMeasure *, bool throws = true) const;
561 int IndexOf(QString sn, bool throws = true) const;
562 int IndexOfRefMeasure() const;
563 bool IsReferenceExplicit() const;
564 QString GetReferenceSN() const;
565 void emitMeasureModified(ControlMeasure *measure, ControlMeasure::ModType modType, QVariant oldValue, QVariant newValue);
566
567
568
569 Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const;
570 Statistics GetStatistic(long dataType) const;
571
572 QList< ControlMeasure * > getMeasures(bool excludeIgnored = false) const;
574
575 const ControlMeasure *operator[](QString serialNumber) const;
576 ControlMeasure *operator[](QString serialNumber);
577
578 const ControlMeasure *operator[](int index) const;
579 ControlMeasure *operator[](int index);
580
581 bool operator!=(const ControlPoint &pPoint) const;
582 bool operator==(const ControlPoint &pPoint) const;
583 const ControlPoint &operator=(const ControlPoint &pPoint);
584
585 // The next 7 methods are specifically to support BundleAdjust
587 void SetNumberOfRejectedMeasures(int numRejected);
588 int GetNumberOfRejectedMeasures() const;
589 double GetSampleResidualRms() const;
590 double GetLineResidualRms() const;
591 double GetResidualRms() const;
592 void ClearJigsawRejected();
593
594 protected:
595 void PointModified();
598
599 private:
601 void ValidateMeasure(QString serialNumber) const;
602 void AddMeasure(ControlMeasure *measure);
603
604
605 ControlNet *parentNetwork;
606
607 QStringList *cubeSerials;
608
609 ControlMeasure *referenceMeasure;
610
616 QString id;
617
626 QString chooserName;
627
632 QString dateTime;
633
639
646
652
658
663 std::bitset<3> constraintStatus;
664
672
677 bool ignore;
678
680 SurfacePointSource::Source aprioriSurfacePointSource;
681
684
689 RadiusSource::Source aprioriRadiusSource;
690
695
705
711
718 };
719}
720
721#endif
a control measurement
ModType
Control Measure Modification Types.
a control network
Definition ControlNet.h:257
A single control point.
const ControlMeasure * GetRefMeasure() const
Get the reference control measure.
static QString RadiusSourceToString(RadiusSource::Source source)
Obtain a string representation of a given RadiusSource.
static SurfacePointSource::Source StringToSurfacePointSource(QString str)
Obtain a SurfacePoint::Source from a string.
Status
This is a return status for many of the mutating (setter) method calls.
@ PointLocked
This is returned when the operation requires Edit Lock to be false but it is currently true.
@ Success
This is returned when the operation successfully took effect.
@ Failure
This is returned when an operation cannot be performed due to a problem such as the point is ignored ...
int NumberOfConstrainedCoordinates()
Return bool indicating if point is Constrained or not.
Status SetEditLock(bool editLock)
Set the EditLock state.
QString dateTime
This is the last modified date and time.
const ControlPoint & operator=(const ControlPoint &pPoint)
bool editLock
This stores the edit lock state.
bool IsFree() const
Return bool indicating if point is Free or not.
static RadiusSource::Source StringToRadiusSource(QString str)
Obtain a RadiusSource::Source from a string.
ConstraintStatus
This is a convenience member for checking number of constrained coordinates in the SurfacePoint.
bool invalid
If we forced a build that we would normally have thrown an exception for then this is set to true.
bool operator==(const ControlPoint &pPoint) const
Compare two Control Points for equality.
void ClearJigsawRejected()
Set jigsaw rejected flag for all measures to false and set the jigsaw rejected flag for the point its...
Status SetAprioriSurfacePoint(SurfacePoint aprioriSP)
This updates the apriori surface point.
QString id
This is the control point ID.
void ValidateMeasure(QString serialNumber) const
Throws an exception if none of the point's measures have the given serial number.
QString aprioriRadiusSourceFile
The name of the file that derives the apriori surface point's radius.
ModType
Control Point Modification Types.
Status SetId(QString id)
Sets the Id of the control point.
QString aprioriSurfacePointSourceFile
FileName where the apriori surface point originated from.
Status SetAprioriRadiusSource(RadiusSource::Source source)
This updates the source of the radius of the apriori surface point.
double GetResidualRms() const
Get rms of residuals.
SurfacePoint aprioriSurfacePoint
The apriori surface point.
bool jigsawRejected
This stores the jigsaw rejected state.
RadiusSource::Source aprioriRadiusSource
Where the apriori surface point's radius originated from, most commonly used by jigsaw.
bool IsReferenceExplicit() const
Status ComputeResiduals_Millimeters()
This method computes the residuals for a point.
virtual ~ControlPoint()
This destroys the current instance and cleans up any and all allocated memory.
bool HasDateTime() const
Returns true if the datetime is not empty.
Status SetChooserName(QString name)
Set the point's chooser name.
bool HasRefMeasure() const
Checks to see if a reference measure is set.
int GetNumValidMeasures() const
QList< QString > getCubeSerialNumbers() const
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.
Status SetRejected(bool rejected)
Set the jigsawRejected state.
SurfacePoint adjustedSurfacePoint
This is the calculated, or aposterori, surface point.
void Add(ControlMeasure *measure)
Add a measurement to the control point, taking ownership of the measure in the process.
PointType GetType() const
Status SetAdjustedSurfacePoint(SurfacePoint newSurfacePoint)
Set or update the surface point relating to this control point.
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.
PointType
These are the valid 'types' of point.
@ Constrained
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
@ Free
A Free point is a Control Point that identifies common measurements between two or more cubes.
@ Fixed
A Fixed point is a Control Point whose lat/lon is well established and should not be changed.
Status SetType(PointType newType)
Updates the control point's type.
Status SetAprioriSurfacePointSourceFile(QString sourceFile)
This updates the filename of where the apriori surface point came from.
int IndexOfRefMeasure() const
Status SetAprioriSurfacePointSource(SurfacePointSource::Source source)
This updates the source of the surface point.
const ControlMeasure * GetMeasure(QString serialNumber) const
Get a control measure based on its cube's serial number.
PointType type
What this control point is tying together.
bool ignore
True if we should preserve but ignore the entire control point and its measures.
double GetLineResidualRms() const
Get rms of line residuals.
bool IsCoord2Constrained()
Return bool indicating if 2nd coordinate is Constrained or not.
bool HasAprioriRadiusSourceFile() const
Checks to see if the radius source file has been set.
bool IsCoord1Constrained()
Return bool indicating if 1st coordinate is Constrained or not.
QString GetPointTypeString() const
Obtain a string representation of the PointType.
double GetSampleResidualRms() const
Get rms of sample residuals.
bool HasChooserName() const
Returns true if the choosername is not empty.
Status SetIgnored(bool newIgnoreStatus)
Set whether to ignore or use control point.
Status SetDateTime(QString newDateTime)
Set the point's last modified time.
bool IsCoord3Constrained()
Return bool indicating if 3rd coordinate is Constrained or not.
ControlPoint()
Construct a control point.
Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const
This function will call a given method on every control measure that this point has.
bool IsConstrained()
Return bool indicating if point is Constrained or not.
void PointModified()
List of Control Measures.
QString chooserName
This is the user name of the person who last modified this control point.
static QString PointTypeToString(PointType type)
Obtain a string representation of a given PointType.
void AddMeasure(ControlMeasure *measure)
Do the actual work of adding a measure to this point, without changing any extra data.
static PointType StringToPointType(QString pointTypeString)
Obtain a PointType given a string representation of it.
bool referenceExplicitlySet
This indicates if a program has explicitely set the reference in this point or the implicit reference...
bool operator!=(const ControlPoint &pPoint) const
Compare two Control Points for inequality.
Status ComputeResiduals()
This method computes the BundleAdjust residuals for a point.
QString GetId() const
Return the Id of the control point.
static QString SurfacePointSourceToString(SurfacePointSource::Source source)
Obtain a string representation of a given SurfacePointSource.
std::bitset< 3 > constraintStatus
This stores the constraint status of the a priori SurfacePoint.
QList< ControlMeasure * > getMeasures(bool excludeIgnored=false) const
Status ResetApriori()
Reset all the Apriori info to defaults.
void ZeroNumberOfRejectedMeasures()
Initialize the number of rejected measures to 0.
int GetNumberOfRejectedMeasures() const
Get the number of rejected measures on the control point.
bool HasSerialNumber(QString serialNumber) const
Return true if given serial number exists in point.
int IndexOf(ControlMeasure *, bool throws=true) const
void SetNumberOfRejectedMeasures(int numRejected)
Set (update) the number of rejected measures for the control point.
bool HasAprioriSurfacePointSourceFile() const
Checks to see if the surface point source file has been set.
void Load(PvlObject &p)
Loads the PvlObject into a ControlPoint.
const ControlMeasure * operator[](QString serialNumber) const
Same as GetMeasure (provided for convenience)
SurfacePoint GetBestSurfacePoint() const
Returns the adjusted surface point if it exists, otherwise returns the a priori surface point.
Status SetRefMeasure(ControlMeasure *cm)
Set the point's reference measure.
Status ComputeApriori()
Computes a priori lat/lon/radius point coordinates by determining the average lat/lon/radius of all m...
bool IsFixed() const
Return bool indicating if point is Fixed or not.
Status SetAprioriRadiusSourceFile(QString sourceFile)
This updates the filename of the DEM that the apriori radius came from.
SurfacePointSource::Source aprioriSurfacePointSource
Where the apriori surface point originated from.
QString GetRadiusSourceString() const
Obtain a string representation of the RadiusSource.
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...
QString GetReferenceSN() const
QString GetSurfacePointSourceString() const
Obtain a string representation of the SurfacePointSource.
This class is designed to encapsulate the concept of a Latitude.
Definition Latitude.h:51
This class is designed to encapsulate the concept of a Longitude.
Definition Longitude.h:40
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:93
This class defines a body-fixed surface point.
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.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16