DisplayedControlPoint Class Reference

helper class to display and manipulate cp in cp tab More...

#include <CPImageCtrl.h>

List of all members.

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, 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

Private Attributes

HuginBase::ControlPoint m_cp
 representation of underlying control point
bool m_mirrored
 is first or second image in cp used
CPImageCtrlm_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


Detailed Description

helper class to display and manipulate cp in cp tab

Definition at line 109 of file CPImageCtrl.h.


Constructor & Destructor Documentation

DisplayedControlPoint::DisplayedControlPoint (  )  [inline]

default constructor

Definition at line 113 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 132 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.


Member Function Documentation

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

Parameters:
mousePos and image coordinates
p is over the first or second point, stores this information in m_mirrored

Definition at line 519 of file CPImageCtrl.cpp.

References CPImageCtrl::invScale(), m_control, m_cp, m_labelPos2, m_line, m_mirrored, hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::x2, hugin_utils::TDiff2D< T >::y, and HuginBase::ControlPoint::y2.

void DisplayedControlPoint::Draw ( wxDC &  dc,
bool  selected,
bool  newPoint = false 
)

draw the control points to the given device context

Definition at line 168 of file CPImageCtrl.cpp.

References CPImageCtrl::applyRot(), DrawCross(), DrawLine(), DrawLineSegment(), DrawTextMag(), CPImageCtrl::GetForceMagnifier(), CPImageCtrl::GetImg(), CPImageCtrl::GetMouseInWindow(), m_control, m_cp, m_labelPos, m_labelPos2, m_line, 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, hugin_utils::TDiff2D< T >::y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.

Referenced by CPImageCtrl::OnDraw().

void DisplayedControlPoint::DrawLine ( wxDC &  dc  )  [private]

draw line control point on same image

Definition at line 376 of file CPImageCtrl.cpp.

References CPImageCtrl::applyRot(), CPImageCtrl::getFirstInvTrans(), CPImageCtrl::getFirstTrans(), m_control, m_cp, hugin_utils::roundi(), CPImageCtrl::roundP(), CPImageCtrl::scale(), HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.

Referenced by Draw().

void DisplayedControlPoint::DrawLineSegment ( wxDC &  dc  )  [private]

draw line control point over different images

Definition at line 423 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::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.

Referenced by Draw().

wxRect DisplayedControlPoint::DrawTextMag ( wxDC &  dc,
wxPoint  p,
hugin_utils::FDiff2D  pointInput,
bool  drawMag,
wxColour  pointColour,
wxColour  textColour 
) [private]

draw magnified area

Definition at line 262 of file CPImageCtrl.cpp.

References CPImageCtrl::generateMagBitmap(), m_control, m_label, and celeste::min().

Referenced by Draw().

const HuginBase::ControlPoint DisplayedControlPoint::GetControlPoint (  )  const [inline]

returns the control point

Definition at line 149 of file CPImageCtrl.h.

References m_cp.

Referenced by CPImageCtrl::mouseReleaseLMBEvent(), CPImageCtrl::OnKey(), and operator==().

const wxString DisplayedControlPoint::GetLabel (  )  const [inline]

return label

Definition at line 135 of file CPImageCtrl.h.

References m_label.

Referenced by operator==().

hugin_utils::FDiff2D DisplayedControlPoint::GetPos (  )  const

returns selected position

Definition at line 597 of file CPImageCtrl.cpp.

References m_cp, m_mirrored, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.

const bool DisplayedControlPoint::IsMirrored (  )  const [inline]

return true, if cp is used with mirrored coordinates by current CPImageCtrl

Definition at line 133 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 486 of file CPImageCtrl.cpp.

References m_labelPos, m_labelPos2, and m_line.

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 498 of file CPImageCtrl.cpp.

References CPImageCtrl::invScale(), m_control, m_cp, m_line, 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 602 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 140 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 151 of file CPImageCtrl.cpp.

References m_control.

Referenced by CPImageCtrl::mousePressLMBEvent().

void DisplayedControlPoint::SetLabel ( wxString  newLabel  ) 

set label to given wxString

Definition at line 146 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

Parameters:
shift 

Definition at line 568 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 582 of file CPImageCtrl.cpp.

References HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, m_cp, m_label, m_line, m_mirrored, HuginBase::ControlPoint::mode, 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 554 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 530 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 542 of file CPImageCtrl.cpp.

References m_cp, m_mirrored, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.


Member Data Documentation

CPImageCtrl* DisplayedControlPoint::m_control [private]

pointer to control to access some functions

Definition at line 164 of file CPImageCtrl.h.

Referenced by CheckSelection(), DisplayedControlPoint(), Draw(), DrawLine(), DrawLineSegment(), DrawTextMag(), isOccupiedPos(), and SetControl().

HuginBase::ControlPoint DisplayedControlPoint::m_cp [private]

representation of underlying control point

Definition at line 160 of file CPImageCtrl.h.

Referenced by CheckSelection(), DisplayedControlPoint(), Draw(), DrawLine(), DrawLineSegment(), GetControlPoint(), GetPos(), isOccupiedPos(), operator==(), ShiftControlPoint(), StartLineControlPoint(), UpdateControlPoint(), UpdateControlPointX(), and UpdateControlPointY().

wxString DisplayedControlPoint::m_label [private]

label of displayed control point: number or new

Definition at line 170 of file CPImageCtrl.h.

Referenced by DrawTextMag(), GetLabel(), operator==(), SetLabel(), and StartLineControlPoint().

wxRect DisplayedControlPoint::m_labelPos [private]

position of the point labels (in screen coordinates)

Definition at line 172 of file CPImageCtrl.h.

Referenced by Draw(), and isOccupiedLabel().

wxRect DisplayedControlPoint::m_labelPos2 [private]

Definition at line 173 of file CPImageCtrl.h.

Referenced by CheckSelection(), Draw(), and isOccupiedLabel().

bool DisplayedControlPoint::m_line [private]

true, if line control point on same image

Definition at line 175 of file CPImageCtrl.h.

Referenced by CheckSelection(), DisplayedControlPoint(), Draw(), isOccupiedLabel(), isOccupiedPos(), and StartLineControlPoint().

bool DisplayedControlPoint::m_mirrored [private]

is first or second image in cp used

Definition at line 162 of file CPImageCtrl.h.

Referenced by CheckSelection(), DisplayedControlPoint(), Draw(), DrawLineSegment(), GetPos(), IsMirrored(), isOccupiedPos(), operator==(), ShiftControlPoint(), StartLineControlPoint(), UpdateControlPoint(), UpdateControlPointX(), and UpdateControlPointY().

wxColour DisplayedControlPoint::m_pointColour [private]

colour of the point

Definition at line 166 of file CPImageCtrl.h.

Referenced by Draw(), and SetColour().

wxColour DisplayedControlPoint::m_textColour [private]

colour of the text background

Definition at line 168 of file CPImageCtrl.h.

Referenced by Draw(), and SetColour().


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