-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLevWidget.h
153 lines (120 loc) · 3.48 KB
/
LevWidget.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//-------------------------------------------------------------------------
//
// Joe Kniss
// Levoy Triangle for transfer function widget
// LevWidget.h Handles 2&3D transfer functions
// 3-19-01
// ________ ____ ___
// | \ / | / /
// +---+ \/ |/ /
// +--+| |\ /| <
// | || | \ / | |\ \
// | | \/ | | \ \
// \_____| |__| \__\
// Copyright 2001
// Joe Michael Kniss
// "All Your Base are Belong to Us"
//-------------------------------------------------------------------------
#ifndef __LEVWIDGET_DOT_H
#define __LEVWIDGET_DOT_H
#include "gluvvPrimitive.h"
#include "BaseWidget.h"
#include <GL/gl.h>
#include <GL/glu.h>
#include "HSLPickWidget.h"
#define LEVWIDGNAME 22223222
struct gluvvGlobal;
class LevWidget : public gluvvPrimitive, public Widget{
public:
LevWidget(gluvvGlobal *gluvv);
LevWidget(LevWidget &lw);
~LevWidget();
void draw();
int pick(int data1, int data2, int data3,
float x, float y, float z);
int pick();
int mouse(int button, int state,
int x, int y);
int move(int x, int y);
int release();
void rasterize(unsigned char *tex, unsigned char *auxTex = 0);//set transfer function!!!!!!!!!!!!!!!
void setBallBar(float ballsize, float barsize);
void setWH(float width, float height);
// left +-----o right left ------o right
// | o | <--thresh \ /
// +-----o bottom \--o thresh
// o bottom
void setPos(float bottom[2],
float left[2], //left pos
float right[2], //right pos
float threshl = -10, //threshold pos left
float threshb = -10); //threshold pos bottom
void setDepth(float depth);
int insert(LevWidget *n);
LevWidget *get(int id);
LevWidget *remove(int id);
void setAlpha(float alpha);
float getBE();
void setBE(float boundaryEmphasis);
void triangleType();
void squareType();
void oneDType();
void alphaMode();
void colorMode();
void clearMode();
int on; //rasterize widget
int drawOn; //draw widget
int id; //this widgets id/name
private:
int LevWidgetGlErr(char *c);
void drawTriangle();
void drawSquare();
void LWdrawSphere(float pos[3], GLuint name);
void LWdrawBar(float rot, WdgRotAxis axis,
float len, float pos[3], unsigned int name);
void LWdrawSlider(float rot, WdgRotAxis axis,
float pos[3], unsigned int name);
enum{
objUnknown,
bball,
lball,
rball,
tbar,
slider,
trap
};
enum{
modeUnknown,
LWcolorMode,
LWscatterMode,
LWalphaMode,
LWclearMode
};
enum{
typeUknown,
LWtriangle, //levoy triangle
LWsquare, //square, actualy ellipse
LW1d, //1d tf style
LWdef, //default tf style
LWcircle
};
int mode;
int type;
float depth;
float verts[3][2];
float thresh[2];
float ballsz;
float barsz;
float width;
float height;
int pickedObj;
int picked;
HSLPickWidget cpick;
float color[3];
float scatter;
float alpha;
float be;
LevWidget *next;
int lastwinpos[2];
};
#endif