gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
drawGeom.cpp
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 
6 #include <string.h>
7 #include "drawContext.h"
8 #include "Context.h"
9 #include "gl2ps.h"
10 #include "VertexArray.h"
11 #include "GModel.h"
12 #include "SBoundingBox3d.h"
13 #include "GmshMessage.h"
14 #include "StringUtils.h"
15 
16 static void drawEntityLabel(drawContext *ctx, GEntity *e, double x, double y,
17  double z, double offset)
18 {
19  double xx = x + offset / ctx->s[0];
20  double yy = y + offset / ctx->s[1];
21  double zz = z + offset / ctx->s[2];
22 
23  if(CTX::instance()->geom.labelType == 0) {
24  std::vector<std::string> info =
25  SplitString(e->getInfoString(false, true), '\n');
26  for(int line = 0; line < (int)info.size(); line++)
27  ctx->drawString(info[line].c_str(), xx, yy, zz, line);
28  return;
29  }
30 
31  char str[1024];
32  if(CTX::instance()->geom.labelType == 1) {
33  sprintf(str, "%d", e->tag());
34  }
35  else if(CTX::instance()->geom.labelType == 2) {
36  strcpy(str, "");
37  for(std::size_t i = 0; i < e->physicals.size(); i++) {
38  char tmp[32];
39  if(i) strcat(str, ", ");
40  sprintf(tmp, "%d", e->physicals[i]);
41  strcat(str, tmp);
42  }
43  }
44  else if(CTX::instance()->geom.labelType == 3) {
45  strcpy(str, e->model()->getElementaryName(e->dim(), e->tag()).c_str());
46  }
47  else {
48  strcpy(str, "");
49  std::string name = "";
50  for(std::size_t i = 0; i < e->physicals.size(); i++) {
51  if(name.size()) strcat(str, ", ");
52  name = e->model()->getPhysicalName(e->dim(), std::abs(e->physicals[i]));
53  if(name.size()) strcat(str, name.c_str());
54  }
55  }
56 
57  ctx->drawString(str, xx, yy, zz);
58 }
59 
60 class drawGVertex {
61 private:
63 
64 public:
65  drawGVertex(drawContext *ctx) : _ctx(ctx) {}
67  {
68  if(!v->getVisibility()) return;
69  if(v->geomType() == GEntity::BoundaryLayerPoint) return;
70 
71  bool select = (_ctx->render_mode == drawContext::GMSH_SELECT &&
72  v->model() == GModel::current());
73  if(select) {
74  glPushName(0);
75  glPushName(v->tag());
76  }
77 
78  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
79 
80  double fact = _ctx->highResolutionPixelFactor();
81  double ps = CTX::instance()->geom.pointSize * fact;
82  double sps = CTX::instance()->geom.selectedPointSize * fact;
83 
84  if(v->getSelection()) {
85  glPointSize((float)sps);
86  gl2psPointSize((float)(CTX::instance()->geom.selectedPointSize *
88  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.selection);
89  }
90  else {
91  glPointSize((float)ps);
92  gl2psPointSize((float)(CTX::instance()->geom.pointSize *
94  unsigned int col = v->useColor() ? v->getColor() :
95  CTX::instance()->color.geom.point;
96  glColor4ubv((GLubyte *)&col);
97  }
98 
99  if(CTX::instance()->geom.highlightOrphans) {
100  if(v->isOrphan())
101  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.highlight[0]);
102  else if(v->numEdges() == 1)
103  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.highlight[1]);
104  }
105 
106  double x = v->x(), y = v->y(), z = v->z();
107  _ctx->transform(x, y, z);
108 
109  if(CTX::instance()->geom.points || v->getSelection() > 1) {
110  if(CTX::instance()->geom.pointType > 0) {
111  if(v->getSelection())
112  _ctx->drawSphere(sps, x, y, z, CTX::instance()->geom.light);
113  else
114  _ctx->drawSphere(ps, x, y, z, CTX::instance()->geom.light);
115  }
116  else {
117  glBegin(GL_POINTS);
118  glVertex3d(x, y, z);
119  glEnd();
120  }
121  }
122 
123  if(CTX::instance()->geom.pointLabels || v->getSelection() > 1) {
124  double offset =
125  (0.5 * ps + 0.1 * CTX::instance()->glFontSize) * _ctx->pixel_equiv_x;
126  if(v->getSelection() > 1)
127  glColor4ubv((GLubyte *)&CTX::instance()->color.fg);
128  drawEntityLabel(_ctx, v, x, y, z, offset);
129  }
130 
131  if(select) {
132  glPopName();
133  glPopName();
134  }
135  }
136 };
137 
138 class drawGEdge {
139 private:
141 
142 public:
143  drawGEdge(drawContext *ctx) : _ctx(ctx) {}
144  void operator()(GEdge *e)
145  {
146  if(!e->getVisibility()) return;
147  if(e->geomType() == GEntity::DiscreteCurve) return;
148  if(e->geomType() == GEntity::PartitionCurve) return;
149  if(e->geomType() == GEntity::BoundaryLayerCurve) return;
150 
151  bool select = (_ctx->render_mode == drawContext::GMSH_SELECT &&
152  e->model() == GModel::current());
153  if(select) {
154  glPushName(1);
155  glPushName(e->tag());
156  }
157 
158  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
159 
160  if(e->getSelection()) {
161  glLineWidth((float)CTX::instance()->geom.selectedCurveWidth);
162  gl2psLineWidth((float)(CTX::instance()->geom.selectedCurveWidth *
164  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.selection);
165  }
166  else {
167  glLineWidth((float)CTX::instance()->geom.curveWidth);
168  gl2psLineWidth((float)(CTX::instance()->geom.curveWidth *
170  unsigned int col = e->useColor() ? e->getColor() :
171  CTX::instance()->color.geom.curve;
172  glColor4ubv((GLubyte *)&col);
173  }
174 
175  if(CTX::instance()->geom.highlightOrphans) {
176  if(e->isOrphan())
177  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.highlight[0]);
178  else if(e->numFaces() == 1)
179  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.highlight[1]);
180  }
181 
182  Range<double> t_bounds = e->parBounds(0);
183  double t_min = t_bounds.low();
184  double t_max = t_bounds.high();
185 
186  if(CTX::instance()->geom.curves || e->getSelection() > 1) {
187  int N = e->minimumDrawSegments() + 1;
188  if(CTX::instance()->geom.curveType > 0) {
189  for(int i = 0; i < N - 1; i++) {
190  double t1 = t_min + (double)i / (double)(N - 1) * (t_max - t_min);
191  GPoint p1 = e->point(t1);
192  double t2 =
193  t_min + (double)(i + 1) / (double)(N - 1) * (t_max - t_min);
194  GPoint p2 = e->point(t2);
195  double x[2] = {p1.x(), p2.x()};
196  double y[2] = {p1.y(), p2.y()};
197  double z[2] = {p1.z(), p2.z()};
198  _ctx->transform(x[0], y[0], z[0]);
199  _ctx->transform(x[1], y[1], z[1]);
203  x, y, z, CTX::instance()->geom.light);
204  }
205  }
206  else {
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);
210  GPoint p = e->point(t);
211  double x = p.x(), y = p.y(), z = p.z();
212  _ctx->transform(x, y, z);
213  glVertex3d(x, y, z);
214  }
215  glEnd();
216  }
217  }
218 
219  if(CTX::instance()->geom.curveLabels || e->getSelection() > 1) {
220  GPoint p = e->point(t_min + 0.5 * (t_max - t_min));
221  double offset = (0.5 * CTX::instance()->geom.curveWidth +
222  0.1 * CTX::instance()->glFontSize) *
224  double x = p.x(), y = p.y(), z = p.z();
225  _ctx->transform(x, y, z);
226  if(e->getSelection() > 1)
227  glColor4ubv((GLubyte *)&CTX::instance()->color.fg);
228  drawEntityLabel(_ctx, e, x, y, z, offset);
229  }
230 
231  if(CTX::instance()->geom.tangents) {
232  double t = t_min + 0.5 * (t_max - t_min);
233  GPoint p = e->point(t);
234  SVector3 der = e->firstDer(t);
235  der.normalize();
236  for(int i = 0; i < 3; i++)
237  der[i] *=
239  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.tangents);
240  double x = p.x(), y = p.y(), z = p.z();
241  _ctx->transform(x, y, z);
242  _ctx->transformOneForm(der[0], der[1], der[2]);
243  _ctx->drawVector(CTX::instance()->vectorType, 0, x, y, z, der[0], der[1],
244  der[2], CTX::instance()->geom.light);
245  }
246 
247  if(select) {
248  glPopName();
249  glPopName();
250  }
251  }
252 };
253 
254 class drawGFace {
255 private:
257  void _drawVertexArray(VertexArray *va, bool useNormalArray,
258  int forceColor = 0, unsigned int color = 0)
259  {
260  if(!va || !va->getNumVertices()) return;
261  glVertexPointer(3, GL_FLOAT, 0, va->getVertexArray());
262  glEnableClientState(GL_VERTEX_ARRAY);
263  if(useNormalArray) {
264  glEnable(GL_LIGHTING);
265  glNormalPointer(NORMAL_GLTYPE, 0, va->getNormalArray());
266  glEnableClientState(GL_NORMAL_ARRAY);
267  }
268  else {
269  glDisableClientState(GL_NORMAL_ARRAY);
270  }
271  if(forceColor) {
272  glDisableClientState(GL_COLOR_ARRAY);
273  glColor4ubv((GLubyte *)&color);
274  }
275  else {
276  glColorPointer(4, GL_UNSIGNED_BYTE, 0, va->getColorArray());
277  glEnableClientState(GL_COLOR_ARRAY);
278  }
279  if(CTX::instance()->polygonOffset) glEnable(GL_POLYGON_OFFSET_FILL);
280  if(CTX::instance()->geom.surfaceType > 1) {
281  if(CTX::instance()->geom.lightTwoSide)
282  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
283  else
284  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
285  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
286  }
287  else {
288  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
289  glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
290  }
291  glDrawArrays(GL_TRIANGLES, 0, va->getNumVertices());
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);
298  }
299 
300 public:
301  drawGFace(drawContext *ctx) : _ctx(ctx) {}
303  {
304  if(!f->getVisibility()) return;
305  if(f->geomType() == GEntity::PartitionSurface) return;
306  if(f->geomType() == GEntity::BoundaryLayerSurface) return;
307 
308  bool select = (_ctx->render_mode == drawContext::GMSH_SELECT &&
309  f->model() == GModel::current());
310  if(select) {
311  glPushName(2);
312  glPushName(f->tag());
313  }
314 
315  if(f->getSelection()) {
316  glLineWidth((float)(CTX::instance()->geom.selectedCurveWidth / 2.));
317  gl2psLineWidth((float)(CTX::instance()->geom.selectedCurveWidth / 2. *
319  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.selection);
320  }
321  else {
322  glLineWidth((float)(CTX::instance()->geom.curveWidth / 2.));
323  gl2psLineWidth((float)(CTX::instance()->geom.curveWidth / 2. *
325  unsigned int col = f->useColor() ? f->getColor() :
326  CTX::instance()->color.geom.surface;
327  glColor4ubv((GLubyte *)&col);
328  }
329 
330  if(CTX::instance()->geom.highlightOrphans) {
331  if(f->isOrphan())
332  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.highlight[0]);
333  else if(f->numRegions() == 1)
334  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.highlight[1]);
335  }
336 
337  if(CTX::instance()->geom.lightTwoSide)
338  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
339  else
340  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
341 
342  if((CTX::instance()->geom.surfaces || f->getSelection() > 1) &&
344  f->fillVertexArray();
345 
346  if(((CTX::instance()->geom.surfaces || f->getSelection() > 1) &&
347  CTX::instance()->geom.surfaceType == 0) ||
349  f->buildRepresentationCross();
350 
351  if(CTX::instance()->geom.surfaces || f->getSelection() > 1) {
352  if(CTX::instance()->geom.surfaceType > 0 && f->va_geom_triangles) {
353  bool selected = false;
354  if(f->getSelection()) selected = true;
355  _drawVertexArray(f->va_geom_triangles, CTX::instance()->geom.light,
356  selected, CTX::instance()->color.geom.selection);
357  }
358  else {
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();
370  _ctx->transform(x, y, z);
371  glVertex3d(x, y, z);
372  }
373  glEnd();
374  }
375  }
376  }
377  glDisable(GL_LINE_STIPPLE);
379  }
380  }
381 
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) {
385  double offset = 0.1 * CTX::instance()->glFontSize * _ctx->pixel_equiv_x;
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();
389  _ctx->transform(x, y, z);
390  if(f->getSelection() > 1)
391  glColor4ubv((GLubyte *)&CTX::instance()->color.fg);
392  drawEntityLabel(_ctx, f, x, y, z, offset);
393  }
394 
395  if(CTX::instance()->geom.normals) {
396  SPoint3 p(f->cross[0][0][idx].x(), f->cross[0][0][idx].y(),
397  f->cross[0][0][idx].z());
398  SPoint2 uv = f->parFromPoint(p);
399  SVector3 n = f->normal(uv);
400  for(int i = 0; i < 3; i++)
401  n[i] *=
403  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.normals);
404  double x = p.x(), y = p.y(), z = p.z();
405  _ctx->transform(x, y, z);
406  _ctx->transformTwoForm(n[0], n[1], n[2]);
407  _ctx->drawVector(CTX::instance()->vectorType, 0, x, y, z, n[0], n[1],
408  n[2], CTX::instance()->geom.light);
409  }
410  }
411 
412  if(select) {
413  glPopName();
414  glPopName();
415  }
416  }
417 };
418 
419 class drawGRegion {
420 private:
422 
423 public:
424  drawGRegion(drawContext *ctx) : _ctx(ctx) {}
426  {
427  if(!r->getVisibility()) return;
428 
429  bool select = (_ctx->render_mode == drawContext::GMSH_SELECT &&
430  r->model() == GModel::current());
431  if(select) {
432  glPushName(3);
433  glPushName(r->tag());
434  }
435 
436  if(CTX::instance()->geom.lightTwoSide)
437  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
438  else
439  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
440 
441  if(r->getSelection()){
442  glColor4ubv((GLubyte *)&CTX::instance()->color.geom.selection);
443  }
444  else{
445  unsigned int col = r->useColor() ? r->getColor() :
446  CTX::instance()->color.geom.volume;
447  glColor4ubv((GLubyte *)&col);
448  }
449 
450  const double size = 8.;
451  double x = 0., y = 0., z = 0.;
452 
453  if(CTX::instance()->geom.volumes || CTX::instance()->geom.volumeLabels ||
454  r->getSelection() > 1) {
455  SPoint3 p = r->bounds(true).center(); // fast approx if mesh-based
456  x = p.x();
457  y = p.y();
458  z = p.z();
459  _ctx->transform(x, y, z);
460  }
461 
462  if(CTX::instance()->geom.volumes || r->getSelection() > 1)
463  _ctx->drawSphere(size, x, y, z, CTX::instance()->geom.light);
464 
465  if(CTX::instance()->geom.volumeLabels || r->getSelection() > 1) {
466  double offset =
467  (1. * size + 0.1 * CTX::instance()->glFontSize) * _ctx->pixel_equiv_x;
468  if(r->getSelection() > 1)
469  glColor4ubv((GLubyte *)&CTX::instance()->color.fg);
470  drawEntityLabel(_ctx, r, x, y, z, offset);
471  }
472 
473  if(select) {
474  glPopName();
475  glPopName();
476  }
477  }
478 };
479 
481 {
482  if(!CTX::instance()->geom.draw) return;
483 
484  // draw any transient geometry stuff
485  if(drawGeomTransient) (*drawGeomTransient)(this);
486 
487  for(int i = 0; i < 6; i++)
488  if(CTX::instance()->geom.clip & (1 << i))
489  glEnable((GLenum)(GL_CLIP_PLANE0 + i));
490  else
491  glDisable((GLenum)(GL_CLIP_PLANE0 + i));
492 
493  for(std::size_t i = 0; i < GModel::list.size(); i++) {
494  GModel *m = GModel::list[i];
495  if(m->getVisibility() && isVisible(m)) {
496  std::for_each(m->firstVertex(), m->lastVertex(), drawGVertex(this));
497  std::for_each(m->firstEdge(), m->lastEdge(), drawGEdge(this));
498  std::for_each(m->firstFace(), m->lastFace(), drawGFace(this));
499  std::for_each(m->firstRegion(), m->lastRegion(), drawGRegion(this));
500  }
501  }
502 
503  for(int i = 0; i < 6; i++) glDisable((GLenum)(GL_CLIP_PLANE0 + i));
504 }
gl2ps.h
drawContext::highResolutionPixelFactor
double highResolutionPixelFactor()
Definition: drawContext.cpp:73
GEntity::BoundaryLayerSurface
@ BoundaryLayerSurface
Definition: GEntity.h:116
GModel::firstEdge
eiter firstEdge()
Definition: GModel.h:356
CTX::tangents
unsigned int tangents
Definition: Context.h:363
gl2psEnable
GL2PSDLL_API GLint gl2psEnable(GLint mode)
Definition: gl2ps.cpp:6476
GEntity::getColor
virtual unsigned int getColor()
Definition: GEntity.h:318
GVertex::z
virtual double z() const =0
CTX::color
struct CTX::@3 color
GPoint::y
double y() const
Definition: GPoint.h:22
contextGeometryOptions::curveWidth
double curveWidth
Definition: Context.h:116
GFace
Definition: GFace.h:33
GEntity::model
GModel * model() const
Definition: GEntity.h:277
SPoint2
Definition: SPoint2.h:12
GEdge::minimumDrawSegments
virtual int minimumDrawSegments() const
Definition: GEdge.h:151
drawGFace::_drawVertexArray
void _drawVertexArray(VertexArray *va, bool useNormalArray, int forceColor=0, unsigned int color=0)
Definition: drawGeom.cpp:257
drawGFace::operator()
void operator()(GFace *f)
Definition: drawGeom.cpp:302
GEntity::physicals
std::vector< int > physicals
Definition: GEntity.h:65
drawContext::drawString
void drawString(const std::string &s, double x, double y, double z, const std::string &font_name, int font_enum, int font_size, int align, int line_num=0)
Definition: drawGlyph.cpp:16
CTX::epsPointSizeFactor
double epsPointSizeFactor
Definition: Context.h:341
drawGRegion::_ctx
drawContext * _ctx
Definition: drawGeom.cpp:421
VertexArray.h
SPoint3
Definition: SPoint3.h:14
LegendrePolynomials::f
void f(int n, double u, double *val)
Definition: orthogonalBasis.cpp:77
drawGEdge
Definition: drawGeom.cpp:138
Range::high
T high() const
Definition: Range.h:20
SVector3
Definition: SVector3.h:16
GEdge::numFaces
virtual std::size_t numFaces() const
Definition: GEdge.h:116
VertexArray
Definition: VertexArray.h:151
CTX::epsLineWidthFactor
double epsLineWidthFactor
Definition: Context.h:341
drawGRegion::drawGRegion
drawGRegion(drawContext *ctx)
Definition: drawGeom.cpp:424
GModel::firstVertex
viter firstVertex()
Definition: GModel.h:357
GVertex::numEdges
virtual std::size_t numEdges() const
Definition: GVertex.h:57
VertexArray::getNumVertices
int getNumVertices()
Definition: VertexArray.h:174
drawGEdge::_ctx
drawContext * _ctx
Definition: drawGeom.cpp:140
drawContext::transform
void transform(double &x, double &y, double &z)
Definition: drawContext.h:173
GEntity::getSelection
virtual char getSelection()
Definition: GEntity.h:314
drawContext::drawVector
void drawVector(int Type, int Fill, double x, double y, double z, double dx, double dy, double dz, int light)
Definition: drawGlyph.cpp:714
GmshMessage.h
drawContext::transformTwoForm
void transformTwoForm(double &x, double &y, double &z)
Definition: drawContext.h:181
GEntity
Definition: GEntity.h:31
GPoint
Definition: GPoint.h:13
gl2psPointSize
GL2PSDLL_API GLint gl2psPointSize(GLfloat value)
Definition: gl2ps.cpp:6537
drawContext::drawGeom
void drawGeom()
Definition: drawGeom.cpp:480
GEntity::DiscreteCurve
@ DiscreteCurve
Definition: GEntity.h:104
contextGeometryOptions::labelType
int labelType
Definition: Context.h:115
GEntity::PartitionCurve
@ PartitionCurve
Definition: GEntity.h:122
drawContext::s
double s[3]
Definition: drawContext.h:135
GPoint::z
double z() const
Definition: GPoint.h:23
CTX::fg
unsigned int fg
Definition: Context.h:358
SBoundingBox3d::center
SPoint3 center() const
Definition: SBoundingBox3d.h:92
CTX::instance
static CTX * instance()
Definition: Context.cpp:122
contextGeometryOptions::selectedCurveWidth
double selectedCurveWidth
Definition: Context.h:116
drawContext::GMSH_SELECT
@ GMSH_SELECT
Definition: drawContext.h:145
SPoint3::x
double x(void) const
Definition: SPoint3.h:125
GModel::lastFace
fiter lastFace()
Definition: GModel.h:359
drawGVertex::operator()
void operator()(GVertex *v)
Definition: drawGeom.cpp:66
drawGEdge::operator()
void operator()(GEdge *e)
Definition: drawGeom.cpp:144
GModel::getPhysicalName
std::string getPhysicalName(int dim, int num) const
Definition: GModel.cpp:961
CTX::normals
unsigned int normals
Definition: Context.h:363
GEdge::firstDer
virtual SVector3 firstDer(double par) const =0
Range
Definition: Range.h:10
CTX::draw
int draw
Definition: Context.h:316
drawGFace
Definition: drawGeom.cpp:254
drawEntityLabel
static void drawEntityLabel(drawContext *ctx, GEntity *e, double x, double y, double z, double offset)
Definition: drawGeom.cpp:16
contextGeometryOptions::surfaceType
int surfaceType
Definition: Context.h:117
drawContext::transformOneForm
void transformOneForm(double &x, double &y, double &z)
Definition: drawContext.h:177
GModel::lastVertex
viter lastVertex()
Definition: GModel.h:361
GVertex
Definition: GVertex.h:23
drawContext::isVisible
bool isVisible(GModel *m)
Definition: drawContext.h:202
SBoundingBox3d.h
VertexArray::getColorArray
unsigned char * getColorArray(int i=0)
Definition: VertexArray.h:192
GEntity::useColor
virtual bool useColor()
Definition: GEntity.cpp:43
VertexArray::getNormalArray
normal_type * getNormalArray(int i=0)
Definition: VertexArray.h:187
contextGeometryOptions::tangents
double tangents
Definition: Context.h:118
GModel
Definition: GModel.h:44
drawContext::drawGeomTransient
static void(* drawGeomTransient)(void *)
Definition: drawContext.h:294
GEntity::geomType
virtual GeomType geomType() const
Definition: GEntity.h:238
GModel::firstFace
fiter firstFace()
Definition: GModel.h:355
drawGFace::drawGFace
drawGFace(drawContext *ctx)
Definition: drawGeom.cpp:301
SPoint3::y
double y(void) const
Definition: SPoint3.h:127
drawContext::render_mode
int render_mode
Definition: drawContext.h:146
GVertex::isOrphan
virtual bool isOrphan()
Definition: GVertex.cpp:175
drawGVertex
Definition: drawGeom.cpp:60
drawContext
Definition: drawContext.h:120
drawGEdge::drawGEdge
drawGEdge(drawContext *ctx)
Definition: drawGeom.cpp:143
GModel::getElementaryName
std::string getElementaryName(int dim, int tag)
Definition: GModel.cpp:1007
GL2PS_LINE_STIPPLE
#define GL2PS_LINE_STIPPLE
Definition: gl2ps.h:149
contextGeometryOptions::normals
double normals
Definition: Context.h:118
GEntity::tag
int tag() const
Definition: GEntity.h:280
drawGVertex::_ctx
drawContext * _ctx
Definition: drawGeom.cpp:62
GEntity::BoundaryLayerCurve
@ BoundaryLayerCurve
Definition: GEntity.h:103
GModel::list
static std::vector< GModel * > list
Definition: GModel.h:202
GVertex::geomType
virtual GeomType geomType() const
Definition: GVertex.h:72
contextGeometryOptions::light
int light
Definition: Context.h:114
GEdge::isOrphan
virtual bool isOrphan()
Definition: GEdge.cpp:705
CTX::geom
contextGeometryOptions geom
Definition: Context.h:311
GRegion
Definition: GRegion.h:28
contextGeometryOptions::volumeLabels
int volumeLabels
Definition: Context.h:115
CTX::print
struct CTX::@2 print
GVertex::x
virtual double x() const =0
StringUtils.h
VertexArray::getVertexArray
float * getVertexArray(int i=0)
Definition: VertexArray.h:182
GModel::getVisibility
char getVisibility() const
Definition: GModel.h:340
GModel::firstRegion
riter firstRegion()
Definition: GModel.h:354
GEntity::PartitionSurface
@ PartitionSurface
Definition: GEntity.h:123
GVertex::y
virtual double y() const =0
GModel::lastRegion
riter lastRegion()
Definition: GModel.h:358
gl2psDisable
GL2PSDLL_API GLint gl2psDisable(GLint mode)
Definition: gl2ps.cpp:6512
Context.h
drawGRegion::operator()
void operator()(GRegion *r)
Definition: drawGeom.cpp:425
GEdge::parBounds
virtual Range< double > parBounds(int i) const =0
contextGeometryOptions::surfaceLabels
int surfaceLabels
Definition: Context.h:115
z
const double z
Definition: GaussQuadratureQuad.cpp:56
CTX::glFontSize
int glFontSize
Definition: Context.h:267
GEdge::point
virtual GPoint point(double p) const =0
contextGeometryOptions::pointSize
double pointSize
Definition: Context.h:116
SplitString
std::vector< std::string > SplitString(const std::string &msg, char separator, bool removeWhiteSpace)
Definition: StringUtils.cpp:210
GEdge
Definition: GEdge.h:26
GEntity::BoundaryLayerPoint
@ BoundaryLayerPoint
Definition: GEntity.h:91
gl2psLineWidth
GL2PSDLL_API GLint gl2psLineWidth(GLfloat value)
Definition: gl2ps.cpp:6567
contextGeometryOptions::selectedPointSize
double selectedPointSize
Definition: Context.h:116
CTX::light
int light[6]
Definition: Context.h:274
SPoint3::z
double z(void) const
Definition: SPoint3.h:129
NORMAL_GLTYPE
#define NORMAL_GLTYPE
Definition: drawContext.h:33
drawContext::drawCylinder
void drawCylinder(double width, double *x, double *y, double *z, int light)
Definition: drawGlyph.cpp:490
GModel::lastEdge
eiter lastEdge()
Definition: GModel.h:360
drawContext::pixel_equiv_x
double pixel_equiv_x
Definition: drawContext.h:141
GModel.h
drawGVertex::drawGVertex
drawGVertex(drawContext *ctx)
Definition: drawGeom.cpp:65
contextGeometryOptions::clip
int clip
Definition: Context.h:120
drawGFace::_ctx
drawContext * _ctx
Definition: drawGeom.cpp:256
Range::low
T low() const
Definition: Range.h:18
line
Definition: shapeFunctions.h:342
CTX::pointSize
double pointSize
Definition: Context.h:271
GEntity::dim
virtual int dim() const
Definition: GEntity.h:196
GPoint::x
double x() const
Definition: GPoint.h:21
GEntity::getVisibility
virtual char getVisibility()
Definition: GEntity.cpp:35
drawContext::drawSphere
void drawSphere(double R, double x, double y, double z, int n1, int n2, int light)
Definition: drawGlyph.cpp:390
GRegion::bounds
virtual SBoundingBox3d bounds(bool fast=false)
Definition: GRegion.cpp:179
GModel::current
static GModel * current(int index=-1)
Definition: GModel.cpp:136
GEntity::getInfoString
virtual std::string getInfoString(bool additional=true, bool multiline=false)
Definition: GEntity.cpp:53
SVector3::normalize
double normalize()
Definition: SVector3.h:38
drawGRegion
Definition: drawGeom.cpp:419
drawContext.h