Commit 612055f2 authored by Tracie Sucharski's avatar Tracie Sucharski
Browse files

Merge branch 'dev' of github.com:USGS-Astrogeology/ISIS3 into ipce

parents 5f874774 ece8b2a2
Loading
Loading
Loading
Loading
+2 −26
Original line number Diff line number Diff line
#include "EquatorialCylindricalShape.h"

#include <QDebug>
#include <QVector>

#include <algorithm>
#include <cfloat>
@@ -21,8 +20,6 @@
// #include "LinearAlgebra.h"
#include "Longitude.h"
#include "NaifStatus.h"
#include "Spice.h"
#include "ShapeModel.h"
#include "SpecialPixel.h"
#include "SurfacePoint.h"
#include "Table.h"
@@ -31,10 +28,7 @@ using namespace std;

#define MAX(x,y) (((x) > (y)) ? (x) : (y))


namespace Isis {


  /**
   * Initialize the Isis3 Equatorial Cylindrical shape model.
   *
@@ -413,26 +407,8 @@ namespace Isis {

    }

    // Do nothing since the DEM intersection was already successful
    setHasIntersection(true);
    return hasIntersection();
  }


  /**
   * Override of virtual function for intersectEllipsoid
   *
   * @return QVector holding three SpiceDoubles: SpiceDouble a, SpiceDouble b, SpiceDouble c
   */
  QVector<SpiceDouble> EquatorialCylindricalShape::setTargetRadii() {
    QVector<SpiceDouble> spiceVector(3);
    SpiceDouble a = m_maxRadius->kilometers();
    SpiceDouble b = m_maxRadius->kilometers();
    SpiceDouble c = m_maxRadius->kilometers();
    spiceVector.insert(0, a);
    spiceVector.insert(1, b);
    spiceVector.insert(2, c);
    return spiceVector;
  }

  // Do nothing since the DEM intersection was already successful
}
+0 −12
Original line number Diff line number Diff line
@@ -24,9 +24,6 @@

#include "DemShape.h"

#include <QVector>

#include "Spice.h"
namespace Isis {
  class Pvl;

@@ -53,11 +50,6 @@ namespace Isis {
   *   @history 2018-01-05 Cole Neubauer - Fixed units conversion in intersectSurface so that the
   *                           loop is stepping by radians per pixel, as recommended by Jeff
   *                           Anderson (LROC team). Fixes #5245
   *   @history 2018-02-05 Cole Neubauer - Added the setTargetRadii virtual method so that the
   *                           intersectEllipsoid method can use the MaximumRadius found in the
   *                           ShapeModelStatistics group of the labels (often written during a run of
   *                           demprep) as a starting radius for the ellipsoid as opposed to the
   *                           default radius of the target. Fixes #5242
   */
  class EquatorialCylindricalShape : public DemShape {
    public:
@@ -71,10 +63,6 @@ namespace Isis {
      bool intersectSurface(std::vector<double> observerPos,
                            std::vector<double> lookDirection);

    protected:
      virtual QVector<SpiceDouble> setTargetRadii(); // returns a QVector of SpiceDouble


    private:
      Distance *m_minRadius;  //!< Minimum radius value in DEM file
      Distance *m_maxRadius;  //!< Maximum radius value in DEM file
+32 −53
Original line number Diff line number Diff line
#include "ShapeModel.h"

#include <QDebug>
#include <QVector>

#include <algorithm>
#include <cfloat>
@@ -200,25 +199,6 @@ namespace Isis {
  }


  /**
   * Override of virtual function for intersectEllipsoid
   *
   * @return QVector of three SpiceDoubles: SpiceDouble a, SpiceDouble b, SpiceDouble c
   */
  QVector<SpiceDouble> ShapeModel::setTargetRadii() {
    QVector<SpiceDouble> spiceVector(3);
    // get target radii
    std::vector<Distance> radii = targetRadii();
    SpiceDouble a = radii[0].kilometers();
    SpiceDouble b = radii[1].kilometers();
    SpiceDouble c = radii[2].kilometers();
    spiceVector.insert(0, a);
    spiceVector.insert(1, b);
    spiceVector.insert(2, c);
    return spiceVector;
  }


  /**
   * Returns the status of the ellipsoid model intersection.
   *
@@ -293,11 +273,10 @@ namespace Isis {
    memcpy(lookB,&observerLookVectorToTarget[0], 3*sizeof(double));

    // get target radii
    QVector<SpiceDouble> spiceVector = setTargetRadii();

    SpiceDouble a = spiceVector.at(0);
    SpiceDouble b = spiceVector.at(1);
    SpiceDouble c = spiceVector.at(2);
    std::vector<Distance> radii = targetRadii();
    SpiceDouble a = radii[0].kilometers();
    SpiceDouble b = radii[1].kilometers();
    SpiceDouble c = radii[2].kilometers();

    // check if observer look vector intersects the target
    SpiceDouble intersectionPoint[3];
+13 −25
Original line number Diff line number Diff line
@@ -23,9 +23,6 @@
 */

#include <vector>
#include <QVector>

#include "Spice.h"

template<class T> class QVector;

@@ -77,11 +74,6 @@ namespace Isis {
   *                            setSurfacePoint() & clearSurfacePoint() virtual
   *                            to give some hope of a consistent internal state
   *                            in derived models.
   *   @history 2018-02-05 Cole Neubauer - added virtual method setTargetRadii to be
   *                           called from intersectEllipsoid. This is to avoid
   *                           redundant code that comes with having intersectEllipsoid be
   *                           virtual as the only code that was changed will now be handled
   *                           in setTargetRadii Fixes #5242
   */
  class ShapeModel {
    public:
@@ -172,24 +164,20 @@ namespace Isis {
                                 const std::vector<double> lookDirection);

    protected:
      virtual QVector<SpiceDouble> setTargetRadii(); // returns a QVector of SpiceDouble

      // Set the normal (surface or local) of the current intersection point
      void setNormal(const std::vector<double>);
      void setNormal(const double a, const double b, const double c);

      // accessor for m_hasEllipsoidIntersection
      bool hasEllipsoidIntersection();

      // Set shape name
      void setName(QString name);

      void calculateEllipsoidalSurfaceNormal();
      bool hasEllipsoidIntersection();

      // Intersect ellipse
      bool intersectEllipsoid(const std::vector<double> observerPosRelativeToTarget,
                              const std::vector<double> &observerLookVectorToTarget);

      bool hasValidTarget() const;
      std::vector<Distance> targetRadii() const;
      void setHasNormal(bool status);