26 #include "hugin_config.h"
45 #include <wx/renderer.h>
94 if (! wxTreeListCtrl::Create(parent,
id, pos, size, style | wxTR_DEFAULT_STYLE|wxTR_HIDE_ROOT|wxTR_NO_LINES|wxTR_FULL_ROW_HIGHLIGHT|wxTR_ROW_LINES|wxTR_LINES_AT_ROOT|wxTR_MULTIPLE) )
103 m_degDigits = wxConfigBase::Get()->Read(wxT(
"/General/DegreeFractionalDigits"),1);
104 m_pixelDigits = wxConfigBase::Get()->Read(wxT(
"/General/PixelFractionalDigits"),1);
105 m_distDigits = wxConfigBase::Get()->Read(wxT(
"/General/DistortionFractionalDigits"),3);
128 #define ADDCOLUMN(header, mapName, width, align, isEditable, IVE, tooltip) \
129 AddColumn(header, width, align, -1, true, false, tooltip);\
130 m_columnMap[mapName]=counter;\
131 m_columnVector.push_back(mapName);\
134 m_editableColumns.insert(counter);\
136 m_variableVector.push_back(IVE);\
138 ADDCOLUMN(wxT(
"#"),
"imgNr", 35, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Image number"))
139 ADDCOLUMN(_(
"Filename"),
"filename", 200, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Filename"))
140 ADDCOLUMN(_(
"Width"),
"width", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Image width"))
141 ADDCOLUMN(_(
"Height"),
"height", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Image height"))
142 ADDCOLUMN(_(
"Anchor"),
"anchor", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Anchor image for position and/or exposure"))
143 ADDCOLUMN(_(
"# Ctrl Pnts"),
"cps", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Number of control points in this image"))
144 ADDCOLUMN(_(
"Lens no."),
"lensNr", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Assigned lens number"))
145 ADDCOLUMN(_(
"Stack no."),
"stackNr", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Assigned stack number"))
147 ADDCOLUMN(_(
"Maker"),
"maker", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Camera maker"))
148 ADDCOLUMN(_(
"Model"),
"model", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Camera model"))
149 ADDCOLUMN(_(
"Lens"),
"lens", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Used lens"))
150 ADDCOLUMN(_(
"Capture date"),
"date", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Date, image was taken"))
151 ADDCOLUMN(_(
"Focal length"),
"focallength", 80, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Focal length"))
152 ADDCOLUMN(_(
"Aperture"),
"aperture", 50, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Aperture"))
153 ADDCOLUMN(_(
"Shutter Speed"),
"time", 50, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Shutter speed"))
154 ADDCOLUMN(_(
"ISO"),
"iso", 50, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"ISO speed"))
156 ADDCOLUMN(_(
"Yaw (y)"),
"y", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Yaw"))
157 ADDCOLUMN(_(
"Pitch (p)"),
"p", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Pitch"))
158 ADDCOLUMN(_(
"Roll (r)"),
"r", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Roll"))
159 ADDCOLUMN(wxT(
"X (TrX)"),
"TrX", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation X"))
160 ADDCOLUMN(wxT(
"Y (TrY)"),
"TrY", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation Y"))
161 ADDCOLUMN(wxT(
"Z (TrZ)"),
"TrZ", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation Z"))
162 ADDCOLUMN(_(
"Plane yaw"),
"Tpy", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Translation remap plane yaw"))
163 ADDCOLUMN(_(
"Plane pitch"),
"Tpp", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Translation remap plane pitch"))
164 ADDCOLUMN(_(
"Camera translation"),
"cam_trans", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation"))
166 ADDCOLUMN(_(
"Lens type (f)"),
"projection", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Lens type (rectilinear, fisheye, equirectangular, ...)"))
167 ADDCOLUMN(_(
"Hfov (v)"),
"v", 80, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_HFOV, _(
"Horizontal field of view (v)"))
168 ADDCOLUMN(wxT(
"a"),
"a", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortion, _(
"Radial distortion (a)"))
169 ADDCOLUMN(wxT(
"b"),
"b", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortion, _(
"Radial distortion (b, barrel)"))
170 ADDCOLUMN(wxT(
"c"),
"c", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortion, _(
"Radial distortion (c)"))
171 ADDCOLUMN(wxT(
"d"),
"d", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortionCenterShift, _(
"Horizontal image center shift (d)"))
172 ADDCOLUMN(wxT(
"e"),
"e", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortionCenterShift, _(
"Vertical image center shift (e)"))
173 ADDCOLUMN(wxT(
"g"),
"g", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Shear, _(
"Horizontal image shearing (g)"))
174 ADDCOLUMN(wxT(
"t"),
"t", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Shear, _(
"Vertical image shearing (t)"))
176 ADDCOLUMN(wxT(
"EV"),
"Eev", 50, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_ExposureValue, _(
"Exposure value (Eev)"))
177 ADDCOLUMN(wxT(
"Er"),
"Er", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_WhiteBalanceRed, _(
"Red multiplier (Er)"))
178 ADDCOLUMN(wxT(
"Eb"),
"Eb", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_WhiteBalanceBlue, _(
"Blue multiplier (Eb)"))
179 ADDCOLUMN(wxT(
"Vb"),
"Vb", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCoeff, _(
"Vignetting (Vb, Vc, Vd)"))
180 ADDCOLUMN(wxT(
"Vc"),
"Vc", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCoeff, _(
"Vignetting (Vb, Vc, Vd)"))
181 ADDCOLUMN(wxT(
"Vd"),
"Vd", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCoeff, _(
"Vignetting (Vb, Vc, Vd)"))
182 ADDCOLUMN(wxT(
"Vx"),
"Vx", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCenterShift, _(
"Horizontal vignetting center shift (Vx)"))
183 ADDCOLUMN(wxT(
"Vy"),
"Vy", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCenterShift, _(
"Vertical vignetting center shift (Vy)"))
184 ADDCOLUMN(_(
"Response type"),
"response", 80, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Camera response type"))
185 ADDCOLUMN(wxT(
"Ra"),
"Ra", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
186 ADDCOLUMN(wxT(
"Rb"),
"Rb", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
187 ADDCOLUMN(wxT(
"Rc"),
"Rc", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
188 ADDCOLUMN(wxT(
"Rd"),
"Rd", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
189 ADDCOLUMN(wxT(
"Re"),
"Re", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
198 int width = wxConfigBase::Get()->Read(wxString::Format(
m_configClassName+wxT(
"/ColumnWidth%d"), j ), -1);
307 if(nrItems!=imageGroups.size())
309 if(nrItems<imageGroups.size())
311 for(
size_t i=nrItems;i<imageGroups.size();i++)
320 wxTreeItemIdValue cookie;
327 wxTreeItemIdValue cookie;
354 e.SetEventType(wxEVT_COMMAND_LIST_ITEM_SELECTED);
356 GetEventHandler()->ProcessEvent(e);
364 bool isSingleImage =
false;
370 const size_t imgNr=itemData->
GetImgNr();
381 wxChar
flags[] = wxT(
"--");
431 wxString text=_(
"not active");
432 if(img.getX()!=0.0 || img.getY()!=0.0 || img.getZ()!=0.0 || img.getTranslationPlaneYaw()!=0.0 || img.getTranslationPlanePitch()!=0.0)
436 text.Prepend(wxT(
" "));
468 std::vector<double> dist=img.getRadialDistortion();
533 std::vector<double> dist=img.getRadialVigCorrCoeff();
565 std::vector<float> vec = img.getEMoRParams();
602 wxTreeItemIdValue cookie;
606 bool haveSingleChild =
false;
626 wxString text=_(
"not active");
627 if(img.getX()!=0.0 || img.getY()!=0.0 || img.getZ()!=0.0 || img.getTranslationPlaneYaw()!=0.0 || img.getTranslationPlanePitch()!=0.0)
631 text.Prepend(wxT(
" "));
669 std::vector<double> dist=img.getRadialDistortion();
734 std::vector<double> dist=img.getRadialVigCorrCoeff();
760 std::vector<float> vec=img.getEMoRParams();
781 bool forceUpdate=
false;
782 if(nrItems!=imgs.size())
785 if(nrItems<imgs.size())
787 for(
size_t i=nrItems;i<imgs.size();i++)
796 wxTreeItemIdValue cookie;
803 wxTreeItemIdValue cookie;
805 HuginBase::UIntSet::const_iterator it=imgs.begin();
813 bool needsUpdate=
false;
826 if(needsUpdate || forceUpdate)
839 wxTreeItemIdValue cookie;
847 wxTreeItemIdValue childCookie;
875 for(HuginBase::UIntSet::const_iterator it=imgNrs.begin(); it!=imgNrs.end() && !opt;++it)
901 wxArrayTreeItemIds selected;
905 for(
size_t i=0;i<selected.size();i++)
910 wxTreeItemIdValue cookie;
938 int colNum = e.GetColumn();
953 wxRendererNative& renderer = wxRendererNative::Get();
954 const wxSize checkBoxSize = renderer.GetCheckBoxSize(
this);
955 wxImageList* checkboxImageList =
new wxImageList(checkBoxSize.GetWidth(), checkBoxSize.GetHeight(),
true, 0);
956 wxBitmap checkBoxImage(checkBoxSize, 32);
957 wxMemoryDC dc(checkBoxImage);
960 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize));
961 dc.SelectObject(wxNullBitmap);
962 checkboxImageList->Add(checkBoxImage);
964 dc.SelectObject(checkBoxImage);
966 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize), wxCONTROL_CHECKED);
967 dc.SelectObject(wxNullBitmap);
968 checkboxImageList->Add(checkBoxImage);
970 dc.SelectObject(checkBoxImage);
972 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize), wxCONTROL_CURRENT);
973 dc.SelectObject(wxNullBitmap);
974 checkboxImageList->Add(checkBoxImage);
976 dc.SelectObject(checkBoxImage);
978 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize), wxCONTROL_CHECKED | wxCONTROL_CURRENT);
979 dc.SelectObject(wxNullBitmap);
980 checkboxImageList->Add(checkBoxImage);
1020 SetWindowStyle(GetWindowStyle() | wxTR_NO_LINES);
1024 SetWindowStyle(GetWindowStyle() & ~wxTR_NO_LINES);
1101 bool allowMenuExtension=
true;
1102 if(e.GetItem().IsOk())
1109 bool varIsLinkable =
false;
1128 menu.Append(
ID_LINK,_(
"Link"));
1146 menu.Append(
ID_LINK, _(
"Link"));
1150 menu.AppendSeparator();
1154 if(data->
IsGroup() == emptyText)
1178 menu.AppendSeparator();
1181 menu.Append(
ID_EDIT, _(
"Edit image variables..."));
1187 if (selectedImages.size() == 1)
1220 allowMenuExtension=
false;
1223 if(allowMenuExtension)
1225 if(menu.GetMenuItemCount()>0)
1227 menu.AppendSeparator();
1232 wxMenu* subMenu=
new wxMenu();
1234 if(subMenu->GetMenuItemCount()>0)
1236 menu.Append(-1,_(
"Lens"), subMenu);
1244 subMenu=
new wxMenu();
1246 if(subMenu->GetMenuItemCount()>0)
1248 menu.Append(-1,_(
"Stacks"), subMenu);
1255 subMenu=
new wxMenu();
1257 if(subMenu->GetMenuItemCount()>0)
1259 menu.Append(-1, _(
"Control points"), subMenu);
1265 subMenu=
new wxMenu();
1267 if(subMenu->GetMenuItemCount()>0)
1269 menu.Append(-1, _(
"Reset"), subMenu);
1276 if(menu.GetMenuItemCount()>0)
1286 for(
size_t i=0; i<operations->size(); i++)
1290 menu->Append(
id, (*operations)[i]->GetLabel());
1300 const wxColour normalColour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
1301 const wxColour disabledColour = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
1304 wxTreeItemIdValue cookie;
1309 bool isActive =
true;
1312 wxTreeItemIdValue childCookie;
1314 while (child.IsOk())
1339 wxTreeItemIdValue childCookie;
1341 while (child.IsOk())
1360 wxTreeItemIdValue cookie;
1368 wxTreeItemIdValue childCookie;
1370 while (child.IsOk())
1399 std::copy(selectedImages.begin(), selectedImages.end(), std::inserter(activeImages, activeImages.end()));
1410 std::set_difference(activeImages.begin(), activeImages.end(), selectedImages.begin(), selectedImages.end(), std::inserter(newActiveImages, newActiveImages.end()));
1421 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum> variables;
1423 if(
m_variableVector[m_selectedColumn]==HuginBase::ImageVariableGroup::IVE_Yaw)
1425 variables.insert(HuginBase::ImageVariableGroup::IVE_Pitch);
1426 variables.insert(HuginBase::ImageVariableGroup::IVE_Roll);
1427 variables.insert(HuginBase::ImageVariableGroup::IVE_X);
1428 variables.insert(HuginBase::ImageVariableGroup::IVE_Y);
1429 variables.insert(HuginBase::ImageVariableGroup::IVE_Z);
1430 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlaneYaw);
1431 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlanePitch);
1496 const bool ctrlPressed=wxGetKeyState(WXK_COMMAND);
1506 SetCursor(wxCURSOR_HAND);
1520 SetCursor(wxCURSOR_ARROW);
1522 wxTreeItemId item=
HitTest(e.GetPosition());
1537 wxPoint pos(e.GetPosition());
1562 for (
auto& i : images)
1566 const bool moveImageChecked = imgList[img1];
1567 imgList.erase(imgList.begin() + img1);
1568 if (img2 < imgList.size())
1570 imgList.insert(imgList.begin() + img2, moveImageChecked);
1574 imgList.push_back(moveImageChecked);
1577 for (
size_t i = 0; i < imgList.size(); ++i)
1649 wxTreeItemId item =
HitTest(e.GetPosition(),
flags, col);
1667 wxTreeItemIdValue cookie;
1669 while (childItem.IsOk())
1682 std::set<std::string> var;
1720 bool deactivate =
false;
1728 for (std::set<std::string>::const_iterator varIt = var.begin(); varIt != var.end(); ++varIt)
1731 for (HuginBase::UIntSet::const_iterator imgIt = imgs.begin(); imgIt != imgs.end() && !deactivate; ++imgIt)
1743 for (std::set<std::string>::const_iterator varIt = var.begin(); varIt != var.end(); ++varIt)
1745 for (HuginBase::UIntSet::const_iterator imgIt = imgs.begin(); imgIt != imgs.end(); ++imgIt)
1747 optVec[*imgIt].erase(*varIt);
1753 for (std::set<std::string>::const_iterator varIt = var.begin(); varIt != var.end(); ++varIt)
1755 for (HuginBase::UIntSet::const_iterator imgIt = imgs.begin(); imgIt != imgs.end(); ++imgIt)
1757 optVec[*imgIt].insert(*varIt);
1787 wxTreeItemId item =
HitTest(e.GetPosition(),
flags, col);
1788 if (item.IsOk() && (flags & wxTREE_HITTEST_ONITEMICON))
1810 wxTreeItemId item =
HitTest(e.GetPosition(),
flags, col);
1811 if (item.IsOk() && (flags & wxTREE_HITTEST_ONITEMICON))
1815 if (imgNr >= 0 && imgNr < 2)
1841 std::set<std::string> imgVars;
1843 if(var==
"cam_trans")
1845 imgVars.insert(
"TrX");
1846 imgVars.insert(
"TrY");
1847 imgVars.insert(
"TrZ");
1848 imgVars.insert(
"Tpy");
1849 imgVars.insert(
"Tpp");
1853 imgVars.insert(var);
1854 if(var==
"Vb" || var==
"Vc" || var==
"Vd")
1856 imgVars.insert(
"Vb");
1857 imgVars.insert(
"Vc");
1858 imgVars.insert(
"Vd");
1860 if(var==
"Vx" || var==
"Vy")
1862 imgVars.insert(
"Vx");
1863 imgVars.insert(
"Vy");
1865 if(var==
"Ra" || var==
"Rb" || var==
"Rc" || var==
"Rd" || var==
"Re")
1867 imgVars.insert(
"Ra");
1868 imgVars.insert(
"Rb");
1869 imgVars.insert(
"Rc");
1870 imgVars.insert(
"Rd");
1871 imgVars.insert(
"Re");
1883 wxArrayTreeItemIds selectedItem;
1886 for(
size_t i=0;i<selectedItem.size();i++)
1889 wxTreeItemId startItem;
1892 startItem=selectedItem[i];
1898 wxTreeItemIdValue cookie;
1911 for(HuginBase::UIntSet::iterator img=imgs.begin(); img!=imgs.end(); ++img)
1913 for(std::set<std::string>::const_iterator it=imgVars.begin(); it!=imgVars.end(); ++it)
1917 if((*it==
"y" || *it==
"p" || *it==
"r" || *it==
"TrX" || *it==
"TrY" || *it==
"TrZ" || *it==
"Tpy" || *it==
"Tpp") &&
1920 optVec[*img].erase(*it);
1925 optVec[*img].erase(*it);
1930 optVec[*img].erase(*it);
1935 optVec[*img].erase(*it);
1938 optVec[*img].insert(*it);
1942 optVec[*img].erase(*it);
1973 switch(e.GetKeyCode())
1977 wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, XRCID(
"action_add_images"));
1987 for (
auto& img : imgs)
1989 ImageCache::getInstance().removeImage(
m_pano->
getImage(img).getFilename());
1998 #if defined __WXMAC__
2002 if (e.GetExtraLong() == wxMOD_CMD)
2030 wxTreeItemIdValue cookie;
2042 if(e.IsEditCancelled())
2066 wxTreeItemIdValue cookie;
2077 wxString::Format(_(
"You have given a field of view of %.2f degrees.\n But the orthographic projection is limited to a field of view of 180 degress.\nDo you want still use that high value?"), val),
2083 wxICON_EXCLAMATION | wxYES_NO)==wxNO)
2129 wxTreeItemId item=
HitTest(e.GetPosition(),
flags, col);
2131 wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED,
ID_EDIT);
2132 GetEventHandler()->AddPendingEvent(commandEvent);
2140 : wxTreeListCtrlXmlHandler()
2148 cp->Create(m_parentAsWindow,
2150 GetPosition(), GetSize(),
2151 GetStyle(wxT(
"style")),
2161 return IsOfClass(node, wxT(
"ImagesTreeList"));
HuginBase::UIntSet GetDragGroupImages()
ImagesTreeCtrl()
general constructor
Base class for all panorama commands.
void Refresh(bool erase=TRUE, const wxRect *rect=NULL)
std::map< std::string, size_t > m_columnMap
map for easier access to column information
static const std::set< ConstImageVariableGroup::ImageVariableEnum > & getLensVariables()
Get the set of lens image variables.
void OnChar(wxTreeEvent &e)
event handler for key events
GroupMode m_groupMode
the active group mode
std::vector< UIntSet > getHDRStacks(const PanoramaData &pano, UIntSet allImgs, PanoramaOptions opts)
returns vector of set of output stacks
declaration of functions to handle stacks and layers
void SetGroupMode(GroupMode newMode)
sets the group mode to given mode
std::vector< UIntSet > UIntSetVector
std::vector< UIntSet > getExposureLayers(const PanoramaData &pano, UIntSet allImgs, PanoramaOptions opts)
returns vector of set of output exposure layers
void OnHeaderContextMenu(wxListEvent &e)
event handler for context menu on header
size_t GetChildrenCount(const wxTreeItemId &item, bool recursively=true)
move image from position1 to position2
virtual PanoCommand::PanoCommand * GetCommand(wxWindow *parent, HuginBase::Panorama &pano, HuginBase::UIntSet images, GuiLevel guiLevel)
returns the appropriate PanoCommand::PanoCommand to be inserted into GlobalCmdHistory, checks if operation is enabled
unsigned int getPartNumber(unsigned int imageNr) const
Get a part number from an image number.
Change the linking of some variables across parts of an ImageVariableGroup containing some specified ...
virtual wxObject * DoCreateResource()
bool str2double(const wxString &s, double &d)
void OnEndEdit(wxTreeEvent &e)
event handler for ending editing, updates the Panorama with modified value
void OnLeftDown(wxMouseEvent &e)
event handler for left mouse down, handles toggle of optimizer variables
void OnExecuteOperation(wxCommandEvent &e)
menu event handler for PanoOperation (context menu items)
void OnLeftUp(wxMouseEvent &e)
event handler for left up, handles end of dragging and updates of optimizer variables states ...
DisplayMode m_displayMode
the active display mode
void SetGuiLevel(GuiLevel newLevel)
sets the GuiLevel
declaration of main image tree control
void SetColumnWidth(int column, int width)
bool removeObserver(PanoramaObserver *observer)
remove a panorama observer.
ImageVariableGroup & getStacks()
Get the ImageVariableGroup representing the group of stack variables.
bool m_dragging
true, if dragging
void UpdateGroup(wxTreeItemId parent, const HuginBase::UIntSet imgs, HuginBase::UIntSet &changed)
updates the given group, updates number of images and the images itself
std::vector< HuginBase::ImageVariableGroup::ImageVariableEnum > m_variableVector
vector for easier access to linking information
Somewhere to specify what variables belong to what.
wxTreeItemId AppendItem(const wxTreeItemId &parent, const wxString &text, int image=-1, int selectedImage=-1, wxTreeItemData *data=NULL)
void OnUnlinkImageVariables(wxCommandEvent &e)
event handler for unlinking image variables
wxTreeItemId m_root
pointer to root item, not shown
void SetColumnShown(int column, bool shown=true)
wxTreeItemData * GetItemData(const wxTreeItemId &item) const
void EndEdit(bool isCancelled)
wxTreeItemId AddRoot(const wxString &text, int image=-1, int selectedImage=-1, wxTreeItemData *data=NULL)
void SetImgNr(long newImgNr)
virtual void panoramaChanged(HuginBase::Panorama &pano)
receives notification about panorama changes
wxString doubleTowxString(double d, int digits)
void SelectTab(size_t i)
selects the tab with index i
void DeleteChildren(const wxTreeItemId &item)
a variable has a value and a name.
bool set_contains(const _Container &c, const typename _Container::key_type &key)
#define DEBUG_ASSERT(cond)
simple class that forward the drop to the mainframe
include file for the hugin project
void AssignImageList(wxImageList *imageList)
void SetColumnEditable(int column, bool edit=true)
wxTreeItemId GetLastChild(const wxTreeItemId &item, wxTreeItemIdValue &cookie) const
wxTreeItemId GetItemParent(const wxTreeItemId &item) const
wxTreeItemId GetFirstChild(const wxTreeItemId &item, wxTreeItemIdValue &cookie) const
bool m_markDisabledImages
true, if disabled images should be marked with other font color
void OnDeactivateImage(wxCommandEvent &e)
event handler for deactivate image
wxTreeItemId HitTest(const wxPoint &point)
void OnLeftDblClick(wxMouseEvent &e)
event handler for left double click
unsigned int colorReferenceImage
Declare the ImageVariableGroup and ImageVariableGroupObserver classes.
void OnDpiChanged(wxDPIChangedEvent &e)
event handler for updating dpi
void Init(HuginBase::Panorama *pano)
initialization, connects all control with Panorama, register observer
wxTreeItemId m_leftDownItem
stores where left mouse click happend
#define ADDCOLUMN(header, mapName, width, align, isEditable, IVE, tooltip)
std::set< unsigned int > UIntSet
void OnContextMenu(wxTreeEvent &e)
event handler to display context menu
DisplayMode
enumeration for display mode, limits the displayed columns
void OnLinkImageVariables(wxCommandEvent &e)
event handler for linking image variables
bool m_needsUpdate
helper variable for update of output stacks/layers
wxTreeItemId GetNext(const wxTreeItemId &item) const
void SetItemImage(const wxTreeItemId &item, int image, wxTreeItemIcon which=wxTreeItemIcon_Normal)
updates the optimize vector, aka all variables which should be optimized
void MarkActiveImages(const bool markActive)
sets the flag, if active/disabled image should be marked with different colour
empirical model of response
UIntSetVector getPartsSet() const
return a vector which contains a HuginBase::UIntSet for each group with the corresponding images numb...
void OnBeginEdit(wxTreeEvent &e)
event handler for beginning editing
void UpdateImageText(wxTreeItemId item)
updates the information for the given image in tree
wxString m_configClassName
const OptimizeVector & getOptimizeVector() const
return the optimize settings stored inside panorama
void SetDisplayMode(DisplayMode newMode)
sets the display mode to given mode
Make a new part in a ImageVariableGroup for a set of images, given the variables that make up the gro...
Definition of dialog to edit image variables.
const long GetGroupNr() const
bool IsSelected(const wxTreeItemId &item) const
void SetDragGroupImages(HuginBase::UIntSet imageDragGroup_in, bool update_check_box=true)
void UnLinkImageVariables(bool linked)
helper procedure for link/unlink image variables
std::size_t getNrOfImages() const
number of images.
static MainFrame * Get()
hack.. kind of a pseudo singleton...
std::vector< unsigned int > getCtrlPointsForImage(unsigned int imgNr) const
return all control points for a given image.
GroupMode
enumeration for grouping mode
ImagesTreeData(const long &nr)
PanoOperationVector * GetLensesOperationVector()
returns list of PanoOperation for work with lenses
double m_editVal
value, which is currently edited
Switch the part number of an image.
PanoOperationVector * GetControlPointsOperationVector()
returns list of PanoOperation for work with control points
base class for different PanoOperations derived classes should overwrite protected PanoOperation::Get...
IMPLEMENT_DYNAMIC_CLASS(wxTreeListHeaderWindow, wxWindow)
ImageVariableGroup & getLenses()
Get the ImageVariableGroup representing the group of lens variables.
void SetItemBold(const wxTreeItemId &item, bool bold=true)
void AddColumn(const wxString &text, int width=DEFAULT_COL_WIDTH, int flag=wxALIGN_LEFT, int image=-1, bool shown=true, bool edit=false, const wxString &tooltip=wxEmptyString)
std::vector< std::string > m_columnVector
vector for easier access to column information
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"))
creates the control
void OnColumnWidthChange(wxListEvent &e)
event handler, when column width was changed, save into wxConfig
wxTreeItemId GetNextChild(const wxTreeItemId &item, wxTreeItemIdValue &cookie) const
static GlobalCmdHist & getInstance()
HuginBase::Panorama * m_pano
void addCommand(PanoCommand *command, bool execute=true)
Adds a command to the history.
bool m_optimizerMode
true, if in optimizer mode
int GetColumnCount() const
wxTreeItemId m_lastCurrentItem
stores last item on which the mouse was hovering
void SetGuiLevel(GuiLevel newSetting)
sets the GuiLevel of the control
UIntSet getActiveImages() const
get active images
const bool IsGroup() const
update a single variable, possibly for a group of images
HuginBase::UIntSet GetSelectedImages()
returns the selected images
void OnEditImageVariables(wxCommandEvent &e)
event handler for showing image variables editing dialog
void SetItemTextColour(const wxTreeItemId &item, const wxColour &colour)
void OnSelectAll(wxCommandEvent &e)
event handler for select all optimizer variables
void addObserver(PanoramaObserver *o)
add a panorama observer.
void OnSelectLensStack(wxCommandEvent &e)
event handler for select all optimizer variables for selected lens/stack
size_t m_selectedColumn
selected column
include file for the hugin project
const PanoramaOptions & getOptions() const
returns the options for this panorama
std::map< int, PanoOperation::PanoOperation * > m_menuOperation
map with current active context menu PanoOperation
void OnBeginDrag(wxTreeEvent &e)
event handler when dragging begins, veto if dragging is not possible
the main images tree control, used on images and optimizer tabs
GLPreviewFrame * getGLPreview()
options wxIntPtr wxIntPtr sortData std::vector< PanoInfo > * data
void OnActivateImage(wxCommandEvent &e)
event handler for activate image
void OnMouseMove(wxMouseEvent &e)
event handler for mouse motion, handles focussing of check boxes
void GenerateSubMenu(wxMenu *menu, PanoOperation::PanoOperationVector *operations, int &id)
generates submenu for given PanoOperationVector
int GetItemImage(const wxTreeItemId &item, wxTreeItemIcon which=wxTreeItemIcon_Normal) const
GuiLevel m_guiLevel
stores the active GuiLevel
wxString m_editOldString
wxString, as shown before editing started
PanoOperationVector * GetResetOperationVector()
returns list of PanoOperation for resetting
void update()
Update part numbers for each variable group.
void SelectAllParameters(bool select, bool allImages)
select/unselect all variables in the active column true selects all, false unselect all true works ...
PanoOperationVector * GetImagesOperationVector()
returns list of PanoOperation for work with images
size_t GetSelections(wxArrayTreeItemIds &) const
std::vector< std::set< std::string > > OptimizeVector
std::vector< PanoOperation * > PanoOperationVector
HuginBase::StandardImageVariableGroups * m_variable_groups
void ExpandAll(const wxTreeItemId &item)
HuginBase::UIntSet m_draggingImages
UIntSet of dragging images.
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
remove multiple images from a panorama
void UpdateGroupText(wxTreeItemId item)
updates the information fot the given lens/stack in the tree
void fill_set(_Container &c, typename _Container::key_type begin, typename _Container::key_type end)
void UpdateItemFont()
update the font colour for all items
void OnUnselectLensStack(wxCommandEvent &e)
event handler for unselect all optimizer variables for selected lens/stack
std::size_t getNumberOfParts() const
get the number of parts.
All variables of a source image.
PanoOperationVector * GetStacksOperationVector()
returns list of PanoOperation for stacks
wxString GetItemText(const wxTreeItemId &item) const
HuginBase::UIntSet m_editableColumns
set, which contains editable columns (all column which contains numeric image variables ...
virtual bool CanHandle(wxXmlNode *node)
const long GetImgNr() const
static const std::set< ConstImageVariableGroup::ImageVariableEnum > & getStackVariables()
Get the set of stack image variables.
void CreateColumns()
creates all columns and stores information in m_columnMap, m_columnVector, m_editableColumns and m_va...
void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
receive the update signal and update display accordingly
void SetItemText(const wxTreeItemId &item, const wxString &text)
void Delete(const wxTreeItemId &item)
void OnUnselectAll(wxCommandEvent &e)
event handler for unselect all optimizer variables
void UpdateOptimizerVariables()
updates the display of the optimizer variables (set font)
void CreateCheckboxImages()
create image list with necessary images of checkboxes
int GetColumnWidth(int column) const
Dialog for editing image variables.
void SetOptimizerMode()
sets to control into optimizer mode
virtual ~ImagesTreeCtrl(void)
destructor
unsigned int optimizeReferenceImage