CPImageCtrl Class Reference

brief description. More...

#include <CPImageCtrl.h>

List of all members.

Public Types

enum  EditorState {
  NO_IMAGE = 0, NO_SELECTION, KNOWN_POINT_SELECTED, NEW_POINT_SELECTED,
  NEW_LINE_CREATING, SELECT_DELETE_REGION
}
 state machine for selection process: More...
enum  ImageRotation { ROT0 = 0, ROT90, ROT180, ROT270 }
 image rotation. More...

Public Member Functions

 CPImageCtrl ()
 ctor.
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxT("panel"))
void Init (CPEditorPanel *parent)
 ~CPImageCtrl ()
 dtor.
void setImage (const std::string &filename, ImageRotation rot)
 display img.
void setSameImage (bool sameImage)
void setTransforms (PTools::Transform *firstTrans, PTools::Transform *firstInvTrans, PTools::Transform *secondInvTrans)
PTools::Transform * getFirstTrans () const
PTools::Transform * getFirstInvTrans () const
PTools::Transform * getSecondInvTrans () const
void setCtrlPoint (const HuginBase::ControlPoint &cp, const bool mirrored)
 add control piont to internal cp list
void clearCtrlPointList ()
 clear internal control point list
void clearNewPoint ()
 clear new point
void setNewPoint (const hugin_utils::FDiff2D &p)
 set new point to a specific point
void selectPoint (unsigned int)
 select a point for usage
void deselect ()
 remove selection.
void mousePressLMBEvent (wxMouseEvent &mouse)
void mouseReleaseLMBEvent (wxMouseEvent &mouse)
void mousePressRMBEvent (wxMouseEvent &mouse)
void mouseReleaseRMBEvent (wxMouseEvent &mouse)
void mouseMoveEvent (wxMouseEvent &mouse)
void mousePressMMBEvent (wxMouseEvent &mouse)
void mouseReleaseMMBEvent (wxMouseEvent &mouse)
wxSize DoGetBestSize () const
void setScale (double factor)
 set the scaling factor for cp display.
double getScale ()
 return scale factor, 0 for autoscale
void showPosition (hugin_utils::FDiff2D point, bool warpPointer=false)
 Show point x, y.
void showSearchArea (bool show=true)
 show/hide the search area rectangle
void showTemplateArea (bool show=true)
hugin_utils::FDiff2D getNewPoint ()
 get the new point
void update ()
 initiate redraw
void ScrollDelta (const wxPoint &delta)
 scroll the window by delta pixels
wxPoint MaxScrollDelta (wxPoint delta)
 calculate maximum delta that is allowed when scrolling
int scale (int x) const
double scale (double x) const
hugin_utils::FDiff2D scale (const hugin_utils::FDiff2D &p) const
wxPoint scale (const wxPoint &p) const
int invScale (int x) const
double invScale (double x) const
hugin_utils::FDiff2D invScale (const hugin_utils::FDiff2D &p) const
wxPoint invScale (const wxPoint &p) const
wxPoint roundP (const hugin_utils::FDiff2D &p) const
template<class T>
applyRot (const T &p) const
template<class T>
applyRotInv (const T &p) const
const bool GetMouseInWindow () const
const bool GetForceMagnifier () const
const HuginBase::ImageCache::ImageCacheRGB8Ptr GetImg () const
 get pointer to image, for DisplayedControlPoint
wxBitmap generateMagBitmap (hugin_utils::FDiff2D point, wxPoint canvasPos) const
 draw the magnified view of a selected control point
const wxSize GetRealImageSize () const
 return the real size of the image in the control
const wxSize GetBitmapSize () const
 return the size of the drawn bitmap (possible rotate is applied)

Protected Member Functions

void OnImageLoaded (ImageCache::EntryPtr entry, std::string filename, bool load_small)
void OnDraw (wxDC &dc)
void OnSize (wxSizeEvent &e)
void OnKey (wxKeyEvent &e)
void OnKeyDown (wxKeyEvent &e)
void OnMouseLeave (wxMouseEvent &e)
void OnMouseEnter (wxMouseEvent &e)
void OnTimer (wxTimerEvent &e)
bool emit (CPEvent &ev)
 helper func to emit a region
double getScaleFactor () const
 get scale factor (calculates factor when fit to window is active)
double calcAutoScaleFactor (wxSize size)
 calculate new scale factor for this image
void rescaleImage ()

Private Member Functions

void DrawSelectionRectangle (hugin_utils::FDiff2D pos1, hugin_utils::FDiff2D pos2)
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
 DECLARE_EVENT_TABLE ()

Private Attributes

