Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages
hugin1/hugin/GLPreviewFrame.h
Go to the documentation of this file.00001 // -*- c-basic-offset: 4 -*- 00022 #ifndef _GLPREVIEWFRAME_H 00023 #define _GLPREVIEWFRAME_H 00024 00025 class GLRenderer; 00026 class wxToolBar; 00027 class wxToggleButton; 00028 class wxCheckBox; 00029 class wxTextCtrl; 00030 class wxBitmapButton; 00031 class wxSpinButton; 00032 class wxScrolledWindow; 00033 class wxBoxSizer; 00034 class wxStaticBoxSizer; 00035 class wxStaticText; 00036 class wxSlider; 00037 class GLViewer; 00038 class wxSpinEvent; 00039 class wxChoice; 00040 00041 class PreviewToolHelper; 00042 class PreviewTool; 00043 class PreviewCropTool; 00044 class PreviewDragTool; 00045 class PreviewIdentifyTool; 00046 class PreviewDifferenceTool; 00047 class PreviewPanoMaskTool; 00048 class PreviewControlPointTool; 00049 class PreviewLayoutLinesTool; 00050 00051 #include "common/utils.h" 00052 #include <wx/string.h> 00053 #include <wx/frame.h> 00054 00055 // the image toggle buttons need a special event handler to trap mouse enter and 00056 // leave events. 00057 class ImageToogleButtonEventHandler : public wxEvtHandler 00058 { 00059 public: 00060 ImageToogleButtonEventHandler(unsigned int image_number, 00061 PreviewIdentifyTool **identify_tool, 00062 wxToolBarToolBase* identify_toolbutton_in, 00063 PT::Panorama * m_pano); 00064 void OnChange(wxCommandEvent &e); 00065 protected: 00066 void OnEnter(wxMouseEvent & e); 00067 void OnLeave(wxMouseEvent & e); 00068 private: 00069 DECLARE_EVENT_TABLE() 00070 unsigned int image_number; 00071 PreviewIdentifyTool **identify_tool; 00072 wxToolBarToolBase *identify_toolbutton; 00073 PT::Panorama * m_pano; 00074 }; 00075 00083 class GLPreviewFrame : public wxFrame, public PT::PanoramaObserver, public utils::MultiProgressDisplay 00084 { 00085 public: 00086 00089 GLPreviewFrame(wxFrame * frame, PT::Panorama &pano); 00090 00093 virtual ~GLPreviewFrame(); 00094 00095 void panoramaChanged(PT::Panorama &pano); 00096 void panoramaImagesChanged(PT::Panorama &pano, const PT::UIntSet &changed); 00097 00098 void updateProgressDisplay(); 00099 00100 void MakeTools(PreviewToolHelper * helper); 00101 void SetImageButtonColour(unsigned int image_nr, unsigned char red, 00102 unsigned char green, unsigned char blue); 00103 void SetStatusMessage(wxString message); 00106 void FillBlendChoice(); 00107 protected: 00108 void OnClose(wxCloseEvent& e); 00109 00110 void OnCenterHorizontally(wxCommandEvent & e); 00111 void OnFitPano(wxCommandEvent& e); 00112 void OnStraighten(wxCommandEvent & e); 00113 void OnShowAll(wxCommandEvent & e); 00114 void OnShowNone(wxCommandEvent & e); 00115 void OnPhotometric(wxCommandEvent & e); 00116 void OnIdentify(wxCommandEvent &e); 00117 void OnAutocrop(wxCommandEvent &e); 00118 void OnControlPoint(wxCommandEvent &e); 00119 void OnNumTransform(wxCommandEvent & e); 00120 void OnChangeFOV(wxScrollEvent & e); 00121 void OnTrackChangeFOV(wxScrollEvent & e); 00122 void OnExposureChanged(wxCommandEvent & e); 00123 void OnProjParameterChanged(wxCommandEvent & e); 00125 void OnProjParameterReset(wxCommandEvent & e); 00126 00127 void OnDefaultExposure( wxCommandEvent & e ); 00128 void OnDecreaseExposure( wxSpinEvent & e ); 00129 void OnIncreaseExposure( wxSpinEvent & e ); 00130 00131 void OnBlendChoice(wxCommandEvent & e); 00132 void OnDragChoice(wxCommandEvent & e); 00133 void OnProjectionChoice(wxCommandEvent & e); 00135 void OnROIChanged(wxCommandEvent & e); 00136 void OnHFOVChanged(wxCommandEvent & e); 00137 void OnVFOVChanged(wxCommandEvent & e); 00138 // No HDR display yet 00139 // void OnOutputChoice(wxCommandEvent & e); 00140 // update tools according to blend mode choice 00141 void updateBlendMode(); 00142 // update the panorama display 00143 void updatePano(); 00145 void OnFullScreen(wxCommandEvent &e); 00147 void OnUndo(wxCommandEvent &e); 00149 void OnRedo(wxCommandEvent &e); 00151 void OnSelectMode(wxNotebookEvent &e); 00153 void OnToolModeChanging(wxNotebookEvent &e); 00155 void OnLayoutScaleChange(wxScrollEvent &e); 00156 private: 00157 00158 void SetMode(int newMode); 00159 PT::Panorama & m_pano; 00160 00161 GLViewer * m_GLViewer; 00162 int m_mode; 00163 int non_layout_blend_mode; 00164 wxToolBar* m_ToolBar_Identify; 00165 wxNotebook* m_tool_notebook; 00166 wxPanel* m_projection_panel; 00167 wxSlider * m_HFOVSlider; 00168 wxSlider * m_VFOVSlider; 00169 wxTextCtrl * m_HFOVText; 00170 wxTextCtrl * m_VFOVText; 00171 wxTextCtrl * m_ROILeftTxt; 00172 wxTextCtrl * m_ROIRightTxt; 00173 wxTextCtrl * m_ROITopTxt; 00174 wxTextCtrl * m_ROIBottomTxt; 00175 wxChoice * m_BlendModeChoice; 00176 wxChoice * m_DragModeChoice; 00177 wxChoice * m_ProjectionChoice; 00178 // No HDR display yet. 00179 // wxChoice * m_outputModeChoice; 00180 wxTextCtrl * m_exposureTextCtrl; 00181 wxBitmapButton * m_defaultExposureBut; 00182 wxSpinButton * m_exposureSpinBut; 00183 00184 wxString m_choices[3]; 00185 int m_oldProjFormat; 00186 // index of difference mode 00187 int m_differenceIndex; 00188 00189 wxScrolledWindow * m_ButtonPanel; 00190 wxBoxSizer * m_ButtonSizer; 00191 wxStaticBoxSizer * m_ToggleButtonSizer; 00192 00193 wxBoxSizer * m_topsizer; 00194 wxBoxSizer * m_projParamSizer; 00195 std::vector<wxStaticText *> m_projParamNamesLabel; 00196 std::vector<wxTextCtrl *> m_projParamTextCtrl; 00197 std::vector<wxSlider *> m_projParamSlider; 00198 00199 #ifdef USE_TOGGLE_BUTTON 00200 std::vector<wxToggleButton *> m_ToggleButtons; 00201 #else 00202 std::vector<wxCheckBox *> m_ToggleButtons; 00203 #endif 00204 std::vector<wxPanel *> m_ToggleButtonPanel; 00205 std::vector<ImageToogleButtonEventHandler *> toogle_button_event_handlers; 00206 DECLARE_EVENT_TABLE() 00207 00208 // tools 00209 PreviewToolHelper *helper; 00210 PreviewCropTool *crop_tool; 00211 PreviewDragTool *drag_tool; 00212 PreviewIdentifyTool *identify_tool; 00213 PreviewDifferenceTool *difference_tool; 00214 PreviewControlPointTool *control_point_tool; 00215 PreviewPanoMaskTool *pano_mask_tool; 00216 PreviewLayoutLinesTool *m_layoutLinesTool; 00217 void TurnOffTools(std::set<PreviewTool*> tools); 00218 void CleanButtonColours(); 00219 }; 00220 00221 00222 #endif // _GLPREVIEWFRAME_H
1.3.9.1