00001 #if !defined(AFX_TRANSFERFUNCTIONEDITORWINDOW_H__AF86700E_3536_4440_AB2D_79855D9FEA4A__INCLUDED_)
00002 #define AFX_TRANSFERFUNCTIONEDITORWINDOW_H__AF86700E_3536_4440_AB2D_79855D9FEA4A__INCLUDED_
00003
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007
00008
00009
00010 #include "TransferFunction.h"
00011
00012 #define TFEDITOR_GRADIENT_TRIANGLE_SIZE 5
00013
00015
00016
00017 class TransferFunctionEditorWindow : public CFrameWnd
00018 {
00019
00020
00021
00022
00023
00024 public:
00025 TransferFunctionEditorWindow();
00026
00027
00028 public:
00029 HDC m_hgldc;
00030 HGLRC m_hglRC;
00031
00032
00033 public:
00034 void SetHistogramDataIndex(int index);
00035
00036 virtual BOOL PreCreateWindow( CREATESTRUCT& cs );
00037 BOOL SetPixelformat(HDC hdc);
00038 int InitGL(void);
00039 void ReSizeGLScene(int width, int height);
00040 int DrawGLScene(void);
00041
00042 TransferFunction *tf;
00043
00044
00045
00046
00047
00048
00049 protected:
00050 virtual ~TransferFunctionEditorWindow();
00051
00052
00053
00054 afx_msg void OnPaint();
00055 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00056 afx_msg void OnSize(UINT nType, int cx, int cy );
00057 afx_msg BOOL OnEraseBkgnd( CDC* pDC );
00058 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
00059 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
00060 afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
00061 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
00062 afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
00063 afx_msg void OnMouseMove( UINT nFlags, CPoint point );
00064 afx_msg void OnTransferfunctionLoad();
00065 afx_msg void OnTransferfunctionSave();
00066
00067 DECLARE_MESSAGE_MAP()
00068 private:
00069 CMenu menu;
00070 CPoint dragStart;
00071 TransferPoint* dragPoint;
00072 TransferPoint* findNearestTFPoint(CPoint point);
00073
00074 int drawTransferFunction();
00075 int drawHistogram();
00076
00077 CFlowVisApp* m_App;
00078 int m_windowWidth;
00079 int m_windowHeight;
00080 bool m_draggingPosition;
00081 double histogramColor[3];
00082 double histogramBGColor[3];
00083 int m_HistogramDataIndex;
00084 };
00085
00087
00088
00089
00090
00091 #endif // !defined(AFX_TRANSFERFUNCTIONEDITORWINDOW_H__AF86700E_3536_4440_AB2D_79855D9FEA4A__INCLUDED_)