wxBitmap bitmap
std::string imageFilename
wxSize imageSize
wxSize m_realSize
std::vector< DisplayedControlPointm_points
wxCursor * m_CPSelectCursor
wxCursor * m_ScrollCursor
unsigned int selectedPointNr
DisplayedControlPoint m_selectedPoint
hugin_utils::FDiff2D newPoint
bool m_sameImage
 true, if in control point tab the same image is selected 2 times in this case a special treatment for creating line control points is activated
hugin_utils::FDiff2D rectStartPos
EditorState editState
PTools::Transform * m_firstTrans
PTools::Transform * m_firstInvTrans
PTools::Transform * m_secondInvTrans
std::vector< wxColour > pointColors
std::vector< wxColour > textColours
double scaleFactor
bool fitToWindow
bool m_showSearchArea
int m_searchRectWidth
hugin_utils::FDiff2D m_mousePos
wxPoint m_mouseScrollPos
bool m_showTemplateArea
int m_templateRectWidth
CPEditorPanelm_editPanel
ImageRotation m_imgRotation
ImageCache::EntryPtr m_img
ImageCache::RequestPtr m_imgRequest
bool m_mouseInWindow
bool m_forceMagnifier
wxTimer m_timer


Detailed Description

brief description.

What this does

Definition at line 182 of file CPImageCtrl.h.


Member Enumeration Documentation

enum CPImageCtrl::EditorState
 

state machine for selection process:

The select region is temporarily disabled.. maybe I find use for it later on..

format of this list:

  • current state name
    • possible next state
      • conditions for next state

states:

  • NO_IMAGE
    • NO_SELECTION
      • an image has been inserted

  • NO_SELECTION nothing selected
    • KNOWN_POINT_SELECTED
      • mouse down on known point
      • set from outside
    • SELECT_DELETE_REGION
      • mouse down on image

  • KNOWN_POINT_SELECTED, a known point is selected and can be moved around. clients are notified about the movement, points can also be switched.

  • KNOWN_POINT_SELECTED
    • selection of another point
  • SELECT_DELETE_REGION
    • mouse down on image

  • NEW_POINT_SELECTED (can move new point), mouse up reports change, movement can be tracked
    • KNOWN_POINT_SELECTED
      • mouse down on known point
      • programatic change
    • SELECT_DELETE_REGION
      • mouse down on image

  • NEW_LINE_CREATING mouse up reports new line movement can be tracked

  • SELECT_DELETE_REGION user can draw rectangle inside which all cp should be removed
    • NO_SELECTION
Enumeration values:
NO_IMAGE 
NO_SELECTION 
KNOWN_POINT_SELECTED 
NEW_POINT_SELECTED 
NEW_LINE_CREATING 
SELECT_DELETE_REGION 

Definition at line 233 of file CPImageCtrl.h.

Referenced by isOccupied(), and mousePressLMBEvent().

enum CPImageCtrl::ImageRotation
 

image rotation.

Useful to display images depending on their roll setting. rotation is clockwise

Enumeration values:
ROT0 
ROT90 
ROT180 
ROT270 

Definition at line 254 of file CPImageCtrl.h.


Constructor & Destructor Documentation

CPImageCtrl::CPImageCtrl  )  [inline]
 

ctor.

Definition at line 237 of file CPImageCtrl.h.

References fitToWindow, and scaleFactor.

CPImageCtrl::~CPImageCtrl  ) 
 

dtor.

Definition at line 695 of file CPImageCtrl.cpp.

References DEBUG_TRACE.


Member Function Documentation

template<class T>
T CPImageCtrl::applyRot const T &  p  )  const [inline]
 

Definition at line 383 of file CPImageCtrl.h.

References m_realSize, ROT0, ROT180, ROT270, and ROT90.

Referenced by DisplayedControlPoint::Draw(), DisplayedControlPoint::DrawLine(), DisplayedControlPoint::DrawLineSegment(), DrawSelectionRectangle(), OnDraw(), and showPosition().

template<class T>
T CPImageCtrl::applyRotInv const T &  p  )  const [inline]
 

Definition at line 407 of file CPImageCtrl.h.

References m_realSize, ROT0, ROT180, ROT270, and ROT90.

Referenced by mouseMoveEvent(), mousePressLMBEvent(), mousePressRMBEvent(), mouseReleaseLMBEvent(), and mouseReleaseRMBEvent().

double CPImageCtrl::calcAutoScaleFactor wxSize  size  )  [protected]
 

calculate new scale factor for this image

Definition at line 1479 of file CPImageCtrl.cpp.

References DEBUG_DEBUG, m_imgRotation, and ROT90.

