Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CPListFrame.cpp
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
27 #include "hugin_config.h"
28 #include "panoinc_WX.h"
29 #include "panoinc.h"
30 
31 #include <algorithm>
32 #include <utility>
33 #include <functional>
34 
35 #include "base_wx/wxPlatform.h"
36 #include "hugin/CPListFrame.h"
37 #include "hugin/MainFrame.h"
38 #include "base_wx/CommandHistory.h"
39 #include "base_wx/PanoCommand.h"
40 #include "hugin/huginApp.h"
41 #include "hugin/config_defaults.h"
44 
45 BEGIN_EVENT_TABLE(CPListCtrl, wxListCtrl)
46  EVT_CHAR(CPListCtrl::OnChar)
47  EVT_LIST_ITEM_SELECTED(wxID_ANY, CPListCtrl::OnCPListSelectionChanged)
48  EVT_LIST_ITEM_DESELECTED(wxID_ANY, CPListCtrl::OnCPListSelectionChanged)
49  EVT_LIST_COL_CLICK(wxID_ANY, CPListCtrl::OnCPListHeaderClick)
50  EVT_LIST_COL_END_DRAG(wxID_ANY, CPListCtrl::OnColumnWidthChange)
52 
53 std::string makePairId(unsigned int id1, unsigned int id2)
54 {
55  // Control points from same image pair, regardless of which is left or right
56  // are counted the same so return the identical hash id.
57  std::ostringstream oss;
58 
59  if (id1 < id2) {
60  oss << id1 << "_" << id2;
61  }
62  else if (id2 < id1) {
63  oss << id2 << "_" << id1;
64  }
65  else {
66  // Control points are from same image.
67  oss << id1;
68  }
69  return oss.str();
70 }
71 
72 CPListCtrl::CPListCtrl() : m_pano(NULL)
73 {
74  m_sortCol = 0;
75  m_sortAscend = true;
76 };
77 
79 {
80  wxConfigBase* config = wxConfig::Get();
81  config->Write(wxT("/CPListFrame/SortColumn"), m_sortCol);
82  config->Write(wxT("/CPListFrame/SortAscending"), m_sortAscend ? 1 : 0);
83  config->Flush();
84  if (m_pano)
85  {
86  m_pano->removeObserver(this);
87  };
88 };
89 
90 bool CPListCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos,
91  const wxSize& size, long style, const wxValidator& validator, const wxString& name)
92 {
93  if (!wxListCtrl::Create(parent, id, pos, size, style))
94  {
95  return false;
96  };
97  InsertColumn(0, _("G CP#"), wxLIST_FORMAT_RIGHT, 25);
98  InsertColumn(1, _("Left Img."), wxLIST_FORMAT_RIGHT, 65);
99  InsertColumn(2, _("Right Img."), wxLIST_FORMAT_RIGHT, 65);
100  InsertColumn(3, _("P CP#"), wxLIST_FORMAT_RIGHT, 25);
101  InsertColumn(4, _("Alignment"), wxLIST_FORMAT_LEFT, 80);
102  InsertColumn(5, MainFrame::Get()->IsShowingCorrelation() ? _("Correlation") : _("Distance"), wxLIST_FORMAT_RIGHT, 80);
103 
104  //get saved width
105  for (int j = 0; j < GetColumnCount(); j++)
106  {
107  // -1 is auto
108  int width = wxConfigBase::Get()->Read(wxString::Format(wxT("/CPListFrame/ColumnWidth%d"), j), -1);
109  if (width != -1)
110  {
111  SetColumnWidth(j, width);
112  };
113  };
114  EnableAlternateRowColours(true);
115 
116 #if !wxCHECK_VERSION(3,1,6)
117  wxMemoryDC memDC;
118  memDC.SetFont(GetFont());
119  wxSize fontSize = memDC.GetTextExtent(wxT("\u25b3"));
120  wxCoord charSize = std::max(fontSize.GetWidth(), fontSize.GetHeight());
121  wxImageList* sortIcons = new wxImageList(charSize, charSize, true, 0);
122  {
123  wxBitmap bmp(charSize, charSize);
124  wxMemoryDC dc(bmp);
125  dc.SetBackgroundMode(wxPENSTYLE_TRANSPARENT);
126  dc.SetBackground(GetBackgroundColour());
127  dc.Clear();
128  dc.SetFont(GetFont());
129  dc.DrawText(wxT("\u25b3"), (charSize - fontSize.GetWidth()) / 2, (charSize - fontSize.GetHeight()) / 2);
130  dc.SelectObject(wxNullBitmap);
131  sortIcons->Add(bmp, GetBackgroundColour());
132  };
133  {
134  wxBitmap bmp(charSize, charSize);
135  wxMemoryDC dc(bmp);
136  dc.SetBackgroundMode(wxPENSTYLE_TRANSPARENT);
137  dc.SetBackground(GetBackgroundColour());
138  dc.Clear();
139  dc.SetFont(GetFont());
140  dc.DrawText(wxT("\u25bd"), (charSize - fontSize.GetWidth()) / 2, (charSize - fontSize.GetHeight()) / 2);
141  dc.SelectObject(wxNullBitmap);
142  sortIcons->Add(bmp, GetBackgroundColour());
143  };
144  AssignImageList(sortIcons, wxIMAGE_LIST_SMALL);
145 #endif
146  wxConfigBase* config = wxConfig::Get();
147  m_sortCol=config->Read(wxT("/CPListFrame/SortColumn"), 0l);
148  m_sortAscend = config->Read(wxT("/CPListFrame/SortAscending"), 1l) == 1;
149  config->Flush();
150 #if wxCHECK_VERSION(3,1,6)
151  ShowSortIndicator(m_sortCol, m_sortAscend);
152 #else
154 #endif
155  return true;
156 };
157 
159 {
160  m_pano = pano;
161  m_pano->addObserver(this);
162  panoramaChanged(*pano);
163 };
164 
165 wxString CPListCtrl::OnGetItemText(long item, long column) const
166 {
167  if (item > m_internalCPList.size())
168  {
169  return wxEmptyString;
170  };
171  const HuginBase::ControlPoint& cp = m_pano->getCtrlPoint(m_internalCPList[item].globalIndex);
172  switch (column)
173  {
174  case 0:
175  return wxString::Format(wxT("%lu"), static_cast<unsigned long>(m_internalCPList[item].globalIndex));
176  break;
177  case 1:
178  return wxString::Format(wxT("%u"), cp.image1Nr);
179  break;
180  case 2:
181  return wxString::Format(wxT("%u"), cp.image2Nr);
182  break;
183  case 3:
184  return wxString::Format(wxT("%lu"), static_cast<unsigned long>(m_internalCPList[item].localNumber));
185  break;
186  case 4:
187  switch (cp.mode)
188  {
190  return wxString(_("normal"));
191  break;
193  return wxString(_("vert. Line"));
194  break;
196  return wxString(_("horiz. Line"));
197  break;
198  default:
199  return wxString::Format(_("Line %d"), cp.mode);
200  break;
201  };
202  break;
203  case 5:
204  return wxString::Format(wxT("%.2f"), cp.error);
205  break;
206  default:
207  return wxEmptyString;
208  };
209  return wxEmptyString;
210 };
211 
212 int CPListCtrl::OnGetItemImage(long item) const
213 {
214  return -1;
215 };
216 
218 {
220  const bool isShowingCorrelation = MainFrame::Get()->IsShowingCorrelation();
221  wxListItem item;
222  if (GetColumn(5, item))
223  {
224  if (isShowingCorrelation)
225  {
226  item.SetText(_("Correlation"));
227  }
228  else
229  {
230  item.SetText(_("Distance"));
231  }
232  SetColumn(5, item);
233  };
234  XRCCTRL(*GetParent(), "cp_list_select", wxButton)->SetLabel(isShowingCorrelation ? _("Select by Correlation") : _("Select by Distance"));
236  SetItemCount(m_internalCPList.size());
237  Refresh();
238 };
239 
241 {
242  const HuginBase::CPVector& cps = m_pano->getCtrlPoints();
243  const HuginBase::UIntSet activeImgs = m_pano->getActiveImages();
244  // Rebuild the global->local CP map on each update as CPs might have been
245  // removed.
246  m_localIds.clear();
247  m_internalCPList.clear();
248  m_internalCPList.reserve(cps.size());
249  for (size_t i = 0; i < cps.size(); i++)
250  {
251  const HuginBase::ControlPoint& cp = cps[i];
252  if (m_onlyActiveImages && (!set_contains(activeImgs, cp.image1Nr) || !set_contains(activeImgs, cp.image2Nr)))
253  {
254  continue;
255  };
256  CPListItem cpListItem;
257  cpListItem.globalIndex = i;
258  std::string pairId = makePairId(cp.image1Nr, cp.image2Nr);
259  std::map<std::string, int>::iterator it = m_localIds.find(pairId);
260  if (it != m_localIds.end())
261  {
262  ++(it->second);
263  }
264  else
265  {
266  m_localIds[pairId] = 0;
267  }
268  cpListItem.localNumber=m_localIds[pairId];
269  m_internalCPList.push_back(cpListItem);
270  };
271  SortInternalList(true);
272 };
273 
274 // sort helper function
275 // sort by global or local number only
276 #define CompareStruct(VAR, TYPESUFFIX, OP) \
277 struct Compare##TYPESUFFIX\
278 {\
279  bool operator()(const CPListItem& item1, const CPListItem& item2)\
280  {\
281  return item1.VAR OP item2.VAR;\
282  };\
283 };
284 CompareStruct(globalIndex, globalIndex, <)
285 CompareStruct(globalIndex, globalIndexGreater, >)
286 CompareStruct(localNumber, localNumber, <)
287 CompareStruct(localNumber, localNumberGreater, >)
288 #undef CompareStruct
289 
290 // sort by image number, take second image number as second criterion and local number as third
291 #define CompareStruct(VAR1, VAR2, TYPESUFFIX, OP)\
292 struct Compare##TYPESUFFIX\
293 {\
294  explicit Compare##TYPESUFFIX(const HuginBase::CPVector& cps) : m_cps(cps) {};\
295  bool operator()(const CPListItem& item1, const CPListItem& item2)\
296  {\
297  return m_cps[item1.globalIndex].VAR1 * 1e4 + m_cps[item1.globalIndex].VAR2 + item1.localNumber * 1.0 / m_cps.size() OP\
298  m_cps[item2.globalIndex].VAR1 * 1e4 + m_cps[item2.globalIndex].VAR2 + item2.localNumber * 1.0 / m_cps.size();\
299  }\
300 private:\
301  const HuginBase::CPVector& m_cps;\
302 };
303 CompareStruct(image1Nr, image2Nr, image1Nr, <)
304 CompareStruct(image1Nr, image2Nr, image1NrGreater, >)
305 CompareStruct(image2Nr, image1Nr, image2Nr, <)
306 CompareStruct(image2Nr, image1Nr, image2NrGreater, >)
307 #undef CompareStruct
308 
309 // sort by mode or error
310 #define CompareStruct(VAR, TYPESUFFIX, OP)\
311 struct Compare##TYPESUFFIX\
312 {\
313  explicit Compare##TYPESUFFIX(const HuginBase::CPVector& cps) : m_cps(cps) {};\
314  bool operator()(const CPListItem& item1, const CPListItem& item2)\
315  {\
316  return m_cps[item1.globalIndex].VAR OP m_cps[item2.globalIndex].VAR;\
317  }\
318 private:\
319  const HuginBase::CPVector& m_cps;\
320 };
321 CompareStruct(mode, mode, <)
322 CompareStruct(mode, modeGreater, >)
323 CompareStruct(error, error, <)
324 CompareStruct(error, errorGreater, >)
325 #undef CompareStruct
326 
327 void CPListCtrl::SortInternalList(bool isAscending)
328 {
329  // nothing to sort
330  if (m_internalCPList.empty())
331  {
332  return;
333  };
334 
335  switch (m_sortCol)
336  {
337  case 0:
338  if (m_sortAscend)
339  {
340  if (!isAscending)
341  {
342  std::sort(m_internalCPList.begin(), m_internalCPList.end(), CompareglobalIndex());
343  };
344  }
345  else
346  {
347  std::sort(m_internalCPList.begin(), m_internalCPList.end(), CompareglobalIndexGreater());
348  };
349  break;
350  case 1:
351  if (m_sortAscend)
352  {
353  std::sort(m_internalCPList.begin(), m_internalCPList.end(), Compareimage1Nr(m_pano->getCtrlPoints()));
354  }
355  else
356  {
357  std::sort(m_internalCPList.begin(), m_internalCPList.end(), Compareimage1NrGreater(m_pano->getCtrlPoints()));
358  };
359  break;
360  case 2:
361  if (m_sortAscend)
362  {
363  std::sort(m_internalCPList.begin(), m_internalCPList.end(), Compareimage2Nr(m_pano->getCtrlPoints()));
364  }
365  else
366  {
367  std::sort(m_internalCPList.begin(), m_internalCPList.end(), Compareimage2NrGreater(m_pano->getCtrlPoints()));
368  };
369  break;
370  case 3:
371  if (m_sortAscend)
372  {
373  std::sort(m_internalCPList.begin(), m_internalCPList.end(), ComparelocalNumber());
374  }
375  else
376  {
377  std::sort(m_internalCPList.begin(), m_internalCPList.end(), ComparelocalNumberGreater());
378  };
379  break;
380  case 4:
381  if (m_sortAscend)
382  {
383  std::sort(m_internalCPList.begin(), m_internalCPList.end(), Comparemode(m_pano->getCtrlPoints()));
384  }
385  else
386  {
387  std::sort(m_internalCPList.begin(), m_internalCPList.end(), ComparemodeGreater(m_pano->getCtrlPoints()));
388  };
389  break;
390  case 5:
391  if (m_sortAscend)
392  {
393  std::sort(m_internalCPList.begin(), m_internalCPList.end(), Compareerror(m_pano->getCtrlPoints()));
394  }
395  else
396  {
397  std::sort(m_internalCPList.begin(), m_internalCPList.end(), CompareerrorGreater(m_pano->getCtrlPoints()));
398  };
399  break;
400  };
401 };
402 
404 {
405  if (GetSelectedItemCount() == 1)
406  {
407  if (e.GetIndex() < m_internalCPList.size())
408  {
409  MainFrame::Get()->ShowCtrlPoint(m_internalCPList[e.GetIndex()].globalIndex);
410  };
411  };
412 };
413 
415 {
416  const int newCol = e.GetColumn();
417 #if wxCHECK_VERSION(3,1,6)
418  if (m_sortCol == newCol)
419  {
421  }
422  else
423  {
424  m_sortCol = newCol;
425  m_sortAscend = true;
426  };
427  ShowSortIndicator(m_sortCol, m_sortAscend);
428 #else
429  if (m_sortCol == newCol)
430  {
433  }
434  else
435  {
436  ClearColumnImage(m_sortCol);
437  m_sortCol = newCol;
439  m_sortAscend = true;
440  }
441 #endif
442  SortInternalList(false);
443  Refresh();
444 };
445 
447 {
448  const int colNum = e.GetColumn();
449  wxConfigBase::Get()->Write(wxString::Format(wxT("/CPListFrame/ColumnWidth%d"), colNum), GetColumnWidth(colNum));
450 };
451 
453 {
454  // no selected item.
455  const int nSelected = GetSelectedItemCount();
456  if (nSelected == 0)
457  {
458  wxBell();
459  return;
460  };
461 
462  HuginBase::UIntSet selected;
463  long item = GetFirstSelected();
464  long newSelection = -1;
465  if (m_internalCPList.size() - nSelected > 0)
466  {
467  newSelection = item;
468  if (item >= m_internalCPList.size() - nSelected)
469  {
470  newSelection = m_internalCPList.size() - nSelected - 1;
471  };
472  };
473  while (item>=0)
474  {
475  // deselect item
476  Select(item, false);
477  selected.insert(m_internalCPList[item].globalIndex);
478  item = GetNextSelected(item);
479  }
480  DEBUG_DEBUG("about to delete " << selected.size() << " points");
482 
483  if (newSelection >= 0)
484  {
485  MainFrame::Get()->ShowCtrlPoint(m_internalCPList[newSelection].globalIndex);
486  Select(newSelection, true);
487  };
488 };
489 
491 {
492  const bool invert = threshold < 0;
493  if (invert)
494  {
495  threshold = -threshold;
496  };
497  const HuginBase::CPVector& cps = m_pano->getCtrlPoints();
498  Freeze();
499  for (size_t i = 0; i < m_internalCPList.size(); i++)
500  {
501  const double error = cps[m_internalCPList[i].globalIndex].error;
502  Select(i, ((error > threshold) && (!invert)) || ((error < threshold) && (invert)));
503  };
504  Thaw();
505 };
506 
508 {
509  for (long i = 0; i < m_internalCPList.size(); i++)
510  {
511  Select(i, true);
512  };
513 };
514 
515 void CPListCtrl::OnChar(wxKeyEvent& e)
516 {
517  switch (e.GetKeyCode())
518  {
519  case WXK_DELETE:
520  case WXK_NUMPAD_DELETE:
521  DeleteSelected();
522  break;
523  case WXK_CONTROL_A:
524  SelectAll();
525  break;
526  default:
527  e.Skip();
528  };
529 };
530 
531 
533 
534 IMPLEMENT_DYNAMIC_CLASS(CPListCtrlXmlHandler, wxListCtrlXmlHandler)
535 
536 CPListCtrlXmlHandler::CPListCtrlXmlHandler()
537 : wxListCtrlXmlHandler()
538 {
539  AddWindowStyles();
540 }
541 
543 {
544  XRC_MAKE_INSTANCE(cp, CPListCtrl)
545  cp->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize(), GetStyle(wxT("style")), wxDefaultValidator, GetName());
546  SetupWindow(cp);
547  return cp;
548 }
549 
550 bool CPListCtrlXmlHandler::CanHandle(wxXmlNode *node)
551 {
552  return IsOfClass(node, wxT("CPListCtrl"));
553 }
554 
555 
556 BEGIN_EVENT_TABLE(CPListFrame, wxFrame)
557  EVT_CLOSE(CPListFrame::OnClose)
558  EVT_BUTTON(XRCID("cp_list_delete"), CPListFrame::OnDeleteButton)
559  EVT_BUTTON(XRCID("cp_list_select"), CPListFrame::OnSelectButton)
561 
562 CPListFrame::CPListFrame(wxFrame* parent, HuginBase::Panorama& pano) : m_pano(pano)
563 {
564  DEBUG_TRACE("");
565  bool ok = wxXmlResource::Get()->LoadFrame(this, parent, wxT("cp_list_frame"));
566  DEBUG_ASSERT(ok);
567  m_list = XRCCTRL(*this, "cp_list_frame_list", CPListCtrl);
568  DEBUG_ASSERT(m_list);
569  m_list->Init(&m_pano);
570 
571 #ifdef __WXMSW__
572  // wxFrame does have a strange background color on Windows, copy color from a child widget
573  this->SetBackgroundColour(XRCCTRL(*this, "cp_list_select", wxButton)->GetBackgroundColour());
574 #endif
575 #ifdef __WXMSW__
576  wxIconBundle myIcons(huginApp::Get()->GetXRCPath() + wxT("data/hugin.ico"),wxBITMAP_TYPE_ICO);
577  SetIcons(myIcons);
578 #else
579  wxIcon myIcon(huginApp::Get()->GetXRCPath() + wxT("data/hugin.png"),wxBITMAP_TYPE_PNG);
580  SetIcon(myIcon);
581 #endif
582 
583 
584  //set minumum size
585  SetSizeHints(200, 300);
586  //size
587  RestoreFramePosition(this, wxT("CPListFrame"));
588 }
589 
591 {
592  DEBUG_TRACE("dtor");
593  StoreFramePosition(this, wxT("CPListFrame"));
594  DEBUG_TRACE("dtor end");
595 }
596 
597 void CPListFrame::OnClose(wxCloseEvent& event)
598 {
599  DEBUG_DEBUG("OnClose");
601  DEBUG_DEBUG("closing");
602  Destroy();
603 }
604 
605 void CPListFrame::OnDeleteButton(wxCommandEvent & e)
606 {
608 }
609 
610 void CPListFrame::OnSelectButton(wxCommandEvent & e)
611 {
612  double threshold;
613  const bool isShowingCorrelation = MainFrame::Get()->IsShowingCorrelation();
614  if(isShowingCorrelation)
615  {
616  threshold = HUGIN_FT_CORR_THRESHOLD;
617  wxConfig::Get()->Read(wxT("/Finetune/CorrThreshold"), &threshold, HUGIN_FT_CORR_THRESHOLD);;
618  }
619  else
620  {
621  // calculate the mean error and the standard deviation
623  double min, max, mean, var;
625 
626  // select points whos distance is greater than the mean
627  // hmm, maybe some theory would be nice.. this is just a
628  // guess.
629  threshold = mean + sqrt(var);
630  };
631  wxString t;
632  do
633  {
634  t = wxGetTextFromUser(isShowingCorrelation ?
635  _("Enter minimum control point correlation.\nAll points with lower correlation will be selected.") :
636  _("Enter minimum control point error.\nAll points with a higher error will be selected"),
637  _("Select Control Points"),
638  hugin_utils::doubleTowxString(threshold, 2));
639  if (t == wxEmptyString) {
640  // do not select anything
641  return;
642  }
643  }
644  while (!hugin_utils::str2double(t, threshold));
645 
646  m_list->SelectDistanceThreshold(isShowingCorrelation ? -threshold : threshold);
647 };
const bool GetOptimizeOnlyActiveImages() const
Definition: MainFrame.cpp:1669
void OnColumnWidthChange(wxListEvent &e)
column width changed
void DeleteSelected()
Delete the selected points.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxLC_REPORT|wxLC_VIRTUAL, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxListCtrlNameStr)
Definition: CPListFrame.cpp:90
void UpdateInternalCPList()
helper class for virtual listview control
Definition: CPListFrame.h:33
bool str2double(const wxString &s, double &d)
Definition: wxPlatform.cpp:37
bool removeObserver(PanoramaObserver *observer)
remove a panorama observer.
Definition: Panorama.cpp:1551
virtual int OnGetItemImage(long item) const
show no images
std::vector< CPListItem > m_internalCPList
Definition: CPListFrame.h:87
#define DEBUG_TRACE(msg)
Definition: utils.h:67
int m_sortCol
Definition: CPListFrame.h:84
void OnDeleteButton(wxCommandEvent &e)
static void calcCtrlPntsErrorStats(const PanoramaData &pano, double &min, double &max, double &mean, double &var, const int &imgNr=-1, const bool onlyActive=false, const bool ignoreLineCp=false)
void Init(HuginBase::Panorama *pano)
void OnClose(wxCloseEvent &event)
void OnSelectButton(wxCommandEvent &e)
void SortInternalList(bool isAscending)
wxString doubleTowxString(double d, int digits)
Definition: wxPlatform.cpp:31
virtual wxString OnGetItemText(long item, long column) const
create labels for virtual list control
bool set_contains(const _Container &c, const typename _Container::key_type &key)
Definition: stl_utils.h:74
#define CompareStruct(VAR, TYPESUFFIX, OP)
#define DEBUG_ASSERT(cond)
Definition: utils.h:80
END_EVENT_TABLE()
include file for the hugin project
const CPVector & getCtrlPoints() const
get all control point of this Panorama
Definition: Panorama.h:319
remove several control points
Definition: PanoCommand.h:307
represents a control point
Definition: ControlPoint.h:38
static huginApp * Get()
hack.. kind of a pseudo singleton...
Definition: huginApp.cpp:649
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
void OnChar(wxKeyEvent &e)
handle keystrokes
void ShowCtrlPoint(unsigned int cpNr)
Definition: MainFrame.cpp:2035
void calcCtrlPointErrors(PanoramaData &pano)
Update the Ctrl Point errors without optimizing.
Model for a panorama.
Definition: Panorama.h:152
void SelectAll()
select all items
List all control points of this project.
Definition: CPListFrame.h:43
static MainFrame * Get()
hack.. kind of a pseudo singleton...
Definition: MainFrame.cpp:2183
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Store window size and position in configfile/registry.
Definition: LensCalApp.cpp:212
HuginBase::Panorama * m_pano
Definition: CPListFrame.h:82
void OnCPListFrameClosed()
Definition: MainFrame.cpp:1638
void SetColumnImage(wxListCtrl *list, int col, int image)
const ControlPoint & getCtrlPoint(std::size_t nr) const
get a control point, counting starts with 0
Definition: Panorama.h:312
IMPLEMENT_DYNAMIC_CLASS(wxTreeListHeaderWindow, wxWindow)
evaluate x, points are on a vertical line
Definition: ControlPoint.h:47
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename)
Restore window size and position from configfile/registry.
Definition: LensCalApp.cpp:158
xrc handler for CPImagesComboBox
Definition: CPListFrame.h:95
static GlobalCmdHist & getInstance()
void OnCPListSelectionChanged(wxListEvent &e)
selection event handler
size_t globalIndex
Definition: CPListFrame.h:35
virtual wxObject * DoCreateResource()
Create CPImagesComboBox from resource.
virtual ~CPListFrame()
dtor.
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
bool m_sortAscend
Definition: CPListFrame.h:85
void SelectDistanceThreshold(double threshold)
select all cp with the given error bigger than the threshold
UIntSet getActiveImages() const
get active images
Definition: Panorama.cpp:1585
void OnCPListHeaderClick(wxListEvent &e)
sort criterium changed
Utility calls into PanoTools using CPP interface.
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.
Definition: threshold.h:41
void addObserver(PanoramaObserver *o)
add a panorama observer.
Definition: Panorama.cpp:1546
CPListCtrl * m_list
Definition: CPListFrame.h:124
include file for the hugin project
#define HUGIN_FT_CORR_THRESHOLD
size_t localNumber
Definition: CPListFrame.h:36
static T max(T x, T y)
Definition: svm.cpp:65
#define DEBUG_DEBUG(msg)
Definition: utils.h:68
std::string makePairId(unsigned int id1, unsigned int id2)
Definition: CPListFrame.cpp:53
std::vector< ControlPoint > CPVector
Definition: ControlPoint.h:99
platform/compiler specific stuff.
std::map< std::string, int > m_localIds
Definition: CPListFrame.h:88
bool m_onlyActiveImages
Definition: CPListFrame.h:86
virtual bool CanHandle(wxXmlNode *node)
Internal use to identify right xml handler.
bool IsShowingCorrelation() const
Definition: MainFrame.cpp:2199
virtual void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
evaluate y, points are on a horizontal line
Definition: ControlPoint.h:48
static T min(T x, T y)
Definition: svm.cpp:62
HuginBase::Panorama & m_pano
Definition: CPListFrame.h:125