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

Go to the SVN repository for this file.

1 /* $Id: glrender.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: Bob Falk
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 #include <gui/opengl/glrender.hpp>
34 #include <gui/opengl/glresmgr.hpp>
35 #include <gui/opengl/glutils.hpp>
37 #include <gui/utils/matrix4.hpp>
38 
39 // define this to cause OpenGL actual state to be updated immediately on state
40 // update calls (useful if some code is using rendermanager and some isn't, and
41 // state is shared between the two)
42 #define GL_STATE_UPDATE
43 
45 
46 ////////////////////////////////////////////////////////////////////////////////
47 ////////////////////////////////////////////////////////////////////////////////
48 
50 {
52 }
53 
55 {
58 }
59 
60 void CGlRender::Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
61 {
62  CRenderCommon::Viewport(x, y, width, height);
63  glViewport(x, y, width, height);
64 }
65 
67 {
68  glMatrixMode(mode);
70 }
71 
73 {
74  glPushMatrix();
75 }
77 {
78  glPopMatrix();
79  if (m_MatrixMode == GL_MODELVIEW) {
80  glGetFloatv(GL_MODELVIEW_MATRIX, m_ModelView.GetData());
82  }
83 }
85 {
86  glLoadIdentity();
87  if (m_MatrixMode == GL_MODELVIEW) {
89  }
90 }
91 void CGlRender::LoadMatrixf(const GLfloat *m)
92 {
93  glLoadMatrixf(m);
94  if (m_MatrixMode == GL_MODELVIEW) {
95  glGetFloatv(GL_MODELVIEW_MATRIX, m_ModelView.GetData());
97  }
98 }
99 void CGlRender::LoadMatrixd(const GLdouble* m)
100 {
101  glLoadMatrixd(m);
102  if (m_MatrixMode == GL_MODELVIEW) {
103  glGetFloatv(GL_MODELVIEW_MATRIX, m_ModelView.GetData());
105  }
106 }
107 void CGlRender::MultMatrixf(const GLfloat* m)
108 {
109  glMultMatrixf(m);
110  if (m_MatrixMode == GL_MODELVIEW) {
111  glGetFloatv(GL_MODELVIEW_MATRIX, m_ModelView.GetData());
113  }
114 }
115 void CGlRender::MultMatrixd(const GLdouble* m)
116 {
117  glMultMatrixd(m);
118  if (m_MatrixMode == GL_MODELVIEW) {
119  glGetFloatv(GL_MODELVIEW_MATRIX, m_ModelView.GetData());
121  }
122 }
123 
125 {
126  CMatrix4<float> m;
127  glGetFloatv(GL_PROJECTION_MATRIX, m.GetData());
128  m.Transpose();
129  return m;
130 }
131 
132 void CGlRender::GetModelViewMatrix(GLdouble* m) const
133 {
134  glGetDoublev(GL_MODELVIEW_MATRIX, m);
135 }
136 
137 void CGlRender::GetProjectionMatrix(GLdouble* m) const
138 {
139  glGetDoublev(GL_PROJECTION_MATRIX, m);
140 }
141 
142 void CGlRender::Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
143 {
144  glRotated(angle, x, y, z);
145  if (m_MatrixMode == GL_MODELVIEW) {
146  glGetFloatv(GL_MODELVIEW_MATRIX, m_ModelView.GetData());
148  }
149 }
150 void CGlRender::Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
151 {
152  glRotatef(angle, x, y, z);
153  if (m_MatrixMode == GL_MODELVIEW) {
154  glGetFloatv(GL_MODELVIEW_MATRIX, m_ModelView.GetData());
156  }
157 }
158 void CGlRender::Scaled(GLdouble x, GLdouble y, GLdouble z)
159 {
160  glScaled(x, y, z);
161  if (m_MatrixMode == GL_MODELVIEW) {
162  glGetFloatv(GL_MODELVIEW_MATRIX, m_ModelView.GetData());
164  }
165 }
166 void CGlRender::Scalef(GLfloat x, GLfloat y, GLfloat z)
167 {
168  glScalef(x, y, z);
169  if (m_MatrixMode == GL_MODELVIEW) {
170  glGetFloatv(GL_MODELVIEW_MATRIX, m_ModelView.GetData());
172  }
173 }
174 void CGlRender::Translated(GLdouble x, GLdouble y, GLdouble z)
175 {
176  glTranslated(x, y, z);
177  if (m_MatrixMode == GL_MODELVIEW) {
178  glGetFloatv(GL_MODELVIEW_MATRIX, m_ModelView.GetData());
180  }
181 }
182 void CGlRender::Translatef(GLfloat x, GLfloat y, GLfloat z)
183 {
184  glTranslatef(x, y, z);
185  if (m_MatrixMode == GL_MODELVIEW) {
186  glGetFloatv(GL_MODELVIEW_MATRIX, m_ModelView.GetData());
188  }
189 }
190 
191 void CGlRender::Ortho(GLdouble left, GLdouble right,
192  GLdouble bottom, GLdouble top,
193  GLdouble nearVal, GLdouble farVal)
194 {
195  glOrtho(left, right, bottom, top, nearVal, farVal);
196 }
197 void CGlRender::Perspective(GLdouble fovy, GLdouble aspect,
198  GLdouble zNear, GLdouble zFar)
199 {
200  gluPerspective(fovy, aspect, zNear, zFar);
201 }
202 
203 ///
204 /// All the OpenGL state commands set both the state object AND update
205 /// the opengl state. The OpenGL state call should be unnecessary, but
206 /// as long as the product has both rendermanager-based rendering
207 /// and non-rendermanager based rendering, keeping the state as it
208 /// was before should help prevent visual artifacts in non-rendermanager code.
209 ///
210 
211 void CGlRender::PushAttrib(GLbitfield mask)
212 {
213  pair<GLbitfield,CGlState> s(mask, m_State.GetNCObject());
214 
215  // The smallest maximum stacksize for attributes in OpenGL is 16, so we'll
216  // give a warning when that number is exceeded (but not an error)
217  if (m_PushedState.size() > 16) {
218  LOG_POST(Warning << "Attribute stack size exceeded in CGlRender: " << m_PushedState.size()+1 );
219  return;
220  }
221 
222  m_PushedState.push_back(s);
223 }
224 
226 {
227  if (m_PushedState.size() == 0) {
228  LOG_POST(Error << "Attribute stack underflow - no state to pop");
229  return;
230  }
231 
232  pair<GLbitfield,CGlState> s = m_PushedState.back();
233  m_PushedState.pop_back();
234 
235  // if the pushed attribute flags were not for all attributes (GL_ALL_ATTRIB_BITS),
236  // then merge the ones which were not included in the push (and which are defined
237  // in CGlState).
238  m_State->MergeStates(s.second, s.first);
239 }
240 
241 void CGlRender::Enable(GLenum glstate)
242 {
243  if (m_CurrentMode != GL_NONE) {
244  LOG_POST(Error << "CGlRender::Enable() called between Begin() and End()" << m_CurrentMode);
245  }
246 
247 #ifdef GL_STATE_UPDATE
248  glEnable(glstate);
249 #endif
250 
251  m_State->Enable(glstate);
252 }
253 void CGlRender::Disable(GLenum glstate)
254 {
255  if (m_CurrentMode != GL_NONE) {
256  LOG_POST(Error << "CGlRender::Disable() called between Begin() and End()");
257  }
258 
259 #ifdef GL_STATE_UPDATE
260  glDisable(glstate);
261 #endif
262 
263  m_State->Disable(glstate);
264 }
265 
266 void CGlRender::LineWidth(GLfloat w)
267 {
268  if (m_CurrentMode != GL_NONE) {
269  LOG_POST(Error << "CGlRender::LineWidth() called between Begin() and End()");
270  }
271 
272 #ifdef GL_STATE_UPDATE
273  glLineWidth(w);
274 #endif
275 
276  m_State->LineWidth(w);
277 }
278 void CGlRender::PointSize(GLfloat s)
279 {
280  if (m_CurrentMode != GL_NONE) {
281  LOG_POST(Error << "CGlRender::PointSize() called between Begin() and End()");
282  }
283 
284 #ifdef GL_STATE_UPDATE
285  glPointSize(s);
286 #endif
287 
288  m_State->PointSize(s);
289 }
291 {
292  if (m_CurrentMode != GL_NONE) {
293  LOG_POST(Error << "CGlRender::ShadeModel() called between Begin() and End()");
294  }
295 
296 #ifdef GL_STATE_UPDATE
297  glShadeModel(mode);
298 #endif
299 
301 }
302 
303 void CGlRender::Scissor(GLint x, GLint y,
304  GLsizei width, GLsizei height)
305 {
306  if (m_CurrentMode != GL_NONE) {
307  LOG_POST(Error << "CGlRender::ShadeModel() called between Begin() and End()");
308  }
309 
310 #ifdef GL_STATE_UPDATE
311  glScissor(x,y,width,height);
312 #endif
313 
314  m_State->Scissor(x,y,width,height);
315 }
316 
317 void CGlRender::ColorMask(GLboolean red,
318  GLboolean green,
319  GLboolean blue,
320  GLboolean alpha)
321 {
322  if (m_CurrentMode != GL_NONE) {
323  LOG_POST(Error << "CGlRender::ColorMask() called between Begin() and End()");
324  }
325 
326 #ifdef GL_STATE_UPDATE
327  glColorMask(red, green, blue, alpha);
328 #endif
329 
330  m_State->ColorMask(red, green, blue, alpha);
331 }
332 void CGlRender::PolygonMode(GLenum face, GLenum mode)
333 {
334  if (m_CurrentMode != GL_NONE) {
335  LOG_POST(Error << "CGlRender::PolygonMode() called between Begin() and End()");
336  }
337 
338 #ifdef GL_STATE_UPDATE
339  glPolygonMode(face, mode);
340 #endif
341 
342  m_State->PolygonMode(face, mode);
343 }
344 void CGlRender::LineStipple(GLint factor, GLushort pattern)
345 {
346  if (m_CurrentMode != GL_NONE) {
347  LOG_POST(Error << "CGlRender::LineStipple() called between Begin() and End()");
348  }
349 
350 #ifdef GL_STATE_UPDATE
351  glLineStipple(factor, pattern);
352 #endif
353 
354  m_State->LineStipple(factor, pattern);
355 }
357 {
358  if (m_CurrentMode != GL_NONE) {
359  LOG_POST(Error << "CGlRender::PolygonStipple() called between Begin() and End()");
360  }
361 
362 #ifdef GL_STATE_UPDATE
363  glPolygonStipple(mask);
364 #endif
365 
367 }
368 void CGlRender::BlendFunc(GLenum sfactor, GLenum dfactor)
369 {
370  if (m_CurrentMode != GL_NONE) {
371  LOG_POST(Error << "CGlRender::BlendFunc() called between Begin() and End()");
372  }
373 
374 #ifdef GL_STATE_UPDATE
375  glBlendFunc(sfactor, dfactor);
376 #endif
377 
378  m_State->BlendFunc(sfactor, dfactor);
379 }
380 
381 void CGlRender::TexEnvi(GLenum target, GLenum pname, GLint param)
382 {
383  glTexEnvi(target, pname, param);
384 }
385 
386 void CGlRender::BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
387  GLenum srcAlpha, GLenum dstAlpha)
388 {
389  if (m_CurrentMode != GL_NONE) {
390  LOG_POST(Error << "CGlRender::BlendFuncSeparate() called between Begin() and End()");
391  }
392 
393 #ifdef GL_STATE_UPDATE
394  // not 1.1
395 #endif
396 
397  m_State->BlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
398 }
399 
401 {
402  if (m_CurrentMode != GL_NONE) {
403  LOG_POST(Error << "CGlRender::BlendColor() called between Begin() and End()");
404  }
405 
406 #ifdef GL_STATE_UPDATE
407  // Not 1.1
408  //glBlendColor(c.GetRed(), c.GetGreen(), c.GetBlue(), c.GetAlpha());
409 #endif
410 
411  m_State->BlendColor(c);
412 }
413 
415 {
416  if (m_CurrentMode != GL_NONE) {
417  LOG_POST(Error << "CGlRender::ScaleInvarient() called between Begin() and End()");
418  }
419  m_State->ScaleInvarient(b, scale);
420 }
421 
423 {
424  if (m_CurrentMode != GL_NONE) {
425  LOG_POST(Error << "CGlRender::ScaleFactor() called between Begin() and End()");
426  }
427  m_State->ScaleFactor(scale);
428 }
429 
431 {
432  if (m_CurrentMode != GL_NONE) {
433  LOG_POST(Error << "CGlRender::LineJoinStyle() called between Begin() and End()");
434  }
436 }
437 
439 {
440  if (m_CurrentMode != GL_NONE) {
441  LOG_POST(Error << "CGlRender::LineCapStyle() called between Begin() and End()");
442  }
443  m_State->LineCapStyle(c);
444 }
445 
447 {
448  if (m_CurrentMode != GL_NONE) {
449  LOG_POST(Error << "CGlRender::PdfShadeStyle() called between Begin() and End()");
450  }
452 }
453 
454 void CGlRender11::Hint(GLenum target, GLenum mode)
455 {
456  glHint(target, mode);
457 }
458 
459 void CGlRender20::UseProgram(GLuint program)
460 {
461  glUseProgram(program);
462 }
463 
464 void CGlRender20::Hint(GLenum target, GLenum mode)
465 {
466  glHint(target, mode);
467 }
468 
469 
470 
471 
472 
473 
474 
475 
476 
477 
478 
479 
480 
481 
482 
483 ////////////////////////////////////////////////////////////////////////////////
484 ////////////////////////////////////////////////////////////////////////////////
485 
487 {
488  glBegin(mode);
489 }
490 
491 void CGlRenderDebug::Vertex3f(GLfloat x, GLfloat y, GLfloat z)
492 {
493  glVertex3f(x,y,z);
494 }
495 
497 {
498  glRectC(rc);
499 }
500 
501 void CGlRenderDebug::Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
502 {
503  //glRectf(x1, y1, x2, y2);
504  glBegin(GL_QUADS);
505  glVertex2f(x1, y1);
506  glVertex2f(x2, y1);
507  glVertex2f(x2, y2);
508  glVertex2f(x1, y2);
509  glEnd();
510 }
511 
512 void CGlRenderDebug::Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
513 {
514  glColor4f(r,g,b,a);
515 }
516 
517 void CGlRenderDebug::TexCoord2f(GLfloat s, GLfloat t)
518 {
519  glTexCoord2f(s, t);
520 }
521 
523 {
524  glEnd();
525 }
526 
528  const CRgbaColor& color)
529 {
530  m_CurrentFont = font;
531  m_TextColor = color;
532 
534 }
535 
537 {
538  m_CurrentFont = font;
540 
542 
543  /*
544  // Bitmap fonts now may crash on linux, so remove from debug feature.
545  if (font->GetFontFace() == CGlTextureFont::eFontFace_Courier) {
546  m_BitmapFont.SetFontFace(CGlBitmapFont::eFontFace_Courier);
547  }
548  else if (font->GetFontFace() == CGlTextureFont::eFontFace_Helvetica) {
549  m_BitmapFont.SetFontFace(CGlBitmapFont::eFontFace_Helvetica);
550  }
551  else if (font->GetFontFace() == CGlTextureFont::eFontFace_Lucida) {
552  m_BitmapFont.SetFontFace(CGlBitmapFont::eFontFace_Lucida);
553  }
554  else if (font->GetFontFace() == CGlTextureFont::eFontFace_TimesRoman) {
555  m_BitmapFont.SetFontFace(CGlBitmapFont::eFontFace_TimesRoman);
556  }
557  else if (font->GetFontFace() == CGlTextureFont::eFontFace_Fixed) {
558  m_BitmapFont.SetFontFace(CGlBitmapFont::eFontFace_Fixed);
559  }
560 
561  m_BitmapFont.SetFontSize((CGlBitmapFont::EFontSize)font->GetFontSize());
562  */
563 }
564 
566 {
569 }
570 
572  const char* text,
573  TModelUnit rotate_degrees)
574 {
575  // bitmap fonts can crash in release mode on linux...
576  // m_BitmapFont.TextOut(x, y, text);
577 
578  if (m_CurrentFont == NULL) {
579  LOG_POST(Error << "Unable to write text - must call BeginText() first");
580  return;
581  }
582 
583  glColor4fv(m_TextColor.GetColorArray());
584  m_CurrentFont->WriteText(x, y, text, rotate_degrees);
585 }
586 
588  TModelUnit width, TModelUnit height,
589  const char* text,
592  TModelUnit rotate_degrees)
593 {
594  //m_BitmapFont.TextOut(x, y, width, height, text, align, trunc);
596  m_CurrentFont->WriteText(x, y, width, height, text, align, trunc, rotate_degrees);
598 }
599 
600 
601 ///
602 /// All the OpenGL state commands set both the state object AND update
603 /// the opengl state. The OpenGL state call should be unnecessary, but
604 /// as long as the product has both rendermanager-based rendering
605 /// and non-rendermanager based rendering, keeping the state as it
606 /// was before should help prevent visual artifacts in non-rendermanager code.
607 ///
608 
610 {
611  glPushAttrib(mask);
612 }
613 
615 {
616  glPopAttrib();
617 }
618 
619 void CGlRenderDebug::Enable(GLenum glstate)
620 {
621  glEnable(glstate);
622 }
623 
624 void CGlRenderDebug::Disable(GLenum glstate)
625 {
626  glDisable(glstate);
627 }
628 
629 void CGlRenderDebug::Hint(GLenum target, GLenum mode)
630 {
631  glHint(target, mode);
632 }
633 
635 {
636  glLineWidth(w);
637 }
638 
640 {
641  glPointSize(s);
642 }
643 
645 {
646  glShadeModel(mode);
647 }
648 
649 void CGlRenderDebug::Scissor(GLint x, GLint y,
650  GLsizei width, GLsizei height)
651 {
652  glScissor(x,y,width,height);
653 }
654 
655 void CGlRenderDebug::ColorMask(GLboolean red,
656  GLboolean green,
657  GLboolean blue,
658  GLboolean alpha)
659 {
660  glColorMask(red, green, blue, alpha);
661 }
662 
663 void CGlRenderDebug::PolygonMode(GLenum face, GLenum mode)
664 {
665  glPolygonMode(face, mode);
666 }
667 
668 void CGlRenderDebug::LineStipple(GLint factor, GLushort pattern)
669 {
670  glLineStipple(factor, pattern);
671 }
672 
674 {
675  glPolygonStipple(mask);
676 }
677 
678 void CGlRenderDebug::BlendFunc(GLenum sfactor, GLenum dfactor)
679 {
680  glBlendFunc(sfactor, dfactor);
681 }
682 
683 void CGlRenderDebug::BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
684  GLenum srcAlpha, GLenum dstAlpha)
685 {
686 }
687 
689 {
690 }
691 
693 {
694 }
695 
697 {
698 }
699 
701 {
702 }
703 
705 {
706 }
707 
709 {
710 }
711 
712 
ncbi::TMaskedQueryRegions mask
CRef< CGlState > m_State
state used by all nodes
CRgbaColor m_TextColor
color and alpha for text only (other GL options do not apply to text)
GLenum m_CurrentMode
rendering mode from Begin()
virtual void Clear()
Clear/delete any graphics/OpenGL memory.
const CGlTextureFont * m_CurrentFont
text parameters
virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
GLenum m_MatrixMode
current modelview matrix and matrix mode
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
static int trunc
Definition: array_out.c:8
#define NULL
Definition: ncbistd.hpp:225
#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
void Transpose()
Definition: matrix4.hpp:347
void Identity()
Definition: matrix4.hpp:373
const T * GetData() const
Definition: matrix4.hpp:103
virtual void Hint(GLenum target, GLenum mode)
Definition: glrender.cpp:464
GLdouble TModelUnit
Definition: gltypes.hpp:48
virtual void BeginText(const CGlTextureFont *font, const CRgbaColor &color)
Text interface.
Definition: glrender.cpp:527
virtual void PushAttrib(GLbitfield mask)
These commands just forward their parameters to the render managers CGlState object m_State.
Definition: glrender.cpp:211
virtual void PopAttrib()
Definition: glrender.cpp:614
virtual void Enable(GLenum glstate)
Definition: glrender.cpp:241
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
CMatrix4< float > m_ModelView
current modelview matrix and matrix mode
Definition: glrender.hpp:273
virtual void BlendFunc(GLenum sfactor, GLenum dfactor)
Options to be used when GL_BLEND is enabled.
Definition: glrender.cpp:678
vector< pair< GLbitfield, CGlState > > m_PushedState
state pushed/poped by PushAttrib/PopAttrib and the corresponding bitmask
Definition: glrender.hpp:269
virtual void PopMatrix()
Definition: glrender.cpp:76
virtual void PointSize(GLfloat s)
Set point size for drawing: glPointSize()
Definition: glstate.cpp:419
virtual void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
Color{3,4}{f,d}{v} commands are defined above....
Definition: glrender.cpp:317
virtual void Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
Definition: glrender.cpp:60
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 void PolygonStipple(GLubyte *mask)
Set polygon stipple pattern: glPolygonStipple(). Deprecated in gl 3.2+.
Definition: glrender.cpp:673
virtual void Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
Definition: glrender.cpp:150
virtual void PushMatrix()
Definition: glrender.cpp:72
virtual void ScaleFactor(const CVect2< TModelUnit > &scale)
Definition: glrender.cpp:696
virtual void Disable(GLenum glstate)
glDisable()
Definition: glrender.cpp:624
virtual void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
Set the color mask (glColorMask)
Definition: glstate.cpp:496
virtual void ScaleFactor(const CVect2< TModelUnit > &scale)
Definition: glrender.cpp:422
virtual void ScaleInvarient(bool b, CVect2< TModelUnit > scale=CVect2< TModelUnit >(TModelUnit(1), TModelUnit(1)))
Generic rendering options not specfically tied to OpenGL (or pdf..)
Definition: glstate.cpp:593
virtual void LineStipple(GLint factor, GLushort pattern)
Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+.
Definition: glstate.cpp:534
virtual void PointSize(GLfloat s)
Set point size for drawing: glPointSize()
Definition: glrender.cpp:639
virtual void BlendColor(const CRgbaColor &c)
glBlendColor() - Optional constant color for blending
Definition: glstate.cpp:555
virtual void MatrixMode(GLenum mode)
Definition: glrender.cpp:66
void glRectC(const TModelRect &rc)
Definition: glutils.hpp:165
virtual void Disable(GLenum glstate)
glDisable()
Definition: glrender.cpp:253
virtual void MultMatrixf(const GLfloat *m)
Definition: glrender.cpp:107
virtual void ShadeModel(GLenum mode)
Set shade model for default lighting: glShadeModel(GL_FLAT or GL_SMOOTH)
Definition: glrender.cpp:644
virtual void Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
Rect() functions also do Begin() and End() (as in OpenGL)
Definition: glrender.cpp:501
virtual void TexCoord2f(GLfloat s, GLfloat t)
Texture coords.
Definition: glrender.cpp:517
virtual void ScaleInvarient(bool b, CVect2< TModelUnit > scale=CVect2< TModelUnit >(TModelUnit(1), TModelUnit(1)))
Definition: glrender.cpp:692
void WriteText(TModelUnit x, TModelUnit y, const char *text, TModelUnit rotate_degrees=0.0) const
Write text at specified model coords.
virtual void ScaleFactor(const CVect2< TModelUnit > &scale)
After setting scale invarient rendering need to update the scale whenever projection matrix changes.
Definition: glstate.hpp:326
virtual void LineJoinStyle(IGlState::ELineJoinStyle s)
PDF-specific rendering state.
Definition: glrender.cpp:430
virtual void Scalef(GLfloat x, GLfloat y, GLfloat z)
Definition: glrender.cpp:166
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 End()
Finish rendering (create buffer and send to renderer)
Definition: glrender.cpp:522
virtual void BlendColor(const CRgbaColor &c)
Definition: glrender.cpp:400
virtual void UseProgram(GLuint program)
Set OpenGL shader program. Other subclasses will not implement this.
Definition: glrender.cpp:459
virtual void PolygonMode(GLenum face, GLenum mode)
Set the polygon rasterization mode.
Definition: glrender.cpp:663
virtual void Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
Definition: glrender.cpp:142
virtual void LineWidth(GLfloat w)
Set line width for drawing: glLineWidth()
Definition: glstate.cpp:410
virtual void RectC(const TModelRect &rc)
Definition: glrender.cpp:496
virtual void LineWidth(GLfloat w)
Set line width for drawing: glLineWidth()
Definition: glrender.cpp:634
virtual void BlendColor(const CRgbaColor &c)
Definition: glrender.cpp:688
virtual void Clear()
Clear/delete any graphics/OpenGL memory.
Definition: glrender.cpp:54
virtual void PointSize(GLfloat s)
Set point size for drawing: glPointSize()
Definition: glrender.cpp:278
virtual void LineCapStyle(ELineCapStyle c)
Set line cap ending style (pdf only)
Definition: glstate.cpp:610
virtual void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
Definition: glrender.cpp:683
virtual void Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
Definition: glrender.cpp:512
virtual void TexEnvi(GLenum target, GLenum pname, GLint param)
Definition: glrender.cpp:381
virtual void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
Color{3,4}{f,d}{v} commands are defined above....
Definition: glrender.cpp:655
virtual void EndText()
Pops matrices and attributes after writing text.
Definition: glrender.cpp:565
virtual void PdfShadeStyle(IGlState::EPdfShadeStyle s)
Set (override defualt) shading style for polygons.
Definition: glrender.cpp:446
virtual void LoadMatrixd(const GLdouble *m)
Definition: glrender.cpp:99
virtual void MultMatrixd(const GLdouble *m)
Definition: glrender.cpp:115
virtual void Vertex3f(GLfloat x, GLfloat y, GLfloat z)
Polygon rendering interface - render similar to matching OpenGL calls.
Definition: glrender.cpp:491
virtual void Hint(GLenum target, GLenum mode)
Definition: glrender.cpp:629
virtual void PushAttrib(GLbitfield mask)
Rendering state interface.
Definition: glrender.cpp:609
virtual void Translated(GLdouble x, GLdouble y, GLdouble z)
Definition: glrender.cpp:174
void BeginText() const
WriteText interface The WriteText functions produce the same results as TextOut but they are more eff...
virtual void PdfShadeStyle(IGlState::EPdfShadeStyle s)
Set (override defualt) shading style for polygons.
Definition: glrender.cpp:708
virtual void Disable(GLenum glstate)
glDisable() all options in m_Disabled
Definition: glstate.cpp:380
virtual void ScaleInvarient(bool b, CVect2< TModelUnit > scale=CVect2< TModelUnit >(TModelUnit(1), TModelUnit(1)))
Definition: glrender.cpp:414
virtual void LineCapStyle(IGlState::ELineCapStyle c)
Set line cap ending style (pdf only)
Definition: glrender.cpp:704
virtual void WriteText(TModelUnit x, TModelUnit y, const char *text, TModelUnit rotate_degrees=0.0)
Write text at specified model coords.
Definition: glrender.cpp:571
virtual void LoadMatrixf(const GLfloat *m)
Definition: glrender.cpp:91
virtual void PolygonStipple(GLubyte *mask)
Set polygon stipple pattern: glPolygonStipple(). Deprecated in gl 3.2+.
Definition: glrender.cpp:356
virtual void LineStipple(GLint factor, GLushort pattern)
Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+.
Definition: glrender.cpp:668
virtual void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
Definition: glrender.cpp:386
ELineCapStyle
Definition: glstate.hpp:78
virtual void LineCapStyle(IGlState::ELineCapStyle c)
Set line cap ending style (pdf only)
Definition: glrender.cpp:438
CRgbaColor GetColor() const
Definition: glstate.hpp:259
virtual void BlendFunc(GLenum sfactor, GLenum dfactor)
Options to be used when GL_BLEND is enabled.
Definition: glrender.cpp:368
virtual void Translatef(GLfloat x, GLfloat y, GLfloat z)
Definition: glrender.cpp:182
void EndText() const
Pops matrices and attributes after writing text.
virtual void Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal)
Definition: glrender.cpp:191
EPdfShadeStyle
Definition: glstate.hpp:79
virtual CMatrix4< float > GetProjectionMatrix() const
Definition: glrender.cpp:124
virtual void LineStipple(GLint factor, GLushort pattern)
Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+.
Definition: glrender.cpp:344
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 LineWidth(GLfloat w)
Set line width for drawing: glLineWidth()
Definition: glrender.cpp:266
virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
Set clipping window: glScissor(x,y,width,height)
Definition: glrender.cpp:649
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 LoadIdentity()
Definition: glrender.cpp:84
virtual void PopAttrib()
Definition: glrender.cpp:225
virtual void PolygonMode(GLenum face, GLenum mode)
Set the polygon rasterization mode.
Definition: glrender.cpp:332
virtual void ShadeModel(GLenum mode)
Set shade model for default lighting: glShadeModel(GL_FLAT or GL_SMOOTH)
Definition: glrender.cpp:290
virtual void Perspective(GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar)
Definition: glrender.cpp:197
virtual void Hint(GLenum target, GLenum mode)
Definition: glrender.cpp:454
virtual void LineJoinStyle(IGlState::ELineJoinStyle s)
PDF-specific rendering state.
Definition: glrender.cpp:700
virtual void PolygonStipple(GLubyte *mask)
Set polygon stipple pattern: glPolygonStipple(). Deprecated in gl 3.2+.
Definition: glstate.cpp:548
virtual void Enable(GLenum glstate)
Definition: glrender.cpp:619
ETruncate
Definition: glfont.hpp:62
virtual CMatrix4< float > GetModelViewMatrix() const
Definition: glrender.hpp:209
virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
Set clipping window: glScissor(x,y,width,height)
Definition: glrender.cpp:303
int TAlign
Definition: glfont.hpp:113
virtual void Scaled(GLdouble x, GLdouble y, GLdouble z)
Definition: glrender.cpp:158
virtual void Begin(GLenum mode)
Start rendering.
Definition: glrender.cpp:486
const float * GetColorArray(void) const
Access the color array directly.
Definition: rgba_color.hpp:394
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
n background color
static void text(MDB_val *v)
Definition: mdb_dump.c:62
mdb_mode_t mode
Definition: lmdb++.h:38
unsigned int a
Definition: ncbi_localip.c:102
EIPRangeType t
Definition: ncbi_localip.c:101
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
Definition: thrddgri.c:44
Modified on Fri Sep 20 14:57:48 2024 by modify_doxy.py rev. 669887