00001
00007 #pragma once
00008 #include "afxwin.h"
00009 #include "afxcmn.h"
00010
00011 #include "FlowData.hpp"
00012 #include "OpenGLControl.hpp"
00013
00014 #include "Transferfunction.hpp"
00015 #include "PresetManager.hpp"
00016
00018 class CTransferDialog : public CDialog
00019 {
00020 DECLARE_DYNAMIC(CTransferDialog)
00021 private:
00022 FlowData *flowdata;
00023 COpenGLControl *opengl;
00024 std::vector<Transferfunction> t;
00025
00026 void refresh();
00027 void updatePresets();
00028
00029 int getHistogramSize();
00030 void drawHistogram(CPaintDC &dc);
00031 void drawColor(CPaintDC &pc);
00032 void drawAlpha(CPaintDC &pc);
00033
00034 public:
00035 CTransferDialog(CWnd* pParent = NULL);
00036 virtual ~CTransferDialog();
00037
00038 virtual BOOL OnInitDialog();
00039
00040
00041 enum { IDD = IDD_TRANSFERDIALOG };
00042
00043 void setFlowData(FlowData *data);
00044 void setOpenGLControl(COpenGLControl *gl);
00045
00046 void updateStaticColor();
00047
00048 protected:
00049 virtual void DoDataExchange(CDataExchange* pDX);
00050
00051 DECLARE_MESSAGE_MAP()
00052 public:
00053 CComboBox m_combo_layer;
00054 CString m_layer_value;
00055 CStatic m_paint_histogram;
00056 CStatic m_paint_colorfunction;
00057 CStatic m_paint_alphafunction;
00058
00059 CStatic m_static_colorvalue;
00060 CString m_colorvalue_value;
00061 CSliderCtrl m_slider_color;
00062 int m_slider_color_value;
00063 CSliderCtrl m_slider_alphavalue;
00064 int m_slider_alphavalue_value;
00065 CComboBox m_combo_preset;
00066 CString m_combo_preset_value;
00067 afx_msg void OnBnClickedButtonLoad();
00068 afx_msg void OnBnClickedButtonNew();
00069 afx_msg void OnBnClickedButtonAddAlpha();
00070 afx_msg void OnBnClickedButtonRemAlpha();
00071 afx_msg void OnBnClickedButtonResetAlpha();
00072 afx_msg void OnBnClickedButtonResetColor();
00073 afx_msg void OnBnClickedButtonRemColor();
00074 afx_msg void OnBnClickedButtonAddColor();
00075 afx_msg void OnCbnSelchangeComboLayer();
00076 afx_msg void OnPaint();
00077 afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
00078 afx_msg void OnNMReleasedcaptureSliderColor(NMHDR *pNMHDR, LRESULT *pResult);
00079 afx_msg void OnBnClickedButtonNextColor();
00080 afx_msg void OnBnClickedButtonPrevColor();
00081 };