-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTFWindow.h
122 lines (93 loc) · 2.87 KB
/
TFWindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// ________ ____ ___
// | \ / | / /
// +---+ \/ |/ /
// +--+| |\ /| <
// | || | \ / | |\ \
// | | \/ | | \ \
// \_____| |__| \__\
// Copyright 2001
// Joe Michael Kniss
// <<< jmk@cs.utah.edu >>>
// "All Your Base are Belong to Us"
//
// TFWindow.h: interface for the TFWindow class.
//
// NOTE: Right now you can only create one of these!
// should use current window ID to pick the right window
// -next rev
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_TFWINDOW_H__211F0AFE_B4E5_4115_80EF_3F0308B27C74__INCLUDED_)
#define AFX_TFWINDOW_H__211F0AFE_B4E5_4115_80EF_3F0308B27C74__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "HSLPicker.h"
//---------------- a helper class -------------------------------------------
class TFPoint
{
public:
TFPoint();
TFPoint(int bin, float u, float v=0, float w=0);
~TFPoint();
inline float *getPos(){return pos;}
inline void setPos(float p[3]){pos[0]=p[0]; pos[1]=p[1]; pos[2]=p[2];}
inline void setPosU(float u){pos[0] = u;}
inline void setPosV(float v){pos[1] = v;}
inline void setPosW(float w){pos[2] = w;}
inline void setV(float a, float b, float c){v[0]=a;v[1]=b;v[2]=c;}
inline int getType(){return type;}
inline int getBin(){return bin;}
inline void setBin(int b){bin = b;}
TFPoint *insert(TFPoint *p); //puts point in list
TFPoint *getPoint(int bin); //removes point from list
TFPoint *findPoint(int bin); //returns a pointer to a point
float operator[](int i){ return pos[i]; }
float v[3]; //the user defined vector
float pos[3]; //the values [0-1]
HSLPicker cpick; //color picker
private:
TFPoint *next, *prev;
int bin;
int type;
};
//--------------- the transfer function window --------------------------------
class TFWindow
{
public:
TFWindow();
virtual ~TFWindow();
void create();
void destroy();
void display();
void mouse(int button, int state, int x, int y);
void motion(int x, int y);
void key(unsigned char key, int x, int y);
void special(int key, int x, int y);
void idle();
void reshape(int w, int h);
int pick();
int width;
int height;
private:
void updateColor();
void updateVolume();
void init();
void draw1Dtf();
void draw2Dtf();
float bots[3];
float tops[3];
float pntsHeight;
float exts[2][2];
unsigned int deptexName;
int data1;
int data2;
int data3;
int name32;
long name64;
int zpick;
int picking;
int pickPos[2];
int butt;
TFPoint points;
};
#endif // !defined(AFX_TFWINDOW_H__211F0AFE_B4E5_4115_80EF_3F0308B27C74__INCLUDED_)