Commit 659ae748 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Merged with trunk.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/Fedora25@8119 41f8697f-d340-4b68-9986-7bafba869bb8
parents 9b75bc6f 51e618cb
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -310,11 +310,6 @@ namespace Isis {
    if ( triangleIndex() != other.triangleIndex() ) return (false);
    if ( partId() != other.partId() ) return (false);
    
    // Check the emission angle from other.observer to this.point
    btVector3 psB = (other.observer() - point()).normalized();
    btScalar  angle = std::acos( normal().dot( psB ) ) * RAD2DEG;
    if ( std::fabs( angle ) > 90.0 ) return (false);
    
    // How close are the two intercept points?
    if ( distance( other ) > tolerance ) return ( false );

+18 −0
Original line number Diff line number Diff line
@@ -346,6 +346,14 @@ namespace Isis {
      return true;
    }
    
    // Check if the emission angle is greater than 90 degrees
    // If true, then it is occluded, if false then unknown
    btVector3 psB = (observer - hit.point()).normalized();
    btScalar  angle = std::acos( hit.normal().dot( psB ) ) * RAD2DEG;
    if ( std::fabs( angle ) > 90.0 - DBL_MIN) {
      return true;
    }

    // Ray cast from the observer to the intersection
    //   If we have an intersection, test for occlusion
    BulletClosestRayCallback results( observer, hit.point() );
@@ -461,8 +469,18 @@ namespace Isis {
   */
  bool BulletShapeModel::isVisibleFrom(const std::vector<double> observerPos,
                                       const std::vector<double> lookDirection)  {

    if ( !m_intercept.isValid() ) return (false);

    // Check if the emission angle is greater than 90 degrees
    // If true, then it is occluded, if false then unknown
    btVector3 observer(observerPos[0], observerPos[1], observerPos[2]);
    btVector3 psB = (observer - m_intercept.point()).normalized();
    btScalar  angle = std::acos( m_intercept.normal().dot( psB ) ) * RAD2DEG;
    if ( std::fabs( angle ) > 90.0 - DBL_MIN) {
      return false;
    }

    btVector3 rayEnd = castLookDir( observer,  btVector3(lookDirection[0], lookDirection[1], lookDirection[2]) );
    BulletClosestRayCallback results(observer, rayEnd);
    (void) m_model->raycast(observer, rayEnd, results);
+82 −11
Original line number Diff line number Diff line
@@ -24,12 +24,13 @@
#include "CameraDistortionMap.h"

namespace Isis {
  /** Camera distortion map constructor
  /** 
   * Camera distortion map constructor
   *
   * Create a camera distortion map.  This class maps between distorted
   * and undistorted focal plane x/y's.  The default mapping is the
   * identity, that is, the focal plane x/y and undistorted focal plane
   * x/y will be identical.
   * Create a radial camera distortion map.  This class maps between 
   * distorted and undistorted focal plane x/y's.  The default mapping 
   * is the identity, that is, the focal plane x/y and undistorted 
   * focal plane x/y will be identical. 
   *
   * @param parent        the parent camera that will use this distortion map
   * @param zDirection    the direction of the focal plane Z-axis
@@ -43,7 +44,15 @@ namespace Isis {
  }


  /** Load distortion coefficients
  /**
   * Destructor for the ISIS3 default camera distortion map. 
   */
  CameraDistortionMap::~CameraDistortionMap() {
  }


  /** 
   * Load distortion coefficients
   *
   * This method loads the distortion coefficients from the instrument
   * kernel.  The coefficients in the NAIF instrument kernel are
@@ -70,7 +79,8 @@ namespace Isis {
  }


  /** Compute undistorted focal plane x/y
  /** 
   * Compute undistorted focal plane x/y
   *
   * Compute undistorted focal plane x/y given a distorted focal plane x/y.
   * This virtual method can be used to apply various techniques for removing
@@ -114,7 +124,8 @@ namespace Isis {
  }


  /** Compute distorted focal plane x/y
  /** 
   * Compute distorted focal plane x/y
   *
   * Compute distorted focal plane x/y given an undistorted focal plane x/y.
   * This virtual method is used to apply various techniques for adding
@@ -192,7 +203,9 @@ namespace Isis {


  /** 
   * @returns The optical distortion of polynomial coefficients
   * Retrieve the distortion coefficients used for this model. 
   *  
   * @returns The optical distortion of polynomial coefficients.
   */
  std::vector<double> CameraDistortionMap::OpticalDistortionCoefficients() const {
    return p_odk;
@@ -200,11 +213,69 @@ namespace Isis {


  /** 
   * Gets the z-direction for this camera. The direction is represented as 
   * +/- 1. 
   * @returns The direction of the focal plane Z-axis
   */
  double CameraDistortionMap::ZDirection() const {
    return p_zDirection;
  }


  /** 
   * Gets the x-value in the focal plane coordinate system. This is represented 
   * in millimeters from the origin. 
   *  
   * @returns The distorted focal plane x.
   */
  double CameraDistortionMap::FocalPlaneX() const {
    return p_focalPlaneX;
  }
  

  /**
   * Gets the y-value in the focal plane coordinate system. This is represented 
   * in millimeters from the origin.
   *  
   * @returns The distorted focal plane y.
   */
  double CameraDistortionMap::FocalPlaneY() const {
    return p_focalPlaneY;
  }
  

  /**
   * Gets the x-value in the undistorted focal plane coordinate system. This is represented 
   * in millimeters from the origin.
   * 
   *@returns The undistorted focal plane x
   */
  double CameraDistortionMap::UndistortedFocalPlaneX() const {
    return p_undistortedFocalPlaneX;
  }
  

  /**
   * Gets the y-value in the undistorted focal plane coordinate system. This is represented 
   * in millimeters from the origin. 
   *  
   * @returns The undistorted focal plane y
   */
  double CameraDistortionMap::UndistortedFocalPlaneY() const {
    return p_undistortedFocalPlaneY;
  }
  

  /**
   * Gets the z-value in the undistorted focal plane coordinate system. This is 
   * represented as the focal length, in millimeters, with the sign indicating 
   * z-direction. 
   *  
   * @returns The undistorted focal plane z
   */
  double CameraDistortionMap::UndistortedFocalPlaneZ() const {
    return p_zDirection *p_camera->FocalLength();
  }

}
+10 −39
Original line number Diff line number Diff line
@@ -50,16 +50,17 @@ namespace Isis {
   *                           since no unitTest exists. Fixed indentation
   *                           of history entries.  References #1490.
   *   @history 2017-08-30 Summer Stapleton - Updated documentation. References #4807.
   *
   *   @history 2017-09-04 Kristin Berry - Made SetDistortion virtual so that
   *                           individual camera model distortion maps can
   *                           set the values.
   */
  class CameraDistortionMap {
    public:
      CameraDistortionMap(Camera *parent, double zDirection = 1.0);

      void SetDistortion(int naifIkCode);
      virtual void SetDistortion(int naifIkCode);

      //! Destructor
      virtual ~CameraDistortionMap() {}
      virtual ~CameraDistortionMap();

      virtual bool SetFocalPlane(double dx, double dy);

@@ -68,41 +69,11 @@ namespace Isis {
      std::vector<double> OpticalDistortionCoefficients() const;

      double ZDirection() const;

      /**
       * @returns The distorted focal plane x
       */
      inline double FocalPlaneX() const {
        return p_focalPlaneX;
      }

      /**
       * @returns The distorted focal plane y
       */
      inline double FocalPlaneY() const {
        return p_focalPlaneY;
      }

      /**
       *@returns The undistorted focal plane x
       */
      inline double UndistortedFocalPlaneX() const {
        return p_undistortedFocalPlaneX;
      }

      /**
       * @returns The undistorted focal plane y
       */
      inline double UndistortedFocalPlaneY() const {
        return p_undistortedFocalPlaneY;
      }

      /**
       * @returns The undistorted focal plane z
       */
      inline double UndistortedFocalPlaneZ() const {
        return p_zDirection * p_camera->FocalLength();
      }
      double FocalPlaneX() const;
      double FocalPlaneY() const;
      double UndistortedFocalPlaneX() const;
      double UndistortedFocalPlaneY() const;
      double UndistortedFocalPlaneZ() const;

    protected:
      Camera *p_camera;                 //!< The camera to distort/undistort
+3 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include "ControlPoint.h"
#include "LineManager.h"
#include "Message.h"
#include "SpecialPixel.h"

#include <iostream>
#include <math.h>
@@ -250,8 +251,8 @@ namespace Isis {
        if (measure->IsIgnored())  continue;

        temp = (measure->*statFunc)();  //get the data using the passed ControlMeasure acessor function pointer
        if (temp > max) max = temp;
        if (temp < min) min = temp;
        if ( !IsSpecial(temp) && temp > max ) max = temp;
        if ( !IsSpecial(temp) && temp < min ) min = temp;
      }
    }

Loading