25#include <ReferenceFrame.h>
34 get(GLfloat x, GLfloat y, GLfloat z, GLfloat t = 1.)
47 bool m_initialized =
false;
48 bool checkBuildErrors(
unsigned int shader, std::string
const &type);
51 GLShader(
const char * ,
const char *);
63 void set(std::string
const &,
bool)
const;
64 void set(std::string
const &,
int)
const;
65 void set(std::string
const &,
unsigned int)
const;
66 void set(std::string
const &,
Vec3 const &)
const;
67 void set(std::string
const &, Real)
const;
70 void GLCube(GLfloat,
bool wireFrame =
false);
73 virtual void display() = 0;
77 GLUquadric *m_quadric =
nullptr;
87 void setBase(GLdouble);
88 void setHeight(GLdouble);
89 void setSlices(GLint);
90 void setStacks(GLint);
91 virtual void display()
override;
96 virtual void requestRecalc();
97 virtual const std::vector<GLfloat> *edge()
const = 0;
101 GLUquadric *m_quadric =
nullptr;
103 std::vector<GLfloat> m_vertices;
104 std::vector<GLfloat> m_normals;
105 std::vector<GLfloat> m_texCoords;
106 std::vector<GLfloat> m_edge;
107 std::vector<GLint> m_indices;
110 GLdouble m_width = 1;
111 GLdouble m_height = 1;
112 bool m_invertNormals =
false;
129 virtual void requestRecalc()
override;
130 void setInverted(
bool);
131 void setRadius(GLdouble);
132 void setWidth(GLdouble);
133 void setHeight(GLdouble);
134 void setSlices(GLint);
136 const std::vector<GLfloat> *edge()
const override;
137 virtual void display()
override;
144 GLUquadric *m_quadric =
nullptr;
146 std::vector<GLfloat> m_vertices;
147 std::vector<GLfloat> m_normals;
148 std::vector<GLfloat> m_texCoords;
149 std::vector<GLint> m_indices;
152 GLdouble m_innerRadius = .5;
153 GLdouble m_outerRadius = 1.;
161 return m_innerRadius;
167 return m_outerRadius;
170 void setInnerRadius(GLdouble);
171 void setOuterRadius(GLdouble);
172 void setSlices(GLint);
174 virtual void display()
override;
181 GLUquadric *m_quadric =
nullptr;
184 GLDisc m_topDiscCap, m_bottomDiscCap;
188 std::vector<GLfloat> m_strip;
189 std::vector<GLfloat> m_normals;
191 bool m_drawTop =
false;
192 bool m_drawBase =
false;
193 bool m_invertNormals =
false;
194 GLdouble m_height = 1.;
195 GLdouble m_radius = .25;
198 void recalculateCaps();
214 void setHeight(GLdouble);
215 void setRadius(GLdouble);
216 void setSlices(GLint);
217 void setVisibleCaps(
bool,
bool);
218 void setInvertNormals(
bool);
219 virtual void display()
override;
226 GLUquadric *m_outerQuadric =
nullptr;
227 GLUquadric *m_innerQuadric =
nullptr;
230 GLRing m_topCap, m_bottomCap;
232 bool m_drawTop =
false;
233 bool m_drawBase =
false;
234 GLdouble m_height = 1.;
235 GLdouble m_innerRadius = .125;
236 GLdouble m_outerRadius = .25;
239 void recalculateCaps();
251 return m_innerRadius;
257 return m_outerRadius;
260 void setHeight(GLdouble);
261 void setInnerRadius(GLdouble);
262 void setOuterRadius(GLdouble);
263 void setSlices(GLint);
264 void setVisibleCaps(
bool,
bool);
266 virtual void display()
override;
273 GLUquadric *m_quadric =
nullptr;
275 std::vector<GLfloat> m_vertices;
276 std::vector<GLfloat> m_normals;
277 std::vector<GLfloat> m_texCoords;
278 std::vector<GLint> m_indices;
279 std::vector<GLfloat> m_edge;
281 GLdouble m_rCurv = 1;
282 GLdouble m_radius = .25;
285 GLint m_sectors = 32;
287 bool m_invertNormals =
false;
293 curvatureRadius()
const
304 void setCenterOffset(GLdouble, GLdouble);
305 void setCurvatureRadius(GLdouble);
306 void setRadius(GLdouble);
307 void setSectors(GLint);
308 void setStacks(GLint);
309 void setInvertNormals(
bool);
311 virtual void display()
override;
312 virtual const std::vector<GLfloat> *edge()
const override;
313 virtual void requestRecalc()
override;
320 GLUquadric *m_quadric =
nullptr;
322 std::vector<GLfloat> m_vertices;
323 std::vector<GLfloat> m_normals;
324 std::vector<GLfloat> m_texCoords;
325 std::vector<GLint> m_indices;
326 std::vector<GLfloat> m_edge;
328 GLdouble m_flength = 2;
329 GLdouble m_radius = .25;
332 GLint m_sectors = 64;
334 bool m_invertNormals =
false;
351 void setCenterOffset(GLdouble, GLdouble);
352 void setFocalLength(GLdouble);
353 void setRadius(GLdouble);
354 void setSectors(GLint);
355 void setStacks(GLint);
356 void setInvertNormals(
bool);
358 virtual const std::vector<GLfloat> *edge()
const override;
359 virtual void requestRecalc()
override;
360 virtual void display()
override;
367 GLUquadric *m_quadric =
nullptr;
369 std::vector<GLfloat> m_vertices;
370 std::vector<GLfloat> m_normals;
371 std::vector<GLfloat> m_texCoords;
372 std::vector<GLint> m_indices;
373 std::vector<GLfloat> m_edge;
375 GLdouble m_rCurv = 1;
377 bool m_convex =
false;
378 GLdouble m_radius = .25;
381 GLdouble m_rHole = 0;
382 GLint m_sectors = 64;
384 bool m_invertNormals =
false;
401 void setCenterOffset(GLdouble, GLdouble);
402 void setConicConstant(GLdouble);
403 void setCurvatureRadius(GLdouble);
404 void setConvex(
bool);
406 void setRadius(GLdouble);
407 void setHoleRadius(GLdouble);
408 void setSectors(GLint);
409 void setStacks(GLint);
410 void setInvertNormals(
bool);
412 virtual const std::vector<GLfloat> *edge()
const override;
413 virtual void requestRecalc()
override;
414 virtual void display()
override;
421 GLUquadric *m_quadric =
nullptr;
423 std::vector<GLfloat> m_vertices;
424 std::vector<GLfloat> m_normals;
427 GLdouble m_radius = .25;
428 GLdouble m_width = 1;
429 GLdouble m_height = 1;
452 void setRadius(GLdouble);
453 void setWidth(GLdouble);
454 void setHeight(GLdouble);
455 void setSlices(GLint);
457 virtual void display()
override;
465 std::vector<GLfloat> m_vertices;
467 GLdouble m_width = 1;
468 GLdouble m_height = 1;
485 void setWidth(GLdouble);
486 void setHeight(GLdouble);
488 virtual void display()
override;
499 GLfloat m_height = 1e-1;
500 GLfloat m_radius = 5e-3;
501 GLfloat m_arrowHeight = 1e-1 / 3;
502 GLfloat m_arrowBase = 1e-2;
506 void setHeight(GLfloat);
507 void setRadius(GLfloat);
508 void setArrowHeight(GLfloat);
509 void setArrowBase(GLfloat);
526 return m_arrowHeight;
535 virtual void display()
override;
543 GLfloat m_thickness = 2;
546 void setThickness(GLfloat thickness);
547 void setDirection(
Vec3 const &vec);
549 virtual void display()
override;
556 unsigned int m_texId;
557 std::vector<uint32_t> m_texture;
560 GLfloat m_vertices[6][2];
561 unsigned int m_texWidth, m_texHeight;
562 unsigned int m_fontSize = 48;
564 GLfloat m_scale = 1e-3;
565 GLfloat m_color[4] = {1, 1, 1, 1};
567 unsigned int m_size = 48;
569 bool m_haveTexture =
false;
570 bool m_texLoaded =
false;
571 bool m_needsReload =
false;
573 void composeTexture();
574 void reloadTexture();
579 void setSize(
unsigned);
580 void setScale(GLfloat);
581 void setColor(GLfloat, GLfloat, GLfloat, GLfloat = 1);
582 void setText(std::string
const &);
583 void setFace(std::string
const &);
585 virtual void display()
override;
589 std::vector<GLfloat> m_vertices;
590 std::vector<GLfloat> m_hlVertices;
591 GLfloat m_gridColor[4] = {1, 1, 1, 1};
592 GLfloat m_hlColor[4] = {1, 0, 0, 1};
594 unsigned m_stepsX = 10;
595 unsigned m_stepsY = 10;
597 GLfloat m_thickness = 1;
601 void recalculateHighlight();
608 return m_stepsX * m_step;
614 return m_stepsY * m_step;
623 virtual void display()
override;
625 void setGridColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a = 1);
626 void setHighlightColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a = 1);
628 void setStepsX(
unsigned);
629 void setStepsY(
unsigned);
631 void setThickness(GLfloat);
633 void highlight(GLfloat x, GLfloat y);
Definition: GLHelpers.h:94
Definition: GLHelpers.h:541
Definition: GLHelpers.h:180
Definition: GLHelpers.h:76
Definition: GLHelpers.h:366
Definition: GLHelpers.h:100
Definition: GLHelpers.h:588
Definition: GLHelpers.h:319
Definition: GLHelpers.h:420
Definition: GLHelpers.h:463
Definition: GLHelpers.h:495
Definition: GLHelpers.h:143
Definition: GLHelpers.h:45
Definition: GLHelpers.h:272
Definition: GLHelpers.h:555
Definition: GLHelpers.h:225
Definition: GLHelpers.h:72
Definition: GLHelpers.h:30