Referenced by rescaleImage(), and setScale().

void CPImageCtrl::clearCtrlPointList  ) 
 

clear internal control point list

Definition at line 1034 of file CPImageCtrl.cpp.

References editState, m_points, and selectedPointNr.

Referenced by CPEditorPanel::UpdateDisplay().

void CPImageCtrl::clearNewPoint  ) 
 

clear new point

Definition at line 1044 of file CPImageCtrl.cpp.

References DEBUG_TRACE, and editState.

Referenced by CPEditorPanel::changeState(), and CPEditorPanel::NewPointChange().

bool CPImageCtrl::Create wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxTAB_TRAVERSAL,
const wxString &  name = wxT("panel")
 

Definition at line 625 of file CPImageCtrl.cpp.

References huginApp::Get(), and huginApp::GetXRCPath().

CPImageCtrl::DECLARE_EVENT_TABLE  )  [private]
 

void CPImageCtrl::deselect  ) 
 

remove selection.

Definition at line 1066 of file CPImageCtrl.cpp.

References DEBUG_TRACE, editState, and update().

Referenced by CPEditorPanel::ClearSelection(), and CPEditorPanel::OnCPListDeselect().

wxSize CPImageCtrl::DoGetBestSize  )  const
 

Definition at line 895 of file CPImageCtrl.cpp.

References imageSize.

void CPImageCtrl::DrawSelectionRectangle hugin_utils::FDiff2D  pos1,
hugin_utils::FDiff2D  pos2
[private]
 

Definition at line 1124 of file CPImageCtrl.cpp.

References applyRot(), hugin_utils::FDiff2D, roundP(), and scale().

Referenced by mouseMoveEvent(), mousePressRMBEvent(), and mouseReleaseRMBEvent().

bool CPImageCtrl::emit CPEvent ev  )  [protected]
 

helper func to emit a region

Definition at line 1452 of file CPImageCtrl.cpp.

Referenced by mouseMoveEvent(), mousePressLMBEvent(), mouseReleaseLMBEvent(), mouseReleaseRMBEvent(), and OnKey().

wxBitmap CPImageCtrl::generateMagBitmap hugin_utils::FDiff2D  point,
wxPoint  canvasPos
const
 

draw the magnified view of a selected control point

Definition at line 808 of file CPImageCtrl.cpp.

References DEBUG_TRACE, hugin_utils::FDiff2D, m_img, ROT180, ROT270, ROT90, vigra_ext::transformImage(), vigra_ext::transformImageIntern(), ScalingTransform::transformImgCoord(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by DisplayedControlPoint::DrawTextMag().

const wxSize CPImageCtrl::GetBitmapSize  )  const
 

return the size of the drawn bitmap (possible rotate is applied)

Definition at line 1739 of file CPImageCtrl.cpp.

References bitmap.

Referenced by DisplayedControlPoint::DrawLineSegment().

PTools::Transform* CPImageCtrl::getFirstInvTrans  )  const [inline]
 

Definition at line 262 of file CPImageCtrl.h.

Referenced by DisplayedControlPoint::DrawLine(), and DisplayedControlPoint::DrawLineSegment().

PTools::Transform* CPImageCtrl::getFirstTrans  )  const [inline]
 

Definition at line 261 of file CPImageCtrl.h.

Referenced by DisplayedControlPoint::DrawLine(), and DisplayedControlPoint::DrawLineSegment().

const bool CPImageCtrl::GetForceMagnifier  )  const [inline]
 

Definition at line 427 of file CPImageCtrl.h.

Referenced by DisplayedControlPoint::Draw().

const HuginBase::ImageCache::ImageCacheRGB8Ptr CPImageCtrl::GetImg  )  const [inline]
 

get pointer to image, for DisplayedControlPoint

Definition at line 429 of file CPImageCtrl.h.

References m_img.

Referenced by DisplayedControlPoint::Draw().

const bool CPImageCtrl::GetMouseInWindow  )  const [inline]
 

Definition at line 426 of file CPImageCtrl.h.

Referenced by DisplayedControlPoint::Draw().

FDiff2D CPImageCtrl::getNewPoint  ) 
 

get the new point

Definition at line 1647 of file CPImageCtrl.cpp.

References hugin_utils::FDiff2D.

Referenced by CPEditorPanel::CreateNewPoint(), CPEditorPanel::estimateAndAddOtherPoint(), CPEditorPanel::FineTuneNewPoint(), and CPEditorPanel::NewPointChange().

const wxSize CPImageCtrl::GetRealImageSize  )  const [inline]
 

return the real size of the image in the control

Definition at line 433 of file CPImageCtrl.h.

