NCBI C++ ToolKit
|
Search Toolkit Book for CRenderVector
#include <gui/opengl/render_vector.hpp>
Classes | |
struct | Matrix |
Public Member Functions | |
CRenderVector () | |
virtual void | PushAttrib (GLbitfield mask) |
virtual void | PopAttrib () |
virtual void | Enable (GLenum glstate) |
virtual void | Disable (GLenum glstate) |
glDisable() More... | |
virtual void | LineWidth (GLfloat w) |
Set line width for drawing: glLineWidth() More... | |
virtual void | PointSize (GLfloat s) |
Set point size for drawing: glPointSize() More... | |
virtual void | ShadeModel (GLenum mode) |
Set shade model for default lighting: glShadeModel(GL_FLAT or GL_SMOOTH) More... | |
virtual void | Scissor (GLint x, GLint y, GLsizei width, GLsizei height) |
Set clipping window: glScissor(x,y,width,height) More... | |
virtual void | ColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) |
Color{3,4}{f,d}{v} commands are defined above.... More... | |
virtual void | PolygonMode (GLenum face, GLenum mode) |
Set the polygon rasterization mode. More... | |
virtual void | LineStipple (GLint factor, GLushort pattern) |
Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+. More... | |
virtual void | PolygonStipple (GLubyte *mask) |
Set polygon stipple pattern: glPolygonStipple(). Deprecated in gl 3.2+. More... | |
virtual void | BlendFunc (GLenum sfactor, GLenum dfactor) |
Options to be used when GL_BLEND is enabled. More... | |
virtual void | TexEnvi (GLenum target, GLenum pname, GLint param) |
virtual void | BlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) |
virtual void | LineJoinStyle (IGlState::ELineJoinStyle s) |
PDF-specific rendering state. More... | |
virtual void | LineCapStyle (IGlState::ELineCapStyle c) |
Set line cap ending style (pdf only) More... | |
virtual void | PdfShadeStyle (IGlState::EPdfShadeStyle s) |
Set (override defualt) shading style for polygons. More... | |
virtual void | UseProgram (GLuint) |
For shaders. Only works with OpenGL 2.0+. More... | |
virtual void | MatrixMode (GLenum mode) |
virtual void | PushMatrix () |
virtual void | PopMatrix () |
virtual void | LoadIdentity () |
virtual void | LoadMatrixf (const GLfloat *m) |
virtual void | LoadMatrixd (const GLdouble *m) |
virtual CMatrix4< float > | GetModelViewMatrix () const |
virtual CMatrix4< float > | GetProjectionMatrix () const |
virtual void | GetModelViewMatrix (GLdouble *m) const |
virtual void | GetProjectionMatrix (GLdouble *m) const |
virtual void | Rotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z) |
virtual void | Rotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z) |
virtual void | Scaled (GLdouble x, GLdouble y, GLdouble z) |
virtual void | Scalef (GLfloat x, GLfloat y, GLfloat z) |
virtual void | Translated (GLdouble x, GLdouble y, GLdouble z) |
virtual void | Translatef (GLfloat x, GLfloat y, GLfloat z) |
virtual void | Ortho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal) |
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 (screen) readability. More... | |
virtual TModelUnit | TextWidth (const CGlTextureFont *font, const char *text) const |
virtual TModelUnit | TextHeight (const CGlTextureFont *font) const |
virtual TModelUnit | GetFontDescender (const CGlTextureFont *font) const |
virtual TModelUnit | GetAdvance (const CGlTextureFont *font, char c) const |
virtual TModelUnit | GetMaxWidth (const CGlTextureFont *font, int max_num) const |
Public Member Functions inherited from CRenderCommon | |
CRenderCommon () | |
virtual | ~CRenderCommon () |
virtual void | SetIsGreyscale (bool) |
virtual bool | IsSimplified () const |
virtual bool | IsPrinterFriendly () const |
virtual void | Clear () |
Clear/delete any graphics/OpenGL memory. More... | |
virtual ERenderTarget | GetApi () |
Overridden in subclasses to return the supported rendering target. More... | |
virtual void | Begin (GLenum mode) |
Start rendering. More... | |
virtual void | End () |
Finish rendering (create buffer and send to renderer) More... | |
virtual CRef< CGlState > | GetState () |
Allow caller to access state directly. More... | |
virtual void | ResetState () |
virtual void | BeginClippingRect (GLint x, GLint y, GLsizei width, GLsizei height) |
virtual void | EndClippingRect () |
virtual void | Render (CGlPane &pane, CGlModel2D *model) |
virtual void | Vertex3f (GLfloat x, GLfloat y, GLfloat z) |
Explicit support not currently available for: GLbyte, GlShort and GLint calls, e.g. More... | |
virtual void | Rectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) |
Rect() functions also do Begin() and End() (as in OpenGL) More... | |
virtual void | ColorC (const CRgbaColor &color) |
Colors (also defined in IGlState since they can be set either before or inside of Begin()/End(). More... | |
virtual void | TexCoord2f (GLfloat s, GLfloat t) |
Texture coords. More... | |
virtual void | BeginText (const CGlTextureFont *font, const CRgbaColor &color) |
Text is drawn is pixel coordinates. More... | |
virtual void | BeginText (const CGlTextureFont *font) |
Same as above, but get color from m_RenderNode.m_State. More... | |
virtual void | EndText () |
Pops matrices and attributes after writing text. More... | |
void | SetTextColor (const CRgbaColor &color) |
Update text color and alpha. More... | |
CRgbaColor | GetTextColor () const |
virtual void | WriteText (TModelUnit x, TModelUnit y, const char *text, TModelUnit rotate_degrees=0.0) |
Write text at specified model coords. More... | |
virtual void | WriteText (TModelUnit x, TModelUnit y, TModelUnit width, TModelUnit height, const char *text, CGlTextureFont::TAlign align=CGlTextureFont::eAlign_Center, CGlTextureFont::ETruncate trunc=CGlTextureFont::eTruncate_Ellipsis, TModelUnit rotate_degrees=0.0f) |
Write text at specified model coords inside box defined by (x,y,width,height) with specified alignment, truncation and rotation. More... | |
virtual void | Viewport (GLint x, GLint y, GLsizei width, GLsizei height) |
virtual void | GetViewport (GLint *params) |
Public Member Functions inherited from IRender | |
virtual | ~IRender () |
virtual void | Hint (GLenum target, GLenum mode)=0 |
void | Color3f (GLfloat r, GLfloat g, GLfloat b) |
void | Color3fv (const GLfloat *v) |
void | Color4f (GLfloat r, GLfloat g, GLfloat b, GLfloat a) |
void | Color4fv (const GLfloat *v) |
void | Color3d (GLdouble r, GLdouble g, GLdouble b) |
void | Color3dv (const GLdouble *v) |
void | Color4d (GLdouble r, GLdouble g, GLdouble b, GLdouble a) |
void | Color4dv (const GLdouble *v) |
void | Vertex2f (GLfloat x, GLfloat y) |
void | Vertex2fv (const GLfloat *v) |
void | Vertex3fv (const GLfloat *v) |
void | Vertex2d (GLdouble x, GLdouble y) |
void | Vertex2dv (const GLdouble *v) |
void | Vertex3d (GLdouble x, GLdouble y, GLdouble z) |
void | Vertex3dv (const GLdouble *v) |
void | Rectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2) |
void | RectC (const TVPRect &rc) |
void | RectC (const TModelRect &rc) |
void | TexCoord2fv (const GLfloat *v) |
void | TexCoord2d (GLdouble s, GLdouble t) |
void | TexCoord2dv (const GLdouble *v) |
Private Member Functions | |
void | x_LoadMatrix (const Matrix &m) |
void | x_ApplyTransf (const Matrix &t) |
Static Private Member Functions | |
static void | x_MultMatrix (Matrix &d, const Matrix &s1, const Matrix &s2) |
static void | x_InitMatrixd (Matrix &d, const GLdouble *s) |
static void | x_InitMatrixf (Matrix &d, const GLfloat *s) |
static void | x_FromMatrix (const Matrix &d, GLdouble *res) |
static CMatrix4< float > | x_FromMatrix (const Matrix &d) |
Private Attributes | |
list< Matrix > | m_ProjectionMatrix |
list< Matrix > | m_ModelViewMatrix |
vector< pair< GLbitfield, CGlState > > | m_PushedState |
Additional Inherited Members | |
Protected Member Functions inherited from CRenderCommon | |
virtual void | x_RenderBuffer (CGlVboNode *node) |
void | x_SyncAttribs (vector< CRgbaColor > &colors) |
void | x_SyncAttribs (vector< CVect3< float > > &vecs) |
void | x_SyncAttribs (vector< CVect2< float > > &vecs) |
Protected Attributes inherited from CRenderCommon | |
vector< CVect3< float > > | m_VertexBuffer |
vector< CRgbaColor > | m_ColorBuffer |
vector< CVect2< float > > | m_TexCoord2DBuffer1 |
CGlVboNode | m_RenderNode |
vertex buffer node for rendering all Begin()/End() renders More... | |
CRef< CGlState > | m_State |
state used by all nodes More... | |
GLenum | m_MatrixMode |
current modelview matrix and matrix mode More... | |
GLint | m_Viewport [4] |
current projection set by Viewport() More... | |
GLenum | m_CurrentMode |
rendering mode from Begin() More... | |
const CGlTextureFont * | m_CurrentFont |
text parameters More... | |
CRgbaColor | m_TextColor |
color and alpha for text only (other GL options do not apply to text) More... | |
Definition at line 42 of file render_vector.hpp.
CRenderVector::CRenderVector | ( | ) |
Definition at line 46 of file render_vector.cpp.
References CRenderVector::Matrix::m, m_ModelViewMatrix, m_ProjectionMatrix, and s_MakeIdentity().
|
virtual |
Options to be used when GL_BLEND is enabled.
The options used at render time will be those most recently given by SetBlendFunc() OR SetBlendFuncSeparate() prior to calling MakeCurrent(). Options for glBlendFunc. Enable via Enable(GL_BLEND);
Implements IRender.
Definition at line 557 of file render_vector.cpp.
References CGlState::BlendFunc(), Error(), LOG_POST, CRenderCommon::m_CurrentMode, and CRenderCommon::m_State.
|
virtual |
Definition at line 570 of file render_vector.cpp.
References CGlState::BlendFuncSeparate(), Error(), LOG_POST, CRenderCommon::m_CurrentMode, and CRenderCommon::m_State.
|
virtual |
Color{3,4}{f,d}{v} commands are defined above....
Implements IRender.
Definition at line 518 of file render_vector.cpp.
References CGlState::ColorMask(), Error(), LOG_POST, CRenderCommon::m_CurrentMode, and CRenderCommon::m_State.
|
virtual |
glDisable()
Implements IRender.
Definition at line 473 of file render_vector.cpp.
References CGlState::Disable(), Error(), LOG_POST, CRenderCommon::m_CurrentMode, and CRenderCommon::m_State.
|
virtual |
Implements IRender.
Definition at line 464 of file render_vector.cpp.
References CGlState::Enable(), Error(), LOG_POST, CRenderCommon::m_CurrentMode, and CRenderCommon::m_State.
|
virtual |
Reimplemented from CRenderCommon.
Definition at line 403 of file render_vector.cpp.
References CGlTextureFont::GetAdvance(), CGlTextureFont::GetFontFace(), CGlTextureFont::GetFontFileForFace(), CGlTextureFont::GetFontSize(), and CGlTextureFont::IsBitmapFont().
|
virtual |
Reimplemented from CRenderCommon.
Definition at line 388 of file render_vector.cpp.
References CGlTextureFont::GetFontDescender(), CGlTextureFont::GetFontFace(), CGlTextureFont::GetFontFileForFace(), CGlTextureFont::GetFontSize(), and CGlTextureFont::IsBitmapFont().
|
virtual |
Reimplemented from CRenderCommon.
Definition at line 419 of file render_vector.cpp.
References CGlTextureFont::GetFontFace(), CGlTextureFont::GetFontFileForFace(), CGlTextureFont::GetFontSize(), CGlTextureFont::GetMaxWidth(), and CGlTextureFont::IsBitmapFont().
|
virtual |
Get font metrics - metrics differ when the font under opengl has been replaced by a bitmap font for (screen) readability.
Other than that, it would be fine to use the glTextureFont metric function directly
Reimplemented from CRenderCommon.
Definition at line 334 of file render_vector.cpp.
References CGlTextureFont::GetFontFace(), CGlTextureFont::GetFontFileForFace(), CGlTextureFont::GetFontSize(), CGlTextureFont::GetMetric(), CGlTextureFont::IsBitmapFont(), len, and text().
|
virtual |
Implements IRender.
Definition at line 225 of file render_vector.cpp.
References m_ModelViewMatrix, and x_FromMatrix().
Referenced by CGlRenderPdf::WriteText(), CSVGRenderer::x_ProjectVertex(), and CSVGRenderer::x_ProjectVertices().
|
virtual |
Implements IRender.
Definition at line 235 of file render_vector.cpp.
References m_ModelViewMatrix, and x_FromMatrix().
|
virtual |
Implements IRender.
Definition at line 230 of file render_vector.cpp.
References m_ProjectionMatrix, and x_FromMatrix().
Referenced by CGlRenderPdf::WriteText(), CSVGRenderer::x_ProjectVertex(), and CSVGRenderer::x_ProjectVertices().
|
virtual |
Implements IRender.
Definition at line 240 of file render_vector.cpp.
References m_ProjectionMatrix, and x_FromMatrix().
|
virtual |
Set line cap ending style (pdf only)
Implements IRender.
Definition at line 588 of file render_vector.cpp.
References Error(), CGlState::LineCapStyle(), LOG_POST, CRenderCommon::m_CurrentMode, and CRenderCommon::m_State.
|
virtual |
PDF-specific rendering state.
Will not have any effect on OpenGL output Note that in PDF files, some or all of these options may be settable pre-element (attributes), not just per-object (uniform) Set path joing style for lines (pdf-only)
Implements IRender.
Definition at line 580 of file render_vector.cpp.
References Error(), CGlState::LineJoinStyle(), LOG_POST, CRenderCommon::m_CurrentMode, and CRenderCommon::m_State.
|
virtual |
Set line stipple pattern: glLineStipple(). Deprecated in gl 3.2+.
Implements IRender.
Definition at line 539 of file render_vector.cpp.
References Error(), CGlState::LineStipple(), LOG_POST, CRenderCommon::m_CurrentMode, and CRenderCommon::m_State.
|
virtual |
Set line width for drawing: glLineWidth()
Implements IRender.
Definition at line 482 of file render_vector.cpp.
References Error(), CGlState::LineWidth(), LOG_POST, CRenderCommon::m_CurrentMode, and CRenderCommon::m_State.
|
virtual |
Implements IRender.
Definition at line 85 of file render_vector.cpp.
References CRenderVector::Matrix::m, s_MakeIdentity(), and x_LoadMatrix().
|
virtual |
Implements IRender.
Definition at line 218 of file render_vector.cpp.
References t, x_InitMatrixd(), and x_LoadMatrix().
|
virtual |
Implements IRender.
Definition at line 211 of file render_vector.cpp.
References t, x_InitMatrixf(), and x_LoadMatrix().
Referenced by CSVGRenderer::x_RenderBuffer().
|
virtual |
Implements IRender.
Definition at line 54 of file render_vector.cpp.
References CRenderCommon::m_MatrixMode.
Referenced by CSVGRenderer::x_RenderBuffer().
|
virtual |
Implements IRender.
Reimplemented in CSVGRenderer.
Definition at line 316 of file render_vector.cpp.
References CRenderVector::Matrix::m, s_MakeIdentity(), and x_ApplyTransf().
Referenced by CSVGRenderer::Ortho().
|
virtual |
Set (override defualt) shading style for polygons.
Implements IRender.
Definition at line 596 of file render_vector.cpp.
References Error(), LOG_POST, CRenderCommon::m_CurrentMode, CRenderCommon::m_State, and CGlState::PdfShadeStyle().
|
virtual |
Set point size for drawing: glPointSize()
Implements IRender.
Definition at line 490 of file render_vector.cpp.
References Error(), LOG_POST, CRenderCommon::m_CurrentMode, CRenderCommon::m_State, and CGlState::PointSize().
|
virtual |
Set the polygon rasterization mode.
For the first parameter, GL_FRONT and GL_BACK are deprecated so better to use GL_FRONT_AND_BACK
Implements IRender.
Definition at line 530 of file render_vector.cpp.
References Error(), LOG_POST, CRenderCommon::m_CurrentMode, CRenderCommon::m_State, and CGlState::PolygonMode().
|
virtual |
Set polygon stipple pattern: glPolygonStipple(). Deprecated in gl 3.2+.
Implements IRender.
Definition at line 548 of file render_vector.cpp.
References Error(), LOG_POST, CRenderCommon::m_CurrentMode, CRenderCommon::m_State, mask, and CGlState::PolygonStipple().
|
virtual |
Implements IRender.
Definition at line 448 of file render_vector.cpp.
References Error(), LOG_POST, m_PushedState, CRenderCommon::m_State, and CGlState::MergeStates().
|
virtual |
Implements IRender.
Definition at line 71 of file render_vector.cpp.
References CRenderCommon::m_MatrixMode, m_ModelViewMatrix, and m_ProjectionMatrix.
Referenced by CSVGRenderer::x_RenderBuffer().
|
virtual |
Implements IRender.
Definition at line 434 of file render_vector.cpp.
References CRef< C, Locker >::GetNCObject(), LOG_POST, m_PushedState, CRenderCommon::m_State, mask, and Warning().
|
virtual |
Implements IRender.
Definition at line 59 of file render_vector.cpp.
References CRenderCommon::m_MatrixMode, m_ModelViewMatrix, and m_ProjectionMatrix.
Referenced by CSVGRenderer::x_RenderBuffer().
|
virtual |
Implements IRender.
Definition at line 245 of file render_vector.cpp.
References mod(), r(), x_ApplyTransf(), and x_InitMatrixd().
Referenced by Rotatef().
|
virtual |
|
virtual |
Definition at line 282 of file render_vector.cpp.
References CRenderVector::Matrix::m, s_MakeIdentity(), and x_ApplyTransf().
Referenced by Scalef().
|
virtual |
|
virtual |
Set clipping window: glScissor(x,y,width,height)
Implements IRender.
Definition at line 508 of file render_vector.cpp.
References Error(), LOG_POST, CRenderCommon::m_CurrentMode, CRenderCommon::m_State, and CGlState::Scissor().
|
virtual |
Set shade model for default lighting: glShadeModel(GL_FLAT or GL_SMOOTH)
Implements IRender.
Definition at line 499 of file render_vector.cpp.
References Error(), LOG_POST, CRenderCommon::m_CurrentMode, CRenderCommon::m_State, and CGlState::ShadeModel().
|
virtual |
Implements IRender.
Definition at line 566 of file render_vector.cpp.
|
virtual |
Reimplemented from CRenderCommon.
Definition at line 373 of file render_vector.cpp.
References CGlTextureFont::GetFontFace(), CGlTextureFont::GetFontFileForFace(), CGlTextureFont::GetFontSize(), CGlTextureFont::IsBitmapFont(), and CGlTextureFont::TextHeight().
|
virtual |
Reimplemented from CRenderCommon.
Definition at line 358 of file render_vector.cpp.
References CGlTextureFont::GetFontFace(), CGlTextureFont::GetFontFileForFace(), CGlTextureFont::GetFontSize(), CGlTextureFont::IsBitmapFont(), text(), and CGlTextureFont::TextWidth().
|
virtual |
Implements IRender.
Definition at line 299 of file render_vector.cpp.
References CRenderVector::Matrix::m, s_MakeIdentity(), and x_ApplyTransf().
Referenced by Translatef().
|
virtual |
|
inlinevirtual |
For shaders. Only works with OpenGL 2.0+.
Implements IRender.
Definition at line 77 of file render_vector.hpp.
Definition at line 104 of file render_vector.cpp.
References CRenderCommon::m_MatrixMode, m_ModelViewMatrix, m_ProjectionMatrix, t, and x_MultMatrix().
Referenced by Ortho(), Rotated(), Scaled(), and Translated().
Definition at line 159 of file render_vector.cpp.
References CRenderVector::Matrix::m.
Definition at line 168 of file render_vector.cpp.
References CRenderVector::Matrix::m.
Referenced by GetModelViewMatrix(), and GetProjectionMatrix().
Definition at line 119 of file render_vector.cpp.
References CRenderVector::Matrix::m.
Referenced by LoadMatrixd(), and Rotated().
Definition at line 139 of file render_vector.cpp.
References CRenderVector::Matrix::m.
Referenced by LoadMatrixf().
Definition at line 92 of file render_vector.cpp.
References CRenderCommon::m_MatrixMode, m_ModelViewMatrix, and m_ProjectionMatrix.
Referenced by LoadIdentity(), LoadMatrixd(), and LoadMatrixf().
Definition at line 188 of file render_vector.cpp.
References CRenderVector::Matrix::m.
Referenced by x_ApplyTransf().
|
private |
Definition at line 134 of file render_vector.hpp.
Referenced by CRenderVector(), GetModelViewMatrix(), PopMatrix(), PushMatrix(), x_ApplyTransf(), and x_LoadMatrix().
|
private |
Definition at line 133 of file render_vector.hpp.
Referenced by CRenderVector(), GetProjectionMatrix(), PopMatrix(), PushMatrix(), x_ApplyTransf(), and x_LoadMatrix().
|
private |
Definition at line 136 of file render_vector.hpp.
Referenced by PopAttrib(), and PushAttrib().