26 #include "hugin_config.h"
46 #include <wx/renderer.h>
95 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) )
104 m_degDigits = wxConfigBase::Get()->Read(
"/General/DegreeFractionalDigits",1);
105 m_pixelDigits = wxConfigBase::Get()->Read(
"/General/PixelFractionalDigits",1);
106 m_distDigits = wxConfigBase::Get()->Read(
"/General/DistortionFractionalDigits",3);
129 #define ADDCOLUMN(header, mapName, width, align, isEditable, IVE, tooltip) \
130 AddColumn(header, width, align, -1, true, false, tooltip);\
131 m_columnMap[mapName]=counter;\
132 m_columnVector.push_back(mapName);\
135 m_editableColumns.insert(counter);\
137 m_variableVector.push_back(IVE);\
139 ADDCOLUMN(
"#",
"imgNr", 35, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Image number"))
140 ADDCOLUMN(_(
"Filename"),
"filename", 200, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Filename"))
141 ADDCOLUMN(_(
"Width"),
"width", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Image width"))
142 ADDCOLUMN(_(
"Height"),
"height", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Image height"))
143 ADDCOLUMN(_(
"Anchor"),
"anchor", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Anchor image for position and/or exposure"))
144 ADDCOLUMN(_(
"# Ctrl Pnts"),
"cps", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Number of control points in this image"))
145 ADDCOLUMN(_(
"Lens no."),
"lensNr", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Assigned lens number"))
146 ADDCOLUMN(_(
"Stack no."),
"stackNr", 60, wxALIGN_RIGHT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Assigned stack number"))
148 ADDCOLUMN(_(
"Maker"),
"maker", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Camera maker"))
149 ADDCOLUMN(_(
"Model"),
"model", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Camera model"))
150 ADDCOLUMN(_(
"Lens"),
"lens", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Used lens"))
151 ADDCOLUMN(_(
"Capture date"),
"date", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Date, image was taken"))
152 ADDCOLUMN(_(
"Focal length"),
"focallength", 80, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Focal length"))
153 ADDCOLUMN(_(
"Aperture"),
"aperture", 50, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Aperture"))
154 ADDCOLUMN(_(
"Shutter Speed"),
"time", 50, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Shutter speed"))
155 ADDCOLUMN(_(
"ISO"),
"iso", 50, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"ISO speed"))
157 ADDCOLUMN(_(
"Yaw (y)"),
"y", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Yaw"))
158 ADDCOLUMN(_(
"Pitch (p)"),
"p", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Pitch"))
159 ADDCOLUMN(_(
"Roll (r)"),
"r", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Roll"))
160 ADDCOLUMN(
"X (TrX)",
"TrX", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation X"))
161 ADDCOLUMN(
"Y (TrY)",
"TrY", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation Y"))
162 ADDCOLUMN(
"Z (TrZ)",
"TrZ", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation Z"))
163 ADDCOLUMN(_(
"Plane yaw"),
"Tpy", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Translation remap plane yaw"))
164 ADDCOLUMN(_(
"Plane pitch"),
"Tpp", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Translation remap plane pitch"))
165 ADDCOLUMN(_(
"Camera translation"),
"cam_trans", 60, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Yaw, _(
"Camera translation"))
167 ADDCOLUMN(_(
"Lens type (f)"),
"projection", 100, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Lens type (rectilinear, fisheye, equirectangular, ...)"))
168 ADDCOLUMN(_(
"Hfov (v)"),
"v", 80, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_HFOV, _(
"Horizontal field of view (v)"))
169 ADDCOLUMN(
"a",
"a", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortion, _(
"Radial distortion (a)"))
170 ADDCOLUMN(
"b",
"b", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortion, _(
"Radial distortion (b, barrel)"))
171 ADDCOLUMN(
"c",
"c", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortion, _(
"Radial distortion (c)"))
172 ADDCOLUMN(
"d",
"d", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortionCenterShift, _(
"Horizontal image center shift (d)"))
173 ADDCOLUMN(
"e",
"e", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialDistortionCenterShift, _(
"Vertical image center shift (e)"))
174 ADDCOLUMN(
"g",
"g", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Shear, _(
"Horizontal image shearing (g)"))
175 ADDCOLUMN(
"t",
"t", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_Shear, _(
"Vertical image shearing (t)"))
177 ADDCOLUMN(
"EV",
"Eev", 50, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_ExposureValue, _(
"Exposure value (Eev)"))
178 ADDCOLUMN(
"Er",
"Er", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_WhiteBalanceRed, _(
"Red multiplier (Er)"))
179 ADDCOLUMN(
"Eb",
"Eb", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_WhiteBalanceBlue, _(
"Blue multiplier (Eb)"))
180 ADDCOLUMN(
"Vb",
"Vb", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCoeff, _(
"Vignetting (Vb, Vc, Vd)"))
181 ADDCOLUMN(
"Vc",
"Vc", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCoeff, _(
"Vignetting (Vb, Vc, Vd)"))
182 ADDCOLUMN(
"Vd",
"Vd", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCoeff, _(
"Vignetting (Vb, Vc, Vd)"))
183 ADDCOLUMN(
"Vx",
"Vx", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCenterShift, _(
"Horizontal vignetting center shift (Vx)"))
184 ADDCOLUMN(
"Vy",
"Vy", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_RadialVigCorrCenterShift, _(
"Vertical vignetting center shift (Vy)"))
185 ADDCOLUMN(_(
"Response type"),
"response", 80, wxALIGN_LEFT,
false, HuginBase::ImageVariableGroup::IVE_Filename, _(
"Camera response type"))
186 ADDCOLUMN(
"Ra",
"Ra", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
187 ADDCOLUMN(
"Rb",
"Rb", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
188 ADDCOLUMN(
"Rc",
"Rc", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
189 ADDCOLUMN(
"Rd",
"Rd", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
190 ADDCOLUMN(
"Re",
"Re", 40, wxALIGN_LEFT,
true, HuginBase::ImageVariableGroup::IVE_EMoRParams, _(
"Camera response parameter"))
199 int width = wxConfigBase::Get()->Read(wxString::Format(
m_configClassName+
"/ColumnWidth%d", j ), -1);
308 if(nrItems!=imageGroups.size())
310 if(nrItems<imageGroups.size())
312 for(
size_t i=nrItems;i<imageGroups.size();i++)
321 wxTreeItemIdValue cookie;
328 wxTreeItemIdValue cookie;
355 e.SetEventType(wxEVT_COMMAND_LIST_ITEM_SELECTED);
357 GetEventHandler()->ProcessEvent(e);
365 bool isSingleImage =
false;
371 const size_t imgNr=itemData->
GetImgNr();
440 wxString text=_(
"not active");
441 if(img.getX()!=0.0 || img.getY()!=0.0 || img.getZ()!=0.0 || img.getTranslationPlaneYaw()!=0.0 || img.getTranslationPlanePitch()!=0.0)
477 std::vector<double> dist=img.getRadialDistortion();
542 std::vector<double> dist=img.getRadialVigCorrCoeff();
574 std::vector<float> vec = img.getEMoRParams();
611 wxTreeItemIdValue cookie;
615 bool haveSingleChild =
false;
635 wxString text=_(
"not active");
636 if(img.getX()!=0.0 || img.getY()!=0.0 || img.getZ()!=0.0 || img.getTranslationPlaneYaw()!=0.0 || img.getTranslationPlanePitch()!=0.0)
678 std::vector<double> dist=img.getRadialDistortion();
743 std::vector<double> dist=img.getRadialVigCorrCoeff();
769 std::vector<float> vec=img.getEMoRParams();
790 bool forceUpdate=
false;
791 if(nrItems!=imgs.size())
794 if(nrItems<imgs.size())
796 for(
size_t i=nrItems;i<imgs.size();i++)
805 wxTreeItemIdValue cookie;
812 wxTreeItemIdValue cookie;
814 HuginBase::UIntSet::const_iterator it=imgs.begin();
822 bool needsUpdate=
false;
835 if(needsUpdate || forceUpdate)
848 wxTreeItemIdValue cookie;
856 wxTreeItemIdValue childCookie;
884 for(HuginBase::UIntSet::const_iterator it=imgNrs.begin(); it!=imgNrs.end() && !opt;++it)
910 wxArrayTreeItemIds selected;
914 for(
size_t i=0;i<selected.size();i++)
919 wxTreeItemIdValue cookie;
947 int colNum = e.GetColumn();
962 wxRendererNative& renderer = wxRendererNative::Get();
963 const wxSize checkBoxSize = renderer.GetCheckBoxSize(
this);
964 wxImageList* checkboxImageList =
new wxImageList(checkBoxSize.GetWidth(), checkBoxSize.GetHeight(),
true, 0);
965 wxBitmap checkBoxImage(checkBoxSize, 32);
966 wxMemoryDC dc(checkBoxImage);
969 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize));
970 dc.SelectObject(wxNullBitmap);
971 checkboxImageList->Add(checkBoxImage);
973 dc.SelectObject(checkBoxImage);
975 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize), wxCONTROL_CHECKED);
976 dc.SelectObject(wxNullBitmap);
977 checkboxImageList->Add(checkBoxImage);
979 dc.SelectObject(checkBoxImage);
981 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize), wxCONTROL_CURRENT);
982 dc.SelectObject(wxNullBitmap);
983 checkboxImageList->Add(checkBoxImage);
985 dc.SelectObject(checkBoxImage);
987 renderer.DrawCheckBox(
this, dc, wxRect(checkBoxSize), wxCONTROL_CHECKED | wxCONTROL_CURRENT);
988 dc.SelectObject(wxNullBitmap);
989 checkboxImageList->Add(checkBoxImage);
1029 SetWindowStyle(GetWindowStyle() | wxTR_NO_LINES);
1033 SetWindowStyle(GetWindowStyle() & ~wxTR_NO_LINES);
1110 bool allowMenuExtension=
true;
1111 if(e.GetItem().IsOk())
1118 bool varIsLinkable =
false;
1137 menu.Append(
ID_LINK,_(
"Link"));
1155 menu.Append(
ID_LINK, _(
"Link"));
1159 menu.AppendSeparator();
1163 if(data->
IsGroup() == emptyText)
1187 menu.AppendSeparator();
1190 menu.Append(
ID_EDIT, _(
"Edit image variables..."));
1196 if (selectedImages.size() == 1)
1229 allowMenuExtension=
false;
1232 if(allowMenuExtension)
1234 if(menu.GetMenuItemCount()>0)
1236 menu.AppendSeparator();
1241 wxMenu* subMenu=
new wxMenu();
1243 if(subMenu->GetMenuItemCount()>0)
1245 menu.Append(-1,_(
"Lens"), subMenu);
1253 subMenu=
new wxMenu();
1255 if(subMenu->GetMenuItemCount()>0)
1257 menu.Append(-1,_(
"Stacks"), subMenu);
1264 subMenu=
new wxMenu();
1266 if(subMenu->GetMenuItemCount()>0)
1268 menu.Append(-1, _(
"Control points"), subMenu);
1274 subMenu=
new wxMenu();
1276 if(subMenu->GetMenuItemCount()>0)
1278 menu.Append(-1, _(
"Reset"), subMenu);
1285 if(menu.GetMenuItemCount()>0)
1295 for(
size_t i=0; i<operations->size(); i++)
1299 menu->Append(
id, (*operations)[i]->GetLabel());
1309 const wxColour normalColour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
1310 const wxColour disabledColour = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT);
1313 wxTreeItemIdValue cookie;
1318 bool isActive =
true;
1321 wxTreeItemIdValue childCookie;
1323 while (child.IsOk())
1348 wxTreeItemIdValue childCookie;
1350 while (child.IsOk())
1369 wxTreeItemIdValue cookie;
1377 wxTreeItemIdValue childCookie;
1379 while (child.IsOk())
1408 std::copy(selectedImages.begin(), selectedImages.end(), std::inserter(activeImages, activeImages.end()));
1419 std::set_difference(activeImages.begin(), activeImages.end(), selectedImages.begin(), selectedImages.end(), std::inserter(newActiveImages, newActiveImages.end()));
1430 std::set<HuginBase::ImageVariableGroup::ImageVariableEnum> variables;
1432 if(
m_variableVector[m_selectedColumn]==HuginBase::ImageVariableGroup::IVE_Yaw)
1434 variables.insert(HuginBase::ImageVariableGroup::IVE_Pitch);
1435 variables.insert(HuginBase::ImageVariableGroup::IVE_Roll);
1436 variables.insert(HuginBase::ImageVariableGroup::IVE_X);
1437 variables.insert(HuginBase::ImageVariableGroup::IVE_Y);
1438 variables.insert(HuginBase::ImageVariableGroup::IVE_Z);
1439 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlaneYaw);
1440 variables.insert(HuginBase::ImageVariableGroup::IVE_TranslationPlanePitch);
1505 const bool ctrlPressed=wxGetKeyState(WXK_COMMAND);
1515 SetCursor(wxCURSOR_HAND);
1529 SetCursor(wxCURSOR_ARROW);
1531 wxTreeItemId item=
HitTest(e.GetPosition());
1546 wxPoint pos(e.GetPosition());
1571 for (
auto& i : images)
1575 const bool moveImageChecked = imgList[img1];
1576 imgList.erase(imgList.begin() + img1);
1577 if (img2 < imgList.size())
1579 imgList.insert(imgList.begin() + img2, moveImageChecked);
1583 imgList.push_back(moveImageChecked);
1586 for (
size_t i = 0; i < imgList.size(); ++i)
1658 wxTreeItemId item =
HitTest(e.GetPosition(),
flags, col);
1676 wxTreeItemIdValue cookie;
1678 while (childItem.IsOk())
1691 std::set<std::string> var;
1729 bool deactivate =
false;
1737 for (std::set<std::string>::const_iterator varIt = var.begin(); varIt != var.end(); ++varIt)
1740 for (HuginBase::UIntSet::const_iterator imgIt = imgs.begin(); imgIt != imgs.end() && !deactivate; ++imgIt)
1752 for (std::set<std::string>::const_iterator varIt = var.begin(); varIt != var.end(); ++varIt)
1754 for (HuginBase::UIntSet::const_iterator imgIt = imgs.begin(); imgIt != imgs.end(); ++imgIt)
1756 optVec[*imgIt].erase(*varIt);
1762 for (std::set<std::string>::const_iterator varIt = var.begin(); varIt != var.end(); ++varIt)
1764 for (HuginBase::UIntSet::const_iterator imgIt = imgs.begin(); imgIt != imgs.end(); ++imgIt)
1766 optVec[*imgIt].insert(*varIt);
1796 wxTreeItemId item =
HitTest(e.GetPosition(),
flags, col);
1797 if (item.IsOk() && (flags & wxTREE_HITTEST_ONITEMICON))
1819 wxTreeItemId item =
HitTest(e.GetPosition(),
flags, col);
1820 if (item.IsOk() && (flags & wxTREE_HITTEST_ONITEMICON))
1824 if (imgNr >= 0 && imgNr < 2)
1850 std::set<std::string> imgVars;
1852 if(var==
"cam_trans")
1854 imgVars.insert(
"TrX");
1855 imgVars.insert(
"TrY");
1856 imgVars.insert(
"TrZ");
1857 imgVars.insert(
"Tpy");
1858 imgVars.insert(
"Tpp");
1862 imgVars.insert(var);
1863 if(var==
"Vb" || var==
"Vc" || var==
"Vd")
1865 imgVars.insert(
"Vb");
1866 imgVars.insert(
"Vc");
1867 imgVars.insert(
"Vd");
1869 if(var==
"Vx" || var==
"Vy")
1871 imgVars.insert(
"Vx");
1872 imgVars.insert(
"Vy");
1874 if(var==
"Ra" || var==
"Rb" || var==
"Rc" || var==
"Rd" || var==
"Re")
1876 imgVars.insert(
"Ra");
1877 imgVars.insert(
"Rb");
1878 imgVars.insert(
"Rc");
1879 imgVars.insert(
"Rd");
1880 imgVars.insert(
"Re");
1892 wxArrayTreeItemIds selectedItem;
1895 for(
size_t i=0;i<selectedItem.size();i++)
1898 wxTreeItemId startItem;
1901 startItem=selectedItem[i];
1907 wxTreeItemIdValue cookie;
1920 for(HuginBase::UIntSet::iterator img=imgs.begin(); img!=imgs.end(); ++img)
1922 for(std::set<std::string>::const_iterator it=imgVars.begin(); it!=imgVars.end(); ++it)
1926 if((*it==
"y" || *it==
"p" || *it==
"r" || *it==
"TrX" || *it==
"TrY" || *it==
"TrZ" || *it==
"Tpy" || *it==
"Tpp") &&
1929 optVec[*img].erase(*it);
1934 optVec[*img].erase(*it);
1939 optVec[*img].erase(*it);
1944 optVec[*img].erase(*it);
1947 optVec[*img].insert(*it);
1951 optVec[*img].erase(*it);
1982 switch(e.GetKeyCode())
1986 wxCommandEvent ev(wxEVT_COMMAND_MENU_SELECTED, XRCID(
"action_add_images"));
1996 for (
auto& img : imgs)
1998 ImageCache::getInstance().removeImage(
m_pano->
getImage(img).getFilename());
2007 #if defined __WXMAC__
2011 if (e.GetExtraLong() == wxMOD_CMD)
2039 wxTreeItemIdValue cookie;
2051 if(e.IsEditCancelled())
2075 wxTreeItemIdValue cookie;
2086 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),
2087 _(
"Hugin"), wxICON_EXCLAMATION | wxYES_NO,
this) == wxNO)
2133 wxTreeItemId item=
HitTest(e.GetPosition(),
flags, col);
2135 wxCommandEvent commandEvent(wxEVT_COMMAND_MENU_SELECTED,
ID_EDIT);
2136 GetEventHandler()->AddPendingEvent(commandEvent);
2144 : wxTreeListCtrlXmlHandler()
2152 cp->Create(m_parentAsWindow,
2154 GetPosition(), GetSize(),
2165 return IsOfClass(node,
"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
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
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name="panel")
creates the control
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
int HuginMessageBox(const wxString &message, const wxString &caption, int style, wxWindow *parent)
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