00001
00002
00003
00004
00005 #pragma once
00006 #pragma warning (disable:4786)
00007
00008 #include "Vector.h"
00009 #include "list_node.h"
00010 #include "gl/glut.h"
00011 #include <list>
00012
00013 using namespace std;
00014
00015 class data_t : public Vector
00016 {
00017 public:
00018 data_t() : Vector() {}
00019 data_t( float px, float py, float pz ) : Vector( px, py, pz ) {}
00020 float a[10];
00021
00022 };
00023
00024 static const enum {
00025 V_STAT_PFEILE = 0,
00026 V_DYN_PFEILE
00027 };
00028
00029 static const enum {
00030 PFEIL_VIEW = 0,
00031 STREAM_VIEW,
00032 FARBCOD_VIEW
00033 };
00034
00039 class Cvisbsp_mfcDoc : public CDocument
00040 {
00041 protected:
00042 Cvisbsp_mfcDoc();
00043 DECLARE_DYNCREATE(Cvisbsp_mfcDoc)
00044
00045
00046 public:
00047
00048
00049
00050
00051 protected:
00052
00054 data_t **gri_data;
00056 data_t **dat_data;
00057 public:
00059 data_t **fast_data;
00060
00061 public:
00062 virtual BOOL OnNewDocument();
00063 virtual void Serialize(CArchive& ar);
00064 HGLRC m_hRC;
00065 HDC m_myhDC;
00066
00067
00068 public:
00069 virtual ~Cvisbsp_mfcDoc();
00070 #ifdef _DEBUG
00071 virtual void AssertValid() const;
00072 virtual void Dump(CDumpContext& dc) const;
00073 #endif
00074
00075 protected:
00076
00077
00078 protected:
00079 DECLARE_MESSAGE_MAP()
00080 public:
00082 int nZoom;
00084 int m_nViewMode;
00086 afx_msg void OnViewStream();
00088 afx_msg void OnViewPfeile();
00090 afx_msg void OnUpdateViewPfeile(CCmdUI *pCmdUI);
00092 afx_msg void OnUpdateViewStream(CCmdUI *pCmdUI);
00094 int SX;
00096 int SY;
00097 int SX_d;
00098 int SY_d;
00100 int SZ;
00102 int NF;
00104 int NT;
00106 float DT;
00107 data_t getPoint(float x, float y);
00108 data_t getPointInPx( float x, float y );
00109
00110 data_t interpolate(data_t startPt, data_t endPt, float coef);
00112 int nPfGroesse;
00114 int nPfDichte;
00116 int nPfType;
00117 float nMinLen;
00118 float nMaxLen;
00119 float nMaxA[10];
00120 float nMinA[10];
00122 int nPfFarbCod;
00124 int nStreamIntegrMeth;
00125 int bStreamMSeeding;
00127 int nStreamSeedType;
00129 GLuint m_nColorMapTexture;
00131 int nColorMapping;
00133 void addSeededStreamlines(float px, float py);
00135 void GenerateTexture();
00137 void setTexture( GLubyte *image, int nTexSizeX, int x, int y, short r, short g, short b, short a );
00138
00140 list< list<Vector> > seededPointsEuler;
00142 list< list<Vector> > seededPointsRK;
00144 float n_fStreamStepSize;
00146 int m_nStreamMaxTraces;
00148 BOOL m_bStreamVerglMethoden;
00150 float m_fStreamWidth;
00152 BOOL m_bTapering;
00154 BOOL m_StreamTexturing;
00156 int m_StreamLengthOfPeriod;
00158 BOOL m_StreamTexturingSmooth;
00160 BOOL m_GlyphMapping;
00162 int m_GlyphSize;
00164 void createEvenelySpacedStreamLines(void);
00166 void createEvenlyEulerLine(float px, float py);
00168 void createEvenlyRKLine(float px, float py);
00170 list< list<Vector> > spacedPointsEuler;
00172 list< list<Vector> > activeSpacedPointsEuler;
00174 list< list<Vector> > allSpacedPointsEuler;
00176 list< list<Vector> > spacedPointsRK;
00178 list< list<Vector> > activeSpacedPointsRK;
00180 list< list<Vector> > allSpacedPointsRK;
00182 float isPointOverDtest(float px, float py);
00184 float m_fDtest;
00186 float m_fDsep;
00188 Vector getSeedPointCandidate(list<Vector> line);
00190 bool isPointInVolume( Vector pt );
00192 afx_msg void OnViewFarbcodierung();
00194 afx_msg void OnUpdateViewFarbcodierung(CCmdUI *pCmdUI);
00196 BOOL m_bStreamDarst;
00198 BOOL m_bPfeilDarst;
00200 BOOL m_bFarbcodDarst;
00202 list_node *pTfPfeilColorList, *pTfStreamColorList, *pTfFarbCodColorList;
00204 list_node *pTfPfeilOpacityList, *pTfStreamOpacityList, *pTfFarbCodOpacityList;
00206 list_node** getTfColorList(void);
00208 list_node** getTfOpacityList(void);
00210 int getTfColor(list_node* tfList, float val);
00212 int getTfOpacity(list_node* tfList, float pos);
00214 void deleteNodeList( list_node* pAnchor );
00216 void initTfs( list_node **pAnchor, int val1, int val2 );
00217 afx_msg void OnViewTransferfunk();
00219 int nStreamFarbCod;
00220
00222 void generateFastArray(void);
00224 data_t lookupPoint(float px, float py);
00225 float fMinXValue;
00226 float fMaxXValue;
00227 float fMinYValue;
00228 float fMaxYValue;
00229 };
00230