HOG2
Classes | Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
Graphics::Display Class Reference

#include <Graphics.h>

Classes

struct  data
 
struct  drawInfo
 
struct  lineInfo
 
struct  segments
 
struct  shapeInfo
 
struct  textInfo
 
struct  triangleInfo
 

Public Types

enum  tDrawClass {
  kFillRectangle, kFrameRectangle, kFillTriangle, kFrameTriangle,
  kFillOval, kFrameOval, kFillNGon, kFrameNGon,
  kLine
}
 

Public Member Functions

 Display ()
 
void StartFrame ()
 
void EndFrame ()
 
void StartBackground ()
 
void EndBackground ()
 
bool BackgroundNeedsRedraw () const
 
void SetViewport (uint8_t v)
 
void SetNumViewports (uint8_t v)
 
int GetNumViewports ()
 
void FrameRect (rect r, rgbColor c, float lineWidth)
 
void FillRect (rect r, rgbColor c)
 
void FrameSquare (point p, float radius, rgbColor c, float lineWidth)
 
void FillSquare (point p, float radius, rgbColor c)
 
void FrameCircle (rect r, rgbColor c, float lineWidth)
 
void FrameCircle (point r, float radius, rgbColor c, float lineWidth)
 
void FillCircle (rect r, rgbColor c)
 
void FillCircle (point p, float radius, rgbColor c)
 
void FillTriangle (point p1, point p2, point p3, rgbColor c)
 
void FrameTriangle (point p1, point p2, point p3, float lineWidth, rgbColor c)
 
void FillNGon (point p, float radius, int sides, float rotation, rgbColor c)
 
void FrameNGon (point p, float radius, float width, int sides, float rotation, rgbColor c)
 
void DrawLine (point start, point end, float lineWidth, rgbColor c)
 
void DrawLineSegments (const std::vector< point > &points, float lineWidth, rgbColor c)
 
void FillLineSegments (const std::vector< point > &points, float lineWidth, rgbColor c)
 
void DrawArrow (point start, point end, float lineWidth, rgbColor c)
 
void DrawText (const char *text, point location, rgbColor c, float height, const char *typeface=0)
 
void DrawText (const char *text, point location, rgbColor c, float height, textAlign align, const char *typeface=0)
 
void DrawText (const char *text, point location, rgbColor c, float height, textAlign align, textBaseline base, const char *typeface=0)
 

Public Attributes

std::vector< datadrawCommands
 
std::vector< textInfotext
 
std::vector< segmentslineSegments
 
std::vector< databackgroundDrawCommands
 
std::vector< textInfobackgroundText
 
std::vector< segmentsbackgroundLineSegments
 
uint64_t backgroundFrame
 
uint64_t foregroundFrame
 

Private Attributes

uint8_t viewport
 
uint8_t numViewports
 
bool drawingBackground
 

Detailed Description

Definition at line 146 of file Graphics.h.

Member Enumeration Documentation

◆ tDrawClass

Enumerator
kFillRectangle 
kFrameRectangle 
kFillTriangle 
kFrameTriangle 
kFillOval 
kFrameOval 
kFillNGon 
kFrameNGon 
kLine 

Definition at line 214 of file Graphics.h.

Constructor & Destructor Documentation

◆ Display()

Graphics::Display::Display ( )

Definition at line 22 of file Graphics.cpp.

References backgroundFrame, drawingBackground, foregroundFrame, and numViewports.

Member Function Documentation

◆ BackgroundNeedsRedraw()

bool Graphics::Display::BackgroundNeedsRedraw ( ) const

Definition at line 58 of file Graphics.cpp.

References backgroundFrame, and foregroundFrame.

◆ DrawArrow()

void Graphics::Display::DrawArrow ( point  start,
point  end,
float  lineWidth,
rgbColor  c 
)

◆ DrawLine()

void Graphics::Display::DrawLine ( point  start,
point  end,
float  lineWidth,
rgbColor  c 
)

◆ DrawLineSegments()

void Graphics::Display::DrawLineSegments ( const std::vector< point > &  points,
float  lineWidth,
rgbColor  c 
)

◆ DrawText() [1/3]

void Graphics::Display::DrawText ( const char *  text,
point  location,
rgbColor  c,
float  height,
const char *  typeface = 0 
)

◆ DrawText() [2/3]

void Graphics::Display::DrawText ( const char *  text,
point  location,
rgbColor  c,
float  height,
textAlign  align,
const char *  typeface = 0 
)

Definition at line 212 of file Graphics.cpp.

References backgroundText, drawingBackground, height, text, and Graphics::textBaselineBottom.

◆ DrawText() [3/3]

void Graphics::Display::DrawText ( const char *  text,
point  location,
rgbColor  c,
float  height,
textAlign  align,
textBaseline  base,
const char *  typeface = 0 
)

Definition at line 202 of file Graphics.cpp.

References backgroundText, drawingBackground, height, and text.

◆ EndBackground()

void Graphics::Display::EndBackground ( )

Definition at line 53 of file Graphics.cpp.

References drawingBackground.

◆ EndFrame()

