Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Public Attributes | Protected Attributes | List of all members
GreatCircleArc Class Reference

#include <GreatCircles.h>

Classes

struct  LineSegment
 

Public Member Functions

 GreatCircleArc ()
 Create a bad great circle arc. More...
 
 GreatCircleArc (double startLat, double startLong, double endLat, double endLong, VisualizationState &m_visualizationState)
 Create a great circle arc. More...
 
void draw (bool withCross=true, double width=1.0) const
 Draw the great circle arc on the fast preview. More...
 
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. More...
 
double getxscale () const
 

Public Attributes

double m_xscale
 

Protected Attributes

std::vector< LineSegmentm_lines
 
VisualizationStatem_visualizationState
 

Detailed Description

Definition at line 67 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 69 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
startLatlattiude of the first point in degrees.
startLonglongitude of the first point in degrees.
endLatlattide of the second point in degrees.
endLonglongitude 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 73 of file GreatCircles.cpp.

References HuginBase::PTools::Transform::createInvTransform(), HuginBase::BaseSrcPanoImage::EQUIRECTANGULAR, VisualizationState::GetOptions(), VisualizationState::GetScale(), HuginBase::PanoramaOptions::getWidth(), GreatCircleArc(), celeste::line, m_lines, M_PI, m_visualizationState, m_xscale, celeste::max(), max_segments, celeste::min(), min_segment_angle, hugin_utils::roundi(), 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.

Definition at line 221 of file GreatCircles.cpp.

References getxscale(), m_lines, and m_visualizationState.

Referenced by PreviewLayoutLinesTool::LineDetails::draw(), and GreatCircles::drawLineFromSpherical().

double GreatCircleArc::getxscale ( void  ) const

Definition at line 426 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 465 of file GreatCircles.cpp.

References m_lines, and celeste::max().

Member Data Documentation

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

Definition at line 111 of file GreatCircles.h.

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

VisualizationState* GreatCircleArc::m_visualizationState
protected

Definition at line 112 of file GreatCircles.h.

Referenced by draw(), and GreatCircleArc().

double GreatCircleArc::m_xscale

Definition at line 90 of file GreatCircles.h.

Referenced by getxscale(), and GreatCircleArc().


The documentation for this class was generated from the following files: