CPEditorPanel Class Reference

control point editor panel. More...

#include <CPEditorPanel.h>

Inheritance diagram for CPEditorPanel:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CPEditorPanel ()
 ctor.
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxT("panel"))
void Init (HuginBase::Panorama *pano)
virtual ~CPEditorPanel ()
 dtor.
void setLeftImage (unsigned int imgNr)
 set left image
void setRightImage (unsigned int imgNr)
 set right image
void SetPano (HuginBase::Panorama *panorama)
void panoramaChanged (HuginBase::Panorama &pano)
 called when the panorama changes and we should update our display
void panoramaImagesChanged (HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
 notifies about changes to images
void SelectGlobalPoint (unsigned int globalNr)
 Select a point.
void ShowControlPoint (unsigned int cpNr)
 show a control point
void ClearSelection ()
 unselect a point

Private Types

 NO_POINT
 no point selected
 LEFT_POINT
 point in left image selected
 RIGHT_POINT
 selected point in right image
 RIGHT_POINT_RETRY
 point in left image selected, finetune failed in right image
 LEFT_POINT_RETRY
 right point, finetune for left point failed
 BOTH_POINTS_SELECTED
 left and right point selected, waiting for add point.
 CPTAB_ACTION_CREATE_CP = 0
 CPTAB_ACTION_CELESTE = 1
 CPTAB_ACTION_CLEAN_CP = 2
enum  CPCreationState {
  NO_POINT, LEFT_POINT, RIGHT_POINT, RIGHT_POINT_RETRY,
  LEFT_POINT_RETRY, BOTH_POINTS_SELECTED
}
 the state machine for point selection: it is set to the current selection More...
enum  CPTabActionButtonMode { CPTAB_ACTION_CREATE_CP = 0, CPTAB_ACTION_CELESTE = 1, CPTAB_ACTION_CLEAN_CP = 2 }

Private Member Functions

void UpdateDisplay (bool newImages)
 updates the display after another image has been selected.
void EnablePointEdit (bool state)
 enable or disable controls for editing other points
void SelectLocalPoint (unsigned int LVpointNr)
 select a local point.
bool globalPNr2LocalPNr (unsigned int &localNr, unsigned int globalNr) const
 map a global point nr to a local one, if possible
unsigned int localPNr2GlobalPNr (unsigned int localNr) const
 find a local point
void NewPointChange (hugin_utils::FDiff2D p, bool left)
void CreateNewPoint ()
 this is used to finally create the point in the panorama model
bool PointFineTune (unsigned int tmplImgNr, const vigra::Diff2D &tmplPoint, int tmplWidth, unsigned int subjImgNr, const hugin_utils::FDiff2D &subjPoint, int searchWidth, vigra_ext::CorrelationResult &tunedPos)
 search for region in destImg
const float getVerticalCPBias ()
void OnCPEvent (CPEvent &ev)
void OnLeftChoiceChange (wxCommandEvent &e)
void OnRightChoiceChange (wxCommandEvent &e)
void OnCPListSelect (wxListEvent &e)
void OnCPListDeselect (wxListEvent &e)
void OnAddButton (wxCommandEvent &e)
void OnZoom (wxCommandEvent &e)
void OnTextPointChange (wxCommandEvent &e)
void OnKey (wxKeyEvent &e)
void OnDeleteButton (wxCommandEvent &e)
void OnPrevImg (wxCommandEvent &e)
void OnNextImg (wxCommandEvent &e)
void OnColumnWidthChange (wxListEvent &e)
void OnFineTuneButton (wxCommandEvent &e)
void OnActionButton (wxCommandEvent &e)
void OnCreateCPButton (wxCommandEvent &e)
void OnCelesteButton (wxCommandEvent &e)
void OnCleanCPButton (wxCommandEvent &e)
void OnActionSelectCreate (wxCommandEvent &e)
void OnActionSelectCeleste (wxCommandEvent &e)
void OnActionSelectCleanCP (wxCommandEvent &e)
void OnActionContextMenu (wxContextMenuEvent &e)
void FineTuneSelectedPoint (bool left)
void FineTuneNewPoint (bool left)
hugin_utils::FDiff2D LocalFineTunePoint (unsigned int srcNr, const vigra::Diff2D &srcPnt, hugin_utils::FDiff2D &movedSrcPnt, unsigned int moveNr, const hugin_utils::FDiff2D &movePnt)
hugin_utils::FDiff2D EstimatePoint (const hugin_utils::FDiff2D &p, bool left)
 Estimate position of point in the other image.
void changeState (CPCreationState newState)
void estimateAndAddOtherPoint (const hugin_utils::FDiff2D &p, bool left, CPImageCtrl *thisImg, unsigned int thisImgNr, CPCreationState THIS_POINT, CPCreationState THIS_POINT_RETRY, CPImageCtrl *otherImg, unsigned int otherImgNr, CPCreationState OTHER_POINT, CPCreationState OTHER_POINT_RETRY)
 estimate and set point in other image
CPImageCtrl::ImageRotation GetRot (double yaw, double roll, double pitch)
 calculate rotation required for upright image display from roll, pitch and yaw angles
void UpdateTransforms ()
 updated the internal transform object for drawing line in controls
 DECLARE_EVENT_TABLE ()

Private Attributes

CPCreationState cpCreationState
CPTabActionButtonMode m_cpActionButtonMode
wxMenu * m_cpActionContextMenu
wxString m_currentCPDetector
CPImagesComboBoxm_leftChoice
CPImagesComboBoxm_rightChoice
CPImageCtrlm_leftImg
CPImageCtrlm_rightImg
wxListCtrl * m_cpList
wxTextCtrl * m_x1Text
wxTextCtrl * m_y1Text
wxTextCtrl * m_x2Text
wxTextCtrl * m_y2Text
wxTextCtrl * m_errorText
wxChoice * m_cpModeChoice
wxButton * m_addButton
wxButton * m_delButton
wxButton * m_actionButton
wxCheckBox * m_autoAddCB
wxCheckBox * m_fineTuneCB
wxCheckBox * m_estimateCB
wxPanel * m_cp_ctrls
HuginBase::Panoramam_pano
unsigned int m_leftImageNr
unsigned int m_rightImageNr
std::string m_leftFile
std::string m_rightFile
bool m_listenToPageChange
double m_detailZoomFactor
HuginBase::PTools::Transform m_leftTransform
HuginBase::PTools::Transform m_leftInvTransform
HuginBase::PTools::Transform m_rightTransform
HuginBase::PTools::Transform m_rightInvTransform
unsigned int m_selectedPoint
HuginBase::CPointVector currentPoints
std::set< unsigned int > mirroredPoints
size_t m_countCP
CPImageCtrl::ImageRotation m_leftRot
CPImageCtrl::ImageRotation m_rightRot

Detailed Description

control point editor panel.

This panel is used to create/change/edit control points

Todo:
support control lines

Definition at line 64 of file CPEditorPanel.h.


Member Enumeration Documentation

enum CPEditorPanel::CPCreationState [private]

the state machine for point selection: it is set to the current selection

Enumerator:
NO_POINT  no point selected
LEFT_POINT  point in left image selected
RIGHT_POINT  selected point in right image
RIGHT_POINT_RETRY  point in left image selected, finetune failed in right image
LEFT_POINT_RETRY  right point, finetune for left point failed
BOTH_POINTS_SELECTED  left and right point selected, waiting for add point.

Definition at line 200 of file CPEditorPanel.h.

enum CPEditorPanel::CPTabActionButtonMode [private]

Enumerator:
CPTAB_ACTION_CREATE_CP 
CPTAB_ACTION_CELESTE 
CPTAB_ACTION_CLEAN_CP 

Definition at line 229 of file CPEditorPanel.h.


Constructor & Destructor Documentation

CPEditorPanel::OnRightChoiceChange CPEditorPanel::OnCPListDeselect CPEditorPanel::OnZoom CPEditorPanel::OnTextPointChange CPEditorPanel::OnTextPointChange CPEditorPanel::OnDeleteButton CPEditorPanel::OnPrevImg CPEditorPanel::OnFineTuneButton CPEditorPanel::OnActionSelectCreate CPEditorPanel::OnActionSelectCleanCP CPEditorPanel::CPEditorPanel (  ) 

ctor.

Definition at line 98 of file CPEditorPanel.cpp.

References DEBUG_TRACE.

CPEditorPanel::~CPEditorPanel (  )  [virtual]

dtor.

Definition at line 258 of file CPEditorPanel.cpp.

References DEBUG_TRACE, m_autoAddCB, m_estimateCB, m_fineTuneCB, m_pano, m_x1Text, m_x2Text, m_y1Text, m_y2Text, and HuginBase::Panorama::removeObserver().


Member Function Documentation

void CPEditorPanel::changeState ( CPCreationState  newState  )  [private]

Definition at line 1802 of file CPEditorPanel.cpp.

References BOTH_POINTS_SELECTED, CPImageCtrl::clearNewPoint(), ClearSelection(), cpCreationState, DEBUG_TRACE, MainFrame::Get(), LEFT_POINT, LEFT_POINT_RETRY, m_addButton, m_delButton, m_fineTuneCB, m_leftImageNr, m_leftImg, m_rightImageNr, m_rightImg, m_selectedPoint, NO_POINT, OnZoom(), RIGHT_POINT, RIGHT_POINT_RETRY, CPImageCtrl::showSearchArea(), and CPImageCtrl::showTemplateArea().

Referenced by ClearSelection(), CreateNewPoint(), estimateAndAddOtherPoint(), NewPointChange(), OnCPEvent(), OnCPListDeselect(), OnCPListSelect(), OnDeleteButton(), OnKey(), setLeftImage(), setRightImage(), and ShowControlPoint().

void CPEditorPanel::ClearSelection (  ) 

unselect a point

Definition at line 577 of file CPEditorPanel.cpp.

References changeState(), CPImageCtrl::deselect(), m_cpList, m_leftImg, m_rightImg, m_selectedPoint, NO_POINT, and UpdateDisplay().

Referenced by changeState().

bool CPEditorPanel::Create ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxTAB_TRAVERSAL,
const wxString &  name = wxT("panel") 
)