Referenced by DisplayedControlPoint::DrawLineSegment().

double CPImageCtrl::getScale  )  [inline]
 

return scale factor, 0 for autoscale

Definition at line 301 of file CPImageCtrl.h.

References fitToWindow.

Referenced by CPEditorPanel::NewPointChange().

double CPImageCtrl::getScaleFactor  )  const [protected]
 

get scale factor (calculates factor when fit to window is active)

Definition at line 1499 of file CPImageCtrl.cpp.

Referenced by invScale(), OnDraw(), rescaleImage(), and scale().

PTools::Transform* CPImageCtrl::getSecondInvTrans  )  const [inline]
 

Definition at line 263 of file CPImageCtrl.h.

Referenced by DisplayedControlPoint::DrawLineSegment().

void CPImageCtrl::Init CPEditorPanel parent  ) 
 

Definition at line 689 of file CPImageCtrl.cpp.

References m_editPanel, and m_sameImage.

Referenced by CPEditorPanel::Create().

wxPoint CPImageCtrl::invScale const wxPoint &  p  )  const [inline]
 

Definition at line 367 of file CPImageCtrl.h.

References invScale(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

hugin_utils::FDiff2D CPImageCtrl::invScale const hugin_utils::FDiff2D p  )  const [inline]
 

Definition at line 359 of file CPImageCtrl.h.

References hugin_utils::FDiff2D, invScale(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

double CPImageCtrl::invScale double  x  )  const [inline]
 

Definition at line 356 of file CPImageCtrl.h.

References getScaleFactor().

int CPImageCtrl::invScale int  x  )  const [inline]
 

Definition at line 353 of file CPImageCtrl.h.

References getScaleFactor().

Referenced by DisplayedControlPoint::CheckSelection(), invScale(), DisplayedControlPoint::isOccupiedPos(), mouseMoveEvent(), mousePressLMBEvent(), mousePressRMBEvent(), mouseReleaseLMBEvent(), and mouseReleaseRMBEvent().

CPImageCtrl::EditorState CPImageCtrl::isOccupied wxPoint  mousePos,
const hugin_utils::FDiff2D point,
unsigned int &  pointNr
const [private]
 

check if p is over a known point, if it is, pointNr contains the point

Definition at line 1097 of file CPImageCtrl.cpp.

References EditorState, hugin_utils::FDiff2D, and m_points.

Referenced by mouseMoveEvent(), and mousePressLMBEvent().

wxPoint CPImageCtrl::MaxScrollDelta wxPoint  delta  ) 
 

calculate maximum delta that is allowed when scrolling

Definition at line 1690 of file CPImageCtrl.cpp.

References bitmap, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by CPEditorPanel::OnCPEvent().

void CPImageCtrl::mouseMoveEvent wxMouseEvent &  mouse  ) 
 

Definition at line 1136 of file CPImageCtrl.cpp.

References applyRotInv(), DEBUG_DEBUG, DrawSelectionRectangle(), editState, emit(), hugin_utils::FDiff2D, invScale(), isOccupied(), KNOWN_POINT_SELECTED, m_CPSelectCursor, m_img, m_mousePos, m_mouseScrollPos, m_points, m_realSize, m_selectedPoint, NEW_LINE_CREATING, NEW_POINT_SELECTED, newPoint, NO_IMAGE, NO_SELECTION, rectStartPos, hugin_utils::roundi(), ScrollDelta(), selectedPointNr, update(), and DisplayedControlPoint::UpdateControlPoint().

void CPImageCtrl::mousePressLMBEvent wxMouseEvent &  mouse  ) 
 

Definition at line 1248 of file CPImageCtrl.cpp.

References applyRotInv(), DEBUG_DEBUG, DEBUG_ERROR, EditorState, editState, emit(), hugin_utils::FDiff2D, invScale(), isOccupied(), m_forceMagnifier, m_img, m_mousePos, m_points, m_realSize, m_sameImage, m_selectedPoint, newPoint, NO_IMAGE, selectedPointNr, DisplayedControlPoint::SetControl(), and DisplayedControlPoint::StartLineControlPoint().

void CPImageCtrl::mousePressMMBEvent wxMouseEvent &  mouse  ) 
 

Definition at line 1380 of file CPImageCtrl.cpp.

References DEBUG_DEBUG, m_img, and m_mouseScrollPos.

void CPImageCtrl::mousePressRMBEvent wxMouseEvent &  mouse  ) 
 

Definition at line 1388 of file CPImageCtrl.cpp.