void Graphics::Display::EndFrame ( )

Definition at line 37 of file Graphics.cpp.

Referenced by drawGL(), and HandleFrame().

◆ FillCircle() [1/2]

void Graphics::Display::FillCircle ( point  p,
float  radius,
rgbColor  c 
)

◆ FillCircle() [2/2]

void Graphics::Display::FillCircle ( rect  r,
rgbColor  c 
)

◆ FillLineSegments()

void Graphics::Display::FillLineSegments ( const std::vector< point > &  points,
float  lineWidth,
rgbColor  c 
)

Definition at line 239 of file Graphics.cpp.

References backgroundLineSegments, drawingBackground, and lineSegments.

◆ FillNGon()

void Graphics::Display::FillNGon ( point  p,
float  radius,
int  sides,
float  rotation,
rgbColor  c 
)

◆ FillRect()

void Graphics::Display::FillRect ( rect  r,
rgbColor  c 
)

◆ FillSquare()

void Graphics::Display::FillSquare ( point  p,
float  radius,
rgbColor  c 
)

◆ FillTriangle()

void Graphics::Display::FillTriangle ( point  p1,
point  p2,
point  p3,
rgbColor  c 
)

◆ FrameCircle() [1/2]

void Graphics::Display::FrameCircle ( point  r,
float  radius,
rgbColor  c,
float  lineWidth 
)

◆ FrameCircle() [2/2]

void Graphics::Display::FrameCircle ( rect  r,
rgbColor  c,
float  lineWidth 
)

◆ FrameNGon()

void Graphics::Display::FrameNGon ( point  p,
float  radius,
float  width,
int  sides,
float  rotation,
rgbColor  c 
)

◆ FrameRect()

void Graphics::Display::FrameRect ( rect  r,
rgbColor  c,
float  lineWidth 
)

◆ FrameSquare()

void Graphics::Display::FrameSquare ( point  p,
float  radius,
rgbColor  c,
float  lineWidth 
)

◆ FrameTriangle()

void Graphics::Display::FrameTriangle ( point  p1,
point  p2,
point  p3,
float  lineWidth,
rgbColor  c 
)

Definition at line 155 of file Graphics.cpp.

References backgroundDrawCommands, drawCommands, drawingBackground, and kFrameTriangle.

Referenced by Hexagon::Draw().

◆ GetNumViewports()

int Graphics::Display::GetNumViewports ( )
inline

Definition at line 156 of file Graphics.h.

References numViewports.

◆ SetNumViewports()

void Graphics::Display::SetNumViewports ( uint8_t  v)

Definition at line 63 of file Graphics.cpp.

References numViewports.

Referenced by SetNumPorts().

◆ SetViewport()

void Graphics::Display::SetViewport ( uint8_t  v)

Definition at line 68 of file Graphics.cpp.

Referenced by SetNumPorts(), and setViewport().

◆ StartBackground()

void Graphics::Display::StartBackground ( )

◆ StartFrame()

void Graphics::Display::StartFrame ( )

Definition at line 29 of file Graphics.cpp.

References drawCommands, foregroundFrame, lineSegments, and text.

Referenced by drawGL().

Member Data Documentation

◆ backgroundDrawCommands

std::vector<data> Graphics::Display::backgroundDrawCommands

◆ backgroundFrame

uint64_t Graphics::Display::backgroundFrame

Definition at line 275 of file Graphics.h.

Referenced by BackgroundNeedsRedraw(), Display(), and StartBackground().

◆ backgroundLineSegments

std::vector<segments> Graphics::Display::backgroundLineSegments

Definition at line 274 of file Graphics.h.

Referenced by DrawGraphics(), DrawLineSegments(), FillLineSegments(), and StartBackground().

◆ backgroundText

std::vector<textInfo> Graphics::Display::backgroundText

Definition at line 273 of file Graphics.h.

Referenced by DrawGraphics(), DrawText(), and StartBackground().

◆ drawCommands

std::vector<data> Graphics::Display::drawCommands

◆ drawingBackground

bool Graphics::Display::drawingBackground
private

◆ foregroundFrame

uint64_t Graphics::Display::foregroundFrame

Definition at line 276 of file Graphics.h.

Referenced by BackgroundNeedsRedraw(), Display(), StartBackground(), and StartFrame().

◆ lineSegments

std::vector<segments> Graphics::Display::lineSegments

Definition at line 270 of file Graphics.h.

Referenced by DrawGraphics(), DrawLineSegments(), FillLineSegments(), MakeSVG(), and StartFrame().

◆ numViewports

uint8_t Graphics::Display::numViewports
private

Definition at line 279 of file Graphics.h.

Referenced by Display(), GetNumViewports(), and SetNumViewports().

◆ text

std::vector<textInfo> Graphics::Display::text

Definition at line 269 of file Graphics.h.

Referenced by DrawGraphics(), DrawText(), MakeSVG(), and StartFrame().

◆ viewport

uint8_t Graphics::Display::viewport
private

Definition at line 278 of file Graphics.h.


The documentation for this class was generated from the following files: