Hugintrunk
0.1
|
helper class to display and manipulate cp in cp tab More...
#include <CPImageCtrl.h>
Public Member Functions | |
DisplayedControlPoint () | |
default constructor More... | |
DisplayedControlPoint (const HuginBase::ControlPoint &cp, CPImageCtrl *control, bool mirrored) | |
constructor with full initialisation More... | |
void | SetColour (wxColour pointColour, wxColour textColour) |
set colours for drawing control points More... | |
void | SetLabel (wxString newLabel) |
set label to given wxString More... | |
void | SetControl (CPImageCtrl *control) |
remember the control, where the information should be drawn More... | |
void | Draw (wxDC &dc, const wxRect &visibleRect, bool selected, bool newPoint=false) |
draw the control points to the given device context More... | |
const bool | isOccupiedLabel (const wxPoint mousePos) const |
check if given point is over label of cp, using screen coordinates More... | |
const bool | isOccupiedPos (const hugin_utils::FDiff2D &p) const |
check if the given point is over the drawn cp, using image coordinates More... | |
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 More... | |
const bool | IsMirrored () const |
return true, if cp is used with mirrored coordinates by current CPImageCtrl More... | |
const wxString | GetLabel () const |
return label More... | |
void | UpdateControlPointX (double x) |
update x coordinate of selected cp coordinate More... | |
void | UpdateControlPointY (double y) |
update y coordinate of selected cp coordinate More... | |
void | UpdateControlPoint (hugin_utils::FDiff2D newPoint) |
update selected cp coordinate More... | |
void | ShiftControlPoint (hugin_utils::FDiff2D shift) |
shift selected cp coordinate by given More... | |
void | StartLineControlPoint (hugin_utils::FDiff2D newPoint) |
starts a new line control point with given coodinates More... | |
hugin_utils::FDiff2D | GetPos () const |
returns selected position More... | |
const HuginBase::ControlPoint | GetControlPoint () const |
returns the control point More... | |
bool | operator== (const DisplayedControlPoint other) |
compare operator More... | |
Private Member Functions | |
wxRect | DrawTextMag (wxDC &dc, wxPoint p, hugin_utils::FDiff2D pointInput, bool drawMag, wxColour pointColour, wxColour textColour) |
draw magnified area More... | |
void | DrawLine (wxDC &dc) |
draw line control point on same image More... | |
void | DrawLineSegment (wxDC &dc) |
draw line control point over different images More... | |
bool | IsDrawingLine () const |
return true, if line cp should be drawn as separate line More... | |
Private Attributes | |
HuginBase::ControlPoint | m_cp |
representation of underlying control point More... | |
bool | m_mirrored |
is first or second image in cp used More... | |
CPImageCtrl * | m_control |
pointer to control to access some functions More... | |
wxColour | m_pointColour |
colour of the point More... | |
wxColour | m_textColour |
colour of the text background More... | |
wxString | m_label |
label of displayed control point: number or new More... | |
wxRect | m_labelPos |
position of the point labels (in screen coordinates) More... | |
wxRect | m_labelPos2 |
bool | m_line |
true, if line control point on same image More... | |
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, and m_mirrored.
DisplayedControlPoint::DisplayedControlPoint | ( | const HuginBase::ControlPoint & | cp, |
CPImageCtrl * | control, | ||
bool | mirrored | ||
) |
constructor with full initialisation
Definition at line 133 of file CPImageCtrl.cpp.
References HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, m_control, m_cp, m_line, m_mirrored, HuginBase::ControlPoint::mode, 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 557 of file CPImageCtrl.cpp.
References CPImageCtrl::invScale(), IsDrawingLine(), m_control, m_cp, m_labelPos2, m_mirrored, 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 169 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, celeste::min(), HuginBase::ControlPoint::mode, hugin_utils::roundi(), CPImageCtrl::roundP(), CPImageCtrl::scale(), hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::X_Y, hugin_utils::TDiff2D< T >::y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.
Referenced by CPImageCtrl::OnDraw().
|
private |
draw line control point on same image
Definition at line 398 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(), 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().
|
private |
draw line control point over different images
Definition at line 456 of file CPImageCtrl.cpp.
References CPImageCtrl::applyRot(), CPImageCtrl::GetBitmapSize(), CPImageCtrl::getFirstInvTrans(), CPImageCtrl::getFirstTrans(), CPImageCtrl::GetRealImageSize(), CPImageCtrl::getSecondInvTrans(), m_control, m_cp, m_mirrored, celeste::min(), hugin_utils::roundi(), CPImageCtrl::roundP(), CPImageCtrl::scale(), hugin_utils::TDiff2D< T >::squareDistance(), 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 284 of file CPImageCtrl.cpp.
References CPImageCtrl::GetMagBitmap(), CPImageCtrl::getScale(), m_control, m_label, and celeste::min().
Referenced by Draw().
|
inline |
returns the control point
Definition at line 134 of file CPImageCtrl.h.
References m_cp.
Referenced by CPImageCtrl::mouseReleaseLMBEvent(), CPImageCtrl::OnKey(), and operator==().
|
inline |
return label
Definition at line 120 of file CPImageCtrl.h.
References m_label.
Referenced by operator==().
hugin_utils::FDiff2D DisplayedControlPoint::GetPos | ( | ) | const |
returns selected position
Definition at line 635 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 519 of file CPImageCtrl.cpp.
References CPImageCtrl::IsShowingLines(), m_control, and m_line.
Referenced by CheckSelection(), Draw(), isOccupiedLabel(), and isOccupiedPos().
|
inline |
return true, if cp is used with mirrored coordinates by current CPImageCtrl
Definition at line 118 of file CPImageCtrl.h.
References m_mirrored.
Referenced by operator==().
const bool DisplayedControlPoint::isOccupiedLabel | ( | const wxPoint | mousePos | ) | const |
check if given point is over label of cp, using screen coordinates
Definition at line 524 of file CPImageCtrl.cpp.
References IsDrawingLine(), m_labelPos, and m_labelPos2.
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 536 of file CPImageCtrl.cpp.
References CPImageCtrl::invScale(), IsDrawingLine(), m_control, 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.
bool DisplayedControlPoint::operator== | ( | const DisplayedControlPoint | other | ) |
compare operator
Definition at line 640 of file CPImageCtrl.cpp.
References GetControlPoint(), GetLabel(), IsMirrored(), m_cp, m_label, and m_mirrored.
void DisplayedControlPoint::SetColour | ( | wxColour | pointColour, |
wxColour | textColour | ||
) |
set colours for drawing control points
Definition at line 141 of file CPImageCtrl.cpp.
References m_pointColour, and m_textColour.
Referenced by CPImageCtrl::setCtrlPoint().
void DisplayedControlPoint::SetControl | ( | CPImageCtrl * | control | ) |
remember the control, where the information should be drawn
Definition at line 152 of file CPImageCtrl.cpp.
References m_control.
Referenced by CPImageCtrl::mousePressLMBEvent().
void DisplayedControlPoint::SetLabel | ( | wxString | newLabel | ) |
set label to given wxString
Definition at line 147 of file CPImageCtrl.cpp.
References m_label.
Referenced by CPImageCtrl::OnDraw(), and CPImageCtrl::setCtrlPoint().
void DisplayedControlPoint::ShiftControlPoint | ( | hugin_utils::FDiff2D | shift | ) |
shift selected cp coordinate by given
shift |
Definition at line 606 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::OnKey().
void DisplayedControlPoint::StartLineControlPoint | ( | hugin_utils::FDiff2D | newPoint | ) |
starts a new line control point with given coodinates
Definition at line 620 of file CPImageCtrl.cpp.
References HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, m_cp, m_label, m_line, m_mirrored, HuginBase::ControlPoint::mode, HuginBase::ControlPoint::X, 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::mousePressLMBEvent().
void DisplayedControlPoint::UpdateControlPoint | ( | hugin_utils::FDiff2D | newPoint | ) |
update selected cp coordinate
Definition at line 592 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().
void DisplayedControlPoint::UpdateControlPointX | ( | double | x | ) |
update x coordinate of selected cp coordinate
Definition at line 568 of file CPImageCtrl.cpp.
References m_cp, m_mirrored, HuginBase::ControlPoint::x1, and HuginBase::ControlPoint::x2.
void DisplayedControlPoint::UpdateControlPointY | ( | double | y | ) |
update y coordinate of selected cp coordinate
Definition at line 580 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(), 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(), IsDrawingLine(), and StartLineControlPoint().
|
private |
is first or second image in cp used
Definition at line 149 of file CPImageCtrl.h.
Referenced by CheckSelection(), 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().