NCBI C++ ToolKit
render_vector.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: render_vector.cpp 45793 2020-12-01 19:38:57Z asztalos $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Roman Katargin
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
35 
37 
38 static void s_MakeIdentity(double m[16])
39 {
40  m[0] = m[5] = m[10] = m[15] = 1;
41  m[1] = m[2] = m[3] = m[4] = 0;
42  m[6] = m[7] = m[8] = m[9] = 0;
43  m[11] = m[12] = m[13] = m[14] = 0;
44 }
45 
47 {
48  Matrix m;
49  s_MakeIdentity(m.m);
50  m_ProjectionMatrix.push_front(m);
51  m_ModelViewMatrix.push_front(m);
52 }
53 
55 {
57 }
58 
60 {
61  switch (m_MatrixMode) {
62  case GL_PROJECTION:
63  m_ProjectionMatrix.push_front(m_ProjectionMatrix.front());
64  break;
65  case GL_MODELVIEW:
66  m_ModelViewMatrix.push_front(m_ModelViewMatrix.front());
67  break;
68  }
69 }
70 
72 {
73  switch (m_MatrixMode) {
74  case GL_PROJECTION:
75  if (m_ProjectionMatrix.size() > 1)
76  m_ProjectionMatrix.pop_front();
77  break;
78  case GL_MODELVIEW:
79  if (m_ModelViewMatrix.size() > 1)
80  m_ModelViewMatrix.pop_front();
81  break;
82  }
83 }
84 
86 {
87  Matrix m;
88  s_MakeIdentity(m.m);
89  x_LoadMatrix(m);
90 }
91 
93 {
94  switch (m_MatrixMode) {
95  case GL_PROJECTION:
96  m_ProjectionMatrix.front() = m;
97  break;
98  case GL_MODELVIEW:
99  m_ModelViewMatrix.front() = m;
100  break;
101  }
102 }
103 
105 {
106  Matrix m;
107  switch (m_MatrixMode) {
108  case GL_PROJECTION:
109  m = m_ProjectionMatrix.front();
110  x_MultMatrix(m_ProjectionMatrix.front(), m, t);
111  break;
112  case GL_MODELVIEW:
113  m = m_ModelViewMatrix.front();
114  x_MultMatrix(m_ModelViewMatrix.front(), m, t);
115  break;
116  }
117 }
118 
119 void CRenderVector::x_InitMatrixd(Matrix& d, const GLdouble* s)
120 {
121  d.m[0] = s[0];
122  d.m[1] = s[1];
123  d.m[2] = s[2];
124  d.m[3] = s[3];
125  d.m[4] = s[4];
126  d.m[5] = s[5];
127  d.m[6] = s[6];
128  d.m[7] = s[7];
129  d.m[8] = s[8];
130  d.m[9] = s[9];
131  d.m[10] = s[10];
132  d.m[11] = s[11];
133  d.m[12] = s[12];
134  d.m[13] = s[13];
135  d.m[14] = s[14];
136  d.m[15] = s[15];
137 }
138 
139 void CRenderVector::x_InitMatrixf(Matrix& d, const GLfloat* s)
140 {
141  d.m[0] = s[0];
142  d.m[1] = s[1];
143  d.m[2] = s[2];
144  d.m[3] = s[3];
145  d.m[4] = s[4];
146  d.m[5] = s[5];
147  d.m[6] = s[6];
148  d.m[7] = s[7];
149  d.m[8] = s[8];
150  d.m[9] = s[9];
151  d.m[10] = s[10];
152  d.m[11] = s[11];
153  d.m[12] = s[12];
154  d.m[13] = s[13];
155  d.m[14] = s[14];
156  d.m[15] = s[15];
157 }
158 
160 {
161  return CMatrix4<float>(
162  (float)d.m[0], (float)d.m[4], (float)d.m[8], (float)d.m[12],
163  (float)d.m[1], (float)d.m[5], (float)d.m[9], (float)d.m[13],
164  (float)d.m[2], (float)d.m[6], (float)d.m[10], (float)d.m[14],
165  (float)d.m[3], (float)d.m[7], (float)d.m[11], (float)d.m[15]);
166 }
167 
168 void CRenderVector::x_FromMatrix(const Matrix& d, GLdouble* res)
169 {
170  res[0] = d.m[0];
171  res[1] = d.m[1];
172  res[2] = d.m[2];
173  res[3] = d.m[3];
174  res[4] = d.m[4];
175  res[5] = d.m[5];
176  res[6] = d.m[6];
177  res[7] = d.m[7];
178  res[8] = d.m[8];
179  res[9] = d.m[9];
180  res[10] = d.m[10];
181  res[11] = d.m[11];
182  res[12] = d.m[12];
183  res[13] = d.m[13];
184  res[14] = d.m[14];
185  res[15] = d.m[15];
186 }
187 
188 void CRenderVector::x_MultMatrix(Matrix& d, const Matrix& s1, const Matrix& s2)
189 {
190  d.m[0] = s1.m[0] * s2.m[0] + s1.m[4] * s2.m[1] + s1.m[8] * s2.m[2] + s1.m[12] * s2.m[3];
191  d.m[1] = s1.m[1] * s2.m[0] + s1.m[5] * s2.m[1] + s1.m[9] * s2.m[2] + s1.m[13] * s2.m[3];
192  d.m[2] = s1.m[2] * s2.m[0] + s1.m[6] * s2.m[1] + s1.m[10] * s2.m[2] + s1.m[14] * s2.m[3];
193  d.m[3] = s1.m[3] * s2.m[0] + s1.m[7] * s2.m[1] + s1.m[11] * s2.m[2] + s1.m[15] * s2.m[3];
194 
195  d.m[4] = s1.m[0] * s2.m[4] + s1.m[4] * s2.m[5] + s1.m[8] * s2.m[6] + s1.m[12] * s2.m[7];
196  d.m[5] = s1.m[1] * s2.m[4] + s1.m[5] * s2.m[5] + s1.m[9] * s2.m[6] + s1.m[13] * s2.m[7];
197  d.m[6] = s1.m[2] * s2.m[4] + s1.m[6] * s2.m[5] + s1.m[10] * s2.m[6] + s1.m[14] * s2.m[7];
198  d.m[7] = s1.m[3] * s2.m[4] + s1.m[7] * s2.m[5] + s1.m[11] * s2.m[6] + s1.m[15] * s2.m[7];
199 
200  d.m[8] = s1.m[0] * s2.m[8] + s1.m[4] * s2.m[9] + s1.m[8] * s2.m[10] + s1.m[12] * s2.m[11];
201  d.m[9] = s1.m[1] * s2.m[8] + s1.m[5] * s2.m[9] + s1.m[9] * s2.m[10] + s1.m[13] * s2.m[11];
202  d.m[10] = s1.m[2] * s2.m[8] + s1.m[6] * s2.m[9] + s1.m[10] * s2.m[10] + s1.m[14] * s2.m[11];
203  d.m[11] = s1.m[3] * s2.m[8] + s1.m[7] * s2.m[9] + s1.m[11] * s2.m[10] + s1.m[15] * s2.m[11];
204 
205  d.m[12] = s1.m[0] * s2.m[12] + s1.m[4] * s2.m[13] + s1.m[8] * s2.m[14] + s1.m[12] * s2.m[15];
206  d.m[13] = s1.m[1] * s2.m[12] + s1.m[5] * s2.m[13] + s1.m[9] * s2.m[14] + s1.m[13] * s2.m[15];
207  d.m[14] = s1.m[2] * s2.m[12] + s1.m[6] * s2.m[13] + s1.m[10] * s2.m[14] + s1.m[14] * s2.m[15];
208  d.m[15] = s1.m[3] * s2.m[12] + s1.m[7] * s2.m[13] + s1.m[11] * s2.m[14] + s1.m[15] * s2.m[15];
209 }
210 
211 void CRenderVector::LoadMatrixf(const GLfloat *m)
212 {
213  Matrix t;
214  x_InitMatrixf(t, m);
215  x_LoadMatrix(t);
216 }
217 
218 void CRenderVector::LoadMatrixd(const GLdouble* m)
219 {
220  Matrix t;
221  x_InitMatrixd(t, m);
222  x_LoadMatrix(t);
223 }
224 
226 {
227  return x_FromMatrix(m_ModelViewMatrix.front());
228 }
229 
231 {
232  return x_FromMatrix(m_ProjectionMatrix.front());
233 }
234 
235 void CRenderVector::GetModelViewMatrix(GLdouble* m) const
236 {
237  x_FromMatrix(m_ModelViewMatrix.front(), m);
238 }
239 
240 void CRenderVector::GetProjectionMatrix(GLdouble* m) const
241 {
242  x_FromMatrix(m_ProjectionMatrix.front(), m);
243 }
244 
245 void CRenderVector::Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
246 {
247  double mod = sqrt(x*x + y * y + z * z);
248  if (mod == 0)
249  return;
250  x /= mod; y /= mod; z /= mod;
251  double r = angle * 3.141592653589793238463 / 360.0;
252  double c = cos(r), s = sin(r);
253 
254  double v[4] = { s*x, s*y, s*z, c };
255  double d[16]
256  {
257  1 - 2 * (v[1] * v[1] + v[2] * v[2]),
258  2 * (v[0] * v[1] + v[2] * v[3]),
259  2 * (v[0] * v[2] - v[1] * v[3]), 0,
260 
261  2 * (v[0] * v[1] - v[2] * v[3]),
262  1 - 2 * (v[2] * v[2] + v[0] * v[0]),
263  2 * (v[1] * v[2] + v[0] * v[3]), 0,
264 
265  2 * (v[2] * v[0] + v[1] * v[3]),
266  2 * (v[1] * v[2] - v[0] * v[3]),
267  1 - 2 * (v[1] * v[1] + v[0] * v[0]), 0,
268 
269  0, 0, 0, 1
270  };
271 
272  Matrix m;
273  x_InitMatrixd(m, d);
274  x_ApplyTransf(m);
275 }
276 
277 void CRenderVector::Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
278 {
279  Rotated(angle, x, y, z);
280 }
281 
282 void CRenderVector::Scaled(GLdouble x, GLdouble y, GLdouble z)
283 {
284  Matrix m;
285  s_MakeIdentity(m.m);
286 
287  m.m[0] = x;
288  m.m[5] = y;
289  m.m[10] = z;
290 
291  x_ApplyTransf(m);
292 }
293 
294 void CRenderVector::Scalef(GLfloat x, GLfloat y, GLfloat z)
295 {
296  Scaled(x, y, z);
297 }
298 
299 void CRenderVector::Translated(GLdouble x, GLdouble y, GLdouble z)
300 {
301  Matrix m;
302  s_MakeIdentity(m.m);
303 
304  m.m[12] = x;
305  m.m[13] = y;
306  m.m[14] = z;
307 
308  x_ApplyTransf(m);
309 }
310 
311 void CRenderVector::Translatef(GLfloat x, GLfloat y, GLfloat z)
312 {
313  Translated(x, y, z);
314 }
315 
316 void CRenderVector::Ortho(GLdouble left, GLdouble right,
317  GLdouble bottom, GLdouble top,
318  GLdouble nearVal, GLdouble farVal)
319 {
320  Matrix m;
321  s_MakeIdentity(m.m);
322 
323  m.m[0] = 2.0 / (right - left);
324  m.m[5] = 2.0 / (top - bottom);
325  m.m[10] = -2.0 / (farVal - nearVal);
326 
327  m.m[12] = -(right + left) / (right - left);
328  m.m[13] = -(top + bottom) / (top - bottom);
329  m.m[14] = -(farVal + nearVal) / (farVal - nearVal);
330 
331  x_ApplyTransf(m);
332 }
333 
335  IGlFont::EMetric metric,
336  const char* text,
337  int len) const
338 {
339  // special case if the font is the basis for pdf rendering - compute metrics based
340  // on corresponding, non-bitmap font
341  if (font->IsBitmapFont()) {
342  // Get the base file name (face name will be the correspnoding texture font face, not
343  // the bitmap face)
344  string face = CGlTextureFont::GetFontFileForFace(font->GetFontFace());
345 
346  // Create a new texture font
347  CGlTextureFont non_bitmap_font(face, font->GetFontSize());
348 
349  // And use that to get our metrics. Alternatively, we could create/find a library that returns
350  // true pdf font metrics.
351  return non_bitmap_font.GetMetric(metric, text, len);
352  }
353  else {
354  return font->GetMetric(metric, text, len);
355  }
356 }
357 
359 {
360  if (font->IsBitmapFont()) {
361  string face = CGlTextureFont::GetFontFileForFace(font->GetFontFace());
362 
363  // Create a new texture font
364  CGlTextureFont non_bitmap_font(face, font->GetFontSize());
365 
366  return non_bitmap_font.TextWidth(text);
367  }
368  else {
369  return font->TextWidth(text);
370  }
371 }
372 
374 {
375  if (font->IsBitmapFont()) {
376  string face = CGlTextureFont::GetFontFileForFace(font->GetFontFace());
377 
378  // Create a new texture font
379  CGlTextureFont non_bitmap_font(face, font->GetFontSize());
380 
381  return non_bitmap_font.TextHeight();
382  }
383  else {
384  return font->TextHeight();
385  }
386 }
387 
389 {
390  if (font->IsBitmapFont()) {
391  string face = CGlTextureFont::GetFontFileForFace(font->GetFontFace());
392 
393  // Create a new texture font
394  CGlTextureFont non_bitmap_font(face, font->GetFontSize());
395 
396  return non_bitmap_font.GetFontDescender();
397  }
398  else {
399  return font->GetFontDescender();
400  }
401 }
402 
404 {
405  if (font->IsBitmapFont()) {
406  string face = CGlTextureFont::GetFontFileForFace(font->GetFontFace());
407 
408  // Create a new texture font
409  CGlTextureFont non_bitmap_font(face, font->GetFontSize());
410 
411  return non_bitmap_font.GetAdvance(c);
412  }
413  else {
414  return font->GetAdvance(c);
415  }
416 }
417 
418 
419 TModelUnit CRenderVector::GetMaxWidth(const CGlTextureFont* font, int max_num) const
420 {
421  if (font->IsBitmapFont()) {
422  string face = CGlTextureFont::GetFontFileForFace(font->GetFontFace());
423 
424  // Create a new texture font
425  CGlTextureFont non_bitmap_font(face, font->GetFontSize());
426 
427  return non_bitmap_font.GetMaxWidth(max_num);
428  }
429  else {
430  return font->GetMaxWidth(max_num);
431  }
432 }
433 
435 {
436  pair<GLbitfield, CGlState> s(mask, m_State.GetNCObject());
437 
438  // The smallest maximum stacksize for attributes in OpenGL is 16, so we'll
439  // give a warning when that number is exceeded (but not an error)
440  if (m_PushedState.size() > 16) {
441  LOG_POST(Warning << "Attribute stack size exceeded in CGlRender: " << m_PushedState.size() + 1);
442  return;
443  }
444 
445  m_PushedState.push_back(s);
446 }
447 
449 {
450  if (m_PushedState.size() == 0) {
451  LOG_POST(Error << "Attribute stack underflow - no state to pop");
452  return;
453  }
454 
455  pair<GLbitfield, CGlState> s = m_PushedState.back();
456  m_PushedState.pop_back();
457 
458  // if the pushed attribute flags were not for all attributes (GL_ALL_ATTRIB_BITS),
459  // then merge the ones which were not included in the push (and which are defined
460  // in CGlState).
461  m_State->MergeStates(s.second, s.first);
462 }
463 
464 void CRenderVector::Enable(GLenum glstate)
465 {
466  if (m_CurrentMode != GL_NONE) {
467  LOG_POST(Error << "CRenderVector::Enable() called between Begin() and End()" << m_CurrentMode);
468  }
469 
470  m_State->Enable(glstate);
471 }
472 
473 void CRenderVector::Disable(GLenum glstate)
474 {
475  if (m_CurrentMode != GL_NONE) {
476  LOG_POST(Error << "CRenderVector::Disable() called between Begin() and End()");
477  }
478 
479  m_State->Disable(glstate);
480 }
481 
483 {
484  if (m_CurrentMode != GL_NONE) {
485  LOG_POST(Error << "CRenderVector::LineWidth() called between Begin() and End()");
486  }
487 
488  m_State->LineWidth(w);
489 }
491 {
492  if (m_CurrentMode != GL_NONE) {
493  LOG_POST(Error << "CRenderVector::PointSize() called between Begin() and End()");
494  }
495 
496  m_State->PointSize(s);
497 }
498 
500 {
501  if (m_CurrentMode != GL_NONE) {
502  LOG_POST(Error << "CRenderVector::ShadeModel() called between Begin() and End()");
503  }
504 
506 }
507 
508 void CRenderVector::Scissor(GLint x, GLint y,
509  GLsizei width, GLsizei height)
510 {
511  if (m_CurrentMode != GL_NONE) {
512  LOG_POST(Error << "CRenderVector::Scissor() called between Begin() and End()");
513  }
514 
515  m_State->Scissor(x, y, width, height);
516 }
517 
518 void CRenderVector::ColorMask(GLboolean red,
519  GLboolean green,
520  GLboolean blue,
521  GLboolean alpha)
522 {
523  if (m_CurrentMode != GL_NONE) {
524  LOG_POST(Error << "CRenderVector::ColorMask() called between Begin() and End()");
525  }
526 
527  m_State->ColorMask(red, green, blue, alpha);
528 }
529 
530 void CRenderVector::PolygonMode(GLenum face, GLenum mode)
531 {
532  if (m_CurrentMode != GL_NONE) {
533  LOG_POST(Error << "CRenderVector::PolygonMode() called between Begin() and End()");
534  }
535 
536  m_State->PolygonMode(face, mode);
537 }
538 
539 void CRenderVector::LineStipple(GLint factor, GLushort pattern)
540 {
541  if (m_CurrentMode != GL_NONE) {
542  LOG_POST(Error << "CRenderVector::LineStipple() called between Begin() and End()");
543  }
544 
545  m_State->LineStipple(factor, pattern);
546 }
547 
549 {
550  if (m_CurrentMode != GL_NONE) {
551  LOG_POST(Error << "CRenderVector::PolygonStipple() called between Begin() and End()");
552  }
553 
555 }
556 
557 void CRenderVector::BlendFunc(GLenum sfactor, GLenum dfactor)
558 {
559  if (m_CurrentMode != GL_NONE) {
560  LOG_POST(Error << "CRenderVector::BlendFunc() called between Begin() and End()");
561  }
562 
563  m_State->BlendFunc(sfactor, dfactor);
564 }
565 
566 void CRenderVector::TexEnvi(GLenum target, GLenum pname, GLint param)
567 {
568 }
569 
570 void CRenderVector::BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
571  GLenum srcAlpha, GLenum dstAlpha)
572 {
573  if (m_CurrentMode != GL_NONE) {
574  LOG_POST(Error << "CRenderVector::BlendFuncSeparate() called between Begin() and End()");
575  }
576 
577  m_State->BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
578 }
579 
581 {
582  if (m_CurrentMode != GL_NONE) {
583  LOG_POST(Error << "CRenderVector::LineJoinStyle() called between Begin() and End()");
584  }
586 }
587 
589 {
590  if (m_CurrentMode != GL_NONE) {
591  LOG_POST(Error << "CRenderVector::LineCapStyle() called between Begin() and End()");
592  }
593  m_State->LineCapStyle(c);
594 }
595 
597 {
598  if (m_CurrentMode != GL_NONE) {
599  LOG_POST(Error << "CRenderVector::PdfShadeStyle() called between Begin() and End()");
600  }
602 }
603 
ncbi::TMaskedQueryRegions mask
CRef< CGlState > m_State
state used by all nodes
GLenum m_CurrentMode
rendering mode from Begin()
GLenum m_MatrixMode
current modelview matrix and matrix mode
virtual void Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal)
virtual void LineCapStyle(IGlState::ELineCapStyle c)
Set line cap ending style (pdf only)
virtual TModelUnit GetMaxWidth(const CGlTextureFont *font, int max_num) const
virtual void Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
virtual void Translated(GLdouble x, GLdouble y, GLdouble z)
virtual void Disable(GLenum glstate)
glDisable()
virtual void BlendFunc(GLenum sfactor, GLenum dfactor)
Options to be used when GL_BLEND is enabled.
virtual CMatrix4< float > GetModelViewMatrix() const
virtual void Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
virtual TModelUnit TextWidth(const CGlTextureFont *font, const char *text) const
virtual void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
Color{3,4}{f,d}{v} commands are defined above....
virtual void LoadMatrixf(const GLfloat *m)
virtual TModelUnit GetAdvance(const CGlTextureFont *font, char c) const
virtual void PushMatrix()
virtual void PolygonMode(GLenum face, GLenum mode)
Set the polygon rasterization mode.
virtual TModelUnit GetMetric(const CGlTextureFont *font, IGlFont::EMetric metric, const char *text=NULL, int len=-1) const
Get font metrics - metrics differ when the font under opengl has been replaced by a bitmap font for (...
virtual void LineWidth(GLfloat w)
Set line width for drawing: glLineWidth()
virtual void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
virtual TModelUnit GetFontDescender(const CGlTextureFont *font) const
virtual void Translatef(GLfloat x, GLfloat y, GLfloat z)
list< Matrix > m_ModelViewMatrix
static void x_MultMatrix(Matrix &d, const Matrix &s1, const Matrix &s2)
virtual void MatrixMode(GLenum mode)
virtual void LineJoinStyle(IGlState::ELineJoinStyle s)
PDF-specific rendering state.
static void x_FromMatrix(const Matrix &d, GLdouble *res)
static void x_InitMatrixf(Matrix &d, const GLfloat *s)
virtual void PushAttrib(GLbitfield mask)
void x_ApplyTransf(const Matrix &t)
virtual void Enable(GLenum glstate)
virtual void PointSize(GLfloat s)
Set point size for drawing: glPointSize()
vector< pair< GLbitfield, CGlState > > m_PushedState
virtual void PdfShadeStyle(IGlState::EPdfShadeStyle s)
Set (override defualt) shading style for polygons.
list< Matrix > m_ProjectionMatrix
virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
Set clipping window: glScissor(x,y,width,height)
virtual void PopMatrix()
virtual void TexEnvi(GLenum target, GLenum pname, GLint param)
virtual void Scaled(GLdouble x, GLdouble y, GLdouble z)
virtual void LoadMatrixd(const GLdouble *m)
virtual void ShadeModel(GLenum mode)
Set shade model for default lighting: glShadeModel(GL_FLAT or GL_SMOOTH)
void x_LoadMatrix(const Matrix &m)
virtual void PolygonStipple(GLubyte *mask)
Set polygon stipple pattern: glPolygonStipple(). Deprecated in gl 3.2+.
virtual TModelUnit TextHeight(const CGlTextureFont *font) const
virtual CMatrix4< float > GetProjectionMatrix() const
static void x_InitMatrixd(Matrix &d, const GLdouble *s)
virtual void PopAttrib()
virtual void LineStipple(GLint factor, GLushort pattern)
Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+.
virtual void LoadIdentity()
virtual void Scalef(GLfloat x, GLfloat y, GLfloat z)
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
Definition: ncbidiag.hpp:226
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
GLdouble TModelUnit
Definition: gltypes.hpp:48
virtual void MergeStates(CGlState &s, GLbitfield mask)
This is for pushing and popping states - retain state variables not included in the mask (as per glPu...
Definition: glstate.cpp:173
ELineJoinStyle
Enumerators for non-enumerated state values (e.g. pdf-only state values)
Definition: glstate.hpp:77
virtual void PointSize(GLfloat s)
Set point size for drawing: glPointSize()
Definition: glstate.cpp:419
virtual void PdfShadeStyle(EPdfShadeStyle s)
In (our) PDF files there are two kinds of polys, flat ones (move to, line to, fill) which can have an...
Definition: glstate.cpp:618
virtual void PolygonMode(GLenum face, GLenum mode)
Set the polygon rasterization mode.
Definition: glstate.cpp:522
virtual bool IsBitmapFont() const
Returns true if the currently loaded font is from a bitmap.
virtual void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
Set the color mask (glColorMask)
Definition: glstate.cpp:496
virtual void LineStipple(GLint factor, GLushort pattern)
Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+.
Definition: glstate.cpp:534
virtual void Enable(GLenum glstate)
glEnable() all options in m_Enabled
Definition: glstate.cpp:356
virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
Set clipping window: glScissor(x,y,width,height)
Definition: glstate.cpp:437
virtual void LineWidth(GLfloat w)
Set line width for drawing: glLineWidth()
Definition: glstate.cpp:410
virtual TModelUnit GetFontDescender() const
static string GetFontFileForFace(EFontFace face)
Get font file for given face.
virtual void LineCapStyle(ELineCapStyle c)
Set line cap ending style (pdf only)
Definition: glstate.cpp:610
TModelUnit GetMaxWidth(int max_num) const
returns minimal space sufficient to render any number in [0, max_num].
virtual void Disable(GLenum glstate)
glDisable() all options in m_Disabled
Definition: glstate.cpp:380
EFontFace GetFontFace() const
ELineCapStyle
Definition: glstate.hpp:78
virtual TModelUnit GetMetric(EMetric metric, const char *text=NULL, int len=-1) const
virtual TModelUnit TextWidth(const char *text) const
Compute and return font metrics.
EPdfShadeStyle
Definition: glstate.hpp:79
virtual TModelUnit TextHeight(void) const
virtual void LineJoinStyle(ELineJoinStyle s)
PDF-specific rendering state.
Definition: glstate.cpp:602
virtual void ShadeModel(GLenum mode)
Set shade model for default lighting: glShadeModel(GL_FLAT or GL_SMOOTH)
Definition: glstate.cpp:428
virtual void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
Options for glBlendFuncSeparate, also enabled via Enable(GL_BLEND).
Definition: glstate.cpp:581
virtual void BlendFunc(GLenum sfactor, GLenum dfactor)
Options to be used when GL_BLEND is enabled.
Definition: glstate.cpp:562
virtual void PolygonStipple(GLubyte *mask)
Set polygon stipple pattern: glPolygonStipple(). Deprecated in gl 3.2+.
Definition: glstate.cpp:548
unsigned int GetFontSize() const
TModelUnit GetAdvance(char c) const
TObjectType & GetNCObject(void) const
Get object.
Definition: ncbiobj.hpp:1187
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
int len
static void text(MDB_val *v)
Definition: mdb_dump.c:62
mdb_mode_t mode
Definition: lmdb++.h:38
EIPRangeType t
Definition: ncbi_localip.c:101
Int mod(Int i, Int j)
Definition: njn_integer.hpp:67
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static void s_MakeIdentity(double m[16])
Modified on Sat Dec 02 09:23:26 2023 by modify_doxy.py rev. 669887