Hugin trunk 0.1
Loading...
Searching...
No Matches
ImagesTree.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
9/* This is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
13 *
14 * This software is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public
20 * License along with this software. If not, see
21 * <http://www.gnu.org/licenses/>.
22 *
23 */
24
25#ifndef _IMAGESTREE_H
26#define _IMAGESTREE_H
27
28#include <map>
29#include "panodata/Panorama.h"
31#include "treelistctrl.h"
32#include "GuiLevel.h"
33#include "hugin/PanoOperation.h"
34
37{
38public:
61
63 bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = "panel");
64
66 void Init(HuginBase::Panorama * pano);
67
69 virtual ~ImagesTreeCtrl(void) ;
70
75
82 void SetOptimizerMode();
84 virtual void panoramaChanged(HuginBase::Panorama & pano);
93 void MarkActiveImages(const bool markActive);
94
95protected:
105 void OnLinkImageVariables(wxCommandEvent &e);
107 void OnUnlinkImageVariables(wxCommandEvent &e);
109 void OnEditImageVariables(wxCommandEvent &e);
111 void OnBeginDrag(wxTreeEvent &e);
113 void OnLeftUp(wxMouseEvent &e);
115 void OnLeftDown(wxMouseEvent &e);
117 void OnMouseMove(wxMouseEvent &e);
121 void OnSelectAll(wxCommandEvent &e);
123 void OnUnselectAll(wxCommandEvent &e);
125 void OnSelectLensStack(wxCommandEvent &e);
127 void OnUnselectLensStack(wxCommandEvent &e);
129 void OnChar(wxTreeEvent &e);
131 void OnBeginEdit(wxTreeEvent &e);
133 void OnEndEdit(wxTreeEvent &e);
135 void OnExecuteOperation(wxCommandEvent & e);
137 void OnContextMenu(wxTreeEvent & e);
141 void OnActivateImage(wxCommandEvent& e);
143 void OnDeactivateImage(wxCommandEvent& e);
146
147private:
149 void CreateColumns();
151 void UnLinkImageVariables(bool linked);
156 void SelectAllParameters(bool select, bool allImages);
162 void UpdateItemFont();
165
166
167 // the model
171
172 // image variable group information
174
175 // number of digits for display
188 std::map<std::string,size_t> m_columnMap;
190 std::vector<std::string> m_columnVector;
194 std::vector<HuginBase::ImageVariableGroup::ImageVariableEnum> m_variableVector;
196 std::map<int,PanoOperation::PanoOperation*> m_menuOperation;
204 double m_editVal;
209
212
219
220 //for saving column width
223};
224
225
227class ImagesTreeCtrlXmlHandler : public wxcode::wxTreeListCtrlXmlHandler
228{
230
231 public:
233 virtual wxObject *DoCreateResource();
234 virtual bool CanHandle(wxXmlNode *node);
235};
236
237#endif // _IMAGESTREE_H
declaration of helper for work with different GuiLevels
GuiLevel
Definition GuiLevel.h:32
Definition of PanoOperation class.
Somewhere to specify what variables belong to what.
this handler class will receive change events from the Panorama.
Model for a panorama.
Definition Panorama.h:153
virtual wxObject * DoCreateResource()
virtual bool CanHandle(wxXmlNode *node)
the main images tree control, used on images and optimizer tabs
Definition ImagesTree.h:37
HuginBase::StandardImageVariableGroups * m_variable_groups
Definition ImagesTree.h:173
void OnExecuteOperation(wxCommandEvent &e)
menu event handler for PanoOperation (context menu items)
void UpdateItemFont()
update the font colour for all items
void OnMouseMove(wxMouseEvent &e)
event handler for mouse motion, handles focussing of check boxes
wxTreeItemId m_leftDownItem
stores where left mouse click happend
Definition ImagesTree.h:217
std::vector< HuginBase::ImageVariableGroup::ImageVariableEnum > m_variableVector
vector for easier access to linking information
Definition ImagesTree.h:194
void OnContextMenu(wxTreeEvent &e)
event handler to display context menu
void OnActivateImage(wxCommandEvent &e)
event handler for activate image
void OnBeginEdit(wxTreeEvent &e)
event handler for beginning editing
void GenerateSubMenu(wxMenu *menu, PanoOperation::PanoOperationVector *operations, int &id)
generates submenu for given PanoOperationVector
void UpdateGroupText(wxTreeItemId item)
updates the information fot the given lens/stack in the tree
void OnSelectLensStack(wxCommandEvent &e)
event handler for select all optimizer variables for selected lens/stack
void UpdateImageText(wxTreeItemId item)
updates the information for the given image in tree
void CreateCheckboxImages()
create image list with necessary images of checkboxes
void OnEditImageVariables(wxCommandEvent &e)
event handler for showing image variables editing dialog
long m_leftDownColumn
Definition ImagesTree.h:218
bool m_optimizerMode
true, if in optimizer mode
Definition ImagesTree.h:182
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
void OnUnselectLensStack(wxCommandEvent &e)
event handler for unselect all optimizer variables for selected lens/stack
void OnBeginDrag(wxTreeEvent &e)
event handler when dragging begins, veto if dragging is not possible
wxTreeItemId m_lastCurrentItem
stores last item on which the mouse was hovering
Definition ImagesTree.h:214
bool m_needsUpdate
helper variable for update of output stacks/layers
Definition ImagesTree.h:208
virtual ~ImagesTreeCtrl(void)
destructor
HuginBase::Panorama * m_pano
Definition ImagesTree.h:168
void OnSelectAll(wxCommandEvent &e)
event handler for select all optimizer variables
HuginBase::UIntSet GetSelectedImages()
returns the selected images
void SelectAllParameters(bool select, bool allImages)
select/unselect all variables in the active column @select true selects all, false unselect all @allI...
void SetGuiLevel(GuiLevel newSetting)
sets the GuiLevel of the control
void OnLinkImageVariables(wxCommandEvent &e)
event handler for linking image variables
HuginBase::UIntSet m_editableColumns
set, which contains editable columns (all column which contains numeric image variables
Definition ImagesTree.h:192
void OnDeactivateImage(wxCommandEvent &e)
event handler for deactivate image
void Init(HuginBase::Panorama *pano)
initialization, connects all control with Panorama, register observer
std::map< std::string, size_t > m_columnMap
map for easier access to column information
Definition ImagesTree.h:188
void OnHeaderContextMenu(wxListEvent &e)
event handler for context menu on header
void OnColumnWidthChange(wxListEvent &e)
event handler, when column width was changed, save into wxConfig
void SetGroupMode(GroupMode newMode)
sets the group mode to given mode
GroupMode m_groupMode
the active group mode
Definition ImagesTree.h:170
void panoramaImagesChanged(HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
receive the update signal and update display accordingly
void OnUnselectAll(wxCommandEvent &e)
event handler for unselect all optimizer variables
void SetOptimizerMode()
sets to control into optimizer mode
size_t m_selectedColumn
selected column
Definition ImagesTree.h:198
void OnUnlinkImageVariables(wxCommandEvent &e)
event handler for unlinking image variables
GroupMode
enumeration for grouping mode
Definition ImagesTree.h:41
void CreateColumns()
creates all columns and stores information in m_columnMap, m_columnVector, m_editableColumns and m_va...
void OnLeftDblClick(wxMouseEvent &e)
event handler for left double click
std::map< int, PanoOperation::PanoOperation * > m_menuOperation
map with current active context menu PanoOperation
Definition ImagesTree.h:196
wxString m_editOldString
wxString, as shown before editing started
Definition ImagesTree.h:206
void UnLinkImageVariables(bool linked)
helper procedure for link/unlink image variables
void OnLeftDown(wxMouseEvent &e)
event handler for left mouse down, handles toggle of optimizer variables
bool m_markDisabledImages
true, if disabled images should be marked with other font color
Definition ImagesTree.h:184
GuiLevel m_guiLevel
stores the active GuiLevel
Definition ImagesTree.h:180
long m_lastCurrentCol
Definition ImagesTree.h:215
void SetDisplayMode(DisplayMode newMode)
sets the display mode to given mode
void UpdateOptimizerVariables()
updates the display of the optimizer variables (set font)
bool m_dragging
true, if dragging
Definition ImagesTree.h:202
DisplayMode
enumeration for display mode, limits the displayed columns
Definition ImagesTree.h:50
@ DISPLAY_PHOTOMETRICS_LENSES
Definition ImagesTree.h:57
@ DISPLAY_PHOTOMETRICS_IMAGES
Definition ImagesTree.h:56
void OnLeftUp(wxMouseEvent &e)
event handler for left up, handles end of dragging and updates of optimizer variables states
HuginBase::UIntSet m_draggingImages
UIntSet of dragging images.
Definition ImagesTree.h:200
wxTreeItemId m_root
pointer to root item, not shown
Definition ImagesTree.h:211
virtual void panoramaChanged(HuginBase::Panorama &pano)
receives notification about panorama changes
double m_editVal
value, which is currently edited
Definition ImagesTree.h:204
void UpdateGroup(wxTreeItemId parent, const HuginBase::UIntSet imgs, HuginBase::UIntSet &changed)
updates the given group, updates number of images and the images itself
void OnDpiChanged(wxDPIChangedEvent &e)
event handler for updating dpi
void MarkActiveImages(const bool markActive)
sets the flag, if active/disabled image should be marked with different colour
void OnChar(wxTreeEvent &e)
event handler for key events
void OnEndEdit(wxTreeEvent &e)
event handler for ending editing, updates the Panorama with modified value
DisplayMode m_displayMode
the active display mode
Definition ImagesTree.h:186
ImagesTreeCtrl()
general constructor
wxString m_configClassName
Definition ImagesTree.h:221
std::vector< std::string > m_columnVector
vector for easier access to column information
Definition ImagesTree.h:190
std::set< unsigned int > UIntSet
std::vector< PanoOperation * > PanoOperationVector
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41