32#include <wx/overlay.h>
65 virtual wxEvent*
Clone()
const;
375 return T(
m_realSize.GetHeight()-1 - p.y, p.x);
396 return T(p.y,
m_realSize.GetHeight()-1 - p.x);
wxDECLARE_EVENT(EVT_CPEVENT, CPEvent)
control point editor panel.
Events to notify about new point / region / point change.
const hugin_utils::FDiff2D & getPoint()
hugin_utils::FDiff2D point
unsigned int getPointNr()
HuginBase::ControlPoint m_cp
const HuginBase::ControlPoint & getControlPoint()
CPEventMode getMode()
accessor functions (they could check mode to see if a getXYZ() is allowed
virtual wxEvent * Clone() const
virtual bool CanHandle(wxXmlNode *node)
virtual wxObject * DoCreateResource()
void mouseReleaseLMBEvent(wxMouseEvent &mouse)
void showSearchArea(bool show=true)
show/hide the search area rectangle
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
wxPoint roundP(const hugin_utils::FDiff2D &p) const
void mousePressLMBEvent(wxMouseEvent &mouse)
ImageRotation
image rotation.
const wxSize GetRealImageSize() const
return the real size of the image in the control
DisplayedControlPoint m_selectedPoint
const bool GetMouseInWindow() const
void mousePressMMBEvent(wxMouseEvent &mouse)
void clearNewPoint()
clear new point
EditorState isOccupied(wxPoint mousePos, const hugin_utils::FDiff2D &point, unsigned int &pointNr) const
check if p is over a known point, if it is, pointNr contains the point
wxCursor * m_CPSelectCursor
void setTransforms(HuginBase::PTools::Transform *firstTrans, HuginBase::PTools::Transform *firstInvTrans, HuginBase::PTools::Transform *secondInvTrans)
HuginBase::PTools::Transform * getFirstTrans() const
unsigned int selectedPointNr
void mouseReleaseMMBEvent(wxMouseEvent &mouse)
hugin_utils::FDiff2D invScale(const hugin_utils::FDiff2D &p) const
std::vector< wxColour > pointColors
hugin_utils::FDiff2D newPoint
void clearCtrlPointList()
clear internal control point list
wxPoint MaxScrollDelta(wxPoint delta)
calculate maximum delta that is allowed when scrolling
double invScale(double x) const
EditorState
state machine for selection process:
bool IsShowingLines() const
HuginBase::PTools::Transform * getFirstInvTrans() const
wxCursor * m_ScrollCursor
HuginBase::PTools::Transform * getSecondInvTrans() const
bool emit(CPEvent &ev)
helper func to emit a region
const wxSize GetBitmapSize() const
return the size of the drawn bitmap (possible rotate is applied)
void setSameImage(bool sameImage)
wxPoint scale(const wxPoint &p) const
void mousePressRMBEvent(wxMouseEvent &mouse)
void Init(CPEditorPanel *parent)
void setImage(const std::string &filename, ImageRotation rot)
display img.
hugin_utils::FDiff2D rectStartPos
double getScale()
return scale factor, 0 for autoscale
hugin_utils::FDiff2D getNewPoint()
get the new point
void OnKeyDown(wxKeyEvent &e)
HuginBase::ImageCache::ImageCacheRGB8Ptr GetImg()
get pointer to image, for DisplayedControlPoint
double getScaleFactor() const
get scale factor (calculates factor when fit to window is active)
HuginBase::PTools::Transform * m_secondInvTrans
ImageCache::RequestPtr m_imgRequest
void setCtrlPoint(const HuginBase::ControlPoint &cp, const bool mirrored)
add control piont to internal cp list
void deselect()
remove selection.
void OnSize(wxSizeEvent &e)
void OnPaint(wxPaintEvent &e)
paint event
void showPosition(hugin_utils::FDiff2D point, bool warpPointer=false)
Show point x, y.
void DrawSelectionRectangle(hugin_utils::FDiff2D pos1, hugin_utils::FDiff2D pos2)
void OnSizeFinished(wxTimerEvent &e)
HuginBase::PTools::Transform * m_firstTrans
std::string imageFilename
void setNewPoint(const hugin_utils::FDiff2D &p)
set new point to a specific point
wxBitmap & GetMagBitmap(hugin_utils::FDiff2D point)
draw the magnified view of a selected control point
CPEditorPanel * m_editPanel
ImageRotation m_imgRotation
void showTemplateArea(bool show=true)
HuginBase::PTools::Transform * m_firstInvTrans
void ShowLines(bool isShown)
hugin_utils::FDiff2D m_mousePos
void setScale(double factor)
set the scaling factor for cp display.
wxPoint invScale(const wxPoint &p) const
hugin_utils::FDiff2D scale(const hugin_utils::FDiff2D &p) const
hugin_utils::FDiff2D m_magImgCenter
void mouseReleaseRMBEvent(wxMouseEvent &mouse)
void setMagTransforms(HuginBase::PTools::Transform *magTrans, HuginBase::PTools::Transform *magInvTrans)
T applyRotInv(const T &p) const
HuginBase::PTools::Transform * m_magTrans
T applyRot(const T &p) const
void ScrollDelta(const wxPoint &delta)
scroll the window by delta pixels
int invScale(int x) const
void OnImageLoaded(ImageCache::EntryPtr entry, std::string filename, bool load_small)
void OnScrollWin(wxScrollWinEvent &e)
const bool GetForceMagnifier() const
wxSize DoGetBestSize() const
void selectPoint(unsigned int, bool scrollTo=true)
select a point for usage
void OnTimer(wxTimerEvent &e)
bool m_sameImage
true, if in control point tab the same image is selected 2 times in this case a special treatment for...
double calcAutoScaleFactor(wxSize size)
calculate new scale factor for this image
void OnMouseLeave(wxMouseEvent &e)
HuginBase::PTools::Transform * m_magInvTrans
std::vector< DisplayedControlPoint > m_points
void OnKey(wxKeyEvent &e)
void mouseMoveEvent(wxMouseEvent &mouse)
void OnMouseEnter(wxMouseEvent &e)
double scale(double x) const
ImageCache::EntryPtr m_img
std::vector< wxColour > textColours
helper class to display and manipulate cp in cp tab
void SetLabel(wxString newLabel)
set label to given wxString
wxColour m_pointColour
colour of the point
wxColour m_textColour
colour of the text background
bool m_mirrored
is first or second image in cp used
const HuginBase::ControlPoint GetControlPoint() const
returns the control point
wxRect m_labelPos
position of the point labels (in screen coordinates)
void UpdateControlPointX(double x)
update x coordinate of selected cp coordinate
DisplayedControlPoint()
default constructor
bool m_line
true, if line control point on same image
void StartLineControlPoint(hugin_utils::FDiff2D newPoint)
starts a new line control point with given coodinates
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
void UpdateControlPoint(hugin_utils::FDiff2D newPoint)
update selected cp coordinate
bool IsDrawingLine() const
return true, if line cp should be drawn as separate line
HuginBase::ControlPoint m_cp
representation of underlying control point
wxString m_label
label of displayed control point: number or new
CPImageCtrl * m_control
pointer to control to access some functions
void SetColour(wxColour pointColour, wxColour textColour)
set colours for drawing control points
void DrawLineSegment(wxDC &dc)
draw line control point over different images
bool operator==(const DisplayedControlPoint other)
compare operator
hugin_utils::FDiff2D GetPos() const
returns selected position
const bool isOccupiedLabel(const wxPoint mousePos) const
check if given point is over label of cp, using screen coordinates
void ShiftControlPoint(hugin_utils::FDiff2D shift)
shift selected cp coordinate by given
void Draw(wxDC &dc, const wxRect &visibleRect, bool selected, bool newPoint=false)
draw the control points to the given device context
void DrawLine(wxDC &dc)
draw line control point on same image
const wxString GetLabel() const
return label
wxRect DrawTextMag(wxDC &dc, wxPoint p, hugin_utils::FDiff2D pointInput, bool drawMag, wxColour pointColour, wxColour textColour)
draw magnified area
void UpdateControlPointY(double y)
update y coordinate of selected cp coordinate
const bool IsMirrored() const
return true, if cp is used with mirrored coordinates by current CPImageCtrl
void SetControl(CPImageCtrl *control)
remember the control, where the information should be drawn
represents a control point
std::shared_ptr< vigra::BRGBImage > ImageCacheRGB8Ptr
use reference counted pointers
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.