27#include "hugin_config.h"
50 std::ostringstream
oss;
98 for (
int j = 0;
j < GetColumnCount();
j++)
101 int width = wxConfigBase::Get()->Read(wxString::Format(
"/CPListFrame/ColumnWidth%d",
j), -1);
104 SetColumnWidth(
j, width);
143 return wxString::Format(
"%u",
cp.image1Nr);
146 return wxString::Format(
"%u",
cp.image2Nr);
164 return wxString::Format(
_(
"Line %d"),
cp.mode);
169 return wxString::Format(
"%.2f",
cp.error);
187 if (GetColumn(5,
item))
191 item.SetText(
_(
"Correlation"));
195 item.SetText(
_(
"Distance"));
214 for (
size_t i = 0;
i < cps.size();
i++)
241#define CompareStruct(VAR, TYPESUFFIX, OP) \
242struct Compare##TYPESUFFIX\
244 bool operator()(const CPListItem& item1, const CPListItem& item2)\
246 return item1.VAR OP item2.VAR;\
256#define CompareStruct(VAR1, VAR2, TYPESUFFIX, OP)\
257struct Compare##TYPESUFFIX\
259 explicit Compare##TYPESUFFIX(const HuginBase::CPVector& cps) : m_cps(cps) {};\
260 bool operator()(const CPListItem& item1, const CPListItem& item2)\
262 return m_cps[item1.globalIndex].VAR1 * 1e4 + m_cps[item1.globalIndex].VAR2 + item1.localNumber * 1.0 / m_cps.size() OP\
263 m_cps[item2.globalIndex].VAR1 * 1e4 + m_cps[item2.globalIndex].VAR2 + item2.localNumber * 1.0 / m_cps.size();\
266 const HuginBase::CPVector& m_cps;\
275#define CompareStruct(VAR, TYPESUFFIX, OP)\
276struct Compare##TYPESUFFIX\
278 explicit Compare##TYPESUFFIX(const HuginBase::CPVector& cps) : m_cps(cps) {};\
279 bool operator()(const CPListItem& item1, const CPListItem& item2)\
281 return m_cps[item1.globalIndex].VAR OP m_cps[item2.globalIndex].VAR;\
284 const HuginBase::CPVector& m_cps;\
381 const int newCol = e.GetColumn();
398 const int colNum = e.GetColumn();
399 wxConfigBase::Get()->Write(wxString::Format(
"/CPListFrame/ColumnWidth%d",
colNum), GetColumnWidth(
colNum));
467 switch (e.GetKeyCode())
482IMPLEMENT_DYNAMIC_CLASS(
CPListCtrl, wxListCtrl)
487: wxListCtrlXmlHandler()
508 bool ok = wxXmlResource::Get()->LoadDialog(
this,
parent,
"cp_list_frame");
556 double min, max,
mean, var;
568 _(
"Enter minimum control point correlation.\nAll points with lower correlation will be selected.") :
569 _(
"Enter minimum control point error.\nAll points with a higher error will be selected"),
570 _(
"Select Control Points"),
#define CompareStruct(VAR, TYPESUFFIX, OP)
std::string makePairId(unsigned int id1, unsigned int id2)
xrc handler for CPImagesComboBox
virtual bool CanHandle(wxXmlNode *node)
Internal use to identify right xml handler.
virtual wxObject * DoCreateResource()
Create CPImagesComboBox from resource.
List all control points of this project.
void SelectDistanceThreshold(double threshold)
select all cp with the given error bigger than the threshold
virtual void panoramaChanged(HuginBase::Panorama &pano)
Notification about a Panorama change.
void OnCPListSelectionChanged(wxListEvent &e)
selection event handler
void OnChar(wxKeyEvent &e)
handle keystrokes
virtual wxString OnGetItemText(long item, long column) const
create labels for virtual list control
virtual int OnGetItemImage(long item) const
show no images
void DeleteSelected()
Delete the selected points.
void SelectAll()
select all items
std::vector< CPListItem > m_internalCPList
void OnColumnWidthChange(wxListEvent &e)
column width changed
void OnCPListHeaderClick(wxListEvent &e)
sort criterium changed
void Init(HuginBase::Panorama *pano)
void UpdateInternalCPList()
HuginBase::Panorama * m_pano
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)
void SortInternalList(bool isAscending)
std::map< std::string, int > m_localIds
void OnSelectButton(wxCommandEvent &e)
HuginBase::Panorama & m_pano
void OnDeleteButton(wxCommandEvent &e)
void OnClose(wxCloseEvent &event)
CPListFrame(wxWindow *parent, HuginBase::Panorama &pano)
ctor.
virtual ~CPListFrame()
dtor.
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)
represents a control point
@ X
evaluate x, points are on a vertical line
@ Y
evaluate y, points are on a horizontal line
void addObserver(PanoramaObserver *o)
add a panorama observer.
const ControlPoint & getCtrlPoint(std::size_t nr) const
get a control point, counting starts with 0
const CPVector & getCtrlPoints() const
get all control point of this Panorama
bool removeObserver(PanoramaObserver *observer)
remove a panorama observer.
UIntSet getActiveImages() const
get active images
void ShowCtrlPoint(unsigned int cpNr)
static MainFrame * Get()
hack.. kind of a pseudo singleton...
bool IsShowingCorrelation() const
void OnCPListFrameClosed()
const bool GetOptimizeOnlyActiveImages() const
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
static GlobalCmdHist & getInstance()
remove several control points
#define HUGIN_FT_CORR_THRESHOLD
#define DEBUG_ASSERT(cond)
std::vector< ControlPoint > CPVector
std::set< unsigned int > UIntSet
bool str2double(const wxString &s, double &d)
wxString doubleTowxString(double d, int digits)
void StoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
void RestoreFramePosition(wxTopLevelWindow *frame, const wxString &basename, const bool ignoreMaximize)
include file for the hugin project
include file for the hugin project
bool set_contains(const _Container &c, const typename _Container::key_type &key)
helper class for virtual listview control
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.