26 #include "hugin_config.h"
45 #include <wx/renderer.h>
81 #if wxCHECK_VERSION(3,1,3)
82 EVT_DPI_CHANGED(ImagesTreeCtrl::OnDpiChanged)
91 void SetImgNr(
long newImgNr) { m_nr=newImgNr;};
93 const bool IsGroup()
const {
return (m_nr<0); };
116 const wxString& name)
119 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) )
128 m_degDigits = wxConfigBase::Get()->Read(wxT(
"/General/DegreeFractionalDigits"),1);
129 m_pixelDigits = wxConfigBase::Get()->Read(wxT(
"/General/PixelFractionalDigits"),1);
130 m_distDigits = wxConfigBase::Get()->Read(wxT(
"/General/DistortionFractionalDigits"),3);
139 #define ADDCOLUMN(header, mapName, width, align, isEditable, IVE, tooltip) \
140 AddColumn(header, width, align, -1, true, false, tooltip);\
141 m_columnMap[mapName]=counter;\
142 m_columnVector.push_back(mapName);\
145 m_editableColumns.insert(counter);\
147 m_variableVector.push_back(IVE);\
149 ADDCOLUMN(wxT(
"#"),
"imgNr", 35, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Image number"))
150 ADDCOLUMN(_(
"Filename"),
"filename", 200, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Filename"))
151 ADDCOLUMN(_(
"Width"),
"width", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Image width"))
152 ADDCOLUMN(_(
"Height"),
"height", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Image height"))
153 ADDCOLUMN(_(
"Anchor"),
"anchor", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Anchor image for position and/or exposure"))
154 ADDCOLUMN(_(
"# Ctrl Pnts"),
"cps", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Number of control points in this image"))
155 ADDCOLUMN(_(
"Lens no."),
"lensNr", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Assigned lens number"))
156 ADDCOLUMN(_(
"Stack no."),
"stackNr", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Assigned stack number"))
158 ADDCOLUMN(_(
"Maker"),
"maker", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Camera maker"))
159 ADDCOLUMN(_(
"Model"),
"model", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Camera model"))
160 ADDCOLUMN(_(
"Lens"),
"lens", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Used lens"))
161 ADDCOLUMN(_(
"Capture date"),
"date", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Date, image was taken"))
162 ADDCOLUMN(_(
"Focal length"),
"focallength", 80, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Focal length"))
163 ADDCOLUMN(_(
"Aperture"),
"aperture", 50, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Aperture"))
164 ADDCOLUMN(_(
"Shutter Speed"),
"time", 50, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Shutter speed"))
165 ADDCOLUMN(_(
"ISO"),
"iso", 50, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"ISO speed"))
167 ADDCOLUMN(_(
"Yaw (y)"),
"y", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Yaw"))
168 ADDCOLUMN(_(
"Pitch (p)"),
"p", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Pitch"))
169 ADDCOLUMN(_(
"Roll (r)"),
"r", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Roll"))
170 ADDCOLUMN(wxT(
"X (TrX)"),
"TrX", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation X"))
171 ADDCOLUMN(wxT(
"Y (TrY)"),
"TrY", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation Y"))
172 ADDCOLUMN(wxT(
"Z (TrZ)"),
"TrZ", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation Z"))
173 ADDCOLUMN(_(
"Plane yaw"),
"Tpy", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Translation remap plane yaw"))
174 ADDCOLUMN(_(
"Plane pitch"),
"Tpp", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Translation remap plane pitch"))
175 ADDCOLUMN(_(
"Camera translation"),
"cam_trans", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation"))
177 ADDCOLUMN(_(
"Lens type (f)"),
"projection", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Lens type (rectilinear, fisheye, equirectangular, ...)"))
178 ADDCOLUMN(_(
"Hfov (v)"),
"v", 80, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_HFOV, _(
"Horizontal field of view (v)"))
179 ADDCOLUMN(wxT(
"a"),
"a", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortion, _(
"Radial distortion (a)"))
180 ADDCOLUMN(wxT(
"b"),
"b", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortion, _(
"Radial distortion (b, barrel)"))
181 ADDCOLUMN(wxT(
"c"),
"c", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortion, _(
"Radial distortion (c)"))
182 ADDCOLUMN(wxT(
"d"),
"d", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortionCenterShift, _(
"Horizontal image center shift (d)"))
183 ADDCOLUMN(wxT(
"e"),
"e", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortionCenterShift, _(
"Vertical image center shift (e)"))
184 ADDCOLUMN(wxT(
"g"),
"g", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Shear, _(
"Horizontal image shearing (g)"))
185 ADDCOLUMN(wxT(
"t"),
"t", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Shear, _(
"Vertical image shearing (t)"))
187 ADDCOLUMN(wxT(
"EV"),
"Eev", 50, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_ExposureValue, _(
"Exposure value (Eev)"))
188 ADDCOLUMN(wxT(
"Er"),
"Er", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_WhiteBalanceRed, _(
"Red multiplier (Er)"))
189 ADDCOLUMN(wxT(
"Eb"),
"Eb", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_WhiteBalanceBlue, _(
"Blue multiplier (Eb)"))
190 ADDCOLUMN(wxT(
"Vb"),
"Vb", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCoeff, _(
"Vignetting (Vb, Vc, Vd)"))
191 ADDCOLUMN(wxT(
"Vc"),
"Vc", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCoeff, _(
"Vignetting (Vb, Vc, Vd)"))
192 ADDCOLUMN(wxT(
"Vd"),
"Vd", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCoeff, _(
"Vignetting (Vb, Vc, Vd)"))
193 ADDCOLUMN(wxT(
"Vx"),
"Vx", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCenterShift, _(
"Horizontal vignetting center shift (Vx)"))
194 ADDCOLUMN(wxT(
"Vy"),
"Vy", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCenterShift, _(
"Vertical vignetting center shift (Vy)"))
195 ADDCOLUMN(_(
"Response type"),
"response", 80, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Camera response type"))
196 ADDCOLUMN(wxT(
"Ra"),
"Ra", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
197 ADDCOLUMN(wxT(
"Rb"),
"Rb", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
198 ADDCOLUMN(wxT(
"Rc"),
"Rc", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
199 ADDCOLUMN(wxT(
"Rd"),
"Rd", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
200 ADDCOLUMN(wxT(
"Re"),
"Re", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
209 int width = wxConfigBase::Get()->Read(wxString::Format(
m_configClassName+wxT(
"/ColumnWidth%d"), j ), -1);
318 if(nrItems!=imageGroups.size())
320 if(nrItems<imageGroups.size())
322 for(
size_t i=nrItems;i<imageGroups.size();i++)
331 wxTreeItemIdValue cookie;
338 wxTreeItemIdValue cookie;
365 e.SetEventType(wxEVT_COMMAND_LIST_ITEM_SELECTED);
367 GetEventHandler()->ProcessEvent(e);
375 bool isSingleImage =
false;
381 const size_t imgNr=itemData->
GetImgNr();
392 wxChar
flags[] = wxT(
"--");
442 wxString text=_(
"not active");
443 if(img.getX()!=0.0 || img.getY()!=0.0 || img.getZ()!=0.0 || img.getTranslationPlaneYaw()!=0.0 || img.getTranslationPlanePitch()!=0.0)
447 text.Prepend(wxT(
" "));
479 std::vector<double> dist=img.getRadialDistortion();
544 std::vector<double> dist=img.getRadialVigCorrCoeff();
576 std::vector<float> vec = img.getEMoRParams();
613 wxTreeItemIdValue cookie;
617 bool haveSingleChild =
false;
637 wxString text=_(
"not active");
638 if(img.getX()!=0.0 || img.getY()!=0.0 || img.getZ()!=0.0 || img.getTranslationPlaneYaw()!=0.0 || img.getTranslationPlanePitch()!=0.0)
642 text.Prepend(wxT(
" "));
680 std::vector<double> dist=img.getRadialDistortion();
745 std::vector<double> dist=img.getRadialVigCorrCoeff();
771 std::vector<float> vec=img.getEMoRParams();
792 bool forceUpdate=
false;
793 if(nrItems!=imgs.size())
796 if(nrItems<imgs.size())
798 for(
size_t i=nrItems;i<imgs.size();i++)
807 wxTreeItemIdValue cookie;
814 wxTreeItemIdValue cookie;
816 HuginBase::UIntSet::const_iterator it=imgs.begin();
824 bool needsUpdate=
false;
837 if(needsUpdate || forceUpdate)
850 wxTreeItemIdValue cookie;
858 wxTreeItemIdValue childCookie;
886 for(HuginBase::UIntSet::const_iterator it=imgNrs.begin(); it!=imgNrs.end() && !opt;++it)
912 wxArrayTreeItemIds selected;
916 for(
size_t i=0;i<selected.size();i++)
921 wxTreeItemIdValue cookie;
949 int colNum = e.GetColumn();
964 wxRendererNative& renderer = wxRendererNative::Get();
965 const wxSize checkBoxSize = renderer.GetCheckBoxSize(
this);
966 wxImageList* checkboxImageList =
new wxImageList(checkBoxSize.GetWidth(), checkBoxSize.GetHeight(),
true, 0);
967 wxBitmap checkBoxImage(checkBoxSize, 32);
968 wxMemoryDC dc(checkBoxImage);
971 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize));
972 dc.SelectObject(wxNullBitmap);
973 checkboxImageList->Add(checkBoxImage);
975 dc.SelectObject(checkBoxImage);
977 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize), wxCONTROL_CHECKED);
978 dc.SelectObject(wxNullBitmap);
979 checkboxImageList->Add(checkBoxImage);
981 dc.SelectObject(checkBoxImage);
983 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize), wxCONTROL_CURRENT);
984 dc.SelectObject(wxNullBitmap);
985 checkboxImageList->Add(checkBoxImage);
987 dc.SelectObject(checkBoxImage);
989 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize), wxCONTROL_CHECKED | wxCONTROL_CURRENT);
990 dc.SelectObject(wxNullBitmap);
991 checkboxImageList->Add(checkBoxImage);
1014 #if wxCHECK_VERSION(3,1,3)
1015 void ImagesTreeCtrl::OnDpiChanged(wxDPIChangedEvent& e)
1033 SetWindowStyle(GetWindowStyle() | wxTR_NO_LINES);
1037 SetWindowStyle(GetWindowStyle() & ~wxTR_NO_LINES);
1114 bool allowMenuExtension=
true;
1115 if(e.GetItem().IsOk())
1122 bool varIsLinkable =
false;
1141 menu.Append(ID_LINK,_(
"Link"));
1145 menu.Append(ID_UNLINK, _(
"Unlink"));
1152 menu.Append(ID_UNLINK,_(
"Unlink"));
1156 menu.Append(ID_LINK, _(
"Link"));
1159 menu.AppendSeparator();
1163 if(data->
IsGroup() == emptyText)
1167 menu.Append(ID_SELECT_LENS_STACK, _(
"Select all for current lens"));
1168 menu.Append(ID_UNSELECT_LENS_STACK, _(
"Unselect all for current lens"));
1172 menu.Append(ID_SELECT_LENS_STACK, _(
"Select all for current stack"));
1173 menu.Append(ID_UNSELECT_LENS_STACK, _(
"Unselect all for current stack"));
1178 menu.Append(ID_SELECT_ALL, _(
"Select all"));
1180 menu.Append(ID_UNSELECT_ALL, _(
"Unselect all"));
1181 menu.AppendSeparator();
1184 menu.Append(ID_EDIT, _(
"Edit image variables..."));
1188 if (selectedImages.size() == 1)
1192 menu.Append(ID_DEACTIVATE_IMAGE, _(
"Deactivate image"));
1196 menu.Append(ID_ACTIVATE_IMAGE, _(
"Activate image"));
1201 menu.Append(ID_ACTIVATE_IMAGE, _(
"Activate images"));
1202 menu.Append(ID_DEACTIVATE_IMAGE, _(
"Deactivate images"));
1212 menu.Append(ID_SELECT_ALL, _(
"Select all"));
1214 menu.Append(ID_UNSELECT_ALL, _(
"Unselect all"));
1215 allowMenuExtension=
false;
1218 if(allowMenuExtension)
1220 if(menu.GetMenuItemCount()>0)
1222 menu.AppendSeparator();
1227 wxMenu* subMenu=
new wxMenu();
1229 if(subMenu->GetMenuItemCount()>0)
1231 menu.Append(-1,_(
"Lens"), subMenu);
1239 subMenu=
new wxMenu();
1241 if(subMenu->GetMenuItemCount()>0)
1243 menu.Append(-1,_(
"Stacks"), subMenu);
1250 subMenu=
new wxMenu();
1252 if(subMenu->GetMenuItemCount()>0)
1254 menu.Append(-1, _(
"Control points"), subMenu);
1260 subMenu=
new wxMenu();
1262 if(subMenu->GetMenuItemCount()>0)
1264 menu.Append(-1, _(
"Reset"), subMenu);
1271 if(menu.GetMenuItemCount()>0)
1281 for(
size_t i=0; i<operations->size(); i++)
1285 menu->Append(
id, (*operations)[i]->GetLabel());
1294 const wxColour normalColour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
1295 const wxColour disabledColour = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
1298 wxTreeItemIdValue cookie;
1303 bool isActive =
true;
1306 wxTreeItemIdValue childCookie;
1308 while (child.IsOk())
1333 wxTreeItemIdValue childCookie;
1335 while (child.IsOk())
1354 wxTreeItemIdValue cookie;
1362 wxTreeItemIdValue childCookie;
1364 while (child.IsOk())
1381 menu.Append(ID_SELECT_ALL, _(
"Select all"));
1382 menu.Append(ID_UNSELECT_ALL, _(
"Unselect all"));
1391 std::copy(selectedImages.begin(), selectedImages.end(), std::inserter(activeImages, activeImages.end()));
1402 std::set_difference(activeImages.begin(), activeImages.end(), selectedImages.begin(), selectedImages.end(), std::inserter(newActiveImages, newActiveImages.end()));
1413 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum> variables;
1415 if(
m_variableVector[m_selectedColumn]==HuginBase::ImageVariableGroup::IVE_Yaw)
1417 variables.insert(HuginBase::ImageVariableGroup::IVE_Pitch);
1418 variables.insert(HuginBase::ImageVariableGroup::IVE_Roll);
1419 variables.insert(HuginBase::ImageVariableGroup::IVE_X);
1420 variables.insert(HuginBase::ImageVariableGroup::IVE_Y);
1421 variables.insert(HuginBase::ImageVariableGroup::IVE_Z);
1422 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlaneYaw);
1423 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlanePitch);
1488 const bool ctrlPressed=wxGetKeyState(WXK_COMMAND);
1498 SetCursor(wxCURSOR_HAND);
1512 SetCursor(wxCURSOR_ARROW);
1514 wxTreeItemId item=
HitTest(e.GetPosition());
1529 wxPoint pos(e.GetPosition());
1554 for (
auto& i : images)
1558 const bool moveImageChecked = imgList[img1];
1559 imgList.erase(imgList.begin() + img1);
1560 if (img2 < imgList.size())
1562 imgList.insert(imgList.begin() + img2, moveImageChecked);
1566 imgList.push_back(moveImageChecked);
1569 for (
size_t i = 0; i < imgList.size(); ++i)
1641 wxTreeItemId item =
HitTest(e.GetPosition(),
flags, col);
1659 wxTreeItemIdValue cookie;
1661 while (childItem.IsOk())
1674 std::set<std::string> var;
1712 bool deactivate =
false;
1720 for (std::set<std::string>::const_iterator varIt = var.begin(); varIt != var.end(); ++varIt)
1723 for (HuginBase::UIntSet::const_iterator imgIt = imgs.begin(); imgIt != imgs.end() && !deactivate; ++imgIt)
1735 for (std::set<std::string>::const_iterator varIt = var.begin(); varIt != var.end(); ++varIt)
1737 for (HuginBase::UIntSet::const_iterator imgIt = imgs.begin(); imgIt != imgs.end(); ++imgIt)
1739 optVec[*imgIt].erase(*varIt);
1745 for (std::set<std::string>::const_iterator varIt = var.begin(); varIt != var.end(); ++varIt)
1747 for (HuginBase::UIntSet::const_iterator imgIt = imgs.begin(); imgIt != imgs.end(); ++imgIt)
1749 optVec[*imgIt].insert(*varIt);
1779 wxTreeItemId item =
HitTest(e.GetPosition(),
flags, col);
1780 if (item.IsOk() && (flags & wxTREE_HITTEST_ONITEMICON))
1802 wxTreeItemId item =
HitTest(e.GetPosition(),
flags, col);
1803 if (item.IsOk() && (flags & wxTREE_HITTEST_ONITEMICON))
1807 if (imgNr >= 0 && imgNr < 2)
1833 std::set<std::string> imgVars;
1835 if(var==
"cam_trans")
1837 imgVars.insert(
"TrX");
1838 imgVars.insert(
"TrY");
1839 imgVars.insert(
"TrZ");
1840 imgVars.insert(
"Tpy");
1841 imgVars.insert(
"Tpp");
1845 imgVars.insert(var);
1846 if(var==
"Vb" || var==
"Vc" || var==
"Vd")
1848 imgVars.insert(
"Vb");
1849 imgVars.insert(
"Vc");
1850 imgVars.insert(
"Vd");
1852 if(var==
"Vx" || var==
"Vy")
1854 imgVars.insert(
"Vx");
1855 imgVars.insert(
"Vy");
1857 if(var==
"Ra" || var==
"Rb" || var==
"Rc" || var==
"Rd" || var==
"Re")
1859 imgVars.insert(
"Ra");
1860 imgVars.insert(
"Rb");
1861 imgVars.insert(
"Rc");
1862 imgVars.insert(
"Rd");
1863 imgVars.insert(
"Re");
1875 wxArrayTreeItemIds selectedItem;
1878 for(
size_t i=0;i<selectedItem.size();i++)
1881 wxTreeItemId startItem;
1884 startItem=selectedItem[i];
1890 wxTreeItemIdValue cookie;
1903 for(HuginBase::UIntSet::iterator img=imgs.begin(); img!=imgs.end(); ++img)
1905 for(std::set<std::string>::const_iterator it=imgVars.begin(); it!=imgVars.end(); ++it)
1909 if((*it==
"y" || *it==
"p" || *it==
"r" || *it==
"TrX" || *it==
"TrY" || *it==
"TrZ" || *it==
"Tpy" || *it==
"Tpp") &&
1912 optVec[*img].erase(*it);
1917 optVec[*img].erase(*it);
1922 optVec[*img].erase(*it);
1927 optVec[*img].erase(*it);
1930 optVec[*img].insert(*it);
1934 optVec[*img].erase(*it);
1965 switch(e.GetKeyCode())
1969 wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, XRCID(
"action_add_images"));
1979 for (
auto& img : imgs)
1981 ImageCache::getInstance().removeImage(
m_pano->
getImage(img).getFilename());
1990 #if defined __WXMAC__
1994 if (e.GetExtraLong() == wxMOD_CMD)
2022 wxTreeItemIdValue cookie;
2034 if(e.IsEditCancelled())
2058 wxTreeItemIdValue cookie;
2069 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),
2075 wxICON_EXCLAMATION | wxYES_NO)==wxNO)
2121 wxTreeItemId item=
HitTest(e.GetPosition(),
flags, col);
2123 wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED, ID_EDIT);
2124 GetEventHandler()->AddPendingEvent(commandEvent);
2132 : wxTreeListCtrlXmlHandler()
2140 cp->Create(m_parentAsWindow,
2142 GetPosition(), GetSize(),
2143 GetStyle(wxT(
"style")),
2153 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 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