Loading isis/src/control/objs/ControlNetVersioner/unitTest.cpp +7 −9 Original line number Diff line number Diff line #include "ControlNetVersioner.h" #include <string> #include <QString> #include <QTime> Loading @@ -20,13 +18,13 @@ void TestNetwork(const QString &filename, bool printNetwork = true, bool pvlInpu int main(int argc, char *argv[]) { Preference::Preferences(true); cerr << "Test ControlNetVersioner" << endl; TestNetwork("./reallyOldNetwork.net"); // No target TestNetwork("./reallyOldNetwork2.net"); // Really odd keywords with target TestNetwork("./oldNetwork.net"); // Another set of odd keywords TestNetwork("./oldNetwork2.net"); // Binary V1 TestNetwork("./badNetwork.net"); // Corrupted (based off of oldNetwork2.net) TestNetwork("./semilarge.net", false); TestNetwork("./smallPvlTest.pvl", true, true); // network with rejected jigsaw points TestNetwork("$control/unitTest_ControlNetVersioner_reallyOldNetwork.net"); // No target TestNetwork("$control/unitTest_ControlNetVersioner_reallyOldNetwork2.net"); // Really odd keywords with target TestNetwork("$control/unitTest_ControlNetVersioner_oldNetwork.net"); // Another set of odd keywords TestNetwork("$control/unitTest_ControlNetVersioner_oldNetwork2.net"); // Binary V1 TestNetwork("$control/unitTest_ControlNetVersioner_badNetwork.net"); // Corrupted (based off of oldNetwork2.net) TestNetwork("$control/unitTest_ControlNetVersioner_semilarge.net", false); TestNetwork("$control/unitTest_ControlNetVersioner_smallPvlTest.pvl", true, true); // network with rejected jigsaw points } void TestNetwork(const QString &filename, bool printNetwork, bool pvlInput) { Loading isis/src/control/objs/ControlPoint/ControlPoint.cpp +11 −94 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ namespace Isis { } if (!measures->size()) { ASSERT(referenceMeasure == NULL); ASSERT(!HasRefMeasure()); referenceMeasure = measure; } else if (referenceMeasure->IsIgnored() && !measure->IsIgnored() && Loading Loading @@ -428,7 +428,7 @@ namespace Isis { * @returns const reference measure for this point */ const ControlMeasure *ControlPoint::GetRefMeasure() const { if (referenceMeasure == NULL) { if (!HasRefMeasure()) { QString msg = "Control point [" + GetId() + "] has no reference measure!"; throw IException(IException::Programmer, msg, _FILEINFO_); } Loading @@ -441,7 +441,7 @@ namespace Isis { * Get the measure that is the reference directly. */ ControlMeasure *ControlPoint::GetRefMeasure() { if (referenceMeasure == NULL) { if (!HasRefMeasure()) { QString msg = "Control point [" + GetId() + "] has no reference measure!"; throw IException(IException::Programmer, msg, _FILEINFO_); } Loading Loading @@ -1208,36 +1208,6 @@ namespace Isis { } /** * Gets the adjusted x coordinate. * * @return Displacement The adjusted x coordinate. */ Displacement ControlPoint::GetAdjustedX() const { return adjustedSurfacePoint.GetX(); } /** * Gets the adjusted y coordinate. * * @return Displacement The adjusted y coordinate. */ Displacement ControlPoint::GetAdjustedY() const { return adjustedSurfacePoint.GetY(); } /** * Gets the adjusted z coordinate. * * @return Displacement The adjusted z coordinate. */ Displacement ControlPoint::GetAdjustedZ() const { return adjustedSurfacePoint.GetZ(); } /** * Returns the adjusted surface point if it exists, otherwise returns * the a priori surface point. Loading Loading @@ -1520,65 +1490,12 @@ namespace Isis { return aprioriSurfacePoint; } /** * Gets the apriori x coordinate. * * @return Displacement The apriori x coordinate. */ Displacement ControlPoint::GetAprioriX() const { return aprioriSurfacePoint.GetX(); } /** * Gets the apriori y coordinate. * * @return Displacement The apriori y coordinate. */ Displacement ControlPoint::GetAprioriY() const { return aprioriSurfacePoint.GetY(); } /** * Gets the apriori z coordinate. * * @return Displacement The apriori z coordinate. */ Displacement ControlPoint::GetAprioriZ() const { return aprioriSurfacePoint.GetZ(); } ControlPoint::RadiusSource::Source ControlPoint::GetAprioriRadiusSource() const { return aprioriRadiusSource; } bool ControlPoint::HasAprioriCoordinates() { if (aprioriSurfacePoint.GetX().isValid() && aprioriSurfacePoint.GetY().isValid() && aprioriSurfacePoint.GetZ().isValid()) return true; return false; } /** * Checks to see if the ControlPoint has an adjusted SurfacePoint. * * @return bool True if the control point has adjusted x, y, and z coordinates. */ bool ControlPoint::HasAdjustedCoordinates() { if (adjustedSurfacePoint.GetX().isValid() && adjustedSurfacePoint.GetY().isValid() && adjustedSurfacePoint.GetZ().isValid()) { return true; } return false; } bool ControlPoint::IsConstrained() { Loading Loading @@ -1697,7 +1614,7 @@ namespace Isis { * @returns The cube serial number of the reference measure */ QString ControlPoint::GetReferenceSN() const { if (referenceMeasure == NULL) { if (!HasRefMeasure()) { QString msg = "There is no reference measure set in the ControlPoint [" + GetId() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); Loading isis/src/control/objs/ControlPoint/ControlPoint.h +1 −14 Original line number Diff line number Diff line Loading @@ -337,10 +337,7 @@ namespace Isis { * constructor (Merged by Kristin Berry. Fixes #2392) * @history 2017-12-18 Kristin Berry - Added convenience methods: * HasAprioriSurfacePointSourceFile(), HasAprioriRadiusSourceFile(), * GetAprioriX(), GetAprioriY(), GetAprioriZ(), * HasAdjustedCoordinates(), GetAdjustedX(), GetAdjustedY(), * GetAdjustedZ(), HasRefMeasure(). * @history 2017-12-19 Kristin Berry - Added IsJigsawRejected(). * HasRefMeasure(). * @history 2017-12-21 Adam Goins - Removed redundant code following ControlNetVersioner * refactor. */ Loading Loading @@ -495,9 +492,6 @@ namespace Isis { Status ComputeResiduals_Millimeters(); SurfacePoint GetAdjustedSurfacePoint() const; Displacement GetAdjustedX() const; Displacement GetAdjustedY() const; Displacement GetAdjustedZ() const; SurfacePoint GetBestSurfacePoint() const; QString GetChooserName() const; Loading @@ -509,10 +503,6 @@ namespace Isis { bool IsValid() const; bool IsInvalid() const; bool IsFixed() const; bool IsJigsawRejected() const; bool HasAprioriCoordinates(); bool HasAdjustedCoordinates(); bool IsConstrained(); bool IsLatitudeConstrained(); Loading @@ -533,9 +523,6 @@ namespace Isis { static SurfacePointSource::Source StringToSurfacePointSource(QString str); QString GetSurfacePointSourceString() const; SurfacePoint GetAprioriSurfacePoint() const; Displacement GetAprioriX() const; Displacement GetAprioriY() const; Displacement GetAprioriZ() const; RadiusSource::Source GetAprioriRadiusSource() const; bool HasAprioriRadiusSourceFile() const; Loading isis/src/control/objs/ControlPoint/ControlPoint.truth +5 −5 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ Object = ControlNetwork Created = Yesterday LastModified = Yesterday Description = Null Version = 3 Version = 5 Object = ControlPoint PointType = Fixed Loading Loading @@ -78,7 +78,7 @@ Object = ControlNetwork Created = Yesterday LastModified = Yesterday Description = Null Version = 3 Version = 5 Object = ControlPoint PointType = Fixed Loading Loading @@ -167,7 +167,7 @@ Object = ControlNetwork Created = Yesterday LastModified = Yesterday Description = Null Version = 3 Version = 5 Object = ControlPoint PointType = Fixed Loading Loading @@ -253,7 +253,7 @@ Object = ControlNetwork Created = Yesterday LastModified = Yesterday Description = Null Version = 3 Version = 5 Object = ControlPoint PointType = Fixed Loading Loading @@ -338,7 +338,7 @@ Object = ControlNetwork Created = Yesterday LastModified = Yesterday Description = Null Version = 3 Version = 5 Object = ControlPoint PointType = Fixed Loading isis/src/control/objs/ControlPoint/unitTest.cpp +9 −5 Original line number Diff line number Diff line Loading @@ -97,11 +97,13 @@ int main() { if (cp.GetRefMeasure() != cm2) { cp.SetEditLock(false); cp.SetRefMeasure(cm2); if (cp.GetRefMeasure() == cm2) if (cp.GetRefMeasure() == cm2) { cout << "ok!\n"; else } else { cout << "Failed!\n"; } } else { cout << "Failed!\n"; } Loading Loading @@ -242,15 +244,17 @@ int main() { getMeasuresTestPoint.Add(alpha); getMeasuresTestPoint.Add(beta); QList< ControlMeasure * > measures = getMeasuresTestPoint.getMeasures(); foreach (ControlMeasure * measure, measures) foreach (ControlMeasure * measure, measures) { cout << measure->GetCubeSerialNumber() << "\n"; } beta->SetIgnored(true); measures = getMeasuresTestPoint.getMeasures(true); foreach (ControlMeasure * measure, measures) foreach (ControlMeasure * measure, measures) { cout << measure->GetCubeSerialNumber() << "\n"; } cout << "Testing various accessor methods... " << endl; cout << endl << "Testing various accessor methods... " << endl; if (cp.HasAprioriSurfacePointSourceFile()) { cout << "AprioriSurfacePointSourceFile: " << cp.GetAprioriSurfacePointSourceFile() << endl; Loading Loading
isis/src/control/objs/ControlNetVersioner/unitTest.cpp +7 −9 Original line number Diff line number Diff line #include "ControlNetVersioner.h" #include <string> #include <QString> #include <QTime> Loading @@ -20,13 +18,13 @@ void TestNetwork(const QString &filename, bool printNetwork = true, bool pvlInpu int main(int argc, char *argv[]) { Preference::Preferences(true); cerr << "Test ControlNetVersioner" << endl; TestNetwork("./reallyOldNetwork.net"); // No target TestNetwork("./reallyOldNetwork2.net"); // Really odd keywords with target TestNetwork("./oldNetwork.net"); // Another set of odd keywords TestNetwork("./oldNetwork2.net"); // Binary V1 TestNetwork("./badNetwork.net"); // Corrupted (based off of oldNetwork2.net) TestNetwork("./semilarge.net", false); TestNetwork("./smallPvlTest.pvl", true, true); // network with rejected jigsaw points TestNetwork("$control/unitTest_ControlNetVersioner_reallyOldNetwork.net"); // No target TestNetwork("$control/unitTest_ControlNetVersioner_reallyOldNetwork2.net"); // Really odd keywords with target TestNetwork("$control/unitTest_ControlNetVersioner_oldNetwork.net"); // Another set of odd keywords TestNetwork("$control/unitTest_ControlNetVersioner_oldNetwork2.net"); // Binary V1 TestNetwork("$control/unitTest_ControlNetVersioner_badNetwork.net"); // Corrupted (based off of oldNetwork2.net) TestNetwork("$control/unitTest_ControlNetVersioner_semilarge.net", false); TestNetwork("$control/unitTest_ControlNetVersioner_smallPvlTest.pvl", true, true); // network with rejected jigsaw points } void TestNetwork(const QString &filename, bool printNetwork, bool pvlInput) { Loading
isis/src/control/objs/ControlPoint/ControlPoint.cpp +11 −94 Original line number Diff line number Diff line Loading @@ -234,7 +234,7 @@ namespace Isis { } if (!measures->size()) { ASSERT(referenceMeasure == NULL); ASSERT(!HasRefMeasure()); referenceMeasure = measure; } else if (referenceMeasure->IsIgnored() && !measure->IsIgnored() && Loading Loading @@ -428,7 +428,7 @@ namespace Isis { * @returns const reference measure for this point */ const ControlMeasure *ControlPoint::GetRefMeasure() const { if (referenceMeasure == NULL) { if (!HasRefMeasure()) { QString msg = "Control point [" + GetId() + "] has no reference measure!"; throw IException(IException::Programmer, msg, _FILEINFO_); } Loading @@ -441,7 +441,7 @@ namespace Isis { * Get the measure that is the reference directly. */ ControlMeasure *ControlPoint::GetRefMeasure() { if (referenceMeasure == NULL) { if (!HasRefMeasure()) { QString msg = "Control point [" + GetId() + "] has no reference measure!"; throw IException(IException::Programmer, msg, _FILEINFO_); } Loading Loading @@ -1208,36 +1208,6 @@ namespace Isis { } /** * Gets the adjusted x coordinate. * * @return Displacement The adjusted x coordinate. */ Displacement ControlPoint::GetAdjustedX() const { return adjustedSurfacePoint.GetX(); } /** * Gets the adjusted y coordinate. * * @return Displacement The adjusted y coordinate. */ Displacement ControlPoint::GetAdjustedY() const { return adjustedSurfacePoint.GetY(); } /** * Gets the adjusted z coordinate. * * @return Displacement The adjusted z coordinate. */ Displacement ControlPoint::GetAdjustedZ() const { return adjustedSurfacePoint.GetZ(); } /** * Returns the adjusted surface point if it exists, otherwise returns * the a priori surface point. Loading Loading @@ -1520,65 +1490,12 @@ namespace Isis { return aprioriSurfacePoint; } /** * Gets the apriori x coordinate. * * @return Displacement The apriori x coordinate. */ Displacement ControlPoint::GetAprioriX() const { return aprioriSurfacePoint.GetX(); } /** * Gets the apriori y coordinate. * * @return Displacement The apriori y coordinate. */ Displacement ControlPoint::GetAprioriY() const { return aprioriSurfacePoint.GetY(); } /** * Gets the apriori z coordinate. * * @return Displacement The apriori z coordinate. */ Displacement ControlPoint::GetAprioriZ() const { return aprioriSurfacePoint.GetZ(); } ControlPoint::RadiusSource::Source ControlPoint::GetAprioriRadiusSource() const { return aprioriRadiusSource; } bool ControlPoint::HasAprioriCoordinates() { if (aprioriSurfacePoint.GetX().isValid() && aprioriSurfacePoint.GetY().isValid() && aprioriSurfacePoint.GetZ().isValid()) return true; return false; } /** * Checks to see if the ControlPoint has an adjusted SurfacePoint. * * @return bool True if the control point has adjusted x, y, and z coordinates. */ bool ControlPoint::HasAdjustedCoordinates() { if (adjustedSurfacePoint.GetX().isValid() && adjustedSurfacePoint.GetY().isValid() && adjustedSurfacePoint.GetZ().isValid()) { return true; } return false; } bool ControlPoint::IsConstrained() { Loading Loading @@ -1697,7 +1614,7 @@ namespace Isis { * @returns The cube serial number of the reference measure */ QString ControlPoint::GetReferenceSN() const { if (referenceMeasure == NULL) { if (!HasRefMeasure()) { QString msg = "There is no reference measure set in the ControlPoint [" + GetId() + "]"; throw IException(IException::Programmer, msg, _FILEINFO_); Loading
isis/src/control/objs/ControlPoint/ControlPoint.h +1 −14 Original line number Diff line number Diff line Loading @@ -337,10 +337,7 @@ namespace Isis { * constructor (Merged by Kristin Berry. Fixes #2392) * @history 2017-12-18 Kristin Berry - Added convenience methods: * HasAprioriSurfacePointSourceFile(), HasAprioriRadiusSourceFile(), * GetAprioriX(), GetAprioriY(), GetAprioriZ(), * HasAdjustedCoordinates(), GetAdjustedX(), GetAdjustedY(), * GetAdjustedZ(), HasRefMeasure(). * @history 2017-12-19 Kristin Berry - Added IsJigsawRejected(). * HasRefMeasure(). * @history 2017-12-21 Adam Goins - Removed redundant code following ControlNetVersioner * refactor. */ Loading Loading @@ -495,9 +492,6 @@ namespace Isis { Status ComputeResiduals_Millimeters(); SurfacePoint GetAdjustedSurfacePoint() const; Displacement GetAdjustedX() const; Displacement GetAdjustedY() const; Displacement GetAdjustedZ() const; SurfacePoint GetBestSurfacePoint() const; QString GetChooserName() const; Loading @@ -509,10 +503,6 @@ namespace Isis { bool IsValid() const; bool IsInvalid() const; bool IsFixed() const; bool IsJigsawRejected() const; bool HasAprioriCoordinates(); bool HasAdjustedCoordinates(); bool IsConstrained(); bool IsLatitudeConstrained(); Loading @@ -533,9 +523,6 @@ namespace Isis { static SurfacePointSource::Source StringToSurfacePointSource(QString str); QString GetSurfacePointSourceString() const; SurfacePoint GetAprioriSurfacePoint() const; Displacement GetAprioriX() const; Displacement GetAprioriY() const; Displacement GetAprioriZ() const; RadiusSource::Source GetAprioriRadiusSource() const; bool HasAprioriRadiusSourceFile() const; Loading
isis/src/control/objs/ControlPoint/ControlPoint.truth +5 −5 Original line number Diff line number Diff line Loading @@ -8,7 +8,7 @@ Object = ControlNetwork Created = Yesterday LastModified = Yesterday Description = Null Version = 3 Version = 5 Object = ControlPoint PointType = Fixed Loading Loading @@ -78,7 +78,7 @@ Object = ControlNetwork Created = Yesterday LastModified = Yesterday Description = Null Version = 3 Version = 5 Object = ControlPoint PointType = Fixed Loading Loading @@ -167,7 +167,7 @@ Object = ControlNetwork Created = Yesterday LastModified = Yesterday Description = Null Version = 3 Version = 5 Object = ControlPoint PointType = Fixed Loading Loading @@ -253,7 +253,7 @@ Object = ControlNetwork Created = Yesterday LastModified = Yesterday Description = Null Version = 3 Version = 5 Object = ControlPoint PointType = Fixed Loading Loading @@ -338,7 +338,7 @@ Object = ControlNetwork Created = Yesterday LastModified = Yesterday Description = Null Version = 3 Version = 5 Object = ControlPoint PointType = Fixed Loading
isis/src/control/objs/ControlPoint/unitTest.cpp +9 −5 Original line number Diff line number Diff line Loading @@ -97,11 +97,13 @@ int main() { if (cp.GetRefMeasure() != cm2) { cp.SetEditLock(false); cp.SetRefMeasure(cm2); if (cp.GetRefMeasure() == cm2) if (cp.GetRefMeasure() == cm2) { cout << "ok!\n"; else } else { cout << "Failed!\n"; } } else { cout << "Failed!\n"; } Loading Loading @@ -242,15 +244,17 @@ int main() { getMeasuresTestPoint.Add(alpha); getMeasuresTestPoint.Add(beta); QList< ControlMeasure * > measures = getMeasuresTestPoint.getMeasures(); foreach (ControlMeasure * measure, measures) foreach (ControlMeasure * measure, measures) { cout << measure->GetCubeSerialNumber() << "\n"; } beta->SetIgnored(true); measures = getMeasuresTestPoint.getMeasures(true); foreach (ControlMeasure * measure, measures) foreach (ControlMeasure * measure, measures) { cout << measure->GetCubeSerialNumber() << "\n"; } cout << "Testing various accessor methods... " << endl; cout << endl << "Testing various accessor methods... " << endl; if (cp.HasAprioriSurfacePointSourceFile()) { cout << "AprioriSurfacePointSourceFile: " << cp.GetAprioriSurfacePointSourceFile() << endl; Loading