Definition at line 105 of file CPEditorPanel.cpp.

References cpCreationState, CPTAB_ACTION_CELESTE, CPTAB_ACTION_CLEAN_CP, CPTAB_ACTION_CREATE_CP, DEBUG_ASSERT, DEBUG_TRACE, CPImageCtrl::Init(), m_actionButton, m_addButton, m_autoAddCB, m_cp_ctrls, m_cpActionButtonMode, m_cpActionContextMenu, m_cpList, m_cpModeChoice, m_delButton, m_detailZoomFactor, m_estimateCB, m_fineTuneCB, m_leftChoice, m_leftImageNr, m_leftImg, m_leftInvTransform, m_leftRot, m_leftTransform, m_listenToPageChange, m_rightChoice, m_rightImageNr, m_rightImg, m_rightInvTransform, m_rightRot, m_rightTransform, m_selectedPoint, m_x1Text, m_x2Text, m_y1Text, m_y2Text, NO_POINT, OnActionContextMenu(), OnActionSelectCeleste(), OnActionSelectCleanCP(), OnActionSelectCreate(), OnKey(), OnZoom(), CPImageCtrl::ROT0, and CPImageCtrl::setTransforms().

void CPEditorPanel::CreateNewPoint (  )  [private]

this is used to finally create the point in the panorama model

