00001
00002 #pragma once
00003
00004 #ifndef __AFXWIN_H__
00005 #error 'stdafx.h' muss vor dieser Datei in PCH eingeschlossen werden.
00006 #endif
00007
00008 #include "resource.h"
00009 #include "Visualize3D.h"
00010 #include "Visualize3DDoc.h"
00011 #include <map>
00012
00013 class CVisualize3DDoc;
00014
00045 class TransferFunction
00046 {
00047
00048 private:
00049
00050 double ratio;
00051 int m_max;
00052 CVisualize3DDoc* m_doc;
00053 int startPos, endPos;
00054
00055 std::map<int, COLORREF> lastMap;
00056 std::map<int, int> lastOpMap;
00057
00058 typedef std::pair <int, COLORREF> tf_Pair;
00059 typedef std::pair <int, int> tf_OpPair;
00060
00061 unsigned short* tf;
00062
00063
00064
00065 private:
00066 void CalcTF(int oldK, int newK, COLORREF oldV, COLORREF newV, int oldOp, int newOp);
00067
00068 public:
00069 TransferFunction(CVisualize3DDoc *doc, int max);
00070 virtual ~TransferFunction();
00071
00072 void CreateTransferFunction( std::map<int, COLORREF> m, std::map<int, int> mOp);
00073 unsigned short* GetTransferFunction();
00074 void ResetTF();
00075 void CreateWindowingFunction(int min, int max);
00076 void CreateWindowingTransferFunction( std::map<int, COLORREF> m, std::map<int, int> mOp);
00077
00078 };