gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
drawContext.h
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 #ifndef DRAW_CONTEXT_H
7 #define DRAW_CONTEXT_H
8 
9 #include <string>
10 #include <vector>
11 #include <set>
12 #include "SBoundingBox3d.h"
13 #include "SPoint2.h"
14 #include "Camera.h"
15 
16 #if defined(WIN32)
17 #include <windows.h>
18 #undef min
19 #undef max
20 #endif
21 
22 #if defined(__APPLE__)
23 #include <OpenGL/gl.h>
24 #include <OpenGL/glu.h>
25 #else
26 #include <GL/gl.h>
27 #include <GL/glu.h>
28 #endif
29 
30 #if defined(HAVE_VISUDEV)
31 #define NORMAL_GLTYPE GL_FLOAT
32 #else
33 #define NORMAL_GLTYPE GL_BYTE
34 #endif
35 
36 class PView;
37 class GModel;
38 class GVertex;
39 class GEdge;
40 class GFace;
41 class GRegion;
42 class MElement;
43 class PView;
44 class openglWindow;
45 
47 public:
49  virtual ~drawTransform() {}
50  virtual void transform(double &x, double &y, double &z) {}
51  virtual void transformOneForm(double &x, double &y, double &z) {}
52  virtual void transformTwoForm(double &x, double &y, double &z) {}
53  virtual void setMatrix(double mat[3][3], double tra[3]) {}
54 };
55 
57 private:
58  double _mat[3][3];
59  double _tra[3];
60 
61 public:
62  drawTransformScaled(double mat[3][3], double tra[3] = nullptr) : drawTransform()
63  {
65  }
66  virtual void setMatrix(double mat[3][3], double tra[3] = nullptr)
67  {
68  for(int i = 0; i < 3; i++) {
69  for(int j = 0; j < 3; j++) _mat[i][j] = mat[i][j];
70  if(tra)
71  _tra[i] = tra[i];
72  else
73  _tra[i] = 0.;
74  }
75  }
76  virtual void transform(double &x, double &y, double &z)
77  {
78  double xyz[3] = {x, y, z};
79  x = y = z = 0.;
80  for(int k = 0; k < 3; k++) {
81  x += _mat[0][k] * xyz[k];
82  y += _mat[1][k] * xyz[k];
83  z += _mat[2][k] * xyz[k];
84  }
85  x += _tra[0];
86  y += _tra[1];
87  z += _tra[2];
88  }
89 };
90 
91 // global drawing functions, which need to be redefined for each widget toolkit
92 // (FLTK, Qt, etc.)
94 public:
96  virtual ~drawContextGlobal() {}
97  virtual void draw(bool rateLimited = true) {}
98  virtual void drawCurrentOpenglWindow(bool make_current) {}
99  virtual int getFontIndex(const char *fontname) { return 0; }
100  virtual int getFontEnum(int index) { return 0; }
101  virtual const char *getFontName(int index) { return "Helvetica"; }
102  virtual int getFontAlign(const char *alignstr) { return 0; }
103  virtual int getFontSize() { return 12; }
104  virtual void setFont(int fontid, int fontsize) {}
105  virtual double getStringWidth(const char *str) { return 1.; }
106  virtual int getStringHeight() { return 12; }
107  virtual int getStringDescent() { return 3; }
108  virtual void drawString(const char *str) {}
109  virtual void resetFontTextures() {}
110  virtual void flushString() {}
111  virtual std::string getName() { return "None"; }
112 };
113 
114 class imgtex {
115 public:
116  GLuint tex, w, h;
117  imgtex() : tex(0), w(0), h(0) {}
118 };
119 
120 class drawContext {
121 private:
124  GLUquadricObj *_quadric;
126  std::set<GModel *> _hiddenModels;
127  std::set<PView *> _hiddenViews;
129  openglWindow *_openglWindow;
130  std::map<std::string, imgtex> _imageTextures;
131 
132 public:
134  double r[3]; // current Euler angles (in degrees!)
135  double t[3], s[3]; // current translation and scale
136  double quaternion[4]; // current quaternion used for "trackball" rotation
137  int viewport[4]; // current viewport
138  double rot[16]; // current rotation matrix
139  double t_init[3]; // initial translation before applying modelview transform
140  double vxmin, vxmax, vymin, vymax; // current viewport in real coordinates
141  double pixel_equiv_x, pixel_equiv_y; // approx equiv model length of a pixel
142  double model[16],
143  proj[16]; // the modelview and projection matrix as they were
144  // at the time of the last InitPosition() call
146  int render_mode; // current rendering mode
147 public:
148  drawContext(openglWindow *window = nullptr, drawTransform *transform = nullptr);
149  ~drawContext();
150  // factor between the (true) size in pixels and the size reported by OSes
151  // (e.g. 2 on an Apple "retina" display)
152  double highResolutionPixelFactor();
154  {
155  camera = other->camera;
156  for(int i = 0; i < 3; i++) {
157  r[i] = other->r[i];
158  t[i] = other->t[i];
159  s[i] = other->s[i];
160  t_init[i] = other->t_init[i];
161  }
162  for(int i = 0; i < 4; i++) {
163  quaternion[i] = other->quaternion[i];
164  }
165  for(int i = 0; i < 16; i++) {
166  rot[i] = other->rot[i];
167  }
168  }
170  static drawContextGlobal *global();
173  void transform(double &x, double &y, double &z)
174  {
175  if(_transform) _transform->transform(x, y, z);
176  }
177  void transformOneForm(double &x, double &y, double &z)
178  {
180  }
181  void transformTwoForm(double &x, double &y, double &z)
182  {
184  }
185  void hide(GModel *m) { _hiddenModels.insert(m); }
186  void hide(PView *v) { _hiddenViews.insert(v); }
187  void show(GModel *m)
188  {
189  auto it = _hiddenModels.find(m);
190  if(it != _hiddenModels.end()) _hiddenModels.erase(it);
191  }
192  void show(PView *v)
193  {
194  auto it = _hiddenViews.find(v);
195  if(it != _hiddenViews.end()) _hiddenViews.erase(it);
196  }
197  void showAll()
198  {
199  _hiddenModels.clear();
200  _hiddenViews.clear();
201  }
202  bool isVisible(GModel *m)
203  {
204  return (_hiddenModels.find(m) == _hiddenModels.end());
205  }
206  bool isVisible(PView *v)
207  {
208  return (_hiddenViews.find(v) == _hiddenViews.end());
209  }
212  bool generateTextureForImage(const std::string &name, int page,
213  GLuint &imageTexture, GLuint &imageW,
214  GLuint &imageH);
216  void buildRotationMatrix();
217  void setQuaternion(double p1x, double p1y, double p2x, double p2y);
218  void addQuaternion(double p1x, double p1y, double p2x, double p2y);
219  void addQuaternionFromAxisAndAngle(double axis[3], double angle);
222  void initProjection(int xpick = 0, int ypick = 0, int wpick = 0,
223  int hpick = 0);
224  void initRenderModel();
225  void initPosition(bool saveMatrices);
226  void unproject(double winx, double winy, double p[3], double d[3]);
227  void viewport2World(double vp[3], double xyz[3]);
228  void world2Viewport(double xyz[3], double vp[3]);
229  bool select(int type, bool multiple, bool mesh, bool post, int x, int y,
230  int w, int h, std::vector<GVertex *> &vertices,
231  std::vector<GEdge *> &edges, std::vector<GFace *> &faces,
232  std::vector<GRegion *> &regions,
233  std::vector<MElement *> &elements, std::vector<SPoint2> &points,
234  std::vector<PView *> &views);
235  void recenterForRotationCenterChange(SPoint3 newRotationCenter);
236  int fix2dCoordinates(double *x, double *y);
237  void draw3d();
238  void draw2d();
239  void drawGeom();
240  void drawMesh();
241  void drawPost();
242  void drawBackgroundGradient();
243  void drawBackgroundImage(bool moving);
244  void drawText2d();
245  void drawGraph2d(bool inModelCoordinates);
246  void drawAxis(double xmin, double ymin, double zmin, double xmax, double ymax,
247  double zmax, int nticks, int mikado);
248  void drawAxes(int mode, double tics[3], std::string format[3],
249  std::string label[3], double bb[6], int mikado,
250  double value_bb[6]);
251  void drawAxes(int mode, double tics[3], std::string format[3],
252  std::string label[3], SBoundingBox3d &bb, int mikado,
253  SBoundingBox3d &value_bb);
254  void drawAxes();
255  void drawSmallAxes();
257  void drawScales();
258  void drawString(const std::string &s, double x, double y, double z,
259  const std::string &font_name, int font_enum, int font_size,
260  int align, int line_num = 0);
261  void drawString(const std::string &s, double x, double y, double z,
262  int line_num = 0);
263  void drawStringCenter(const std::string &s, double x, double y, double z,
264  int line_num = 0);
265  void drawStringRight(const std::string &s, double x, double y, double z,
266  int line_num = 0);
267  void drawString(const std::string &s, double x, double y, double z,
268  double style, int line_num = 0);
269  void drawImage(const std::string &s, double x, double y, double z,
270  int align = 0);
271  void drawSphere(double R, double x, double y, double z, int n1, int n2,
272  int light);
273  void drawCube(double x, double y, double z, double val[9], int light);
274  void drawEllipsoid(double x, double y, double z, float v0[3], float v1[3],
275  float v2[3], int light);
276  void drawEllipse(double x, double y, double z, float v0[3], float v1[3],
277  int light);
278  void drawSphere(double size, double x, double y, double z, int light);
279  void drawCylinder(double width, double *x, double *y, double *z, int light);
280  void drawTaperedCylinder(double width, double val1, double val2,
281  double ValMin, double ValMax, double *x, double *y,
282  double *z, int light);
283  void drawArrow3d(double x, double y, double z, double dx, double dy,
284  double dz, double length, int light);
285  void drawVector(int Type, int Fill, double x, double y, double z, double dx,
286  double dy, double dz, int light);
287  void drawBox(double xmin, double ymin, double zmin, double xmax, double ymax,
288  double zmax, bool labels = true);
289  void drawPlaneInBoundingBox(double xmin, double ymin, double zmin,
290  double xmax, double ymax, double zmax, double a,
291  double b, double c, double d, int shade = 0);
292  // dynamic pointer to a transient geometry drawing function
293  static void setDrawGeomTransientFunction(void (*fct)(void *));
294  static void (*drawGeomTransient)(void *);
295 };
296 
298 public:
299  double win[3]; // window coordinates
300  double wnr[3]; // world coordinates BEFORE rotation
301  double s[3]; // scaling state when the event was recorded
302  double t[3]; // translation state when the event was recorded
304  {
305  for(int i = 0; i < 3; i++) win[i] = wnr[i] = s[i] = t[i] = 0.;
306  }
307  mousePosition(const mousePosition &instance)
308  {
309  for(int i = 0; i < 3; i++) {
310  win[i] = instance.win[i];
311  wnr[i] = instance.wnr[i];
312  s[i] = instance.s[i];
313  t[i] = instance.t[i];
314  }
315  }
316  void set(drawContext *ctx, int x, int y)
317  {
318  for(int i = 0; i < 3; i++) {
319  s[i] = ctx->s[i];
320  t[i] = ctx->t[i];
321  }
322  win[0] = (double)x;
323  win[1] = (double)y;
324  win[2] = 0.;
325 
326  wnr[0] = (ctx->vxmin +
327  win[0] / (double)ctx->viewport[2] * (ctx->vxmax - ctx->vxmin)) /
328  ctx->s[0] -
329  ctx->t[0] + ctx->t_init[0] / ctx->s[0];
330  wnr[1] = (ctx->vymax -
331  win[1] / (double)ctx->viewport[3] * (ctx->vymax - ctx->vymin)) /
332  ctx->s[1] -
333  ctx->t[1] + ctx->t_init[1] / ctx->s[1];
334  wnr[2] = 0.;
335  }
337  {
338  // compute the equivalent translation to apply *after* the scaling so that
339  // the scaling is done around the point which was clicked:
340  ctx->t[0] = t[0] * (s[0] / ctx->s[0]) - wnr[0] * (1. - (s[0] / ctx->s[0]));
341  ctx->t[1] = t[1] * (s[1] / ctx->s[1]) - wnr[1] * (1. - (s[1] / ctx->s[1]));
342  }
343 };
344 
345 #endif
drawContext::fix2dCoordinates
int fix2dCoordinates(double *x, double *y)
Definition: drawGraph2d.cpp:15
drawContext::pixel_equiv_y
double pixel_equiv_y
Definition: drawContext.h:141
drawContext::setQuaternion
void setQuaternion(double p1x, double p1y, double p2x, double p2y)
Definition: drawContext.cpp:211
drawContext::highResolutionPixelFactor
double highResolutionPixelFactor()
Definition: drawContext.cpp:73
drawContext::rot
double rot[16]
Definition: drawContext.h:138
drawContext::showAll
void showAll()
Definition: drawContext.h:197
PView
Definition: PView.h:27
drawContext::RenderMode
RenderMode
Definition: drawContext.h:145
drawContextGlobal::getFontAlign
virtual int getFontAlign(const char *alignstr)
Definition: drawContext.h:102
drawContext::viewport2World
void viewport2World(double vp[3], double xyz[3])
Definition: drawContext.cpp:861
drawContext::_hiddenViews
std::set< PView * > _hiddenViews
Definition: drawContext.h:127
drawContext::generateTextureForImage
bool generateTextureForImage(const std::string &name, int page, GLuint &imageTexture, GLuint &imageW, GLuint &imageH)
Definition: drawContext.cpp:402
drawTransform
Definition: drawContext.h:46
drawContext::draw3d
void draw3d()
Definition: drawContext.cpp:277
global
Definition: OctreeInternals.h:40
drawContext::hide
void hide(PView *v)
Definition: drawContext.h:186
drawContext::_bgImageW
GLuint _bgImageW
Definition: drawContext.h:128
GFace
Definition: GFace.h:33
drawContext::initRenderModel
void initRenderModel()
Definition: drawContext.cpp:696
angle
double angle(const SVector3 &a, const SVector3 &b)
Definition: SVector3.h:157
drawContext::drawStringCenter
void drawStringCenter(const std::string &s, double x, double y, double z, int line_num=0)
Definition: drawGlyph.cpp:147
drawContext::drawScales
void drawScales()
Definition: drawScales.cpp:272
c
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
Definition: discreteFrechetDistance.cpp:15
mousePosition::set
void set(drawContext *ctx, int x, int y)
Definition: drawContext.h:316
drawContext::_imageTextures
std::map< std::string, imgtex > _imageTextures
Definition: drawContext.h:130
drawContext::_quadric
GLUquadricObj * _quadric
Definition: drawContext.h:124
drawContextGlobal::getFontName
virtual const char * getFontName(int index)
Definition: drawContext.h:101
mousePosition::win
double win[3]
Definition: drawContext.h:299
drawContext::drawText2d
void drawText2d()
Definition: drawGraph2d.cpp:34
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
SPoint3
Definition: SPoint3.h:14
drawContext::drawBackgroundGradient
void drawBackgroundGradient()
Definition: drawContext.cpp:355
drawContext::drawTrackball
void drawTrackball()
imgtex::w
GLuint w
Definition: drawContext.h:116
drawContext::draw2d
void draw2d()
Definition: drawContext.cpp:329
drawContextGlobal::setFont
virtual void setFont(int fontid, int fontsize)
Definition: drawContext.h:104
drawContext::setTransform
void setTransform(drawTransform *transform)
Definition: drawContext.h:171
drawContextGlobal::drawCurrentOpenglWindow
virtual void drawCurrentOpenglWindow(bool make_current)
Definition: drawContext.h:98
drawContext::drawMesh
void drawMesh()
Definition: drawMesh.cpp:680
drawContext::transform
void transform(double &x, double &y, double &z)
Definition: drawContext.h:173
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
drawContext::recenterForRotationCenterChange
void recenterForRotationCenterChange(SPoint3 newRotationCenter)
Definition: drawContext.cpp:1119
edges
static int edges[6][2]
Definition: meshGRegionLocalMeshMod.cpp:23
drawContext::model
double model[16]
Definition: drawContext.h:142
drawContext::GMSH_RENDER
@ GMSH_RENDER
Definition: drawContext.h:145
drawContext::transformTwoForm
void transformTwoForm(double &x, double &y, double &z)
Definition: drawContext.h:181
drawContext::setGlobal
static void setGlobal(drawContextGlobal *global)
Definition: drawContext.h:169
drawContext::global
static drawContextGlobal * global()
Definition: drawContext.cpp:85
drawTransform::transformOneForm
virtual void transformOneForm(double &x, double &y, double &z)
Definition: drawContext.h:51
drawContext::t
double t[3]
Definition: drawContext.h:135
drawContext::drawGeom
void drawGeom()
Definition: drawGeom.cpp:480
drawContext::drawEllipsoid
void drawEllipsoid(double x, double y, double z, float v0[3], float v1[3], float v2[3], int light)
Definition: drawGlyph.cpp:428
mousePosition::wnr
double wnr[3]
Definition: drawContext.h:300
drawContext::addQuaternionFromAxisAndAngle
void addQuaternionFromAxisAndAngle(double axis[3], double angle)
Definition: drawContext.cpp:203
drawContext::s
double s[3]
Definition: drawContext.h:135
drawContextGlobal::draw
virtual void draw(bool rateLimited=true)
Definition: drawContext.h:97
drawContext::drawTaperedCylinder
void drawTaperedCylinder(double width, double val1, double val2, double ValMin, double ValMax, double *x, double *y, double *z, int light)
Definition: drawGlyph.cpp:455
drawContext::drawPlaneInBoundingBox
void drawPlaneInBoundingBox(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, double a, double b, double c, double d, int shade=0)
Definition: drawGlyph.cpp:824
drawContext::createQuadricsAndDisplayLists
void createQuadricsAndDisplayLists()
Definition: drawContext.cpp:103
drawTransformScaled::drawTransformScaled
drawTransformScaled(double mat[3][3], double tra[3]=nullptr)
Definition: drawContext.h:62
drawContext::GMSH_SELECT
@ GMSH_SELECT
Definition: drawContext.h:145
drawTransformScaled::_tra
double _tra[3]
Definition: drawContext.h:59
drawContext::vymax
double vymax
Definition: drawContext.h:140
drawContext::drawStringRight
void drawStringRight(const std::string &s, double x, double y, double z, int line_num=0)
Definition: drawGlyph.cpp:154
drawContext::transformOneForm
void transformOneForm(double &x, double &y, double &z)
Definition: drawContext.h:177
drawContextGlobal::getFontIndex
virtual int getFontIndex(const char *fontname)
Definition: drawContext.h:99
GVertex
Definition: GVertex.h:23
drawContext::setQuaternionFromEulerAngles
void setQuaternionFromEulerAngles()
Definition: drawContext.cpp:219
drawContext::isVisible
bool isVisible(GModel *m)
Definition: drawContext.h:202
drawTransformScaled::setMatrix
virtual void setMatrix(double mat[3][3], double tra[3]=nullptr)
Definition: drawContext.h:66
SBoundingBox3d.h
drawContext::_global
static drawContextGlobal * _global
Definition: drawContext.h:122
drawContextGlobal
Definition: drawContext.h:93
drawContext::r
double r[3]
Definition: drawContext.h:134
drawContext::drawAxes
void drawAxes()
Definition: drawAxes.cpp:295
drawContext::_bgImageH
GLuint _bgImageH
Definition: drawContext.h:128
drawContextGlobal::drawContextGlobal
drawContextGlobal()
Definition: drawContext.h:95
GModel
Definition: GModel.h:44
drawContextGlobal::getName
virtual std::string getName()
Definition: drawContext.h:111
imgtex::h
GLuint h
Definition: drawContext.h:116
drawContext::drawGeomTransient
static void(* drawGeomTransient)(void *)
Definition: drawContext.h:294
drawContext::drawAxis
void drawAxis(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, int nticks, int mikado)
Definition: drawAxes.cpp:146
mousePosition::mousePosition
mousePosition(const mousePosition &instance)
Definition: drawContext.h:307
drawContext::_transform
drawTransform * _transform
Definition: drawContext.h:123
drawContext::initPosition
void initPosition(bool saveMatrices)
Definition: drawContext.cpp:786
drawContext::vymin
double vymin
Definition: drawContext.h:140
drawContext::initProjection
void initProjection(int xpick=0, int ypick=0, int wpick=0, int hpick=0)
Definition: drawContext.cpp:554
drawContext::world2Viewport
void world2Viewport(double xyz[3], double vp[3])
Definition: drawContext.cpp:872
drawContext::_hiddenModels
std::set< GModel * > _hiddenModels
Definition: drawContext.h:126
drawContext::render_mode
int render_mode
Definition: drawContext.h:146
drawContext::show
void show(PView *v)
Definition: drawContext.h:192
drawContext
Definition: drawContext.h:120
drawContext::_displayLists
GLuint _displayLists
Definition: drawContext.h:125
drawContextGlobal::getStringDescent
virtual int getStringDescent()
Definition: drawContext.h:107
MElement
Definition: MElement.h:30
drawTransform::transformTwoForm
virtual void transformTwoForm(double &x, double &y, double &z)
Definition: drawContext.h:52
drawTransform::drawTransform
drawTransform()
Definition: drawContext.h:48
drawContextGlobal::getFontSize
virtual int getFontSize()
Definition: drawContext.h:103
drawContext::_openglWindow
openglWindow * _openglWindow
Definition: drawContext.h:129
mousePosition::t
double t[3]
Definition: drawContext.h:302
drawContext::camera
Camera camera
Definition: drawContext.h:133
imgtex::imgtex
imgtex()
Definition: drawContext.h:117
drawContext::vxmax
double vxmax
Definition: drawContext.h:140
drawContext::drawPost
void drawPost()
Definition: drawPost.cpp:615
GRegion
Definition: GRegion.h:28
drawContext::vxmin
double vxmin
Definition: drawContext.h:140
drawContext::drawBox
void drawBox(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, bool labels=true)
Definition: drawGlyph.cpp:787
drawContext::setEulerAnglesFromRotationMatrix
void setEulerAnglesFromRotationMatrix()
Definition: drawContext.cpp:235
drawContext::unproject
void unproject(double winx, double winy, double p[3], double d[3])
Definition: drawContext.cpp:827
drawContext::getTransform
drawTransform * getTransform()
Definition: drawContext.h:172
drawContext::setDrawGeomTransientFunction
static void setDrawGeomTransientFunction(void(*fct)(void *))
Definition: drawContext.cpp:38
mousePosition::mousePosition
mousePosition()
Definition: drawContext.h:303
length
double length(Quaternion &q)
Definition: Camera.cpp:346
drawContext::invalidateQuadricsAndDisplayLists
void invalidateQuadricsAndDisplayLists()
Definition: drawContext.cpp:91
drawTransformScaled
Definition: drawContext.h:56
drawContextGlobal::getStringHeight
virtual int getStringHeight()
Definition: drawContext.h:106
Camera.h
drawContextGlobal::getStringWidth
virtual double getStringWidth(const char *str)
Definition: drawContext.h:105
drawContextGlobal::flushString
virtual void flushString()
Definition: drawContext.h:110
drawContext::copyViewAttributes
void copyViewAttributes(drawContext *other)
Definition: drawContext.h:153
mousePosition::recenter
void recenter(drawContext *ctx)
Definition: drawContext.h:336
drawContext::select
bool select(int type, bool multiple, bool mesh, bool post, int x, int y, int w, int h, std::vector< GVertex * > &vertices, std::vector< GEdge * > &edges, std::vector< GFace * > &faces, std::vector< GRegion * > &regions, std::vector< MElement * > &elements, std::vector< SPoint2 > &points, std::vector< PView * > &views)
Definition: drawContext.cpp:917
drawContext::buildRotationMatrix
void buildRotationMatrix()
Definition: drawContext.cpp:157
drawContext::drawArrow3d
void drawArrow3d(double x, double y, double z, double dx, double dy, double dz, double length, int light)
Definition: drawGlyph.cpp:689
drawContext::isVisible
bool isVisible(PView *v)
Definition: drawContext.h:206
z
const double z
Definition: GaussQuadratureQuad.cpp:56
drawContext::proj
double proj[16]
Definition: drawContext.h:143
drawTransform::transform
virtual void transform(double &x, double &y, double &z)
Definition: drawContext.h:50
drawContext::viewport
int viewport[4]
Definition: drawContext.h:137
GEdge
Definition: GEdge.h:26
drawContext::GMSH_FEEDBACK
@ GMSH_FEEDBACK
Definition: drawContext.h:145
drawContext::_bgImageTexture
GLuint _bgImageTexture
Definition: drawContext.h:128
Camera
Definition: Camera.h:46
drawTransformScaled::_mat
double _mat[3][3]
Definition: drawContext.h:58
drawContext::show
void show(GModel *m)
Definition: drawContext.h:187
drawContext::invalidateBgImageTexture
void invalidateBgImageTexture()
Definition: drawContext.cpp:396
drawContext::quaternion
double quaternion[4]
Definition: drawContext.h:136
drawContextGlobal::getFontEnum
virtual int getFontEnum(int index)
Definition: drawContext.h:100
drawContext::drawCylinder
void drawCylinder(double width, double *x, double *y, double *z, int light)
Definition: drawGlyph.cpp:490
drawContext::drawContext
drawContext(openglWindow *window=nullptr, drawTransform *transform=nullptr)
Definition: drawContext.cpp:45
drawContext::addQuaternion
void addQuaternion(double p1x, double p1y, double p2x, double p2y)
Definition: drawContext.cpp:195
drawContext::pixel_equiv_x
double pixel_equiv_x
Definition: drawContext.h:141
drawContext::drawGraph2d
void drawGraph2d(bool inModelCoordinates)
Definition: drawGraph2d.cpp:574
imgtex
Definition: drawContext.h:114
drawContextGlobal::drawString
virtual void drawString(const char *str)
Definition: drawContext.h:108
drawContext::~drawContext
~drawContext()
Definition: drawContext.cpp:71
drawContext::drawBackgroundImage
void drawBackgroundImage(bool moving)
Definition: drawContext.cpp:464
drawContextGlobal::resetFontTextures
virtual void resetFontTextures()
Definition: drawContext.h:109
mousePosition
Definition: drawContext.h:297
drawContext::drawImage
void drawImage(const std::string &s, double x, double y, double z, int align=0)
Definition: drawGlyph.cpp:180
mousePosition::s
double s[3]
Definition: drawContext.h:301
imgtex::tex
GLuint tex
Definition: drawContext.h:116
SBoundingBox3d
Definition: SBoundingBox3d.h:21
drawContext::drawSphere
void drawSphere(double R, double x, double y, double z, int n1, int n2, int light)
Definition: drawGlyph.cpp:390
drawContext::t_init
double t_init[3]
Definition: drawContext.h:139
drawContext::drawEllipse
void drawEllipse(double x, double y, double z, float v0[3], float v1[3], int light)
Definition: drawGlyph.cpp:401
drawContext::drawCube
void drawCube(double x, double y, double z, double val[9], int light)
Definition: drawGlyph.cpp:316
drawTransform::setMatrix
virtual void setMatrix(double mat[3][3], double tra[3])
Definition: drawContext.h:53
drawTransform::~drawTransform
virtual ~drawTransform()
Definition: drawContext.h:49
drawContext::drawSmallAxes
void drawSmallAxes()
Definition: drawAxes.cpp:364
SPoint2.h
faces
static int faces[4][3]
Definition: meshGRegionDelaunayInsertion.cpp:165
drawTransformScaled::transform
virtual void transform(double &x, double &y, double &z)
Definition: drawContext.h:76
drawContextGlobal::~drawContextGlobal
virtual ~drawContextGlobal()
Definition: drawContext.h:96
drawContext::hide
void hide(GModel *m)
Definition: drawContext.h:185