References applyRotInv(), DrawSelectionRectangle(), editState, hugin_utils::FDiff2D, invScale(), KNOWN_POINT_SELECTED, m_img, m_realSize, NO_SELECTION, and rectStartPos.

void CPImageCtrl::mouseReleaseLMBEvent wxMouseEvent &  mouse  ) 
 

Definition at line 1311 of file CPImageCtrl.cpp.

References applyRotInv(), DEBUG_DEBUG, editState, emit(), hugin_utils::FDiff2D, DisplayedControlPoint::GetControlPoint(), invScale(), KNOWN_POINT_SELECTED, m_img, m_points, m_realSize, m_selectedPoint, m_timer, NEW_LINE_CREATING, NEW_POINT_SELECTED, newPoint, NO_IMAGE, NO_SELECTION, and selectedPointNr.

void CPImageCtrl::mouseReleaseMMBEvent wxMouseEvent &  mouse  ) 
 

Definition at line 1373 of file CPImageCtrl.cpp.

References DEBUG_DEBUG.

void CPImageCtrl::mouseReleaseRMBEvent wxMouseEvent &  mouse  ) 
 

Definition at line 1410 of file CPImageCtrl.cpp.

References applyRotInv(), DEBUG_DEBUG, DrawSelectionRectangle(), editState, emit(), hugin_utils::FDiff2D, invScale(), m_img, m_realSize, and rectStartPos.

void CPImageCtrl::OnDraw wxDC &  dc  )  [protected]
 

Definition at line 703 of file CPImageCtrl.cpp.

References applyRot(), bitmap, DEBUG_DEBUG, DisplayedControlPoint::Draw(), editState, hugin_utils::FDiff2D, getScaleFactor(), KNOWN_POINT_SELECTED, m_img, m_mousePos, m_points, m_searchRectWidth, m_selectedPoint, m_showSearchArea, m_templateRectWidth, NEW_LINE_CREATING, NEW_POINT_SELECTED, newPoint, NO_IMAGE, NO_SELECTION, hugin_utils::roundi(), roundP(), scale(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by update().

void CPImageCtrl::OnImageLoaded ImageCache::EntryPtr  entry,
std::string  filename,
bool  load_small
[protected]
 

Definition at line 941 of file CPImageCtrl.cpp.

References imageFilename, m_img, and rescaleImage().

Referenced by setImage().

void CPImageCtrl::OnKey wxKeyEvent &  e  )  [protected]
 

Definition at line 1515 of file CPImageCtrl.cpp.

References DEBUG_TRACE, editState, emit(), hugin_utils::FDiff2D, DisplayedControlPoint::GetControlPoint(), m_forceMagnifier, m_img, m_imgRotation, m_points, m_timer, newPoint, ScrollDelta(), selectedPointNr, shift, DisplayedControlPoint::ShiftControlPoint(), update(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

void CPImageCtrl::OnKeyDown wxKeyEvent &  e  )  [protected]
 

Definition at line 1620 of file CPImageCtrl.cpp.

References DEBUG_DEBUG, DEBUG_TRACE, m_img, and m_mouseScrollPos.

void CPImageCtrl::OnMouseEnter wxMouseEvent &  e  )  [protected]
 

Definition at line 1639 of file CPImageCtrl.cpp.

References DEBUG_TRACE, m_mouseInWindow, and update().

void CPImageCtrl::OnMouseLeave wxMouseEvent &  e  )  [protected]
 

Definition at line 1631 of file CPImageCtrl.cpp.

References DEBUG_TRACE, hugin_utils::FDiff2D, m_mouseInWindow, m_mousePos, and update().

void CPImageCtrl::OnSize wxSizeEvent &  e  )  [protected]
 

Definition at line 1504 of file CPImageCtrl.cpp.

References DEBUG_TRACE, imageFilename, and setScale().

void CPImageCtrl::OnTimer wxTimerEvent &  e  )  [protected]
 

Definition at line 1304 of file CPImageCtrl.cpp.

References m_forceMagnifier, m_img, and update().

void CPImageCtrl::rescaleImage  )  [protected]
 

Definition at line 951 of file CPImageCtrl.cpp.

References bitmap, calcAutoScaleFactor(), DEBUG_DEBUG, editState, getScaleFactor(), imageCacheEntry2wxImage(), imageSize, m_img, m_imgRotation, m_realSize, NO_IMAGE, ROT180, ROT270, ROT90, scale(), and scaleFactor.

Referenced by OnImageLoaded(), setImage(), and setScale().

wxPoint CPImageCtrl::roundP const hugin_utils::FDiff2D p  )  const [inline]
 

Definition at line 375 of file CPImageCtrl.h.

