Exemple #1
0
/**
 * Convenience overload.
 * 
 * @param minBounds :: Near-bottom-left corner of the scene.
 * @param maxBounds :: Far-top-right corner of the scene.
 * @param type :: Projection type: ORTHO or PERSPECTIVE. PERSPECTIVE isn't fully implemented
 */
void Viewport::setProjection(const Mantid::Kernel::V3D& minBounds, const Mantid::Kernel::V3D& maxBounds, ProjectionType type)
{
  double radius = minBounds.norm();
  double tmp = maxBounds.norm();
  if (tmp > radius) radius = tmp;

  setProjection( minBounds.X(), maxBounds.X(), minBounds.Y(), maxBounds.Y(), -radius, radius, type );
}
  /**
 Calculate the weight at distance from epicenter. Uses linear scaling based on distance from epicenter.
 @param distance : absolute distance from epicenter
 @return weighting
 */
 double GaussianWeightingnD::weightAt(const Mantid::Kernel::V3D& distance)
 {
   /*
   distance.norm() = r
   r/R provides normalisation
   */
   double normalisedDistance = distance.norm()/m_cutOff; //Ensures 1 at the edges and zero in the center no matter what the units are
   return calculateGaussian(normalisedDistance*normalisedDistance);
 }
 /**
 Calculate the weight at distance from epicenter. Uses linear scaling based on distance from epicenter.
 @param distance : absolute distance from epicenter
 @return weighting
 */
 double LinearWeighting::weightAt(const Mantid::Kernel::V3D& distance)
 {
   return 1 - (distance.norm()/m_cutOff);
 }