NCBI C++ ToolKit
glstate.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_OPENGL___GL_STATE__HPP
2 #define GUI_OPENGL___GL_STATE__HPP
3 
4 /* $Id: glstate.hpp 44821 2020-03-23 16:08:14Z evgeniev $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Bob Falk
30  *
31  * File Description:
32  *
33  */
34 
35 #include <gui/opengl.h>
36 #include <gui/gui.hpp>
37 
38 #include <gui/utils/vect2.hpp>
39 #include <gui/utils/vect3.hpp>
40 #include <gui/utils/vect4.hpp>
41 #include <gui/utils/matrix3.hpp>
42 #include <gui/utils/matrix4.hpp>
43 #include <gui/utils/rgba_color.hpp>
44 
45 #include <gui/opengl/gltypes.hpp>
46 #include <gui/opengl/globject.hpp>
47 
48 /** @addtogroup GUI_OPENGL
49  *
50  * @{
51  */
52 
54 
55 class I3DTexture;
56 
57 
58 /// Different api levels based on information from OpenGL driver. Most
59 /// will be 20 (2.0), but machines > 5 years old or with improperly installed
60 /// drivers can be as low as 1.1. Note that eOpenGL20 is used for 2.0 and above.
62 
63 //////////////////////////////////////////////////////////////////////////////
64 /// IGlState
65 /// Interface for setting values in CGlState. Abstraction allows other classes
66 /// (CGlRender) to present OpenGL 1.1 style state setting, e.g.
67 ///
68 /// class CGlRender : public IGlState ... {...};
69 ///
70 /// CGlRender gl;
71 /// gl.Color3f(0.0f, 1.0f, 0.0f);
72 ///
74 {
75 public:
76  /// Enumerators for non-enumerated state values (e.g. pdf-only state values)
77  enum ELineJoinStyle { eMiteredJoin=0, eRoundedJoin, eBeveledJoin };
78  enum ELineCapStyle { eButtCap=0, eRoundCap, eSquareCap };
79  enum EPdfShadeStyle { eFlat, eGouraud };
80 
81 public:
82  IGlState() {}
83  virtual ~IGlState() {}
84 
85  /// glEnable()
86  virtual void Enable(GLenum glstate) = 0;
87  /// glDisable()
88  virtual void Disable(GLenum glstate) = 0;
89 
90  /// Allow 1 texture for now (no multi-texturing)
91  virtual void SetTexture(I3DTexture* tex) = 0;
92 
93  /// Set line width for drawing: glLineWidth()
94  virtual void LineWidth(GLfloat w) = 0;
95 
96  /// Set point size for drawing: glPointSize()
97  virtual void PointSize(GLfloat s) = 0;
98 
99  /// Set shade model for default lighting: glShadeModel(GL_FLAT or GL_SMOOTH)
100  virtual void ShadeModel(GLenum mode) = 0;
101 
102  /// Set clipping window: glScissor(x,y,width,height)
103  virtual void Scissor(GLint x, GLint y,
104  GLsizei width, GLsizei height) = 0;
105 
106  /// Set current color (glColor{3,4}{f,d}{v,})
107  virtual void Color3f(GLfloat r, GLfloat g, GLfloat b) = 0;
108  virtual void Color3fv(const GLfloat* v) = 0;
109  virtual void Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) = 0;
110  virtual void Color4fv(const GLfloat* v) = 0;
111  virtual void Color3d(GLdouble r, GLdouble g, GLdouble b) = 0;
112  virtual void Color3dv(const GLdouble* v) = 0;
113  virtual void Color4d(GLdouble r, GLdouble g, GLdouble b, GLdouble a) = 0;
114  virtual void Color4dv(const GLdouble* v) = 0;
115  virtual void ColorC(const CRgbaColor& c) = 0;
116 
117  /// Set the color mask (glColorMask)
118  virtual void ColorMask(GLboolean red,
119  GLboolean green,
120  GLboolean blue,
121  GLboolean alpha) = 0;
122 
123  /// Set the polygon rasterization mode. For the first parameter, GL_FRONT
124  /// and GL_BACK are deprecated so better to use GL_FRONT_AND_BACK
125  virtual void PolygonMode(GLenum face, GLenum mode) = 0;
126 
127  /// Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+
128  virtual void LineStipple(GLint factor, GLushort pattern) = 0;
129 
130  /// Set polygon stipple pattern: glPolygonStipple(). Deprecated in gl 3.2+
131  virtual void PolygonStipple(GLubyte* mask) = 0;
132 
133 
134  ///
135  /// Options to be used when GL_BLEND is enabled.
136  /// The options used at render time will be those most recently
137  /// given by SetBlendFunc() OR SetBlendFuncSeparate() prior
138  /// to calling MakeCurrent().
139  ///
140 
141  /// Options for glBlendFunc. Enable via Enable(GL_BLEND);
142  virtual void BlendFunc(GLenum sfactor, GLenum dfactor) = 0;
143 
144  /// Options for glBlendFuncSeparate, also enabled via Enable(GL_BLEND).
145  virtual void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
146  GLenum srcAlpha, GLenum dstAlpha) = 0;
147  /// glBlendColor() - Optional constant color for blending
148  virtual void BlendColor(const CRgbaColor& c) = 0;
149 
150 
151  ///
152  /// Generic rendering options not specfically tied to OpenGL (or pdf..)
153  ///
154 
155  /// If true, object size is in pixels and will not get bigger/smaller with zoom
156  virtual void ScaleInvarient(bool b, CVect2<TModelUnit> scale =
158 
159  virtual void ScaleFactor(const CVect2<TModelUnit>& scale) = 0;
160 
161 
162 
163  ///
164  /// PDF-specific rendering state. Will not have any effect on OpenGL output
165  /// Note that in PDF files, some or all of these options may be settable
166  /// pre-element (attributes), not just per-object (uniform)
167  ///
168 
169  /// Set path joing style for lines (pdf-only)
170  virtual void LineJoinStyle(ELineJoinStyle s) = 0;
171 
172  /// Set line cap ending style (pdf only)
173  virtual void LineCapStyle(ELineCapStyle c) = 0;
174 
175  /// Set (override defualt) shading style for polygons
176  virtual void PdfShadeStyle(EPdfShadeStyle s) = 0;
177 
178  /// Resets the state back to the default one
179  virtual void Reset() = 0;
180 };
181 
182 //////////////////////////////////////////////////////////////////////////////
183 /// CGlState
184 /// Class to encapsulate Rendering state so that a set of user-selected GL
185 /// state options can be saved and then enabled as needed, particularly before
186 /// the rendering of some object.
187 ///
188 /// This class does not currently support the full range of GL options (but
189 /// those can be added as needed). State variables that apply to other output
190 /// formats PDF can be added here as well. When possible, states such as color
191 /// will apply to all output types.
192 ///
194  , public IGlState
195 {
196 public:
197  CGlState();
198  virtual ~CGlState() {}
199 
200  /// Set current options
201  void MakeCurrent(ERenderTarget target);
202 
203  /// Return to default state (TBD)
205  /// Updates all state variables with current openGL state (TBD)
206  void ReadState() {}
207  /// Computes difference between current state (e.g. from last ReadState()
208  /// and current OpenGL state (TBD)
209  void StateDelta() {}
210 
211  /// This is for pushing and popping states - retain state variables
212  /// not included in the mask (as per glPushAttrib)
213  virtual void MergeStates(CGlState& s, GLbitfield mask);
214 
215  /// glEnable() all options in m_Enabled
216  virtual void Enable(GLenum glstate);
217  /// Return true if option is in m_Enabled list for this state
218  bool IsEnabled(GLenum glstate) const;
219 
220  /// glDisable() all options in m_Disabled
221  virtual void Disable(GLenum glstate);
222  /// Return true if option is in m_Disabled list for this state
223  bool IsDisabled(GLenum glstate) const;
224 
225  virtual void SetTexture(I3DTexture* tex);
226  I3DTexture* GetTexture() { return m_Texture; }
227 
228  /// Set line width for drawing: glLineWidth()
229  virtual void LineWidth(GLfloat w);
230  GLfloat GetLineWidth() const { return m_LineWidth; }
231  bool LineWidthSet() const { return m_LineWidthSet; }
232 
233  /// Set point size for drawing: glPointSize()
234  virtual void PointSize(GLfloat s);
235  GLfloat GetPointSize() const { return m_PointSize; }
236  bool PointSizeSet() const { return m_PointSizeSet; }
237 
238  /// Set shade model for default lighting: glShadeModel(GL_FLAT or GL_SMOOTH)
239  virtual void ShadeModel(GLenum mode);
240  GLenum GetShadeModel() const { return m_ShadeModel; }
241  bool ShadeModelSet() const { return m_ShadeModelSet; }
242 
243  /// Set clipping window: glScissor(x,y,width,height)
244  virtual void Scissor(GLint x, GLint y,
245  GLsizei width, GLsizei height);
246  TVPRect GetScissor() const { return m_ScissorRect; }
247  bool ScissorSet() const { return m_ScissorSet; }
248 
249  /// Set current color (glColor{3,4}{f,d})
250  virtual void Color3f(GLfloat r, GLfloat g, GLfloat b);
251  virtual void Color3fv(const GLfloat* v);
252  virtual void Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
253  virtual void Color4fv(const GLfloat* v);
254  virtual void Color3d(GLdouble r, GLdouble g, GLdouble b);
255  virtual void Color3dv(const GLdouble* v);
256  virtual void Color4d(GLdouble r, GLdouble g, GLdouble b, GLdouble a);
257  virtual void Color4dv(const GLdouble* v);
258  virtual void ColorC(const CRgbaColor& c);
259  CRgbaColor GetColor() const { return m_Color; }
260  bool ColorSet() const { return m_ColorSet; }
261 
262  /// Set the color mask (glColorMask)
263  virtual void ColorMask(GLboolean red,
264  GLboolean green,
265  GLboolean blue,
266  GLboolean alpha);
267  void GetColorMask(GLboolean& red,
268  GLboolean& green,
269  GLboolean& blue,
270  GLboolean& alpha);
271  bool ColorMaskSet() const { return m_ColorMaskSet; }
272 
273  /// Set the polygon rasterization mode. For the first parameter, GL_FRONT
274  /// and GL_BACK are deprecated so better to use GL_FRONT_AND_BACK
275  virtual void PolygonMode(GLenum face, GLenum mode);
276  GLenum GetPolygonMode() const { return m_PolygonMode; }
277  bool PolygonModeSet() const { return m_PolygonModeSet; }
278 
279  /// Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+
280  virtual void LineStipple(GLint factor, GLushort pattern);
281  void GetLineStipple(GLint& factor, GLushort& pattern) const;
282  bool LineStippleSet() const { return m_LineStippleSet; }
283 
284  /// Set polygon stipple pattern: glPolygonStipple(). Deprecated in gl 3.2+
285  virtual void PolygonStipple(GLubyte* mask);
286  const GLubyte* GetPolygonStipple() const { return m_PolygonStippleMask; }
287  bool PolygonStippleSet() const { return m_PolygonStippleSet; }
288 
289 
290  ///
291  /// Options to be used when GL_BLEND is enabled.
292  /// The options used at render time will be those most recently
293  /// given by SetBlendFunc() OR SetBlendFuncSeparate() prior
294  /// to calling MakeCurrent().
295  ///
296 
297  /// Options for glBlendFunc. Enable via Enable(GL_BLEND);
298  virtual void BlendFunc(GLenum sfactor, GLenum dfactor);
299  GLenum GetSourceBlendFactor() const { return m_SourceBlendFactor; }
300  GLenum GetTargetBlendFactor() const { return m_TargetBlendFactor; }
301  bool BlendFuncSet() const { return m_BlendFuncSet; }
302 
303  /// Options for glBlendEquation
304  virtual void BlendEquation(GLenum mode);
305  bool BlendEquationSet() const { return m_BlendEquationSet; }
306 
307  /// Options for glBlendFuncSeparate, also enabled via Enable(GL_BLEND).
308  virtual void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
309  GLenum srcAlpha, GLenum dstAlpha);
310  /// glBlendColor() - Optional constant color for blending
311  virtual void BlendColor(const CRgbaColor& c);
312 
313 
314 
315  ///
316  /// Generic rendering options not specfically tied to OpenGL (or pdf..)
317  ///
318 
319  /// If true, object size is in pixels and will not get bigger/smaller with zoom
320  virtual void ScaleInvarient(bool b, CVect2<TModelUnit> scale =
322  bool GetScaleInvarient() const { return m_ScaleInvarient; }
323  bool ScaleInvarientSet() const { return m_ScaleInvarientSet; }
324  /// After setting scale invarient rendering need to update the scale whenever
325  /// projection matrix changes
326  virtual void ScaleFactor(const CVect2<TModelUnit>& scale) { m_ScaleFactor = scale; }
327  CVect2<TModelUnit> GetScaleFactor() const { return m_ScaleFactor; }
328 
329 
330 
331  ///
332  /// PDF-specific rendering state. Will not have any effect on OpenGL output
333  /// Note that in PDF files, some or all of these options may be settable
334  /// per-element (attributes), not just per-object (uniform)
335  ///
336 
337  /// Set path joing style for lines (pdf-only)
338  virtual void LineJoinStyle(ELineJoinStyle s);
339  ELineJoinStyle GetLineJoinStyle() const { return m_LineJoinStyle; }
340  bool LineJoinStyleSet() const { return m_LineJoinStyleSet; }
341 
342  /// Set line cap ending style (pdf only)
343  virtual void LineCapStyle(ELineCapStyle c);
344  ELineCapStyle GetLineCapStyle() const { return m_LineCapStyle; }
345  bool LineCapStyleSet() const { return m_LineCapStyleSet; }
346 
347  /// In (our) PDF files there are two kinds of polys, flat ones (move to,
348  /// line to, fill) which can have any # of vertices and Gouraud-shaded
349  /// ones (always tris). Using flat tris (or quads) to build larger polys
350  /// doesn't work well in pdf - you get cracks. So Gouraud is slower but no
351  /// cracks and flat is faster but they should stand alone (default is gouraud)
352  virtual void PdfShadeStyle(EPdfShadeStyle s);
353  EPdfShadeStyle GetPdfShadeStyle() const { return m_PdfShadeStyle; }
354  bool PdfShadeStyleSet() const { return m_PdfShadeStyleSet; }
355 
356  /// Resets the state back to the default one
357  virtual void Reset();
358 
359 protected:
360  /// helper function for MergeState that determines if a flag was masked
361  bool x_MergeFlag(GLenum e, GLbitfield mask);
362 
363  /// Line width (glLineWidth())
364  GLfloat m_LineWidth;
366 
367  /// Joining style for adjacent lines (effects pdf only)
370 
371  /// Cap (line terminator) style (effects pdf only)
374 
375  /// Pdf shading style (effects pdf only)
378 
379  /// Point size (glPointSize())
380  GLfloat m_PointSize;
382 
383  /// Shade model (GL_FLAT or GL_SMOOTH)
384  GLenum m_ShadeModel;
386 
387  /// Scissor rectangle
390 
391  /// Current color (glColor())
394 
395  /// ColorMask
396  GLboolean m_ColorMaskRed;
397  GLboolean m_ColorMaskGreen;
398  GLboolean m_ColorMaskBlue;
399  GLboolean m_ColorMaskAlpha;
401 
402  /// parameters for glPolygonMode. We only support one entry - can't specify
403  /// different modes for GL_FRONT and GL_BACK (should use GL_FRONT_AND_BACK)
407 
408  /// glLineStipple(factor, pattern) Deprecated in OpenGL 3+
412 
413  GLubyte m_PolygonStippleMask[32*32];
415 
416  /// Blend factors for glBlendFunc()
420 
421  /// Blend equatnion for glBlendEquation()
424 
425  /// Blend factors for glBlendFuncSeparate
431 
432  /// Optional color to be used in blending (glBlendColor())
435 
436  /// Set of all options to be enabled (glEnable())
437  vector<GLenum> m_Enabled;
438  /// Set of all options to be disabled (glDisable())
439  vector<GLenum> m_Disabled;
440 
441  /// If true, object dimension are in pixels/points (not zoomable)
444  /// Only needed for scale-invariant rendering (from CGlPane::GetScale()
446 
447  /// For now only allow 1 texture per object (no multi-texturing)
448  // This class does not own the texture (no deleting it)
450 
451  /// Set to false in MakeCurrent and true when any parms are updated
452  bool m_Dirty;
453 };
454 
455 
457 
458 /* @} */
459 
460 #endif // GUI_OPENGL___GL_STATE__HPP
ncbi::TMaskedQueryRegions mask
CGlObject Base class for OpenGl objects like buffers and models.
Definition: globject.hpp:55
CGlState Class to encapsulate Rendering state so that a set of user-selected GL state options can be ...
Definition: glstate.hpp:195
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
IGlState Interface for setting values in CGlState.
Definition: glstate.hpp:74
bool BlendEquationSet() const
Definition: glstate.hpp:305
GLenum GetShadeModel() const
Definition: glstate.hpp:240
GLdouble TModelUnit
Definition: gltypes.hpp:48
bool ShadeModelSet() const
Definition: glstate.hpp:241
GLenum m_PolygonModeFace
parameters for glPolygonMode.
Definition: glstate.hpp:404
bool PdfShadeStyleSet() const
Definition: glstate.hpp:354
GLenum GetPolygonMode() const
Definition: glstate.hpp:276
virtual void Color4d(GLdouble r, GLdouble g, GLdouble b, GLdouble a)=0
bool LineWidthSet() const
Definition: glstate.hpp:231
bool m_PdfShadeStyleSet
Definition: glstate.hpp:377
virtual void ShadeModel(GLenum mode)=0
Set shade model for default lighting: glShadeModel(GL_FLAT or GL_SMOOTH)
virtual void PolygonMode(GLenum face, GLenum mode)=0
Set the polygon rasterization mode.
ELineJoinStyle
Enumerators for non-enumerated state values (e.g. pdf-only state values)
Definition: glstate.hpp:77
ELineCapStyle m_LineCapStyle
Cap (line terminator) style (effects pdf only)
Definition: glstate.hpp:372
virtual void Reset()=0
Resets the state back to the default one.
GLfloat m_PointSize
Point size (glPointSize())
Definition: glstate.hpp:380
bool m_BlendColorSet
Definition: glstate.hpp:434
GLfloat GetLineWidth() const
Definition: glstate.hpp:230
virtual void Color3fv(const GLfloat *v)=0
bool BlendFuncSet() const
Definition: glstate.hpp:301
GLboolean m_ColorMaskGreen
Definition: glstate.hpp:397
bool ScaleInvarientSet() const
Definition: glstate.hpp:323
virtual void PdfShadeStyle(EPdfShadeStyle s)=0
Set (override defualt) shading style for polygons.
bool ScissorSet() const
Definition: glstate.hpp:247
virtual ~CGlState()
Definition: glstate.hpp:198
virtual void BlendFunc(GLenum sfactor, GLenum dfactor)=0
Options to be used when GL_BLEND is enabled.
bool m_ScaleInvarient
If true, object dimension are in pixels/points (not zoomable)
Definition: glstate.hpp:442
bool ColorMaskSet() const
Definition: glstate.hpp:271
virtual void LineWidth(GLfloat w)=0
Set line width for drawing: glLineWidth()
ELineJoinStyle m_LineJoinStyle
Joining style for adjacent lines (effects pdf only)
Definition: glstate.hpp:368
bool m_LineStippleSet
Definition: glstate.hpp:411
virtual void Color3d(GLdouble r, GLdouble g, GLdouble b)=0
I3DTexture * m_Texture
For now only allow 1 texture per object (no multi-texturing)
Definition: glstate.hpp:449
bool m_BlendFuncSet
Definition: glstate.hpp:419
I3DTexture * GetTexture()
Definition: glstate.hpp:226
GLushort m_LineStipplePattern
Definition: glstate.hpp:410
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
TVPRect GetScissor() const
Definition: glstate.hpp:246
CVect2< TModelUnit > GetScaleFactor() const
Definition: glstate.hpp:327
void StateDelta()
Computes difference between current state (e.g.
Definition: glstate.hpp:209
virtual void LineStipple(GLint factor, GLushort pattern)=0
Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+.
virtual void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)=0
Options for glBlendFuncSeparate, also enabled via Enable(GL_BLEND).
GLfloat GetPointSize() const
Definition: glstate.hpp:235
bool m_ShadeModelSet
Definition: glstate.hpp:385
virtual void BlendColor(const CRgbaColor &c)=0
glBlendColor() - Optional constant color for blending
EPdfShadeStyle m_PdfShadeStyle
Pdf shading style (effects pdf only)
Definition: glstate.hpp:376
CRgbaColor m_BlendColor
Optional color to be used in blending (glBlendColor())
Definition: glstate.hpp:433
GLenum m_TargetAlphaFactor
Definition: glstate.hpp:429
bool LineCapStyleSet() const
Definition: glstate.hpp:345
virtual ~IGlState()
Definition: glstate.hpp:83
virtual void Color3f(GLfloat r, GLfloat g, GLfloat b)=0
Set current color (glColor{3,4}{f,d}{v,})
CRgbaColor m_Color
Current color (glColor())
Definition: glstate.hpp:392
GLenum GetSourceBlendFactor() const
Definition: glstate.hpp:299
EPdfShadeStyle GetPdfShadeStyle() const
Definition: glstate.hpp:353
virtual void ColorC(const CRgbaColor &c)=0
GLenum m_SourceRgbFactor
Blend factors for glBlendFuncSeparate.
Definition: glstate.hpp:426
void ReadState()
Updates all state variables with current openGL state (TBD)
Definition: glstate.hpp:206
bool m_BlendEquationSet
Definition: glstate.hpp:423
CVect2< TModelUnit > m_ScaleFactor
Only needed for scale-invariant rendering (from CGlPane::GetScale()
Definition: glstate.hpp:445
virtual void PolygonStipple(GLubyte *mask)=0
Set polygon stipple pattern: glPolygonStipple(). Deprecated in gl 3.2+.
IGlState()
Definition: glstate.hpp:82
ERenderTarget
Different api levels based on information from OpenGL driver.
Definition: glstate.hpp:61
bool PointSizeSet() const
Definition: glstate.hpp:236
bool LineJoinStyleSet() const
Definition: glstate.hpp:340
bool m_ColorSet
Definition: glstate.hpp:393
virtual void Color4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)=0
virtual void Color4fv(const GLfloat *v)=0
bool m_ScaleInvarientSet
Definition: glstate.hpp:443
GLenum m_SourceBlendFactor
Blend factors for glBlendFunc()
Definition: glstate.hpp:417
virtual void Scissor(GLint x, GLint y, GLsizei width, GLsizei height)=0
Set clipping window: glScissor(x,y,width,height)
ELineCapStyle GetLineCapStyle() const
Definition: glstate.hpp:344
GLenum m_TargetRgbFactor
Definition: glstate.hpp:427
ELineCapStyle
Definition: glstate.hpp:78
CRgbaColor GetColor() const
Definition: glstate.hpp:259
GLenum GetTargetBlendFactor() const
Definition: glstate.hpp:300
bool PolygonModeSet() const
Definition: glstate.hpp:277
virtual void PointSize(GLfloat s)=0
Set point size for drawing: glPointSize()
bool m_BlendFuncSeparateSet
Definition: glstate.hpp:430
const GLubyte * GetPolygonStipple() const
Definition: glstate.hpp:286
virtual void ScaleFactor(const CVect2< TModelUnit > &scale)=0
virtual void SetTexture(I3DTexture *tex)=0
Allow 1 texture for now (no multi-texturing)
GLenum m_ShadeModel
Shade model (GL_FLAT or GL_SMOOTH)
Definition: glstate.hpp:384
bool m_PolygonStippleSet
Definition: glstate.hpp:414
bool m_PointSizeSet
Definition: glstate.hpp:381
GLfloat m_LineWidth
Line width (glLineWidth())
Definition: glstate.hpp:364
virtual void Enable(GLenum glstate)=0
glEnable()
bool m_PolygonModeSet
Definition: glstate.hpp:406
bool m_LineJoinStyleSet
Definition: glstate.hpp:369
virtual void Color3dv(const GLdouble *v)=0
virtual void LineCapStyle(ELineCapStyle c)=0
Set line cap ending style (pdf only)
EPdfShadeStyle
Definition: glstate.hpp:79
GLint m_LineStippleFactor
glLineStipple(factor, pattern) Deprecated in OpenGL 3+
Definition: glstate.hpp:409
GLboolean m_ColorMaskBlue
Definition: glstate.hpp:398
ELineJoinStyle GetLineJoinStyle() const
Definition: glstate.hpp:339
virtual void Disable(GLenum glstate)=0
glDisable()
bool ColorSet() const
Definition: glstate.hpp:260
GLboolean m_ColorMaskRed
ColorMask.
Definition: glstate.hpp:396
bool m_ColorMaskSet
Definition: glstate.hpp:400
GLboolean m_ColorMaskAlpha
Definition: glstate.hpp:399
GLenum m_SourceAlpahFactor
Definition: glstate.hpp:428
virtual void LineJoinStyle(ELineJoinStyle s)=0
PDF-specific rendering state.
virtual void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)=0
Set the color mask (glColorMask)
vector< GLenum > m_Disabled
Set of all options to be disabled (glDisable())
Definition: glstate.hpp:439
bool m_LineCapStyleSet
Definition: glstate.hpp:373
bool m_Dirty
Set to false in MakeCurrent and true when any parms are updated.
Definition: glstate.hpp:452
bool PolygonStippleSet() const
Definition: glstate.hpp:287
TVPRect m_ScissorRect
Scissor rectangle.
Definition: glstate.hpp:388
bool m_ScissorSet
Definition: glstate.hpp:389
GLenum m_PolygonMode
Definition: glstate.hpp:405
virtual void ScaleInvarient(bool b, CVect2< TModelUnit > scale=CVect2< TModelUnit >(TModelUnit(1), TModelUnit(1)))=0
Generic rendering options not specfically tied to OpenGL (or pdf..)
vector< GLenum > m_Enabled
Set of all options to be enabled (glEnable())
Definition: glstate.hpp:437
virtual void Color4dv(const GLdouble *v)=0
bool LineStippleSet() const
Definition: glstate.hpp:282
bool m_LineWidthSet
Definition: glstate.hpp:365
GLenum m_BlendEquation
Blend equatnion for glBlendEquation()
Definition: glstate.hpp:422
bool GetScaleInvarient() const
Definition: glstate.hpp:322
GLenum m_TargetBlendFactor
Definition: glstate.hpp:418
void SetDefaultGLState()
Return to default state (TBD)
Definition: glstate.hpp:204
@ eRoundedJoin
Definition: glstate.hpp:77
@ eRenderSVG
Definition: glstate.hpp:61
@ eOpenGL20
Definition: glstate.hpp:61
@ eMetal
Definition: glstate.hpp:61
@ eRenderPDF
Definition: glstate.hpp:61
@ eApiUndefined
Definition: glstate.hpp:61
@ eOpenGL11
Definition: glstate.hpp:61
@ eRenderDebug
Definition: glstate.hpp:61
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIOPENGL_EXPORT
Definition: gui_export.h:514
mdb_mode_t mode
Definition: lmdb++.h:38
unsigned int a
Definition: ncbi_localip.c:102
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
Standard mechanism to include OpenGL headers for all platforms.
int g(Seg_Gsm *spe, Seq_Mtf *psm, Thd_Gsm *tdg)
Definition: thrddgri.c:44
Modified on Sun Jun 23 05:19:46 2024 by modify_doxy.py rev. 669887