Definition at line 500 of file CPEditorPanel.cpp.

References CommandHistory::addCommand(), CPImagesComboBox::CalcCPDistance(), changeState(), DEBUG_TRACE, MainFrame::Get(), PanoCommand::GlobalCmdHist::getInstance(), CPImageCtrl::getNewPoint(), getVerticalCPBias(), HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, m_cpModeChoice, m_leftChoice, m_leftImageNr, m_leftImg, m_leftRot, m_pano, m_rightChoice, m_rightImageNr, m_rightImg, HuginBase::ControlPoint::mode, NO_POINT, CPImageCtrl::ROT0, CPImageCtrl::ROT180, SelectGlobalPoint(), HuginBase::ControlPoint::X, hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::X_Y, HuginBase::ControlPoint::Y, hugin_utils::TDiff2D< T >::y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.

Referenced by estimateAndAddOtherPoint(), NewPointChange(), OnAddButton(), and OnCPEvent().

CPEditorPanel::DECLARE_EVENT_TABLE (  )  [private]

void CPEditorPanel::EnablePointEdit ( bool  state  )  [private]

enable or disable controls for editing other points

Definition at line 1515 of file CPEditorPanel.cpp.

References m_cpModeChoice, m_delButton, m_x1Text, m_x2Text, m_y1Text, and m_y2Text.

Referenced by OnCPListDeselect(), OnCPListSelect(), SelectLocalPoint(), and UpdateDisplay().

void CPEditorPanel::estimateAndAddOtherPoint ( const hugin_utils::FDiff2D p,
bool  left,
CPImageCtrl thisImg,
unsigned int  thisImgNr,
CPCreationState  THIS_POINT,
CPCreationState  THIS_POINT_RETRY,
CPImageCtrl otherImg,
unsigned int  otherImgNr,
CPCreationState  OTHER_POINT,
CPCreationState  OTHER_POINT_RETRY 
) [private]

estimate and set point in other image

Definition at line 652 of file CPEditorPanel.cpp.