References hugin_utils::FDiff2D, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by DisplayedControlPoint::Draw(), DisplayedControlPoint::DrawLine(), DisplayedControlPoint::DrawLineSegment(), DrawSelectionRectangle(), and OnDraw().

wxPoint CPImageCtrl::scale const wxPoint &  p  )  const [inline]
 

Definition at line 345 of file CPImageCtrl.h.

References scale(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

hugin_utils::FDiff2D CPImageCtrl::scale const hugin_utils::FDiff2D p  )  const [inline]
 

Definition at line 337 of file CPImageCtrl.h.

References hugin_utils::FDiff2D, scale(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

double CPImageCtrl::scale double  x  )  const [inline]
 

Definition at line 334 of file CPImageCtrl.h.

References getScaleFactor().

int CPImageCtrl::scale int  x  )  const [inline]
 

Definition at line 331 of file CPImageCtrl.h.

References getScaleFactor().

Referenced by DisplayedControlPoint::Draw(), DisplayedControlPoint::DrawLine(), DisplayedControlPoint::DrawLineSegment(), DrawSelectionRectangle(), OnDraw(), rescaleImage(), scale(), and showPosition().

void CPImageCtrl::ScrollDelta const wxPoint &  delta  ) 
 

scroll the window by delta pixels

Definition at line 1724 of file CPImageCtrl.cpp.

References hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by mouseMoveEvent(), CPEditorPanel::OnCPEvent(), and OnKey().

void CPImageCtrl::selectPoint unsigned  int  ) 
 

select a point for usage

Definition at line 1053 of file CPImageCtrl.cpp.

References DEBUG_DEBUG, DEBUG_TRACE, editState, m_points, selectedPointNr, showPosition(), and update().

Referenced by CPEditorPanel::SelectLocalPoint(), and CPEditorPanel::UpdateDisplay().

void CPImageCtrl::setCtrlPoint const HuginBase::ControlPoint cp,
const bool  mirrored
 

add control piont to internal cp list

Definition at line 1026 of file CPImageCtrl.cpp.

References m_points, pointColors, DisplayedControlPoint::SetColour(), DisplayedControlPoint::SetLabel(), and textColours.

Referenced by CPEditorPanel::UpdateDisplay().

void CPImageCtrl::setImage const std::string filename,
ImageRotation  rot
 

display img.

every CPImageCtrl has a wxBitmap with its current image

Definition at line 901 of file CPImageCtrl.cpp.

References bitmap, DEBUG_TRACE, editState, hugin_utils::FileExists(), imageFilename, m_img, m_imgRequest, m_imgRotation, m_sameImage, OnImageLoaded(), and rescaleImage().

Referenced by CPEditorPanel::panoramaImagesChanged(), CPEditorPanel::setLeftImage(), and CPEditorPanel::setRightImage().

void CPImageCtrl::setNewPoint const hugin_utils::FDiff2D p  ) 
 

set new point to a specific point

Definition at line 1654 of file CPImageCtrl.cpp.

References DEBUG_DEBUG, editState, hugin_utils::FDiff2D, newPoint, showPosition(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by CPEditorPanel::estimateAndAddOtherPoint(), CPEditorPanel::FineTuneNewPoint(), and CPEditorPanel::NewPointChange().

void CPImageCtrl::setSameImage bool  sameImage  ) 
 

Definition at line 936 of file CPImageCtrl.cpp.

References m_sameImage.

Referenced by CPEditorPanel::UpdateDisplay().

void CPImageCtrl::setScale double  factor  ) 
 

set the scaling factor for cp display.

Parameters:
factor zoom factor, 0 means fit to window.

Definition at line 1462 of file CPImageCtrl.cpp.

References calcAutoScaleFactor(), DEBUG_DEBUG, fitToWindow, imageSize, rescaleImage(), and scaleFactor.

Referenced by CPEditorPanel::estimateAndAddOtherPoint(), CPEditorPanel::NewPointChange(), OnSize(), and CPEditorPanel::OnZoom().

void CPImageCtrl::setTransforms PTools::Transform *  firstTrans,
PTools::Transform *  firstInvTrans,
PTools::Transform *  secondInvTrans
 

Definition at line 929 of file CPImageCtrl.cpp.

References m_firstInvTrans, m_firstTrans, and m_secondInvTrans.

Referenced by CPEditorPanel::Create().

void CPImageCtrl::showPosition hugin_utils::FDiff2D  point,
bool  warpPointer = false
 

Show point x, y.

Scrolls the windows so that x,y is shown in the center if warpPointer is true, the mouse pointer is moved to that position as well

Definition at line 1076 of file CPImageCtrl.cpp.

