17 double z,
double offset)
19 double xx = x + offset / ctx->
s[0];
20 double yy = y + offset / ctx->
s[1];
21 double zz =
z + offset / ctx->
s[2];
24 std::vector<std::string> info =
33 sprintf(str,
"%d", e->
tag());
37 for(std::size_t i = 0; i < e->
physicals.size(); i++) {
39 if(i) strcat(str,
", ");
49 std::string name =
"";
50 for(std::size_t i = 0; i < e->
physicals.size(); i++) {
51 if(name.size()) strcat(str,
", ");
53 if(name.size()) strcat(str, name.c_str());
78 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
85 glPointSize((
float)sps);
91 glPointSize((
float)ps);
96 glColor4ubv((GLubyte *)&col);
106 double x = v->
x(), y = v->
y(),
z = v->
z();
155 glPushName(e->
tag());
158 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
161 glLineWidth((
float)
CTX::instance()->geom.selectedCurveWidth);
172 glColor4ubv((GLubyte *)&col);
183 double t_min = t_bounds.
low();
184 double t_max = t_bounds.
high();
189 for(
int i = 0; i < N - 1; i++) {
190 double t1 = t_min + (double)i / (
double)(N - 1) * (t_max - t_min);
193 t_min + (double)(i + 1) / (double)(N - 1) * (t_max - t_min);
195 double x[2] = {p1.
x(), p2.
x()};
196 double y[2] = {p1.
y(), p2.
y()};
197 double z[2] = {p1.
z(), p2.
z()};
207 glBegin(GL_LINE_STRIP);
208 for(
int i = 0; i < N; i++) {
209 double t = t_min + (double)i / (
double)(N - 1) * (t_max - t_min);
211 double x = p.
x(), y = p.
y(),
z = p.
z();
220 GPoint p = e->
point(t_min + 0.5 * (t_max - t_min));
224 double x = p.
x(), y = p.
y(),
z = p.
z();
232 double t = t_min + 0.5 * (t_max - t_min);
236 for(
int i = 0; i < 3; i++)
240 double x = p.
x(), y = p.
y(),
z = p.
z();
258 int forceColor = 0,
unsigned int color = 0)
262 glEnableClientState(GL_VERTEX_ARRAY);
264 glEnable(GL_LIGHTING);
266 glEnableClientState(GL_NORMAL_ARRAY);
269 glDisableClientState(GL_NORMAL_ARRAY);
272 glDisableClientState(GL_COLOR_ARRAY);
273 glColor4ubv((GLubyte *)&color);
277 glEnableClientState(GL_COLOR_ARRAY);
279 if(
CTX::instance()->polygonOffset) glEnable(GL_POLYGON_OFFSET_FILL);
282 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
284 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
285 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
288 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
289 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
292 glDisable(GL_POLYGON_OFFSET_FILL);
293 glDisable(GL_LIGHTING);
294 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
295 glDisableClientState(GL_VERTEX_ARRAY);
296 glDisableClientState(GL_NORMAL_ARRAY);
297 glDisableClientState(GL_COLOR_ARRAY);
304 if(!
f->getVisibility())
return;
312 glPushName(
f->tag());
315 if(
f->getSelection()) {
316 glLineWidth((
float)(
CTX::instance()->geom.selectedCurveWidth / 2.));
325 unsigned int col =
f->useColor() ?
f->getColor() :
327 glColor4ubv((GLubyte *)&col);
333 else if(
f->numRegions() == 1)
338 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
340 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
344 f->fillVertexArray();
349 f->buildRepresentationCross();
352 if(
CTX::instance()->geom.surfaceType > 0 &&
f->va_geom_triangles) {
353 bool selected =
false;
354 if(
f->getSelection()) selected =
true;
359 glEnable(GL_LINE_STIPPLE);
360 glLineStipple(1, 0x0F0F);
362 for(
int dim = 0; dim < 2; dim++) {
363 for(std::size_t i = 0; i <
f->cross[dim].size(); i++) {
364 if(
f->cross[dim][i].size() >= 2) {
365 glBegin(GL_LINE_STRIP);
366 for(std::size_t j = 0; j <
f->cross[dim][i].size(); j++) {
367 double x =
f->cross[dim][i][j].x();
368 double y =
f->cross[dim][i][j].y();
369 double z =
f->cross[dim][i][j].z();
377 glDisable(GL_LINE_STIPPLE);
382 if(
f->cross[0].size() &&
f->cross[0][0].size()) {
383 int idx =
f->cross[0][0].size() / 2;
384 if(
CTX::instance()->geom.surfaceLabels ||
f->getSelection() > 1) {
386 double x =
f->cross[0][0][idx].x();
387 double y =
f->cross[0][0][idx].y();
388 double z =
f->cross[0][0][idx].z();
390 if(
f->getSelection() > 1)
396 SPoint3 p(
f->cross[0][0][idx].x(),
f->cross[0][0][idx].y(),
397 f->cross[0][0][idx].z());
400 for(
int i = 0; i < 3; i++)
404 double x = p.
x(), y = p.
y(),
z = p.
z();
433 glPushName(r->
tag());
437 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
439 glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
447 glColor4ubv((GLubyte *)&col);
450 const double size = 8.;
451 double x = 0., y = 0.,
z = 0.;
487 for(
int i = 0; i < 6; i++)
489 glEnable((GLenum)(GL_CLIP_PLANE0 + i));
491 glDisable((GLenum)(GL_CLIP_PLANE0 + i));
503 for(
int i = 0; i < 6; i++) glDisable((GLenum)(GL_CLIP_PLANE0 + i));