|
OpenCPN Partial API docs
|
Device context class that can use either wxDC or OpenGL for drawing. More...
#include <ocpndc.h>
Public Member Functions | |
| ocpnDC (glChartCanvas &canvas) | |
| ocpnDC (wxGLCanvas &canvas) | |
| ocpnDC (wxDC &pdc) | |
| void | Init () |
| void | SetGLCanvas (glChartCanvas *canvas) |
| void | SetBackground (const wxBrush &brush) |
| void | SetPen (const wxPen &pen) |
| void | SetBrush (const wxBrush &brush) |
| void | SetTextForeground (const wxColour &colour) |
| void | SetFont (const wxFont &font) |
| void | SetGLStipple () const |
| const wxPen & | GetPen () const |
| const wxBrush & | GetBrush () const |
| const wxFont & | GetFont () const |
| void | GetSize (wxCoord *width, wxCoord *height) const |
| void | DrawLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, bool b_hiqual=true) |
| Draw a line between two points using either wxDC or OpenGL. | |
| void | DrawLines (int n, wxPoint points[], wxCoord xoffset=0, wxCoord yoffset=0, bool b_hiqual=true) |
| void | DrawGLThickLine (float x1, float y1, float x2, float y2, wxPen pen, bool b_hiqual) |
| void | DrawGLThickLines (int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPen pen, bool b_hiqual) |
| void | StrokeLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) |
| void | StrokeLine (wxPoint a, wxPoint b) |
| void | StrokeLines (int n, wxPoint *points) |
| void | Clear () |
| void | DrawRectangle (wxCoord x, wxCoord y, wxCoord w, wxCoord h) |
| void | DrawRoundedRectangle (wxCoord x, wxCoord y, wxCoord w, wxCoord h, wxCoord rr) |
| void | DrawCircle (wxCoord x, wxCoord y, wxCoord radius) |
| void | DrawCircle (const wxPoint &pt, wxCoord radius) |
| void | StrokeCircle (wxCoord x, wxCoord y, wxCoord radius) |
| void | DrawEllipse (wxCoord x, wxCoord y, wxCoord width, wxCoord height) |
| void | DrawPolygon (int n, wxPoint points[], wxCoord xoffset=0, wxCoord yoffset=0, float scale=1.0, float angle=0.0) |
| void | DrawPolygonTessellated (int n, wxPoint points[], wxCoord xoffset=0, wxCoord yoffset=0) |
| void | StrokePolygon (int n, wxPoint points[], wxCoord xoffset=0, wxCoord yoffset=0, float scale=1.0) |
| void | DrawBitmap (const wxBitmap &bitmap, wxCoord x, wxCoord y, bool usemask) |
| void | DrawText (const wxString &text, wxCoord x, wxCoord y, float angle=0.0) |
| void | GetTextExtent (const wxString &string, wxCoord *w, wxCoord *h, wxCoord *descent=NULL, wxCoord *externalLeading=NULL, wxFont *font=NULL) |
| void | ResetBoundingBox () |
| void | CalcBoundingBox (wxCoord x, wxCoord y) |
| void | DestroyClippingRegion () |
| wxDC * | GetDC () const |
| void | SetDPIFactor (double factor) |
| void | SetVP (ViewPort vp) |
Static Public Member Functions | |
| static void | SetGLAttrs (bool highQuality) |
Public Attributes | |
| int | m_canvasIndex |
Protected Member Functions | |
| bool | ConfigurePen () |
| bool | ConfigureBrush () |
| void | GLDrawBlendData (wxCoord x, wxCoord y, wxCoord w, wxCoord h, int format, const unsigned char *data) |
| void | drawrrhelperGLES2 (wxCoord x0, wxCoord y0, wxCoord r, int quadrant, int steps) |
| void | BuildShaders () |
Protected Attributes | |
| glChartCanvas * | m_glchartCanvas |
| wxGLCanvas * | m_glcanvas |
| wxDC * | dc |
| wxPen | m_pen |
| wxBrush | m_brush |
| wxColour | m_textforegroundcolour |
| wxFont | m_font |
| bool | m_buseTex |
| float * | workBuf |
| size_t | workBufSize |
| unsigned int | workBufIndex |
| double | m_dpi_factor |
| ViewPort | m_vp |
Device context class that can use either wxDC or OpenGL for drawing.
Provides a unified interface for drawing operations, abstracting the underlying context. Allows seamless switching between contexts and offers various drawing methods.
| ocpnDC::ocpnDC | ( | glChartCanvas & | canvas | ) |
Definition at line 80 of file ocpndc.cpp.
| ocpnDC::ocpnDC | ( | wxGLCanvas & | canvas | ) |
Definition at line 95 of file ocpndc.cpp.
| ocpnDC::ocpnDC | ( | wxDC & | pdc | ) |
Definition at line 107 of file ocpndc.cpp.
| ocpnDC::ocpnDC | ( | ) |
Definition at line 127 of file ocpndc.cpp.
| ocpnDC::~ocpnDC | ( | ) |
Definition at line 139 of file ocpndc.cpp.
| void ocpnDC::CalcBoundingBox | ( | wxCoord | x, |
| wxCoord | y ) |
Definition at line 1872 of file ocpndc.cpp.
| void ocpnDC::Clear | ( | ) |
Definition at line 187 of file ocpndc.cpp.
|
protected |
Definition at line 1891 of file ocpndc.cpp.
|
protected |
Definition at line 1876 of file ocpndc.cpp.
| void ocpnDC::DrawBitmap | ( | const wxBitmap & | bitmap, |
| wxCoord | x, | ||
| wxCoord | y, | ||
| bool | usemask ) |
Definition at line 1562 of file ocpndc.cpp.
|
inline |
| void ocpnDC::DrawCircle | ( | wxCoord | x, |
| wxCoord | y, | ||
| wxCoord | radius ) |
Definition at line 1047 of file ocpndc.cpp.
| void ocpnDC::DrawEllipse | ( | wxCoord | x, |
| wxCoord | y, | ||
| wxCoord | width, | ||
| wxCoord | height ) |
Definition at line 1146 of file ocpndc.cpp.
| void ocpnDC::DrawGLThickLine | ( | float | x1, |
| float | y1, | ||
| float | x2, | ||
| float | y2, | ||
| wxPen | pen, | ||
| bool | b_hiqual ) |
Definition at line 360 of file ocpndc.cpp.
| void ocpnDC::DrawGLThickLines | ( | int | n, |
| wxPoint | points[], | ||
| wxCoord | xoffset, | ||
| wxCoord | yoffset, | ||
| wxPen | pen, | ||
| bool | b_hiqual ) |
Definition at line 698 of file ocpndc.cpp.
| void ocpnDC::DrawLine | ( | wxCoord | x1, |
| wxCoord | y1, | ||
| wxCoord | x2, | ||
| wxCoord | y2, | ||
| bool | b_hiqual = true ) |
Draw a line between two points using either wxDC or OpenGL.
When using OpenGL, this function supports different line qualities and widths. For high quality lines (b_hiqual=true), it enables anti-aliasing and line smoothing. The function also handles dashed lines via line stippling in OpenGL mode.
| x1 | The x-coordinate of the starting point, in physical pixels. |
| y1 | The y-coordinate of the starting point, in physical pixels. |
| x2 | The x-coordinate of the ending point, in physical pixels. |
| y2 | The y-coordinate of the ending point, in physical pixels. |
| b_hiqual | If true, enables high quality rendering with anti-aliasing and line smoothing in OpenGL mode. Has no effect in wxDC mode. |
Definition at line 476 of file ocpndc.cpp.
| void ocpnDC::DrawLines | ( | int | n, |
| wxPoint | points[], | ||
| wxCoord | xoffset = 0, | ||
| wxCoord | yoffset = 0, | ||
| bool | b_hiqual = true ) |
Definition at line 713 of file ocpndc.cpp.
| void ocpnDC::DrawPolygon | ( | int | n, |
| wxPoint | points[], | ||
| wxCoord | xoffset = 0, | ||
| wxCoord | yoffset = 0, | ||
| float | scale = 1.0, | ||
| float | angle = 0.0 ) |
Definition at line 1167 of file ocpndc.cpp.
| void ocpnDC::DrawPolygonTessellated | ( | int | n, |
| wxPoint | points[], | ||
| wxCoord | xoffset = 0, | ||
| wxCoord | yoffset = 0 ) |
Definition at line 1460 of file ocpndc.cpp.
| void ocpnDC::DrawRectangle | ( | wxCoord | x, |
| wxCoord | y, | ||
| wxCoord | w, | ||
| wxCoord | h ) |
Definition at line 883 of file ocpndc.cpp.
| void ocpnDC::DrawRoundedRectangle | ( | wxCoord | x, |
| wxCoord | y, | ||
| wxCoord | w, | ||
| wxCoord | h, | ||
| wxCoord | rr ) |
Definition at line 963 of file ocpndc.cpp.
|
protected |
Definition at line 926 of file ocpndc.cpp.
| void ocpnDC::DrawText | ( | const wxString & | text, |
| wxCoord | x, | ||
| wxCoord | y, | ||
| float | angle = 0.0 ) |
Definition at line 1639 of file ocpndc.cpp.
| const wxBrush & ocpnDC::GetBrush | ( | ) | const |
Definition at line 260 of file ocpndc.cpp.
| const wxFont & ocpnDC::GetFont | ( | ) | const |
Definition at line 265 of file ocpndc.cpp.
| const wxPen & ocpnDC::GetPen | ( | ) | const |
Definition at line 255 of file ocpndc.cpp.
| void ocpnDC::GetSize | ( | wxCoord * | width, |
| wxCoord * | height ) const |
Definition at line 270 of file ocpndc.cpp.
| void ocpnDC::GetTextExtent | ( | const wxString & | string, |
| wxCoord * | w, | ||
| wxCoord * | h, | ||
| wxCoord * | descent = NULL, | ||
| wxCoord * | externalLeading = NULL, | ||
| wxFont * | font = NULL ) |
Definition at line 1834 of file ocpndc.cpp.
|
protected |
Definition at line 1903 of file ocpndc.cpp.
| void ocpnDC::Init | ( | ) |
Definition at line 155 of file ocpndc.cpp.
| void ocpnDC::ResetBoundingBox | ( | ) |
Definition at line 1868 of file ocpndc.cpp.
| void ocpnDC::SetBackground | ( | const wxBrush & | brush | ) |
Definition at line 209 of file ocpndc.cpp.
| void ocpnDC::SetBrush | ( | const wxBrush & | brush | ) |
Definition at line 234 of file ocpndc.cpp.
| void ocpnDC::SetFont | ( | const wxFont & | font | ) |
Definition at line 248 of file ocpndc.cpp.
|
static |
Definition at line 285 of file ocpndc.cpp.
| void ocpnDC::SetGLStipple | ( | ) | const |
Definition at line 302 of file ocpndc.cpp.
| void ocpnDC::SetPen | ( | const wxPen & | pen | ) |
Definition at line 224 of file ocpndc.cpp.
| void ocpnDC::SetTextForeground | ( | const wxColour & | colour | ) |
Definition at line 241 of file ocpndc.cpp.
| void ocpnDC::SetVP | ( | ViewPort | vp | ) |
Definition at line 1917 of file ocpndc.cpp.
| void ocpnDC::StrokeCircle | ( | wxCoord | x, |
| wxCoord | y, | ||
| wxCoord | radius ) |
Definition at line 1128 of file ocpndc.cpp.
| void ocpnDC::StrokeLine | ( | wxCoord | x1, |
| wxCoord | y1, | ||
| wxCoord | x2, | ||
| wxCoord | y2 ) |
Definition at line 850 of file ocpndc.cpp.
| void ocpnDC::StrokeLines | ( | int | n, |
| wxPoint * | points ) |
Definition at line 863 of file ocpndc.cpp.
| void ocpnDC::StrokePolygon | ( | int | n, |
| wxPoint | points[], | ||
| wxCoord | xoffset = 0, | ||
| wxCoord | yoffset = 0, | ||
| float | scale = 1.0 ) |
Definition at line 1537 of file ocpndc.cpp.
|
protected |