References applyRot(), DEBUG_DEBUG, hugin_utils::FDiff2D, hugin_utils::roundi(), scale(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by CPEditorPanel::estimateAndAddOtherPoint(), CPEditorPanel::NewPointChange(), selectPoint(), and setNewPoint().

void CPImageCtrl::showSearchArea bool  show = true  ) 
 

show/hide the search area rectangle

Definition at line 1669 of file CPImageCtrl.cpp.

References bitmap, DEBUG_DEBUG, hugin_utils::FDiff2D, HUGIN_FT_SEARCH_AREA_PERCENT, m_mousePos, m_realSize, m_searchRectWidth, and m_showSearchArea.

Referenced by CPEditorPanel::changeState().

void CPImageCtrl::showTemplateArea bool  show = true  ) 
 

Definition at line 1681 of file CPImageCtrl.cpp.

References HUGIN_FT_TEMPLATE_SIZE, m_showTemplateArea, and m_templateRectWidth.

Referenced by CPEditorPanel::changeState().

void CPImageCtrl::update  ) 
 

initiate redraw

Definition at line 1444 of file CPImageCtrl.cpp.

References DEBUG_TRACE, editState, and OnDraw().

Referenced by deselect(), CPEditorPanel::FineTuneNewPoint(), mouseMoveEvent(), CPEditorPanel::NewPointChange(), CPEditorPanel::OnCPEvent(), OnKey(), OnMouseEnter(), OnMouseLeave(), OnTimer(), selectPoint(), and CPEditorPanel::UpdateDisplay().


Member Data Documentation

wxBitmap CPImageCtrl::bitmap [private]
 

Definition at line 461 of file CPImageCtrl.h.

Referenced by GetBitmapSize(), MaxScrollDelta(), OnDraw(), rescaleImage(), setImage(), and showSearchArea().

EditorState CPImageCtrl::editState [private]
 

Definition at line 488 of file CPImageCtrl.h.

Referenced by clearCtrlPointList(), clearNewPoint(), deselect(), mouseMoveEvent(), mousePressLMBEvent(), mousePressRMBEvent(), mouseReleaseLMBEvent(), mouseReleaseRMBEvent(), OnDraw(), OnKey(), rescaleImage(), selectPoint(), setImage(), setNewPoint(), and update().

bool CPImageCtrl::fitToWindow [private]
 

Definition at line 498 of file CPImageCtrl.h.

Referenced by CPImageCtrl(), getScale(), and setScale().

std::string CPImageCtrl::imageFilename [private]
 

Definition at line 462 of file CPImageCtrl.h.

Referenced by OnImageLoaded(), OnSize(), and setImage().

wxSize CPImageCtrl::imageSize [private]
 

Definition at line 464 of file CPImageCtrl.h.

Referenced by DoGetBestSize(), rescaleImage(), and setScale().

wxCursor* CPImageCtrl::m_CPSelectCursor [private]
 

Definition at line 470 of file CPImageCtrl.h.

Referenced by mouseMoveEvent().

CPEditorPanel* CPImageCtrl::m_editPanel [private]
 

Definition at line 513 of file CPImageCtrl.h.

Referenced by Init().

PTools::Transform* CPImageCtrl::m_firstInvTrans [private]
 

Definition at line 491 of file CPImageCtrl.h.

Referenced by setTransforms().

PTools::Transform* CPImageCtrl::m_firstTrans [private]
 

Definition at line 490 of file CPImageCtrl.h.

Referenced by setTransforms().

bool CPImageCtrl::m_forceMagnifier [private]
 

Definition at line 521 of file CPImageCtrl.h.

Referenced by mousePressLMBEvent(), OnKey(), and OnTimer().

ImageCache::EntryPtr CPImageCtrl::m_img [private]
 

Definition at line 517 of file CPImageCtrl.h.

Referenced by generateMagBitmap(), GetImg(), mouseMoveEvent(), mousePressLMBEvent(), mousePressMMBEvent(), mousePressRMBEvent(), mouseReleaseLMBEvent(), mouseReleaseRMBEvent(), OnDraw(), OnImageLoaded(), OnKey(), OnKeyDown(), OnTimer(), rescaleImage(), and setImage().

ImageCache::RequestPtr CPImageCtrl::m_imgRequest [private]
 

Definition at line 518 of file CPImageCtrl.h.

Referenced by setImage().

ImageRotation CPImageCtrl::m_imgRotation [private]
 

Definition at line 515 of file CPImageCtrl.h.

Referenced by calcAutoScaleFactor(), OnKey(), rescaleImage(), and setImage().

bool CPImageCtrl::m_mouseInWindow [private]
 

