Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

vuSimpleFBR.h

Go to the documentation of this file.
00001 #ifndef _VU_SIMPLE_FBR_UTILITY_H_
00002 #define _VU_SIMPLE_FBR_UTILITY_H_
00003 
00004 #include <wx/wx.h>
00005 #include "../../vuBasicUtility.h"
00006 #include "vuCamera.h"
00007 #include "Volume/Lightfield/Unimodal/Spheric/IBR/ibr.h"
00008 #include "Volume/Lightfield/Unimodal/Spheric/IBR/vuSphericInteractive.h"
00009 #include "General/vuLightfield/SphericViewFilter/vuSphVwFlt_Fourier.h"
00010 #include "General/vuFourier/vuFourierFilter/vuTorstensFourierFilter.h"
00011 #include "General/vuLightfield/SphericViewFilter/vuSliceFilter.h"
00012 #include "../../../wxUIElements/vuFBRSubViewer.h"
00013 
00014 template <int SIZE, class TYPE>
00015 class vuSimpleFBR : public vuBasicUtility
00016 {
00017 protected:
00018   enum {
00019     idPREPROCESS,
00020     idFILTER,
00021     idFILTERHINT,   // hint for 'Fit Angle' or 'Nearest' lightfield filter
00022     idFOURIERFILTER,
00023     idSLICEFILTERKIND,
00024     idSLICEFILTER,
00025     idSLICEFILTERSIZE,
00026     idLOWPASS,
00027     idRENDERMETHOD,
00028     idSNAP2VIEW,
00029     idIMAGESCALE,
00030     idIMAGEBIAS,
00031     idFITSCALE,
00032     idSHOWSUBWINDOW,
00033     idINTERACT_RECONST,
00034     idCHANNELS,
00035     idRESET,
00036     idFILL,
00037     idSAVE
00038   };
00039 
00040 public:
00042     vuSimpleFBR();
00043 
00045     ~vuSimpleFBR();
00046 
00047     virtual const char *_titleString();
00048 
00052     bool init(const char* DataFile);
00053 
00054 public:
00055     //The following methods are overridden to add controls to the window.
00057     virtual void addRight(wxSizer *sizer);
00058 
00059 protected:
00064     bool glInit();
00065 
00067     void glRender();
00068 
00070     void glResize();
00071 
00073     void onMouse(wxMouseEvent &ev);
00074 
00076     void onKeyboard(wxKeyEvent& event);
00077 
00079     vu1 *getVolume();
00080 
00081     /* --- some GUI callbacks ---------------------------------------------- */
00082 
00084     void OnChoiceFilter(wxCommandEvent& event);
00085 
00087     void OnChoiceFourierFilter(wxCommandEvent& event);
00088 
00090     void OnButtonPreprocess(wxCommandEvent& event);
00091 
00093     void OnButtonReset(wxCommandEvent& event);
00094 
00096     void vuSimpleFBR::OnButtonFill(wxCommandEvent& event);
00097 
00099     void OnButtonSnap2View(wxCommandEvent& event);
00100 
00102     void OnButtonShowSubWindow(wxCommandEvent& event);
00103 
00105     void OnChoiceRenderMethod(wxCommandEvent& event);
00106 
00108     void OnSliderImageScale(wxScrollEvent& event);
00109 
00111     void OnButtonFitScale(wxCommandEvent& event);
00112 
00114     void OnButtonSave(wxCommandEvent& event);
00115 
00117     void OnCheckboxInteractiveReconst(wxCommandEvent& event);
00118 
00120     void OnCheckboxChannels(wxCommandEvent& event);
00121 
00122 private:
00123     vuSphVwFlt_Fourier<SIZE,TYPE> *getFourierViewFilter();
00124     void _updateFourierFilter();
00125     bool _updateViewFilter(bool isPreprocess);
00126     bool _updateSliceFilter();
00127 
00128     void _filterHintTextUpdate();
00129     void _resetInteractivePreprocessing();
00130     void _addViewWithIndex(dword idx);
00131 
00132     void _addChannelControls(wxFlexGridSizer *sizer);
00133     void _interactiveReconstruction();
00134     void _renderImage();
00135     void _displayImage();
00136 
00137 protected:
00139     vu1611_2<SIZE,TYPE>             *m_Data;
00140     vuFixelMap<SIZE,float>          *m_Image;
00141     vuSphericInteractive<SIZE,TYPE> *m_Interactive;
00142     vuFBRSubViewer<SIZE,TYPE>       *m_FBRsubViewer;
00143 
00144     vuTorstensFourierFilter *m_FourierFilter; // interpolation while rendering
00145     vuSliceFilter           *m_SliceFilter;   // interpolation while creating
00146 
00147     bool *m_AlreadyVisisted; // needed for interactive reconstruction
00148 
00149 private:
00150     // Some wxWindows GUI Elements...
00152     wxTextCtrl        *m_TEXTfilterHint;
00153     wxChoice          *m_CHOICEfilter;
00154     wxChoice          *m_CHOICEfourierFilter;
00155     wxChoice          *m_CHOICEsliceFilter;
00156     wxChoice          *m_CHOICEsliceFilterKind;
00157     wxChoice          *m_CHOICEsliceFilterSize;
00158     wxChoice          *m_CHOICElowPass;
00159     wxChoice          *m_CHOICErenderMethod;
00160     wxCheckBox        *m_CHECKBOXinteractiveReconst;
00161     wxCheckBox       **m_CHECKBOXchannels;
00162     wxButton          *m_BUTTONfitScale;
00163     wxButton          *m_BUTTONpreprocess;
00164     wxButton          *m_BUTTONreset;
00165     wxButton          *m_BUTTONfill;
00166     wxButton          *m_BUTTONsave;
00167     wxSlider          *m_SLIDERimageScale;
00168     wxBoxSizer        *m_SIZERpreprocess;
00169     wxBoxSizer        *m_SIZERhint;
00170 
00171 public:
00172     virtual vuCamera* getCamera();
00173     virtual vuImage* getCurrentImage();
00174     virtual void DrawFromImage();
00175     virtual void DrawAgain();
00176 };
00177 
00178 
00179 template class vuSimpleFBR<1,byte>;
00180 template class vuSimpleFBR<3,byte>;
00181 //template vuSimpleFBR<1,float>;
00182 //template vuSimpleFBR<2,float>;
00183 //template vuSimpleFBR<3,float>;
00184 
00185 #endif /* _VU_SIMPLE_FBR_UTILITY_H_ */

Generated on Wed Dec 15 21:20:36 2004 for vuVolume by  doxygen 1.3.9.1