Loading isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.cpp +9 −51 Original line number Diff line number Diff line Loading @@ -417,59 +417,17 @@ namespace Isis { /** * Finds the intersection point on the ellipsoid model using the given * position of the observer (spacecraft) and direction vector from the * observer to the target (body). * Override of virtual function for intersectEllipsoid * * @param observerBodyFixedPosition Three dimensional position of the observer, * in the coordinate system of the target body. * @param observerLookVectorToTarget Three dimensional direction vector from * the observer to the target. * param &a SpiceDouble reference to be set * * @return @b bool Indicates whether this shape model found a valid ellipsoid intersection. * param &b SpiceDouble reference to be set * * param &c SpiceDouble reference to be set */ bool EquatorialCylindricalShape::intersectEllipsoid( const std::vector<double> observerBodyFixedPosition, const std::vector<double> &observerLookVectorToTarget) { // Clear out previous surface point and normal clearSurfacePoint(); SpiceDouble lookB[3]; // This memcpy does: // lookB[0] = observerLookVectorToTarget[0]; // lookB[1] = observerLookVectorToTarget[1]; // lookB[2] = observerLookVectorToTarget[2]; memcpy(lookB,&observerLookVectorToTarget[0], 3*sizeof(double)); // get target radii // std::vector<Distance> radii = targetRadii(); // SpiceDouble a = radii[0].kilometers(); // SpiceDouble b = radii[1].kilometers(); // SpiceDouble c = radii[2].kilometers(); SpiceDouble a = m_maxRadius->kilometers(); SpiceDouble b = m_maxRadius->kilometers(); SpiceDouble c = m_maxRadius->kilometers(); // check if observer look vector intersects the target SpiceDouble intersectionPoint[3]; SpiceBoolean intersected = false; NaifStatus::CheckErrors(); surfpt_c((SpiceDouble *) &observerBodyFixedPosition[0], lookB, a, b, c, intersectionPoint, &intersected); NaifStatus::CheckErrors(); if (intersected) { SurfacePoint p; p.FromNaifArray(intersectionPoint); setSurfacePoint(p); virtual void setTargetRadii(SpiceDouble &a, SpiceDouble &b, SpiceDouble &c) { a = m_maxRadius->kilometers(); b = m_maxRadius->kilometers(); c = m_maxRadius->kilometers(); } setHasIntersection(intersected); setHasEllipsoidIntersection(intersected); return intersected; } } isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.h +2 −3 Original line number Diff line number Diff line Loading @@ -66,9 +66,8 @@ namespace Isis { std::vector<double> lookDirection); protected: virtual bool intersectEllipsoid( const std::vector<double> observerPosRelativeToTarget, const std::vector<double> &observerLookVectorToTarget); virtual void setTargetRadii(SpiceDouble &a, SpiceDouble &b, SpiceDouble &c); private: Distance *m_minRadius; //!< Minimum radius value in DEM file Loading isis/src/base/objs/ShapeModel/ShapeModel.cpp +21 −4 Original line number Diff line number Diff line Loading @@ -198,6 +198,23 @@ namespace Isis { return acos(angle) * RAD2DEG; } /** * Sets the parameters to the Target radii * * param &a SpiceDouble reference to be set * * param &b SpiceDouble reference to be set * * param &c SpiceDouble reference to be set */ virtual void setTargetRadii(SpiceDouble &a, SpiceDouble &b, SpiceDouble &c) { // get target radii std::vector<Distance> radii = targetRadii(); a = radii[0].kilometers(); b = radii[1].kilometers(); c = radii[2].kilometers(); } /** * Returns the status of the ellipsoid model intersection. Loading Loading @@ -283,10 +300,10 @@ namespace Isis { memcpy(lookB,&observerLookVectorToTarget[0], 3*sizeof(double)); // get target radii std::vector<Distance> radii = targetRadii(); SpiceDouble a = radii[0].kilometers(); SpiceDouble b = radii[1].kilometers(); SpiceDouble c = radii[2].kilometers(); SpiceDouble a; SpiceDouble b; SpiceDouble c; setTargetRadii(&a, &b, &c); // check if observer look vector intersects the target SpiceDouble intersectionPoint[3]; Loading isis/src/base/objs/ShapeModel/ShapeModel.h +5 −2 Original line number Diff line number Diff line Loading @@ -166,6 +166,9 @@ namespace Isis { const std::vector<double> lookDirection); protected: // Virtual function to be called in intersectEllipsoid to avoid redundant code virtual void setTargetRadii(SpiceDouble &a, SpiceDouble &b, SpiceDouble &c); // Set the normal (surface or local) of the current intersection point void setNormal(const std::vector<double>); Loading @@ -181,7 +184,7 @@ namespace Isis { void calculateEllipsoidalSurfaceNormal(); // Intersect ellipse virtual bool intersectEllipsoid( bool intersectEllipsoid( const std::vector<double> observerPosRelativeToTarget, const std::vector<double> &observerLookVectorToTarget); Loading Loading
isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.cpp +9 −51 Original line number Diff line number Diff line Loading @@ -417,59 +417,17 @@ namespace Isis { /** * Finds the intersection point on the ellipsoid model using the given * position of the observer (spacecraft) and direction vector from the * observer to the target (body). * Override of virtual function for intersectEllipsoid * * @param observerBodyFixedPosition Three dimensional position of the observer, * in the coordinate system of the target body. * @param observerLookVectorToTarget Three dimensional direction vector from * the observer to the target. * param &a SpiceDouble reference to be set * * @return @b bool Indicates whether this shape model found a valid ellipsoid intersection. * param &b SpiceDouble reference to be set * * param &c SpiceDouble reference to be set */ bool EquatorialCylindricalShape::intersectEllipsoid( const std::vector<double> observerBodyFixedPosition, const std::vector<double> &observerLookVectorToTarget) { // Clear out previous surface point and normal clearSurfacePoint(); SpiceDouble lookB[3]; // This memcpy does: // lookB[0] = observerLookVectorToTarget[0]; // lookB[1] = observerLookVectorToTarget[1]; // lookB[2] = observerLookVectorToTarget[2]; memcpy(lookB,&observerLookVectorToTarget[0], 3*sizeof(double)); // get target radii // std::vector<Distance> radii = targetRadii(); // SpiceDouble a = radii[0].kilometers(); // SpiceDouble b = radii[1].kilometers(); // SpiceDouble c = radii[2].kilometers(); SpiceDouble a = m_maxRadius->kilometers(); SpiceDouble b = m_maxRadius->kilometers(); SpiceDouble c = m_maxRadius->kilometers(); // check if observer look vector intersects the target SpiceDouble intersectionPoint[3]; SpiceBoolean intersected = false; NaifStatus::CheckErrors(); surfpt_c((SpiceDouble *) &observerBodyFixedPosition[0], lookB, a, b, c, intersectionPoint, &intersected); NaifStatus::CheckErrors(); if (intersected) { SurfacePoint p; p.FromNaifArray(intersectionPoint); setSurfacePoint(p); virtual void setTargetRadii(SpiceDouble &a, SpiceDouble &b, SpiceDouble &c) { a = m_maxRadius->kilometers(); b = m_maxRadius->kilometers(); c = m_maxRadius->kilometers(); } setHasIntersection(intersected); setHasEllipsoidIntersection(intersected); return intersected; } }
isis/src/base/objs/EquatorialCylindricalShape/EquatorialCylindricalShape.h +2 −3 Original line number Diff line number Diff line Loading @@ -66,9 +66,8 @@ namespace Isis { std::vector<double> lookDirection); protected: virtual bool intersectEllipsoid( const std::vector<double> observerPosRelativeToTarget, const std::vector<double> &observerLookVectorToTarget); virtual void setTargetRadii(SpiceDouble &a, SpiceDouble &b, SpiceDouble &c); private: Distance *m_minRadius; //!< Minimum radius value in DEM file Loading
isis/src/base/objs/ShapeModel/ShapeModel.cpp +21 −4 Original line number Diff line number Diff line Loading @@ -198,6 +198,23 @@ namespace Isis { return acos(angle) * RAD2DEG; } /** * Sets the parameters to the Target radii * * param &a SpiceDouble reference to be set * * param &b SpiceDouble reference to be set * * param &c SpiceDouble reference to be set */ virtual void setTargetRadii(SpiceDouble &a, SpiceDouble &b, SpiceDouble &c) { // get target radii std::vector<Distance> radii = targetRadii(); a = radii[0].kilometers(); b = radii[1].kilometers(); c = radii[2].kilometers(); } /** * Returns the status of the ellipsoid model intersection. Loading Loading @@ -283,10 +300,10 @@ namespace Isis { memcpy(lookB,&observerLookVectorToTarget[0], 3*sizeof(double)); // get target radii std::vector<Distance> radii = targetRadii(); SpiceDouble a = radii[0].kilometers(); SpiceDouble b = radii[1].kilometers(); SpiceDouble c = radii[2].kilometers(); SpiceDouble a; SpiceDouble b; SpiceDouble c; setTargetRadii(&a, &b, &c); // check if observer look vector intersects the target SpiceDouble intersectionPoint[3]; Loading
isis/src/base/objs/ShapeModel/ShapeModel.h +5 −2 Original line number Diff line number Diff line Loading @@ -166,6 +166,9 @@ namespace Isis { const std::vector<double> lookDirection); protected: // Virtual function to be called in intersectEllipsoid to avoid redundant code virtual void setTargetRadii(SpiceDouble &a, SpiceDouble &b, SpiceDouble &c); // Set the normal (surface or local) of the current intersection point void setNormal(const std::vector<double>); Loading @@ -181,7 +184,7 @@ namespace Isis { void calculateEllipsoidalSurfaceNormal(); // Intersect ellipse virtual bool intersectEllipsoid( bool intersectEllipsoid( const std::vector<double> observerPosRelativeToTarget, const std::vector<double> &observerLookVectorToTarget); Loading