References BOTH_POINTS_SELECTED, changeState(), CreateNewPoint(), EstimatePoint(), MainFrame::Get(), HuginBase::Panorama::getImage(), CPImageCtrl::getNewPoint(), HuginBase::SrcPanoImage::getWidth(), HUGIN_FT_SEARCH_AREA_PERCENT, HUGIN_FT_TEMPLATE_SIZE, m_autoAddCB, m_detailZoomFactor, m_fineTuneCB, m_pano, celeste::min(), PointFineTune(), CPImageCtrl::setNewPoint(), CPImageCtrl::setScale(), CPImageCtrl::showPosition(), hugin_utils::TDiff2D< T >::toDiff2D(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by NewPointChange().

FDiff2D CPEditorPanel::EstimatePoint ( const hugin_utils::FDiff2D p,
bool  left 
) [private]

Estimate position of point in the other image.

Parameters:
p point to warp to other image
left true if p is located in left image.

Definition at line 2237 of file CPEditorPanel.cpp.

References HuginBase::Panorama::addImage(), HuginBase::PTools::Transform::createInvTransform(), HuginBase::PTools::Transform::createTransform(), currentPoints, DEBUG_DEBUG, DEBUG_WARN, deregisterPTWXDlgFcn(), HuginBase::SrcPanoImage::getHeight(), HuginBase::Panorama::getImage(), HuginBase::Panorama::getOptions(), HuginBase::Panorama::getSrcImage(), HuginBase::SrcPanoImage::getWidth(), m_leftImageNr, m_pano, m_rightImageNr, HuginBase::PTools::optimize(), registerPTWXDlgFcn(), HuginBase::Panorama::setCtrlPoints(), HuginBase::Panorama::setOptimizeVector(), HuginBase::BaseSrcPanoImage::setPitch(), HuginBase::BaseSrcPanoImage::setRoll(), HuginBase::BaseSrcPanoImage::setX(), HuginBase::BaseSrcPanoImage::setY(), HuginBase::BaseSrcPanoImage::setYaw(), HuginBase::BaseSrcPanoImage::setZ(), HuginBase::PTools::Transform::transformImgCoord(), and HuginBase::ControlPoint::X_Y.

Referenced by estimateAndAddOtherPoint().

void CPEditorPanel::FineTuneNewPoint ( bool  left  )  [private]

Definition at line 2192 of file CPEditorPanel.cpp.

References BOTH_POINTS_SELECTED, cpCreationState, CPImageCtrl::getNewPoint(), LEFT_POINT_RETRY, LocalFineTunePoint(), m_leftImageNr, m_leftImg, m_rightImageNr, m_rightImg, RIGHT_POINT_RETRY, CPImageCtrl::setNewPoint(), hugin_utils::TDiff2D< T >::toDiff2D(), CPImageCtrl::update(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by OnFineTuneButton(), and OnKey().

void CPEditorPanel::FineTuneSelectedPoint ( bool  left  )  [private]

Definition at line 2142 of file CPEditorPanel.cpp.

References CommandHistory::addCommand(), currentPoints, DEBUG_ASSERT, DEBUG_DEBUG, PanoCommand::GlobalCmdHist::getInstance(), LocalFineTunePoint(), m_pano, m_selectedPoint, mirroredPoints, hugin_utils::roundi(), set_contains(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by OnFineTuneButton(), and OnKey().

CPImageCtrl::ImageRotation CPEditorPanel::GetRot ( double  yaw,
double  roll,
double  pitch 
) [private]

calculate rotation required for upright image display from roll, pitch and yaw angles

Definition at line 2330 of file CPEditorPanel.cpp.

References CPImageCtrl::ROT0, CPImageCtrl::ROT180, CPImageCtrl::ROT270, and CPImageCtrl::ROT90.

Referenced by setLeftImage(), and setRightImage().

const float CPEditorPanel::getVerticalCPBias (  )  [private]

Definition at line 559 of file CPEditorPanel.cpp.

References HuginBase::Panorama::getOptions(), HuginBase::PanoramaOptions::getProjection(), m_pano, and HuginBase::PanoramaOptions::RECTILINEAR.

Referenced by CreateNewPoint(), and OnCPEvent().

bool CPEditorPanel::globalPNr2LocalPNr ( unsigned int &  localNr,
unsigned int  globalNr 
) const [private]

map a global point nr to a local one, if possible

Definition at line 629 of file CPEditorPanel.cpp.

References currentPoints.

Referenced by SelectGlobalPoint().

void CPEditorPanel::Init ( HuginBase::Panorama pano  ) 

Definition at line 251 of file CPEditorPanel.cpp.

References HuginBase::Panorama::addObserver(), and m_pano.

hugin_utils::FDiff2D CPEditorPanel::LocalFineTunePoint ( unsigned int  srcNr,
const vigra::Diff2D &  srcPnt,
hugin_utils::FDiff2D movedSrcPnt,
unsigned int  moveNr,
const hugin_utils::FDiff2D movePnt 
) [private]

Referenced by FineTuneNewPoint(), and FineTuneSelectedPoint().

unsigned int CPEditorPanel::localPNr2GlobalPNr ( unsigned int  localNr  )  const [private]

find a local point

Definition at line 645 of file CPEditorPanel.cpp.

References currentPoints.

Referenced by OnCPEvent(), OnDeleteButton(), and OnKey().

void CPEditorPanel::NewPointChange ( hugin_utils::FDiff2D  p,
bool  left 
) [private]

Definition at line 740 of file CPEditorPanel.cpp.

References BOTH_POINTS_SELECTED, changeState(), CPImageCtrl::clearNewPoint(), cpCreationState, CreateNewPoint(), currentPoints, DEBUG_ASSERT, DEBUG_TRACE, estimateAndAddOtherPoint(), MainFrame::Get(), HuginBase::Panorama::getImage(), CPImageCtrl::getNewPoint(), CPImageCtrl::getScale(), HuginBase::SrcPanoImage::getWidth(), HUGIN_FT_SEARCH_AREA_PERCENT, HUGIN_FT_TEMPLATE_SIZE, LEFT_POINT, LEFT_POINT_RETRY, m_autoAddCB, m_detailZoomFactor, m_estimateCB, m_fineTuneCB, m_leftImageNr, m_leftImg, m_pano, m_rightImageNr, m_rightImg, celeste::min(), NO_POINT, PointFineTune(), RIGHT_POINT, RIGHT_POINT_RETRY, CPImageCtrl::setNewPoint(), CPImageCtrl::setScale(), CPImageCtrl::showPosition(), hugin_utils::TDiff2D< T >::toDiff2D(), CPImageCtrl::update(), and HuginBase::ControlPoint::X_Y.

Referenced by OnCPEvent().

void CPEditorPanel::OnActionButton ( wxCommandEvent &  e  )  [private]

Definition at line 1937 of file CPEditorPanel.cpp.

References CPTAB_ACTION_CELESTE, CPTAB_ACTION_CLEAN_CP, CPTAB_ACTION_CREATE_CP, m_cpActionButtonMode, OnCelesteButton(), OnCleanCPButton(), and OnCreateCPButton().

void CPEditorPanel::OnActionContextMenu ( wxContextMenuEvent &  e  )  [private]

Definition at line 1931 of file CPEditorPanel.cpp.

References MainFrame::Get(), and m_cpActionContextMenu.

Referenced by Create().

void CPEditorPanel::OnActionSelectCeleste ( wxCommandEvent &  e  )  [private]

Definition at line 2100 of file CPEditorPanel.cpp.

References CPTAB_ACTION_CELESTE, m_actionButton, and m_cpActionButtonMode.

Referenced by Create().

void CPEditorPanel::OnActionSelectCleanCP ( wxCommandEvent &  e  )  [private]

Definition at line 2109 of file CPEditorPanel.cpp.

References CPTAB_ACTION_CLEAN_CP, m_actionButton, and m_cpActionButtonMode.

Referenced by Create().

void CPEditorPanel::OnActionSelectCreate ( wxCommandEvent &  e  )  [private]

Definition at line 2091 of file CPEditorPanel.cpp.

References CPTAB_ACTION_CREATE_CP, m_actionButton, and m_cpActionButtonMode.

Referenced by Create().

void CPEditorPanel::OnAddButton ( wxCommandEvent &  e  )  [private]

Definition at line 1754 of file CPEditorPanel.cpp.

References BOTH_POINTS_SELECTED, cpCreationState, and CreateNewPoint().

void CPEditorPanel::OnCelesteButton ( wxCommandEvent &  e  )  [private]

Definition at line 1980 of file CPEditorPanel.cpp.

References CommandHistory::addCommand(), vigra::omp::copyImage(), cout, currentPoints, DEBUG_TRACE, vigra_ext::destImage(), MainFrame::Get(), celeste::getCelesteControlPoints(), HuginBase::Panorama::getImage(), PanoCommand::GlobalCmdHist::getInstance(), MainFrame::GetSVMModel(), HUGIN_CELESTE_FILTER, HUGIN_CELESTE_THRESHOLD, m_leftImageNr, m_pano, vigra_ext::srcImageRange(), threshold(), vigra::omp::transformImage(), ProgressReporterDialog::updateDisplay(), and ProgressReporterDialog::updateDisplayValue().

Referenced by OnActionButton().

void CPEditorPanel::OnCleanCPButton ( wxCommandEvent &  e  )  [private]

Definition at line 2051 of file CPEditorPanel.cpp.

References CommandHistory::addCommand(), currentPoints, PanoCommand::GlobalCmdHist::getInstance(), and m_pano.

Referenced by OnActionButton().

void CPEditorPanel::OnColumnWidthChange ( wxListEvent &  e  )  [private]

Definition at line 2324 of file CPEditorPanel.cpp.

References m_cpList.

void CPEditorPanel::OnCPEvent ( CPEvent ev  )  [private]

Definition at line 357 of file CPEditorPanel.cpp.

References CommandHistory::addCommand(), BOTH_POINTS_SELECTED, CPImagesComboBox::CalcCPDistance(), changeState(), cpCreationState, CreateNewPoint(), currentPoints, DEBUG_DEBUG, DEBUG_ERROR, DEBUG_FATAL, DEBUG_TRACE, CPEvent::DELETE_REGION_SELECTED, MainFrame::Get(), CPEvent::getControlPoint(), PanoCommand::GlobalCmdHist::getInstance(), CPEvent::getMode(), CPEvent::getPoint(), CPEvent::getPointNr(), CPEvent::getRect(), getVerticalCPBias(), HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, localPNr2GlobalPNr(), m_leftChoice, m_leftImageNr, m_leftImg, m_leftRot, m_pano, m_rightChoice, m_rightImageNr, m_rightImg, CPImageCtrl::MaxScrollDelta(), HuginBase::ControlPoint::mode, CPEvent::NEW_LINE_ADDED, CPEvent::NEW_POINT_CHANGED, NewPointChange(), NO_POINT, CPEvent::NONE, CPEvent::POINT_CHANGED, CPEvent::POINT_SELECTED, CPEvent::RIGHT_CLICK, CPImageCtrl::ROT0, CPImageCtrl::ROT180, hugin_utils::roundi(), CPImageCtrl::ScrollDelta(), CPEvent::SCROLLED, SelectGlobalPoint(), SelectLocalPoint(), CPImageCtrl::update(), hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::X, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::X_Y, hugin_utils::TDiff2D< T >::y, HuginBase::ControlPoint::Y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.

void CPEditorPanel::OnCPListDeselect ( wxListEvent &  e  )  [private]

Definition at line 1617 of file CPEditorPanel.cpp.

References changeState(), CPImageCtrl::deselect(), EnablePointEdit(), m_leftImg, m_rightImg, and NO_POINT.

void CPEditorPanel::OnCPListSelect ( wxListEvent &  e  )  [private]

Definition at line 1606 of file CPEditorPanel.cpp.

References changeState(), DEBUG_TRACE, EnablePointEdit(), NO_POINT, and SelectLocalPoint().

void CPEditorPanel::OnCreateCPButton ( wxCommandEvent &  e  )  [private]

Definition at line 1954 of file CPEditorPanel.cpp.

References MainFrame::Get(), m_leftImageNr, m_rightImageNr, MainFrame::RunCPGenerator(), CPDetectorSetting::SetArgs(), and CPDetectorSetting::SetProg().

Referenced by OnActionButton().

void CPEditorPanel::OnDeleteButton ( wxCommandEvent &  e  )  [private]

Definition at line 1762 of file CPEditorPanel.cpp.

References CommandHistory::addCommand(), CPImagesComboBox::CalcCPDistance(), changeState(), cpCreationState, DEBUG_TRACE, PanoCommand::GlobalCmdHist::getInstance(), localPNr2GlobalPNr(), m_cpList, m_leftChoice, m_pano, m_rightChoice, and NO_POINT.

void CPEditorPanel::OnFineTuneButton ( wxCommandEvent &  e  )  [private]

Definition at line 1922 of file CPEditorPanel.cpp.

References BOTH_POINTS_SELECTED, cpCreationState, FineTuneNewPoint(), FineTuneSelectedPoint(), and NO_POINT.

void CPEditorPanel::OnKey ( wxKeyEvent &  e  )  [private]

Definition at line 1670 of file CPEditorPanel.cpp.

References CommandHistory::addCommand(), BOTH_POINTS_SELECTED, changeState(), cpCreationState, DEBUG_DEBUG, FineTuneNewPoint(), FineTuneSelectedPoint(), PanoCommand::GlobalCmdHist::getInstance(), localPNr2GlobalPNr(), m_cpList, m_leftImageNr, m_leftImg, m_pano, m_rightImageNr, NO_POINT, OnNextImg(), OnPrevImg(), and OnZoom().

Referenced by Create().

void CPEditorPanel::OnLeftChoiceChange ( wxCommandEvent &  e  )  [private]

Definition at line 1591 of file CPEditorPanel.cpp.

References DEBUG_TRACE, m_listenToPageChange, and setLeftImage().

void CPEditorPanel::OnNextImg ( wxCommandEvent &  e  )  [private]

Definition at line 1901 of file CPEditorPanel.cpp.

References HuginBase::Panorama::getNrOfImages(), m_leftImageNr, m_pano, m_rightImageNr, setLeftImage(), and setRightImage().

Referenced by OnKey().

void CPEditorPanel::OnPrevImg ( wxCommandEvent &  e  )  [private]

Definition at line 1880 of file CPEditorPanel.cpp.

References HuginBase::Panorama::getNrOfImages(), m_leftImageNr, m_pano, m_rightImageNr, setLeftImage(), and setRightImage().

Referenced by OnKey().

void CPEditorPanel::OnRightChoiceChange ( wxCommandEvent &  e  )  [private]

Definition at line 1599 of file CPEditorPanel.cpp.

References DEBUG_TRACE, m_listenToPageChange, and setRightImage().

void CPEditorPanel::OnTextPointChange ( wxCommandEvent &  e  )  [private]

Definition at line 1526 of file CPEditorPanel.cpp.

References CommandHistory::addCommand(), currentPoints, DEBUG_TRACE, HuginBase::SrcPanoImage::getHeight(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getSrcImage(), HuginBase::SrcPanoImage::getWidth(), m_cpList, m_cpModeChoice, m_pano, m_x1Text, m_x2Text, m_y1Text, m_y2Text, mirroredPoints, set_contains(), and str2double().

void CPEditorPanel::OnZoom ( wxCommandEvent &  e  )  [private]

Definition at line 1629 of file CPEditorPanel.cpp.

References DEBUG_ERROR, m_detailZoomFactor, m_leftImg, m_rightImg, m_selectedPoint, SelectLocalPoint(), and CPImageCtrl::setScale().

Referenced by changeState(), Create(), and OnKey().

void CPEditorPanel::panoramaChanged ( HuginBase::Panorama pano  )  [virtual]

called when the panorama changes and we should update our display

Implements HuginBase::PanoramaObserver.

Definition at line 1190 of file CPEditorPanel.cpp.

References DEBUG_DEBUG, DEBUG_TRACE, HuginBase::Panorama::getNextCPTypeLineNumber(), HuginBase::Panorama::getNrOfCtrlPoints(), m_countCP, m_cpModeChoice, UpdateDisplay(), and UpdateTransforms().

void CPEditorPanel::panoramaImagesChanged ( HuginBase::Panorama pano,
const HuginBase::UIntSet imgNr 
) [virtual]

notifies about changes to images

Images might have been added/removed. to find out how many images are still there, use Panorama::getNrOfImages.

Parameters:
pano the panorama object that changed
changed set of changed images

Implements HuginBase::PanoramaObserver.

bool CPEditorPanel::PointFineTune ( unsigned int  tmplImgNr,
const vigra::Diff2D &  tmplPoint,
int  tmplWidth,
unsigned int  subjImgNr,
const hugin_utils::FDiff2D subjPoint,
int  searchWidth,
vigra_ext::CorrelationResult tunedPos 
) [private]

search for region in destImg

Referenced by estimateAndAddOtherPoint(), and NewPointChange().

void CPEditorPanel::SelectGlobalPoint ( unsigned int  globalNr  ) 

Select a point.

This should highlight it in the listview and on the pictures.

Does not change the pictures. The control point must be on the two existing images

Definition at line 618 of file CPEditorPanel.cpp.

References DEBUG_DEBUG, DEBUG_ERROR, globalPNr2LocalPNr(), and SelectLocalPoint().

Referenced by CreateNewPoint(), OnCPEvent(), and ShowControlPoint().

void CPEditorPanel::SelectLocalPoint ( unsigned int  LVpointNr  )  [private]

select a local point.

Todo:
scroll windows so that the point is centred

Definition at line 592 of file CPEditorPanel.cpp.

References currentPoints, DEBUG_DEBUG, DEBUG_TRACE, EnablePointEdit(), m_cpList, m_cpModeChoice, m_leftImg, m_rightImg, m_selectedPoint, m_x1Text, m_x2Text, m_y1Text, m_y2Text, HuginBase::ControlPoint::mode, CPImageCtrl::selectPoint(), HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.

Referenced by OnCPEvent(), OnCPListSelect(), OnZoom(), and SelectGlobalPoint().

void CPEditorPanel::setLeftImage ( unsigned int  imgNr  ) 

set left image

Definition at line 275 of file CPEditorPanel.cpp.

References changeState(), const_map_get(), DEBUG_TRACE, HuginBase::Panorama::getImage(), HuginBase::Panorama::getImageVariables(), GetRot(), m_leftChoice, m_leftFile, m_leftImageNr, m_leftImg, m_leftRot, m_pano, m_rightChoice, m_selectedPoint, NO_POINT, CPImageCtrl::ROT0, CPImageCtrl::setImage(), CPImagesComboBox::SetRefImage(), UpdateDisplay(), and UpdateTransforms().

Referenced by OnLeftChoiceChange(), OnNextImg(), OnPrevImg(), ShowControlPoint(), and MainFrame::ShowCtrlPointEditor().

void CPEditorPanel::SetPano ( HuginBase::Panorama panorama  )  [inline]

Definition at line 84 of file CPEditorPanel.h.

References m_pano.

void CPEditorPanel::setRightImage ( unsigned int  imgNr  ) 

set right image

Definition at line 307 of file CPEditorPanel.cpp.

References changeState(), const_map_get(), DEBUG_TRACE, HuginBase::Panorama::getImage(), HuginBase::Panorama::getImageVariables(), GetRot(), m_leftChoice, m_pano, m_rightChoice, m_rightFile, m_rightImageNr, m_rightImg, m_rightRot, m_selectedPoint, NO_POINT, CPImageCtrl::ROT0, CPImageCtrl::setImage(), CPImagesComboBox::SetRefImage(), UpdateDisplay(), and UpdateTransforms().

Referenced by OnNextImg(), OnPrevImg(), OnRightChoiceChange(), ShowControlPoint(), and MainFrame::ShowCtrlPointEditor().

void CPEditorPanel::ShowControlPoint ( unsigned int  cpNr  ) 

show a control point

show control point cpNr and the corrosponding images

Definition at line 1791 of file CPEditorPanel.cpp.

References changeState(), HuginBase::Panorama::getCtrlPoint(), HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, m_pano, NO_POINT, SelectGlobalPoint(), setLeftImage(), and setRightImage().

Referenced by MainFrame::ShowCtrlPoint().

void CPEditorPanel::UpdateDisplay ( bool  newImages  )  [private]

updates the display after another image has been selected.

updates control points, and other widgets

Definition at line 1385 of file CPEditorPanel.cpp.

References CPImageCtrl::clearCtrlPointList(), currentPoints, DEBUG_DEBUG, EnablePointEdit(), HuginBase::Panorama::getCtrlPoints(), m_cpList, m_cpModeChoice, m_leftChoice, m_leftImageNr, m_leftImg, m_pano, m_rightChoice, m_rightImageNr, m_rightImg, m_selectedPoint, m_x1Text, m_x2Text, m_y1Text, m_y2Text, mirroredPoints, HuginBase::ControlPoint::mode, CPImageCtrl::selectPoint(), CPImageCtrl::setCtrlPoint(), CPImageCtrl::setSameImage(), CPImageCtrl::update(), HuginBase::ControlPoint::X, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::X_Y, HuginBase::ControlPoint::Y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.

Referenced by ClearSelection(), panoramaChanged(), setLeftImage(), and setRightImage().

void CPEditorPanel::UpdateTransforms (  )  [private]

updated the internal transform object for drawing line in controls

Definition at line 343 of file CPEditorPanel.cpp.

References HuginBase::PTools::Transform::createInvTransform(), HuginBase::PTools::Transform::createTransform(), HuginBase::Panorama::getImage(), HuginBase::Panorama::getOptions(), m_leftImageNr, m_leftInvTransform, m_leftTransform, m_pano, m_rightImageNr, m_rightInvTransform, and m_rightTransform.

Referenced by panoramaChanged(), setLeftImage(), and setRightImage().


Member Data Documentation

CPCreationState CPEditorPanel::cpCreationState [private]

Definition at line 227 of file CPEditorPanel.h.

Referenced by changeState(), Create(), FineTuneNewPoint(), NewPointChange(), OnAddButton(), OnCPEvent(), OnDeleteButton(), OnFineTuneButton(), and OnKey().

HuginBase::CPointVector CPEditorPanel::currentPoints [private]

Definition at line 272 of file CPEditorPanel.h.

Referenced by EstimatePoint(), FineTuneSelectedPoint(), globalPNr2LocalPNr(), localPNr2GlobalPNr(), NewPointChange(), OnCelesteButton(), OnCleanCPButton(), OnCPEvent(), OnTextPointChange(), SelectLocalPoint(), and UpdateDisplay().

wxButton* CPEditorPanel::m_actionButton [private]

Definition at line 248 of file CPEditorPanel.h.

Referenced by Create(), OnActionSelectCeleste(), OnActionSelectCleanCP(), and OnActionSelectCreate().

wxButton* CPEditorPanel::m_addButton [private]

Definition at line 246 of file CPEditorPanel.h.

Referenced by changeState(), and Create().

wxCheckBox* CPEditorPanel::m_autoAddCB [private]

Definition at line 249 of file CPEditorPanel.h.

Referenced by Create(), estimateAndAddOtherPoint(), NewPointChange(), and ~CPEditorPanel().

size_t CPEditorPanel::m_countCP [private]

Definition at line 276 of file CPEditorPanel.h.

Referenced by panoramaChanged().

wxPanel* CPEditorPanel::m_cp_ctrls [private]

Definition at line 252 of file CPEditorPanel.h.

Referenced by Create().

CPTabActionButtonMode CPEditorPanel::m_cpActionButtonMode [private]

Definition at line 235 of file CPEditorPanel.h.

Referenced by Create(), OnActionButton(), OnActionSelectCeleste(), OnActionSelectCleanCP(), and OnActionSelectCreate().

wxMenu* CPEditorPanel::m_cpActionContextMenu [private]

Definition at line 236 of file CPEditorPanel.h.

Referenced by Create(), and OnActionContextMenu().

wxListCtrl* CPEditorPanel::m_cpList [private]

Definition at line 242 of file CPEditorPanel.h.

Referenced by ClearSelection(), Create(), OnColumnWidthChange(), OnDeleteButton(), OnKey(), OnTextPointChange(), SelectLocalPoint(), and UpdateDisplay().

wxChoice* CPEditorPanel::m_cpModeChoice [private]

Definition at line 245 of file CPEditorPanel.h.

Referenced by Create(), CreateNewPoint(), EnablePointEdit(), OnTextPointChange(), panoramaChanged(), SelectLocalPoint(), and UpdateDisplay().

wxString CPEditorPanel::m_currentCPDetector [private]

Definition at line 237 of file CPEditorPanel.h.

wxButton* CPEditorPanel::m_delButton [private]

Definition at line 247 of file CPEditorPanel.h.

Referenced by changeState(), Create(), and EnablePointEdit().

double CPEditorPanel::m_detailZoomFactor [private]

Definition at line 262 of file CPEditorPanel.h.

Referenced by Create(), estimateAndAddOtherPoint(), NewPointChange(), and OnZoom().

wxTextCtrl * CPEditorPanel::m_errorText [private]

Definition at line 244 of file CPEditorPanel.h.

wxCheckBox* CPEditorPanel::m_estimateCB [private]

Definition at line 251 of file CPEditorPanel.h.

Referenced by Create(), NewPointChange(), and ~CPEditorPanel().

wxCheckBox* CPEditorPanel::m_fineTuneCB [private]

Definition at line 250 of file CPEditorPanel.h.

Referenced by changeState(), Create(), estimateAndAddOtherPoint(), NewPointChange(), and ~CPEditorPanel().

CPImagesComboBox* CPEditorPanel::m_leftChoice [private]

Definition at line 239 of file CPEditorPanel.h.

Referenced by Create(), CreateNewPoint(), OnCPEvent(), OnDeleteButton(), setLeftImage(), setRightImage(), and UpdateDisplay().

std::string CPEditorPanel::m_leftFile [private]

Definition at line 259 of file CPEditorPanel.h.

Referenced by setLeftImage().

unsigned int CPEditorPanel::m_leftImageNr [private]

Definition at line 257 of file CPEditorPanel.h.

Referenced by changeState(), Create(), CreateNewPoint(), EstimatePoint(), FineTuneNewPoint(), NewPointChange(), OnCelesteButton(), OnCPEvent(), OnCreateCPButton(), OnKey(), OnNextImg(), OnPrevImg(), setLeftImage(), UpdateDisplay(), and UpdateTransforms().

CPImageCtrl* CPEditorPanel::m_leftImg [private]

Definition at line 241 of file CPEditorPanel.h.

Referenced by changeState(), ClearSelection(), Create(), CreateNewPoint(), FineTuneNewPoint(), NewPointChange(), OnCPEvent(), OnCPListDeselect(), OnKey(), OnZoom(), SelectLocalPoint(), setLeftImage(), and UpdateDisplay().

HuginBase::PTools::Transform CPEditorPanel::m_leftInvTransform [private]

Definition at line 265 of file CPEditorPanel.h.

Referenced by Create(), and UpdateTransforms().

CPImageCtrl::ImageRotation CPEditorPanel::m_leftRot [private]

Definition at line 278 of file CPEditorPanel.h.

Referenced by Create(), CreateNewPoint(), OnCPEvent(), and setLeftImage().

HuginBase::PTools::Transform CPEditorPanel::m_leftTransform [private]

Definition at line 264 of file CPEditorPanel.h.

Referenced by Create(), and UpdateTransforms().

bool CPEditorPanel::m_listenToPageChange [private]

Definition at line 261 of file CPEditorPanel.h.

Referenced by Create(), OnLeftChoiceChange(), and OnRightChoiceChange().

HuginBase::Panorama* CPEditorPanel::m_pano [private]

Definition at line 255 of file CPEditorPanel.h.

Referenced by CreateNewPoint(), estimateAndAddOtherPoint(), EstimatePoint(), FineTuneSelectedPoint(), getVerticalCPBias(), Init(), NewPointChange(), OnCelesteButton(), OnCleanCPButton(), OnCPEvent(), OnDeleteButton(), OnKey(), OnNextImg(), OnPrevImg(), OnTextPointChange(), setLeftImage(), SetPano(), setRightImage(), ShowControlPoint(), UpdateDisplay(), UpdateTransforms(), and ~CPEditorPanel().

CPImagesComboBox* CPEditorPanel::m_rightChoice [private]

Definition at line 240 of file CPEditorPanel.h.

Referenced by Create(), CreateNewPoint(), OnCPEvent(), OnDeleteButton(), setLeftImage(), setRightImage(), and UpdateDisplay().

std::string CPEditorPanel::m_rightFile [private]

Definition at line 260 of file CPEditorPanel.h.

Referenced by setRightImage().

unsigned int CPEditorPanel::m_rightImageNr [private]

Definition at line 258 of file CPEditorPanel.h.

Referenced by changeState(), Create(), CreateNewPoint(), EstimatePoint(), FineTuneNewPoint(), NewPointChange(), OnCPEvent(), OnCreateCPButton(), OnKey(), OnNextImg(), OnPrevImg(), setRightImage(), UpdateDisplay(), and UpdateTransforms().

CPImageCtrl * CPEditorPanel::m_rightImg [private]

Definition at line 241 of file CPEditorPanel.h.

Referenced by changeState(), ClearSelection(), Create(), CreateNewPoint(), FineTuneNewPoint(), NewPointChange(), OnCPEvent(), OnCPListDeselect(), OnZoom(), SelectLocalPoint(), setRightImage(), and UpdateDisplay().

HuginBase::PTools::Transform CPEditorPanel::m_rightInvTransform [private]

Definition at line 267 of file CPEditorPanel.h.

Referenced by Create(), and UpdateTransforms().

CPImageCtrl::ImageRotation CPEditorPanel::m_rightRot [private]

Definition at line 279 of file CPEditorPanel.h.

Referenced by Create(), and setRightImage().

HuginBase::PTools::Transform CPEditorPanel::m_rightTransform [private]

Definition at line 266 of file CPEditorPanel.h.

Referenced by Create(), and UpdateTransforms().

unsigned int CPEditorPanel::m_selectedPoint [private]

Definition at line 269 of file CPEditorPanel.h.

Referenced by changeState(), ClearSelection(), Create(), FineTuneSelectedPoint(), OnZoom(), SelectLocalPoint(), setLeftImage(), setRightImage(), and UpdateDisplay().

wxTextCtrl* CPEditorPanel::m_x1Text [private]

Definition at line 244 of file CPEditorPanel.h.

Referenced by Create(), EnablePointEdit(), OnTextPointChange(), SelectLocalPoint(), UpdateDisplay(), and ~CPEditorPanel().

wxTextCtrl * CPEditorPanel::m_x2Text [private]

Definition at line 244 of file CPEditorPanel.h.

Referenced by Create(), EnablePointEdit(), OnTextPointChange(), SelectLocalPoint(), UpdateDisplay(), and ~CPEditorPanel().

wxTextCtrl * CPEditorPanel::m_y1Text [private]

Definition at line 244 of file CPEditorPanel.h.

Referenced by Create(), EnablePointEdit(), OnTextPointChange(), SelectLocalPoint(), UpdateDisplay(), and ~CPEditorPanel().

wxTextCtrl * CPEditorPanel::m_y2Text [private]

Definition at line 244 of file CPEditorPanel.h.

Referenced by Create(), EnablePointEdit(), OnTextPointChange(), SelectLocalPoint(), UpdateDisplay(), and ~CPEditorPanel().

std::set<unsigned int> CPEditorPanel::mirroredPoints [private]

Definition at line 275 of file CPEditorPanel.h.

Referenced by FineTuneSelectedPoint(), OnTextPointChange(), and UpdateDisplay().


The documentation for this class was generated from the following files:
Generated on 1 Sep 2015 for Hugintrunk by  doxygen 1.4.7