|
Hugin trunk 0.1
|
helper class to display and manipulate cp in cp tab More...
#include <CPImageCtrl.h>
Public Member Functions | |
| DisplayedControlPoint () | |
| default constructor | |
| DisplayedControlPoint (const HuginBase::ControlPoint &cp, CPImageCtrl *control, bool mirrored) | |
| constructor with full initialisation | |
| void | SetColour (wxColour pointColour, wxColour textColour) |
| set colours for drawing control points | |
| void | SetLabel (wxString newLabel) |
| set label to given wxString | |
| void | SetControl (CPImageCtrl *control) |
| remember the control, where the information should be drawn | |
| void | Draw (wxDC &dc, const wxRect &visibleRect, bool selected, bool newPoint=false) |
| draw the control points to the given device context | |
| const bool | isOccupiedLabel (const wxPoint mousePos) const |
| check if given point is over label of cp, using screen coordinates | |
| const bool | isOccupiedPos (const hugin_utils::FDiff2D &p) const |
| check if the given point is over the drawn cp, using image coordinates | |
| void | CheckSelection (const wxPoint mousePos, const hugin_utils::FDiff2D &p) |
| used by manipulating line control points, remember if the selected point given in screen coordinates | |
| const bool | IsMirrored () const |
| return true, if cp is used with mirrored coordinates by current CPImageCtrl | |
| const wxString | GetLabel () const |
| return label | |
| void | UpdateControlPointX (double x) |
| update x coordinate of selected cp coordinate | |
| void | UpdateControlPointY (double y) |
| update y coordinate of selected cp coordinate | |
| void | UpdateControlPoint (hugin_utils::FDiff2D newPoint) |
| update selected cp coordinate | |
| void | ShiftControlPoint (hugin_utils::FDiff2D shift) |
| shift selected cp coordinate by given | |
| void | StartLineControlPoint (hugin_utils::FDiff2D newPoint) |
| starts a new line control point with given coodinates | |
| hugin_utils::FDiff2D | GetPos () const |
| returns selected position | |
| const HuginBase::ControlPoint | GetControlPoint () const |
| returns the control point | |
| bool | operator== (const DisplayedControlPoint other) |
| compare operator | |
Private Member Functions | |
| wxRect | DrawTextMag (wxDC &dc, wxPoint p, hugin_utils::FDiff2D pointInput, bool drawMag, wxColour pointColour, wxColour textColour) |
| draw magnified area | |
| void | DrawLine (wxDC &dc) |
| draw line control point on same image | |
| void | DrawLineSegment (wxDC &dc) |
| draw line control point over different images | |
| bool | IsDrawingLine () const |
| return true, if line cp should be drawn as separate line | |
Private Attributes | |
| HuginBase::ControlPoint | m_cp |
| representation of underlying control point | |
| bool | m_mirrored |
| is first or second image in cp used | |
| CPImageCtrl * | m_control |
| pointer to control to access some functions | |
| wxColour | m_pointColour |
| colour of the point | |
| wxColour | m_textColour |
| colour of the text background | |
| wxString | m_label |
| label of displayed control point: number or new | |
| wxRect | m_labelPos |
| position of the point labels (in screen coordinates) | |
| wxRect | m_labelPos2 |
| bool | m_line |
| true, if line control point on same image | |
helper class to display and manipulate cp in cp tab
Definition at line 94 of file CPImageCtrl.h.
|
inline |
default constructor
Definition at line 98 of file CPImageCtrl.h.
References m_control, m_line, m_mirrored, and threshold().
| DisplayedControlPoint::DisplayedControlPoint | ( | const HuginBase::ControlPoint & | cp, |
| CPImageCtrl * | control, | ||
| bool | mirrored | ||
| ) |
constructor with full initialisation
Definition at line 134 of file CPImageCtrl.cpp.
References HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, m_control, m_cp, m_line, m_mirrored, HuginBase::ControlPoint::mode, threshold(), and HuginBase::ControlPoint::X_Y.
| void DisplayedControlPoint::CheckSelection | ( | const wxPoint | mousePos, |
| const hugin_utils::FDiff2D & | p | ||
| ) |
used by manipulating line control points, remember if the selected point given in screen coordinates
| mousePos | and image coordinates |
| p | is over the first or second point, stores this information in m_mirrored |
Definition at line 558 of file CPImageCtrl.cpp.
References CPImageCtrl::invScale(), IsDrawingLine(), m_control, m_cp, m_labelPos2, m_mirrored, threshold(), hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::x2, hugin_utils::TDiff2D< T >::y, and HuginBase::ControlPoint::y2.
| void DisplayedControlPoint::Draw | ( | wxDC & | dc, |
| const wxRect & | visibleRect, | ||
| bool | selected, | ||
| bool | newPoint = false |
||
| ) |
draw the control points to the given device context
Definition at line 170 of file CPImageCtrl.cpp.
References CPImageCtrl::applyRot(), DrawCross(), DrawLine(), DrawLineSegment(), DrawTextMag(), CPImageCtrl::GetForceMagnifier(), CPImageCtrl::GetImg(), CPImageCtrl::GetMouseInWindow(), IsDrawingLine(), CPImageCtrl::IsShowingLines(), m_control, m_cp, m_labelPos, m_labelPos2, m_mirrored, m_pointColour, m_textColour, HuginBase::ControlPoint::mode, hugin_utils::roundi(), CPImageCtrl::roundP(), CPImageCtrl::scale(), threshold(), HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::X_Y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.
Referenced by CPImageCtrl::OnPaint().
draw line control point on same image
Definition at line 399 of file CPImageCtrl.cpp.
References CPImageCtrl::applyRot(), CPImageCtrl::GetBitmapSize(), CPImageCtrl::getFirstInvTrans(), CPImageCtrl::getFirstTrans(), CPImageCtrl::GetRealImageSize(), m_control, m_cp, hugin_utils::roundi(), CPImageCtrl::roundP(), CPImageCtrl::scale(), threshold(), HuginBase::PTools::Transform::transformImgCoord(), hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, hugin_utils::TDiff2D< T >::y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.
Referenced by Draw().
draw line control point over different images
Definition at line 457 of file CPImageCtrl.cpp.
References CPImageCtrl::applyRot(), CPImageCtrl::GetBitmapSize(), CPImageCtrl::getFirstInvTrans(), CPImageCtrl::getFirstTrans(), CPImageCtrl::GetRealImageSize(), CPImageCtrl::getSecondInvTrans(), m_control, m_cp, m_mirrored, hugin_utils::roundi(), CPImageCtrl::roundP(), CPImageCtrl::scale(), threshold(), HuginBase::PTools::Transform::transformImgCoord(), HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.
Referenced by Draw().
|
private |
draw magnified area
Definition at line 285 of file CPImageCtrl.cpp.
References CPImageCtrl::GetMagBitmap(), CPImageCtrl::getScale(), m_control, m_label, and threshold().
Referenced by Draw().
|
inline |
returns the control point
Definition at line 134 of file CPImageCtrl.h.
References m_cp.
Referenced by CPImageCtrl::mouseReleaseLMBEvent().
| hugin_utils::FDiff2D DisplayedControlPoint::GetPos | ( | ) | const |
returns selected position
Definition at line 636 of file CPImageCtrl.cpp.
References m_cp, m_mirrored, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.
Referenced by CPImageCtrl::mouseReleaseLMBEvent().
|
private |
return true, if line cp should be drawn as separate line
Definition at line 520 of file CPImageCtrl.cpp.
References CPImageCtrl::IsShowingLines(), m_control, and m_line.
Referenced by CheckSelection(), Draw(), isOccupiedLabel(), and isOccupiedPos().
return true, if cp is used with mirrored coordinates by current CPImageCtrl
Definition at line 118 of file CPImageCtrl.h.
References m_mirrored.
check if given point is over label of cp, using screen coordinates
Definition at line 525 of file CPImageCtrl.cpp.
References IsDrawingLine(), m_labelPos, m_labelPos2, and threshold().
| const bool DisplayedControlPoint::isOccupiedPos | ( | const hugin_utils::FDiff2D & | p | ) | const |
check if the given point is over the drawn cp, using image coordinates
Definition at line 537 of file CPImageCtrl.cpp.
References CPImageCtrl::invScale(), IsDrawingLine(), m_control, m_cp, m_mirrored, threshold(), hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, hugin_utils::TDiff2D< T >::y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.
| bool DisplayedControlPoint::operator== | ( | const DisplayedControlPoint | other | ) |
compare operator
Definition at line 641 of file CPImageCtrl.cpp.
References m_cp, m_label, m_mirrored, and threshold().
set colours for drawing control points
Definition at line 142 of file CPImageCtrl.cpp.
References m_pointColour, m_textColour, and threshold().
| void DisplayedControlPoint::SetControl | ( | CPImageCtrl * | control | ) |
remember the control, where the information should be drawn
Definition at line 153 of file CPImageCtrl.cpp.
References m_control.
Referenced by CPImageCtrl::mousePressLMBEvent().
set label to given wxString
Definition at line 148 of file CPImageCtrl.cpp.
References m_label, and threshold().
| void DisplayedControlPoint::ShiftControlPoint | ( | hugin_utils::FDiff2D | shift | ) |
shift selected cp coordinate by given
| shift |
Definition at line 607 of file CPImageCtrl.cpp.
References m_cp, m_mirrored, shift, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.
Referenced by CPImageCtrl::OnKey().
| void DisplayedControlPoint::StartLineControlPoint | ( | hugin_utils::FDiff2D | newPoint | ) |
starts a new line control point with given coodinates
Definition at line 621 of file CPImageCtrl.cpp.
References HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, m_cp, m_label, m_line, m_mirrored, HuginBase::ControlPoint::mode, threshold(), hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::X, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, hugin_utils::TDiff2D< T >::y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.
Referenced by CPImageCtrl::mousePressLMBEvent().
| void DisplayedControlPoint::UpdateControlPoint | ( | hugin_utils::FDiff2D | newPoint | ) |
update selected cp coordinate
Definition at line 593 of file CPImageCtrl.cpp.
References m_cp, m_mirrored, hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, hugin_utils::TDiff2D< T >::y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.
Referenced by CPImageCtrl::mouseMoveEvent().
update x coordinate of selected cp coordinate
Definition at line 569 of file CPImageCtrl.cpp.
References m_cp, m_mirrored, HuginBase::ControlPoint::x1, and HuginBase::ControlPoint::x2.
update y coordinate of selected cp coordinate
Definition at line 581 of file CPImageCtrl.cpp.
References m_cp, m_mirrored, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.
|
private |
pointer to control to access some functions
Definition at line 151 of file CPImageCtrl.h.
Referenced by CheckSelection(), DisplayedControlPoint(), DisplayedControlPoint(), Draw(), DrawLine(), DrawLineSegment(), DrawTextMag(), IsDrawingLine(), isOccupiedPos(), and SetControl().
|
private |
representation of underlying control point
Definition at line 147 of file CPImageCtrl.h.
Referenced by CheckSelection(), DisplayedControlPoint(), Draw(), DrawLine(), DrawLineSegment(), GetControlPoint(), GetPos(), isOccupiedPos(), operator==(), ShiftControlPoint(), StartLineControlPoint(), UpdateControlPoint(), UpdateControlPointX(), and UpdateControlPointY().
|
private |
label of displayed control point: number or new
Definition at line 157 of file CPImageCtrl.h.
Referenced by DrawTextMag(), GetLabel(), operator==(), SetLabel(), and StartLineControlPoint().
|
private |
position of the point labels (in screen coordinates)
Definition at line 159 of file CPImageCtrl.h.
Referenced by Draw(), and isOccupiedLabel().
|
private |
Definition at line 160 of file CPImageCtrl.h.
Referenced by CheckSelection(), Draw(), and isOccupiedLabel().
|
private |
true, if line control point on same image
Definition at line 162 of file CPImageCtrl.h.
Referenced by DisplayedControlPoint(), DisplayedControlPoint(), IsDrawingLine(), and StartLineControlPoint().
|
private |
is first or second image in cp used
Definition at line 149 of file CPImageCtrl.h.
Referenced by CheckSelection(), DisplayedControlPoint(), DisplayedControlPoint(), Draw(), DrawLineSegment(), GetPos(), IsMirrored(), isOccupiedPos(), operator==(), ShiftControlPoint(), StartLineControlPoint(), UpdateControlPoint(), UpdateControlPointX(), and UpdateControlPointY().
|
private |
colour of the point
Definition at line 153 of file CPImageCtrl.h.
Referenced by Draw(), and SetColour().
|
private |
colour of the text background
Definition at line 155 of file CPImageCtrl.h.
Referenced by Draw(), and SetColour().