Commit dee6be4d authored by Jeannie Backer's avatar Jeannie Backer
Browse files

Modified BundleUtilities. Brought code closer to coding standards, improved...

Modified BundleUtilities. Brought code closer to coding standards, improved unitTest, added assignment operators and copy constructors where needed.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@6067 41f8697f-d340-4b68-9986-7bafba869bb8
parent 06c1ed20
Loading
Loading
Loading
Loading
+472 −279

File changed.

Preview size limit exceeded, changes collapsed.

+10 −9
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@
#include "BundleObservationVector.h"
#include "BundleResults.h"
#include "BundleSettings.h"
#include "BundleStatistics.h"
#include "BundleSolutionInfo.h"
#include "Camera.h"
#include "CameraGroundMap.h"
#include "ControlMeasure.h"
@@ -189,7 +189,7 @@ namespace Isis {
   *                           separate thread.
   *   @history 2014-11-05 Ken Edmundson - Fixed memory bug. Wasn't releasing cholmod_factor m_L
   *                           every iteration. Now release every iteration but the last since we
   *                         need m_L for error propagation. References #2189.
   *   @history 2015-02-20 Jeannie Backer - Updated to be more compliant with ISIS coding standards.
   */
  class BundleAdjust : public QObject {
      Q_OBJECT
@@ -227,7 +227,7 @@ namespace Isis {
      ~BundleAdjust();
    
      double           solve();
      BundleResults    solveCholeskyBR();
      BundleSolutionInfo    solveCholeskyBR();
///////////////////////////////////////////////////////////////////////////////////////////////////
    public slots:
      bool             solveCholesky();
@@ -261,7 +261,7 @@ namespace Isis {

    signals:
      void statusUpdate(QString);
      void resultsReady(BundleResults *bundleResults);
      void resultsReady(BundleSolutionInfo *bundleSolveInformation);

    public slots:
      void outputBundleStatus(QString status);
@@ -288,7 +288,7 @@ namespace Isis {
      bool outputImagesCSV();
      bool outputResiduals();
      bool wrapUp();
      BundleResults bundleResults();
      BundleSolutionInfo bundleSolveInformation();
      bool computeBundleStatistics();

      void initialize();
@@ -444,13 +444,13 @@ namespace Isis {
      double m_dError;                                  //!< error


      BundleObservationVector m_BundleObservations;
      BundleControlPointVector m_BundleControlPoints;
      BundleObservationVector m_bundleObservations;
      BundleControlPointVector m_bundleControlPoints;

//       BundleObservationSolveSettings m_boss;
      double m_dRTM;                                    //!< radians to meters conversion factor (body specific)
      double m_dMTR;                                    //!< meters to radians conversion factor (body specific)
      Distance m_BodyRadii[3];                          //!< body radii i meters
      Distance m_bodyRadii[3];                          //!< body radii i meters

      QString m_strCnetFileName;                        //!< Control Net file specification

@@ -497,7 +497,8 @@ Statistics m_Statsy; //!< y errors
Statistics m_Statsrx;                      //!<  x residuals
Statistics m_Statsry;                      //!<  y residuals
Statistics m_Statsrxy;                     //!< xy residuals
    BundleStatistics m_bundleStatistics;
    BundleResults m_bundleResults;
//    BundleSolutionInfo m_bundleSolveInformation;
  };
}

+59 −2
Original line number Diff line number Diff line
#include <iostream>
#include <QDebug>

#include "BundleAdjust.h"
#include "IException.h"
#include "Preference.h"

using namespace std;
using namespace Isis;

int main(int argc, char *argv[]) {
  std::cout << "This class is currently tested by the jigsaw application" << std::endl;
  qDebug() << "This class is currently tested by the jigsaw application";
  try {
    Preference::Preferences(true);
  }
  catch (IException &e) {
    e.print();
  }
}

#if 0
Code not currently covered by jigsaw app tests

These methods are never called
 static void cholmod_error_handler();
 BundleAdjust(BundleSettings bundleSettings, QString &cnet, SerialNumberList &snlist, bool bPrintSummary);
 BundleAdjust(BundleSettings bundleSettings, Control &cnet, SerialNumberList &snlist, bool bPrintSummary);
 BundleAdjust(BundleSettings bundleSettings, ControlNet &cnet, SerialNumberList &snlist, bool bPrintSummary);
 BundleAdjust(BundleSettings bundleSettings, Control &cnet, QList<ImageList *> &imgLists, bool bPrintSummary);
 ~BundleAdjust();
 bool BundleAdjust::freeCHOLMODLibraryVariables();


These have partial coverage
 void BundleAdjust::init(Progress *progress) {
    (pCamera==false) for Camera *pCamera = m_pCnet->Camera(0);
    (m_bodyRadii[0] < 0 && pCamera==true)
    (image==false) for BundleImage* image = new BundleImage(camera, serialNumber, fileName);
    (m_bundleSettings.validateNetwork()==false) -- this is never the case for jigsaw, need to test elsewhere


 bool BundleAdjust::initializeCHOLMODLibraryVariables() {
    ( m_nRank <= 0 )

Errors:
 void BundleAdjust::init(Progress *progress) {
    (image==false) for BundleImage* image = new BundleImage(camera, serialNumber, fileName);
          QString msg = "In BundleAdjust::init(): image " + fileName + "is null" + "\n";
    (observation==false) for BundleObservation *observation = m_bundleObservations.addnew(image, observationNumber, instrumentId, m_bundleSettings);            
          QString msg = "In BundleAdjust::init(): observation " + observationNumber + "is null" + "\n";


 bool BundleAdjust::validateNetwork() {
    ( nMeasures <= 1 ) for int nMeasures = m_pCnet->GetNumberOfValidMeasuresInImage(m_pSnList->SerialNumber(i));
    ( nimagesWithInsufficientMeasures > 0 )
          QString msg = "Images with one or less measures:\n";

 void BundleAdjust::checkHeldList() {
    (m_pSnList->HasSerialNumber(m_pHeldSnList->SerialNumber(ih))==false)
          QString msg = "Held image not in FROMLIST";

#endif
+231 −147

File changed.

Preview size limit exceeded, changes collapsed.

+32 −27

File changed.

Preview size limit exceeded, changes collapsed.

Loading