9#include "ControlPoint.h"
11#include <boost/numeric/ublas/symmetric.hpp>
12#include <boost/numeric/ublas/io.hpp>
19#include "Application.h"
20#include "CameraDetectorMap.h"
21#include "CameraDistortionMap.h"
22#include "CameraFocalPlaneMap.h"
23#include "CameraGroundMap.h"
24#include "ControlMeasure.h"
25#include "ControlMeasureLogData.h"
26#include "ControlNet.h"
32#include "SerialNumberList.h"
33#include "SpecialPixel.h"
34#include "Statistics.h"
36using boost::numeric::ublas::symmetric_matrix;
37using boost::numeric::ublas::upper;
51 measures =
new QHash< QString, ControlMeasure * >;
63 referenceMeasure = NULL;
77 referenceMeasure = NULL;
82 measures =
new QHash< QString, ControlMeasure * >;
85 QListIterator<QString> i(*other.cubeSerials);
87 QString sn = i.next();
93 if (other.referenceMeasure == otherCm) {
124 parentNetwork = NULL;
126 referenceMeasure = NULL;
128 measures =
new QHash< QString, ControlMeasure * >;
147 if (measures != NULL) {
149 for (
int i = 0; i < keys.size(); i++) {
150 delete(*measures)[keys[i]];
151 (*measures)[keys[i]] = NULL;
163 referenceMeasure = NULL;
235 if (m->GetCubeSerialNumber() == measure->GetCubeSerialNumber()) {
236 QString msg =
"The SerialNumber is not unique. A measure with "
237 "serial number [" + measure->GetCubeSerialNumber() +
"] already "
238 "exists for ControlPoint [" +
GetId() +
"]";
243 if (!measures->size()) {
244 referenceMeasure = measure;
246 else if (referenceMeasure->IsIgnored() && !measure->IsIgnored() &&
251 referenceMeasure = measure;
255 QString newSerial = measure->GetCubeSerialNumber();
256 measures->insert(newSerial, measure);
257 cubeSerials->append(newSerial);
275 if (!measures->contains(serialNumber)) {
276 QString msg =
"No measure with serial number [" + serialNumber +
277 "] is owned by this point";
297 if (!IsIgnored() && !cm->IsIgnored()) {
302 if (cm->IsEditLocked()) {
303 return ControlMeasure::MeasureLocked;
307 measures->remove(serialNumber);
308 cubeSerials->removeAt(cubeSerials->indexOf(serialNumber));
311 if (cubeSerials->size()) {
312 if (referenceMeasure == cm) {
313 referenceMeasure = (*measures)[cubeSerials->at(0)];
318 referenceMeasure = NULL;
326 return ControlMeasure::Success;
353 return Delete(measure->GetCubeSerialNumber());
364 if (index < 0 || index >= cubeSerials->size()) {
365 QString msg =
"index [" + QString(index) +
"] out of bounds";
369 return Delete(cubeSerials->at(index));
379 if (IsEditLocked()) {
403 return (*measures)[serialNumber];
415 return measures->value(serialNumber);
420 if (index < 0 || index >= cubeSerials->size()) {
421 QString msg =
"Index [" +
toString(index) +
"] out of range";
430 if (index < 0 || index >= cubeSerials->size()) {
431 QString msg =
"Index [" +
toString(index) +
"] out of range";
445 return !(referenceMeasure == NULL);
456 QString msg =
"Control point [" +
GetId() +
"] has no reference measure!";
460 return referenceMeasure;
469 QString msg =
"Control point [" +
GetId() +
"] has no reference measure!";
473 return referenceMeasure;
587 if (index < 0 || index >= cubeSerials->size()) {
588 QString msg =
"Index [";
589 msg +=
toString(index) +
"] out of range";
608 if (!cubeSerials->contains(sn)) {
609 QString msg =
"Point [" +
id +
"] has no measure with serial number [" +
639 referenceMeasure = measure;
658 if (oldStatus !=
ignore) {
707 QString msg =
"Invalid Point Enumeration, [" + QString(
type) +
"], for "
708 "Control Point [" +
GetId() +
"]";
733 RadiusSource::Source source) {
752 QString sourceFile) {
788 if (aprioriSP.GetLatSigma().isValid())
790 if (aprioriSP.GetLonSigma().isValid())
792 if (aprioriSP.GetLocalRadiusSigma().isValid())
796 if (aprioriSP.GetXSigma().isValid())
798 if (aprioriSP.GetYSigma().isValid())
800 if (aprioriSP.GetZSigma().isValid())
818 SurfacePointSource::Source source) {
836 QString sourceFile) {
901 QString msg =
"In method ControlPoint::ComputeApriori(). ControlPoint [" +
GetId() +
"] is ";
902 msg +=
"fixed or constrained and requires a priori coordinates";
910 int goodMeasures = 0;
917 for (
int i = 0; i < cubeSerials->size(); i++) {
919 if (m->IsIgnored()) {
925 QString cubeSN = m->GetCubeSerialNumber();
926 QString msg =
"in method ControlPoint::ComputeApriori(). Camera has not been set in ";
927 msg +=
"measure for cube serial number [" + cubeSN +
"], Control Point id ";
928 msg +=
"[" +
GetId() +
"]. Camera must be set prior to calculating a priori coordinates";
932 bool setImageSuccess = cam->SetImage(m->GetSample(), m->GetLine());
935 m->SetFocalPlaneMeasured(m->GetSample(),
939 m->SetFocalPlaneMeasured(cam->DistortionMap()->UndistortedFocalPlaneX(),
940 cam->DistortionMap()->UndistortedFocalPlaneY());
946 if (setImageSuccess) {
952 r2B += pB[0]*pB[0] + pB[1]*pB[1] + pB[2]*pB[2];
967 if (goodMeasures == 0) {
968 QString msg =
"in method ControlPoint::ComputeApriori(). ControlPoint [" +
GetId() +
"] has ";
969 msg +=
"no measures which project to the body";
976 double avgX = xB / goodMeasures;
977 double avgY = yB / goodMeasures;
978 double avgZ = zB / goodMeasures;
979 double avgR2 = r2B / goodMeasures;
980 double scale = sqrt(avgR2/(avgX*avgX+avgY*avgY+avgZ*avgZ));
1032 QList<QString> keys = measures->keys();
1034 for (
int j = 0; j < keys.size(); j++) {
1036 if (m->IsIgnored()) {
1069 double sample = m->GetSample();
1070 double computedY = m->GetFocalPlaneComputedY();
1071 double computedX = m->GetFocalPlaneComputedX();
1075 if (computedY < 0) {
1076 adjLine = m->GetLine() - 1.;
1079 adjLine = m->GetLine() + 1.;
1082 cam->SetImage(sample, adjLine);
1086 cam->SetImage(sample, m->GetLine());
1093 cam->GroundMap()->GetXY(sp, &focalplaneX, &scalingY,
false);
1096 if (computedY < 0) {
1097 deltaLine = -computedY/scalingY;
1100 deltaLine = computedY/scalingY;
1105 if (cam->DistortionMap()->SetUndistortedFocalPlane(computedX,
1107 double focalPlaneX = cam->DistortionMap()->FocalPlaneX();
1108 double focalPlaneY = cam->DistortionMap()->FocalPlaneY();
1109 fpmap->SetFocalPlane(focalPlaneX,focalPlaneY);
1111 cuSamp = fpmap->DetectorSample();
1112 cuLine = m->GetLine() + deltaLine;
1116 cuSamp = m->GetFocalPlaneComputedX();
1117 cuLine = m->GetFocalPlaneComputedY();
1124 if (!fpmap->SetFocalPlane(m->GetFocalPlaneComputedX(), m->GetFocalPlaneComputedY())) {
1125 QString msg =
"Sanity check #1 for ControlPoint [" +
GetId() +
1126 "], ControlMeasure [" + m->GetCubeSerialNumber() +
"]";
1131 cuSamp = fpmap->DetectorSample();
1132 cuLine = fpmap->DetectorLine();
1143 muSamp = m->GetSample();
1144 muLine = m->GetLine();
1149 if (!fpmap->SetFocalPlane(m->GetFocalPlaneMeasuredX(), m->GetFocalPlaneMeasuredY())) {
1150 QString msg =
"Sanity check #2 for ControlPoint [" +
GetId() +
1151 "], ControlMeasure [" + m->GetCubeSerialNumber() +
"]";
1155 muSamp = fpmap->DetectorSample();
1156 muLine = fpmap->DetectorLine();
1162 double sampResidual = muSamp - cuSamp;
1163 double lineResidual = muLine - cuLine;
1164 m->SetResidual(sampResidual, lineResidual);
1196 QList<QString> keys = measures->keys();
1198 for (
int j = 0; j < keys.size(); j++) {
1200 if (m->IsIgnored()) {
1217 cam->SetGround(GetAdjustedSurfacePoint());
1218 cudx = cam->Sample();
1221 cam->SetImage(m->GetSample(), m->GetLine());
1225 if (cam->GetCameraType() != 0) {
1226 cam->SetImage(m->GetSample(), m->GetLine());
1229 cam->GroundMap()->GetXY(GetAdjustedSurfacePoint(), &cudx, &cudy,
false);
1232 m->SetFocalPlaneComputed(cudx, cudy);
1238 QString ControlPoint::GetChooserName()
const {
1258 QString ControlPoint::GetDateTime()
const {
1268 bool ControlPoint::IsEditLocked()
const {
1273 bool ControlPoint::IsRejected()
const {
1278 SurfacePoint ControlPoint::GetAdjustedSurfacePoint()
const {
1307 bool ControlPoint::IsIgnored()
const {
1312 bool ControlPoint::IsValid()
const {
1317 bool ControlPoint::IsInvalid()
const {
1332 switch (pointType) {
1337 str =
"Constrained";
1356 QString pointTypeString) {
1361 QString errMsg =
"There is no PointType that has a string representation"
1363 errMsg += pointTypeString;
1366 if (pointTypeString ==
"Fixed") {
1369 else if (pointTypeString ==
"Constrained") {
1372 else if (pointTypeString ==
"Free") {
1413 case RadiusSource::None:
1416 case RadiusSource::User:
1419 case RadiusSource::AverageOfMeasures:
1420 str =
"AverageOfMeasures";
1422 case RadiusSource::Ellipsoid:
1425 case RadiusSource::DEM:
1428 case RadiusSource::BundleSolution:
1429 str =
"BundleSolution";
1447 str = str.toLower();
1448 RadiusSource::Source source = RadiusSource::None;
1450 if (str ==
"user") {
1451 source = RadiusSource::User;
1453 else if (str ==
"averageofmeasures") {
1454 source = RadiusSource::AverageOfMeasures;
1456 else if (str ==
"ellipsoid") {
1457 source = RadiusSource::Ellipsoid;
1459 else if (str ==
"dem") {
1460 source = RadiusSource::DEM;
1462 else if (str ==
"bundlesolution") {
1463 source = RadiusSource::BundleSolution;
1489 SurfacePointSource::Source source) {
1494 case SurfacePointSource::None:
1497 case SurfacePointSource::User:
1500 case SurfacePointSource::AverageOfMeasures:
1501 str =
"AverageOfMeasures";
1503 case SurfacePointSource::Reference:
1506 case SurfacePointSource::Basemap:
1509 case SurfacePointSource::BundleSolution:
1510 str =
"BundleSolution";
1525 ControlPoint::SurfacePointSource::Source
1529 str = str.toLower();
1530 SurfacePointSource::Source source = SurfacePointSource::None;
1532 if (str ==
"user") {
1533 source = SurfacePointSource::User;
1535 else if (str ==
"averageofmeasures") {
1536 source = SurfacePointSource::AverageOfMeasures;
1538 else if (str ==
"reference") {
1539 source = SurfacePointSource::Reference;
1541 else if (str ==
"basemap") {
1542 source = SurfacePointSource::Basemap;
1544 else if (str ==
"bundlesolution") {
1545 source = SurfacePointSource::BundleSolution;
1562 SurfacePoint ControlPoint::GetAprioriSurfacePoint()
const {
1567 ControlPoint::RadiusSource::Source ControlPoint::GetAprioriRadiusSource()
1573 bool ControlPoint::HasAprioriCoordinates() {
1672 QString ControlPoint::GetAprioriRadiusSourceFile()
const {
1677 ControlPoint::SurfacePointSource::Source
1678 ControlPoint::GetAprioriSurfacePointSource()
const {
1693 QString ControlPoint::GetAprioriSurfacePointSourceFile()
const {
1698 int ControlPoint::GetNumMeasures()
const {
1699 return measures->size();
1709 QList<QString> keys = measures->keys();
1710 for (
int cm = 0; cm < keys.size(); cm++) {
1711 if (!(*measures)[keys[cm]]->IsIgnored()) {
1726 QList<QString> keys = measures->keys();
1727 for (
int cm = 0; cm < keys.size(); cm++) {
1728 if ((*measures)[keys[cm]]->IsEditLocked()) {
1743 return cubeSerials->contains(serialNumber);
1761 QString msg =
"There is no reference measure set in the ControlPoint [" +
1779 return IndexOf(cm->GetCubeSerialNumber(),
throws);
1792 int index = cubeSerials->indexOf(sn);
1794 if (
throws && index == -1) {
1795 QString msg =
"ControlMeasure [" + sn +
"] does not exist in point [" +
1814 QString msg =
"There is no reference measure for point [" +
id +
"]."
1815 " This also means of course that the point is empty!";
1840 if (!cm->IsIgnored()) {
1841 stats.
AddData((cm->*statFunc)());
1849 Statistics ControlPoint::GetStatistic(
long dataType)
const {
1851 foreach(ControlMeasure * cm, *measures) {
1852 if (!cm->IsIgnored()) {
1853 stats.
AddData(cm->GetLogData(dataType).GetNumericalValue());
1867 QList< ControlMeasure * > ControlPoint::getMeasures(
1868 bool excludeIgnored)
const {
1869 QList< ControlMeasure * > orderedMeasures;
1870 for (
int i = 0; i < cubeSerials->size(); i++) {
1872 if (!excludeIgnored || !measure->IsIgnored()) {
1873 orderedMeasures.append(measures->value((*cubeSerials)[i]));
1876 return orderedMeasures;
1884 return *cubeSerials;
1896 return GetMeasure(serialNumber);
1908 return GetMeasure(serialNumber);
1921 return GetMeasure(index);
1934 return GetMeasure(index);
1946 return !(*
this == other);
1959 return other.GetNumMeasures() == GetNumMeasures() &&
1961 other.type == type &&
1962 other.chooserName == chooserName &&
1963 other.editLock == editLock &&
1964 other.ignore == ignore &&
1965 other.aprioriSurfacePointSource == aprioriSurfacePointSource &&
1966 other.aprioriSurfacePointSourceFile == aprioriSurfacePointSourceFile &&
1967 other.aprioriRadiusSource == aprioriRadiusSource &&
1968 other.aprioriRadiusSourceFile == aprioriRadiusSourceFile &&
1969 other.aprioriSurfacePoint == aprioriSurfacePoint &&
1970 other.adjustedSurfacePoint == adjustedSurfacePoint &&
1971 other.invalid == invalid &&
1972 other.measures == measures &&
1973 other.dateTime == dateTime &&
1974 other.jigsawRejected == jigsawRejected &&
1975 other.constraintStatus == constraintStatus &&
1976 other.referenceExplicitlySet == referenceExplicitlySet &&
1977 other.numberOfRejectedMeasures == numberOfRejectedMeasures &&
1978 other.cubeSerials == cubeSerials &&
1979 other.referenceMeasure == referenceMeasure;
2001 if (
this != &other) {
2002 bool oldLock = editLock;
2004 for (
int i = cubeSerials->size() - 1; i >= 0; i--) {
2005 (*measures)[cubeSerials->at(i)]->
SetEditLock(
false);
2006 Delete(cubeSerials->at(i));
2011 QHashIterator< QString, ControlMeasure * > i(*other.measures);
2012 while (i.hasNext()) {
2015 *newMeasure = *i.value();
2016 AddMeasure(newMeasure);
2017 if (other.referenceMeasure == i.value()) {
2018 SetRefMeasure(newMeasure);
2022 invalid = other.invalid;
2023 referenceExplicitlySet = other.referenceExplicitlySet;
2024 numberOfRejectedMeasures = other.numberOfRejectedMeasures;
2025 constraintStatus = other.constraintStatus;
2028 SetChooserName(other.chooserName);
2029 SetDateTime(other.dateTime);
2030 SetType(other.type);
2031 SetRejected(other.jigsawRejected);
2032 SetIgnored(other.ignore);
2033 SetAprioriSurfacePointSource(other.aprioriSurfacePointSource);
2034 SetAprioriSurfacePointSourceFile(other.aprioriSurfacePointSourceFile);
2035 SetAprioriRadiusSource(other.aprioriRadiusSource);
2036 SetAprioriRadiusSourceFile(other.aprioriRadiusSourceFile);
2037 SetAprioriSurfacePoint(other.aprioriSurfacePoint);
2038 SetAdjustedSurfacePoint(other.adjustedSurfacePoint);
2042 SetEditLock(other.editLock);
2052 void ControlPoint::PointModified() {
2058 void ControlPoint::ZeroNumberOfRejectedMeasures()
2061 numberOfRejectedMeasures = 0;
2071 void ControlPoint::SetNumberOfRejectedMeasures(
int numRejected) {
2072 numberOfRejectedMeasures = numRejected;
2082 int ControlPoint::GetNumberOfRejectedMeasures()
const {
2083 return numberOfRejectedMeasures;
2092 double ControlPoint::GetSampleResidualRms()
const {
2093 int nmeasures = measures->size();
2094 if ( nmeasures <= 0 ) {
2100 for(
int i = 0; i < nmeasures; i++) {
2106 if ( !m->IsIgnored() || m->IsRejected() ) {
2110 stats.AddData(m->GetSampleResidual());
2123 double ControlPoint::GetLineResidualRms()
const {
2124 int nmeasures = measures->size();
2125 if ( nmeasures <= 0 ) {
2131 for(
int i = 0; i < nmeasures; i++) {
2137 if ( !m->IsIgnored() || m->IsRejected() ) {
2141 stats.AddData(m->GetLineResidual());
2154 double ControlPoint::GetResidualRms()
const {
2155 int nmeasures = measures->size();
2156 if ( nmeasures <= 0 ) {
2162 for(
int i = 0; i < nmeasures; i++) {
2168 if ( m->IsIgnored() || m->IsRejected() ) {
2172 stats.AddData(m->GetSampleResidual());
2173 stats.AddData(m->GetLineResidual());
2184 void ControlPoint::ClearJigsawRejected() {
2185 int nmeasures = measures->size();
2186 if ( nmeasures <= 0 ) {
2190 for(
int i = 0; i < nmeasures; i++) {
2196 m->SetRejected(
false);
static QString DateTime(time_t *curtime=0)
Returns the date and time as a QString.
static QString Name()
Returns the name of the application.
Convert between distorted focal plane and detector coordinates.
Camera(Cube &cube)
Constructs the Camera object.
@ Csm
Community Sensor Model Camera.
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
ControlPoint * parentPoint
Pointer to parent ControlPoint, may be null.
ModType
Control Measure Modification Types.
void pointIgnored(ControlPoint *point)
Update the ControlNet's internal structure when a ControlPoint is ignored.
SurfacePoint::CoordinateType GetCoordType()
Get the control point coordinate type (see the available types in SurfacePoint.h).
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...
void emitNetworkStructureModified()
This method is a wrapper to emit the networkStructureModified() signal.
void measureAdded(ControlMeasure *measure)
Updates the ControlNet graph for the measure's serial number to reflect the addition.
void UpdatePointReference(ControlPoint *point, QString oldId)
Updates the key reference (poind Id) from the old one to what the point id was changet to.
void measureDeleted(ControlMeasure *measure)
Updates the node for this measure's serial number to reflect the deletion.
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...
void pointUnIgnored(ControlPoint *point)
Update the ControlNet's internal structure when a ControlPoint is un-ignored.
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.
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.
bool invalid
If we forced a build that we would normally have thrown an exception for then this is set to true.
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.
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.
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
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.
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.
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...
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.
Status ResetApriori()
Reset all the Apriori info to defaults.
bool HasSerialNumber(QString serialNumber) const
Return true if given serial number exists in point.
int IndexOf(ControlMeasure *, bool throws=true) const
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.
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.
Displacement is a signed length, usually in meters.
bool isValid() const
Test if this displacement has been initialized or not.
@ Kilometers
The distance is being specified in kilometers.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
@ Programmer
This error is for when a programmer made an API call that was illegal.
Contains Pvl Groups and Pvl Objects.
This class is used to accumulate statistics on double arrays.
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
This class defines a body-fixed surface point.
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
@ Latitudinal
Planetocentric latitudinal (lat/lon/rad) coordinates.
@ Rectangular
Body-fixed rectangular x/y/z coordinates.
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.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Namespace for the standard library.