28 #if QT_VERSION < 0x040000
30 : QGLViewer(parent, name)
48 setFPSIsDisplayed(
true);
54 glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambientColor);
57 glEnable(GL_LIGHTING);
58 glEnable(GL_NORMALIZE);
59 glShadeModel(GL_SMOOTH);
73 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
75 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
76 glAlphaFunc(GL_GREATER, 0.5);
77 glEnable(GL_DEPTH_TEST);
80 glMaterialfv(GL_FRONT, GL_SPECULAR, white);
82 glMaterialfv(GL_FRONT, GL_SHININESS, shininess1);
95 glDisable(GL_DEPTH_TEST);
101 glEnable(GL_DEPTH_TEST);
102 glPolygonMode(GL_FRONT_AND_BACK, GL_TRIANGLES );
105 glMaterialfv(GL_FRONT, GL_SPECULAR, white);
107 glMaterialfv(GL_FRONT, GL_SHININESS, shininess1);
109 for (
int i = 0; i <
stl_data[0].size()-4; i = i+4){
112 glBegin(GL_TRIANGLES);
123 glDisable(GL_DEPTH_TEST);
131 glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
133 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
134 glAlphaFunc(GL_GREATER, 0.5);
135 glEnable(GL_DEPTH_TEST);
138 glMaterialfv(GL_FRONT, GL_SPECULAR, white);
140 glMaterialfv(GL_FRONT, GL_SHININESS, shininess1);
152 glDisable(GL_DEPTH_TEST);
171 glEnable(GL_LINE_SMOOTH);
172 glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
176 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE );
177 glEnable(GL_DEPTH_TEST);
180 glVertex3f(x_max, y_max, z_max);
181 glVertex3f(x_min, y_max, z_max);
182 glVertex3f(x_min, y_min, z_max);
183 glVertex3f(x_max, y_min, z_max);
185 glVertex3f(x_max, y_max, z_min);
186 glVertex3f(x_min, y_max, z_min);
187 glVertex3f(x_min, y_min, z_min);
188 glVertex3f(x_max, y_min, z_min);
190 glVertex3f(x_max, y_max, z_max);
191 glVertex3f(x_max, y_min, z_max);
192 glVertex3f(x_max, y_min, z_min);
193 glVertex3f(x_max, y_max, z_min);
195 glVertex3f(x_min, y_max, z_max);
196 glVertex3f(x_min, y_min, z_max);
197 glVertex3f(x_min, y_min, z_min);
198 glVertex3f(x_min, y_max, z_min);
200 glVertex3f(x_max, y_max, z_max);
201 glVertex3f(x_min, y_max, z_max);
202 glVertex3f(x_min, y_max, z_min);
203 glVertex3f(x_max, y_max, z_min);
205 glVertex3f(x_max, y_min, z_max);
206 glVertex3f(x_min, y_min, z_max);
207 glVertex3f(x_min, y_min, z_min);
208 glVertex3f(x_max, y_min, z_min);
212 glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
213 glDisable(GL_LINE_SMOOTH);
214 glDisable(GL_DEPTH_TEST);