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

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...
 
CPImageCtrlm_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...
 

Detailed Description

helper class to display and manipulate cp in cp tab

Definition at line 94 of file CPImageCtrl.h.

Constructor & Destructor Documentation

DisplayedControlPoint::DisplayedControlPoint ( )
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 
)

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
mousePosand image coordinates
pis 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 
)
void DisplayedControlPoint::DrawLine ( wxDC &  dc)
private
void DisplayedControlPoint::DrawLineSegment ( wxDC &  dc)
private
wxRect DisplayedControlPoint::DrawTextMag ( wxDC &  dc,
wxPoint  p,
hugin_utils::FDiff2D  pointInput,
bool  drawMag,
wxColour  pointColour,
wxColour  textColour 
)
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().

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

returns the control point

Definition at line 134 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 120 of file CPImageCtrl.h.

References m_label.

Referenced by operator==().

hugin_utils::FDiff2D DisplayedControlPoint::GetPos ( ) const
bool DisplayedControlPoint::IsDrawingLine ( ) const
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().

const bool DisplayedControlPoint::IsMirrored ( ) const
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
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)
void DisplayedControlPoint::StartLineControlPoint ( hugin_utils::FDiff2D  newPoint)
void DisplayedControlPoint::UpdateControlPoint ( hugin_utils::FDiff2D  newPoint)
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.

Member Data Documentation

CPImageCtrl* DisplayedControlPoint::m_control
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().

HuginBase::ControlPoint DisplayedControlPoint::m_cp
private
wxString DisplayedControlPoint::m_label
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().

wxRect DisplayedControlPoint::m_labelPos
private

position of the point labels (in screen coordinates)

Definition at line 159 of file CPImageCtrl.h.

Referenced by Draw(), and isOccupiedLabel().

wxRect DisplayedControlPoint::m_labelPos2
private

Definition at line 160 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 162 of file CPImageCtrl.h.

Referenced by DisplayedControlPoint(), IsDrawingLine(), and StartLineControlPoint().

bool DisplayedControlPoint::m_mirrored
private
wxColour DisplayedControlPoint::m_pointColour
private

colour of the point

Definition at line 153 of file CPImageCtrl.h.

Referenced by Draw(), and SetColour().

wxColour DisplayedControlPoint::m_textColour
private

colour of the text background

Definition at line 155 of file CPImageCtrl.h.

Referenced by Draw(), and SetColour().


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