GreatCircleArc Class Reference

#include <GreatCircles.h>

List of all members.

Public Member Functions

 GreatCircleArc ()
 Create a bad great circle arc.
 GreatCircleArc (double startLat, double startLong, double endLat, double endLong, VisualizationState &m_visualizationState)
 Create a great circle arc.
void draw (bool withCross=true, double width=1.0) const
 Draw the great circle arc on the fast preview.
float squareDistance (hugin_utils::FDiff2D point) const
 Return the square of the minimal distance between the great circle arc and a coorinate on the panorama.
double getxscale () const

Public Attributes

double m_xscale

Protected Attributes

std::vector< LineSegmentm_lines
VisualizationStatem_visualizationState

Classes

struct  LineSegment


Detailed Description

Definition at line 65 of file GreatCircles.h.


Constructor & Destructor Documentation

GreatCircleArc::GreatCircleArc (  ) 

Create a bad great circle arc.

draw() won't do anything and squareDistance() will return the maximum float.

Definition at line 64 of file GreatCircles.cpp.

Referenced by GreatCircleArc().

GreatCircleArc::GreatCircleArc ( double  startLat,
double  startLong,
double  endLat,
double  endLong,
VisualizationState m_visualizationState 
)

Create a great circle arc.

Parameters:
startLat lattiude of the first point in degrees.
startLong longitude of the first point in degrees.
endLat lattide of the second point in degrees.
endLong longitude of the second point in degrees.

Handle case where the points are opposite sides of the sphere (i.e. The angle startLat is -endLat and startLong is -endLong.) There are infinetly many great circles in this case, we pick one going through (180, 90), by splitting the problem in two.

Todo:
don't check the +/- 180 degree boundary when projection does not break there.

Definition at line 68 of file GreatCircles.cpp.

References HuginBase::PTools::Transform::createInvTransform(), HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, VisualizationState::GetOptions(), VisualizationState::GetScale(), HuginBase::PanoramaOptions::getWidth(), GreatCircleArc(), m_lines, M_PI, m_visualizationState, m_xscale, segments, HuginBase::BaseSrcPanoImage::setHFOV(), HuginBase::BaseSrcPanoImage::setProjection(), HuginBase::SrcPanoImage::setSize(), HuginBase::PTools::Transform::transformImgCoord(), and GreatCircleArc::LineSegment::vertices.


Member Function Documentation

void GreatCircleArc::draw ( bool  withCross = true,
double  width = 1.0 
) const

Draw the great circle arc on the fast preview.

Todo:
It is probably more apropriate to use thin rectangles than lines. There are hardware defined limits on what width a line can be, and the worst case is the hardware only alows lines 1 pixel thick.

Definition at line 215 of file GreatCircles.cpp.

References getxscale(), m_lines, and m_visualizationState.

Referenced by PreviewLayoutLinesTool::LineDetails::draw().

double GreatCircleArc::getxscale (  )  const

Definition at line 425 of file GreatCircles.cpp.

References m_xscale.

Referenced by draw().

float GreatCircleArc::squareDistance ( hugin_utils::FDiff2D  point  )  const

Return the square of the minimal distance between the great circle arc and a coorinate on the panorama.

This is an approximation, but should be reasonable.

Definition at line 464 of file GreatCircles.cpp.

References vigra_ext::distance(), m_lines, and celeste::max().

Referenced by PreviewLayoutLinesTool::LineDetails::getDistance().


Member Data Documentation

std::vector<LineSegment> GreatCircleArc::m_lines [protected]

Definition at line 109 of file GreatCircles.h.

Referenced by draw(), GreatCircleArc(), and squareDistance().

VisualizationState* GreatCircleArc::m_visualizationState [protected]

Definition at line 110 of file GreatCircles.h.

Referenced by draw(), and GreatCircleArc().

double GreatCircleArc::m_xscale

Definition at line 88 of file GreatCircles.h.

Referenced by getxscale(), and GreatCircleArc().


The documentation for this class was generated from the following files:
Generated on 23 Nov 2014 for Hugintrunk by  doxygen 1.4.7