Definition at line 520 of file CPImageCtrl.h.

Referenced by OnMouseEnter(), and OnMouseLeave().

hugin_utils::FDiff2D CPImageCtrl::m_mousePos [private]
 

Definition at line 503 of file CPImageCtrl.h.

Referenced by mouseMoveEvent(), mousePressLMBEvent(), OnDraw(), OnMouseLeave(), and showSearchArea().

wxPoint CPImageCtrl::m_mouseScrollPos [private]
 

Definition at line 504 of file CPImageCtrl.h.

Referenced by mouseMoveEvent(), mousePressMMBEvent(), and OnKeyDown().

std::vector<DisplayedControlPoint> CPImageCtrl::m_points [private]
 

Definition at line 468 of file CPImageCtrl.h.

Referenced by clearCtrlPointList(), isOccupied(), mouseMoveEvent(), mousePressLMBEvent(), mouseReleaseLMBEvent(), OnDraw(), OnKey(), selectPoint(), and setCtrlPoint().

wxSize CPImageCtrl::m_realSize [private]
 

Definition at line 466 of file CPImageCtrl.h.

Referenced by applyRot(), applyRotInv(), mouseMoveEvent(), mousePressLMBEvent(), mousePressRMBEvent(), mouseReleaseLMBEvent(), mouseReleaseRMBEvent(), rescaleImage(), and showSearchArea().

bool CPImageCtrl::m_sameImage [private]
 

true, if in control point tab the same image is selected 2 times in this case a special treatment for creating line control points is activated

Definition at line 481 of file CPImageCtrl.h.

Referenced by Init(), mousePressLMBEvent(), setImage(), and setSameImage().

wxCursor* CPImageCtrl::m_ScrollCursor [private]
 

Definition at line 471 of file CPImageCtrl.h.

int CPImageCtrl::m_searchRectWidth [private]
 

Definition at line 501 of file CPImageCtrl.h.

Referenced by OnDraw(), and showSearchArea().

PTools::Transform* CPImageCtrl::m_secondInvTrans [private]
 

Definition at line 492 of file CPImageCtrl.h.

Referenced by setTransforms().

DisplayedControlPoint CPImageCtrl::m_selectedPoint [private]
 

Definition at line 476 of file CPImageCtrl.h.

Referenced by mouseMoveEvent(), mousePressLMBEvent(), mouseReleaseLMBEvent(), and OnDraw().

bool CPImageCtrl::m_showSearchArea [private]
 

Definition at line 500 of file CPImageCtrl.h.

Referenced by OnDraw(), and showSearchArea().

bool CPImageCtrl::m_showTemplateArea [private]
 

Definition at line 506 of file CPImageCtrl.h.

Referenced by showTemplateArea().

int CPImageCtrl::m_templateRectWidth [private]
 

Definition at line 507 of file CPImageCtrl.h.

Referenced by OnDraw(), and showTemplateArea().

wxTimer CPImageCtrl::m_timer [private]
 

Definition at line 522 of file CPImageCtrl.h.

Referenced by mouseReleaseLMBEvent(), and OnKey().

hugin_utils::FDiff2D CPImageCtrl::newPoint [private]
 

Definition at line 477 of file CPImageCtrl.h.

Referenced by mouseMoveEvent(), mousePressLMBEvent(), mouseReleaseLMBEvent(), OnDraw(), OnKey(), and setNewPoint().

std::vector<wxColour> CPImageCtrl::pointColors [private]
 

Definition at line 495 of file CPImageCtrl.h.

Referenced by setCtrlPoint().

hugin_utils::FDiff2D CPImageCtrl::rectStartPos [private]
 

Definition at line 484 of file CPImageCtrl.h.

Referenced by mouseMoveEvent(), mousePressRMBEvent(), and mouseReleaseRMBEvent().

double CPImageCtrl::scaleFactor [private]
 

Definition at line 497 of file CPImageCtrl.h.

Referenced by CPImageCtrl(), rescaleImage(), and setScale().

unsigned int CPImageCtrl::selectedPointNr [private]
 

Definition at line 474 of file CPImageCtrl.h.

Referenced by clearCtrlPointList(), mouseMoveEvent(), mousePressLMBEvent(), mouseReleaseLMBEvent(), OnKey(), and selectPoint().

std::vector<wxColour> CPImageCtrl::textColours [private]
 

Definition at line 496 of file CPImageCtrl.h.

Referenced by setCtrlPoint().


The documentation for this class was generated from the following files:
Generated on Sun Apr 20 01:25:48 2014 for Hugintrunk by  doxygen 1.3.9.1