Hugin trunk 0.1
Loading...
Searching...
No Matches
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
 
 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
 
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 94 of file CPImageCtrl.h.

Constructor & Destructor Documentation

◆ DisplayedControlPoint() [1/2]

DisplayedControlPoint::DisplayedControlPoint ( )
inline

default constructor

Definition at line 98 of file CPImageCtrl.h.

References m_control, m_line, m_mirrored, and threshold().

◆ DisplayedControlPoint() [2/2]

DisplayedControlPoint::DisplayedControlPoint ( const HuginBase::ControlPoint cp,
CPImageCtrl control,
bool  mirrored 
)

Member Function Documentation

◆ CheckSelection()

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

◆ Draw()

void DisplayedControlPoint::Draw ( wxDC dc,
const wxRect visibleRect,
bool  selected,
bool  newPoint = false 
)

◆ DrawLine()

void DisplayedControlPoint::DrawLine ( wxDC dc)
private

◆ DrawLineSegment()

void DisplayedControlPoint::DrawLineSegment ( wxDC dc)
private

◆ DrawTextMag()

wxRect DisplayedControlPoint::DrawTextMag ( wxDC dc,
wxPoint  p,
hugin_utils::FDiff2D  pointInput,
bool  drawMag,
wxColour  pointColour,
wxColour  textColour 
)
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().

◆ GetControlPoint()

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().

◆ GetLabel()

const wxString DisplayedControlPoint::GetLabel ( ) const
inline

return label

Definition at line 120 of file CPImageCtrl.h.

References m_label.

◆ GetPos()

hugin_utils::FDiff2D DisplayedControlPoint::GetPos ( ) const

◆ IsDrawingLine()

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

◆ IsMirrored()

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.

◆ isOccupiedLabel()

const bool DisplayedControlPoint::isOccupiedLabel ( const wxPoint  mousePos) const

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().

◆ isOccupiedPos()

const bool DisplayedControlPoint::isOccupiedPos ( const hugin_utils::FDiff2D p) const

◆ operator==()

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().

◆ SetColour()

void DisplayedControlPoint::SetColour ( wxColour  pointColour,
wxColour  textColour 
)

set colours for drawing control points

Definition at line 142 of file CPImageCtrl.cpp.

References m_pointColour, m_textColour, and threshold().

◆ SetControl()

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().

◆ SetLabel()

void DisplayedControlPoint::SetLabel ( wxString  newLabel)

set label to given wxString

Definition at line 148 of file CPImageCtrl.cpp.

References m_label, and threshold().

◆ ShiftControlPoint()

void DisplayedControlPoint::ShiftControlPoint ( hugin_utils::FDiff2D  shift)

shift selected cp coordinate by given

Parameters
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().

◆ StartLineControlPoint()

void DisplayedControlPoint::StartLineControlPoint ( hugin_utils::FDiff2D  newPoint)

◆ UpdateControlPoint()

void DisplayedControlPoint::UpdateControlPoint ( hugin_utils::FDiff2D  newPoint)

◆ UpdateControlPointX()

void DisplayedControlPoint::UpdateControlPointX ( double  x)

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.

◆ UpdateControlPointY()

void DisplayedControlPoint::UpdateControlPointY ( double  y)

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.

Member Data Documentation

◆ m_control

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

◆ m_cp

HuginBase::ControlPoint DisplayedControlPoint::m_cp
private

◆ m_label

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().

◆ m_labelPos

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().

◆ m_labelPos2

wxRect DisplayedControlPoint::m_labelPos2
private

Definition at line 160 of file CPImageCtrl.h.

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

◆ m_line

bool DisplayedControlPoint::m_line
private

true, if line control point on same image

Definition at line 162 of file CPImageCtrl.h.

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

◆ m_mirrored

bool DisplayedControlPoint::m_mirrored
private

◆ m_pointColour

wxColour DisplayedControlPoint::m_pointColour
private

colour of the point

Definition at line 153 of file CPImageCtrl.h.

Referenced by Draw(), and SetColour().

◆ m_textColour

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: