Loading isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.cpp +2 −26 Original line number Diff line number Diff line #include "EquatorialCylindricalShape.h" #include <QDebug> #include <QVector> #include <algorithm> #include <cfloat> Loading @@ -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" Loading @@ -31,10 +28,7 @@ using namespace std; #define MAX(x,y) (((x) > (y)) ? (x) : (y)) namespace Isis { /** * Initialize the Isis3 Equatorial Cylindrical shape model. * Loading Loading @@ -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 } isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.h +0 −12 Original line number Diff line number Diff line Loading @@ -24,9 +24,6 @@ #include "DemShape.h" #include <QVector> #include "Spice.h" namespace Isis { class Pvl; Loading @@ -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: Loading @@ -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 Loading isis/src/base/objs/ShapeModel/ShapeModel.cpp +32 −53 Original line number Diff line number Diff line #include "ShapeModel.h" #include <QDebug> #include <QVector> #include <algorithm> #include <cfloat> Loading Loading @@ -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. * Loading Loading @@ -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]; Loading isis/src/base/objs/ShapeModel/ShapeModel.h +13 −25 Original line number Diff line number Diff line Loading @@ -23,9 +23,6 @@ */ #include <vector> #include <QVector> #include "Spice.h" template<class T> class QVector; Loading Loading @@ -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: Loading Loading @@ -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); Loading Loading
isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.cpp +2 −26 Original line number Diff line number Diff line #include "EquatorialCylindricalShape.h" #include <QDebug> #include <QVector> #include <algorithm> #include <cfloat> Loading @@ -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" Loading @@ -31,10 +28,7 @@ using namespace std; #define MAX(x,y) (((x) > (y)) ? (x) : (y)) namespace Isis { /** * Initialize the Isis3 Equatorial Cylindrical shape model. * Loading Loading @@ -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 }
isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.h +0 −12 Original line number Diff line number Diff line Loading @@ -24,9 +24,6 @@ #include "DemShape.h" #include <QVector> #include "Spice.h" namespace Isis { class Pvl; Loading @@ -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: Loading @@ -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 Loading
isis/src/base/objs/ShapeModel/ShapeModel.cpp +32 −53 Original line number Diff line number Diff line #include "ShapeModel.h" #include <QDebug> #include <QVector> #include <algorithm> #include <cfloat> Loading Loading @@ -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. * Loading Loading @@ -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]; Loading
isis/src/base/objs/ShapeModel/ShapeModel.h +13 −25 Original line number Diff line number Diff line Loading @@ -23,9 +23,6 @@ */ #include <vector> #include <QVector> #include "Spice.h" template<class T> class QVector; Loading Loading @@ -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: Loading Loading @@ -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); Loading