00001
00002
00004
00005 #if !defined(AFX_FLOWVIZVIEW_H__A3C03A08_E08D_401D_BACE_EA205B2D5642__INCLUDED_)
00006 #define AFX_FLOWVIZVIEW_H__A3C03A08_E08D_401D_BACE_EA205B2D5642__INCLUDED_
00007
00008 #if _MSC_VER > 1000
00009 #pragma once
00010 #endif // _MSC_VER > 1000
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <gl/gl.h>
00024 #include <gl/glu.h>
00025 #include <math.h>
00026 #include "TriangleGlyph.h"
00027 #include "Glyph_BackColor.h"
00028 #include "Glyph.h"
00029 #include "GlobalState.h"
00030 #include "Data.h"
00031 #include <windows.h>
00032
00033 #include "Camera.h"
00034
00035
00036
00037 #include "ColorCoding.h"
00038 #include "ColorCoding_RGB.h"
00039 #include "ColorCoding_RGB_flat.h"
00040 #include "ColorCoding_Yellow2Red.h"
00041 #include "ColorCoding_Verticity.h"
00042
00043
00047 class CFlowVizView : public CView
00048 {
00049
00050
00051
00052 protected:
00053
00054
00055
00056
00057 HDC m_hgldc;
00058 HGLRC m_hglrc;
00059 BOOL SetPixelformat(HDC hdc);
00060 void ReSizeGLScene(int width, int height);
00061 void GetGLInfo();
00062
00063
00064 int DrawGLScene(void);
00065
00066 int InitGL(void);
00067
00068 int mouseOldx;
00069 int mouseOldy;
00070 int mouseOldz;
00071
00072 Rect brushingRectangle;
00073 Rect legendRectangle;
00074 Rect upperLegendcolorRect;
00075 Rect lowerLegendcolorRect;
00076 Rect middleLegendcolorRect;
00077
00078 float xScatterPlotOffset;
00079 float yScatterPlotOffset;
00080 float scalefactorScatterPlot;
00081
00082 int width;
00083 int height;
00084
00085 CString m_StatusBarBuffer;
00086
00087 LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
00088
00089 void MouseProc(UINT message, WPARAM wParam, LPARAM lParam);
00090
00091 CFlowVizView();
00092 DECLARE_DYNCREATE(CFlowVizView)
00093
00094
00095 public:
00096
00097 CFlowVizDoc* GetDocument();
00098
00099
00100
00101 public:
00102
00103
00104
00105
00106 public:
00107 virtual void OnDraw(CDC* pDC);
00108 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
00109 protected:
00110
00111
00112
00113 bool CalcMousePositionInDatagrid(int x, int y, Vec2f *result);
00114
00115
00116
00117
00118 public:
00119 virtual ~CFlowVizView();
00120 #ifdef _DEBUG
00121 virtual void AssertValid() const;
00122 virtual void Dump(CDumpContext& dc) const;
00123 #endif
00124
00125 protected:
00126
00127 bool DrawGLGlyph();
00128 bool DrawGLScatterPlot();
00129 bool DrawGLRectangle(Rect *rectangle);
00130 bool DrawGLRectangle(Rect *rectangle,colorRGBA col, bool frame);
00131 bool DrawGLBackground();
00132 bool DrawGLLegend();
00133
00134 bool DrawGLStreamLines();
00135
00136
00137 bool PointIsInRectangle(Vec2f *point, Rect *rectangle);
00138 Rect CalcBrushingRect();
00139
00140
00141
00142 CGlobalState *globalState;
00143
00144 protected:
00145
00146 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
00147 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
00148 afx_msg void OnDestroy();
00149 afx_msg void OnSize(UINT nType, int cx, int cy);
00150
00151 DECLARE_MESSAGE_MAP()
00152 };
00153
00154 #ifndef _DEBUG // Testversion in FlowVizView.cpp
00155 inline CFlowVizDoc* CFlowVizView::GetDocument()
00156 { return (CFlowVizDoc*)m_pDocument; }
00157 #endif
00158
00160
00161
00162
00163
00164 #endif // !defined(AFX_FLOWVIZVIEW_H__A3C03A08_E08D_401D_BACE_EA205B2D5642__INCLUDED_)