Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::Draw Class Reference

Contains functions for drawing general stuff for graphs. More...

#include <Draw.h>

Public Types

enum  ERulerOrientation : int {
  roNone = 0x0 , roLeft = 0x1 , roRight = 0x2 , roTop = 0x4 ,
  roBottom = 0x8
}
 Orientation for drawing a graph ruler. More...
 
enum  EGridOrientation : int { goHorizontal = 0x1 , goVertical = 0x2 }
 Orientation for drawing grid lines in a graph. More...
 

Public Member Functions

 Draw ()
 Default constructor.
 
bool ruler (QPainter &painter, ERulerOrientation ro, const QColor &color, const QColor &font_color, const QRect &bounds, const QRect &area, double start, double stop, int digits, const QString &unit) const
 Draws a ruler for example around a graph.
 
bool gridLines (QPainter &painter, EGridOrientation go, const QColor &color, const QRect &bounds, double start, double stop, unsigned digits) const
 Draws the lines in the graph as the ruler ticks.
 
bool textCross (QPainter &painter, const QRect &bounds, const QString &text, const QColor &color)
 Draws a cross with text rectangle in the middle.
 

Detailed Description

Contains functions for drawing general stuff for graphs.

Member Enumeration Documentation

◆ EGridOrientation

Orientation for drawing grid lines in a graph.

Enumerator
goHorizontal 

Draws grid horizontally.

goVertical 

Draws grid vertically.

◆ ERulerOrientation

Orientation for drawing a graph ruler.

Enumerator
roNone 

Disable value.

roLeft 

Draws ruler as situated at the left of a graph.

roRight 

Draws ruler as situated at the right of a graph.

roTop 

Draws ruler as situated at the top of a graph.

roBottom 

Draws ruler as situated at the bottom of a graph.

Constructor & Destructor Documentation

◆ Draw()

sf::Draw::Draw ( )

Default constructor.

Member Function Documentation

◆ gridLines()

bool sf::Draw::gridLines ( QPainter &  painter,
EGridOrientation  go,
const QColor &  color,
const QRect &  bounds,
double  start,
double  stop,
unsigned  digits 
) const

Draws the lines in the graph as the ruler ticks.

Parameters
painterPainter context.
goOrientation.
colorColor of the grid lines.
boundsArea boundaries for the ruler.
startStart value of grid lines.
stopStop value of grid lines.
digitsTo make the grid correspond with the ruler when vertical.
Returns
True on success false in case of an exception.

◆ ruler()

bool sf::Draw::ruler ( QPainter &  painter,
ERulerOrientation  ro,
const QColor &  color,
const QColor &  font_color,
const QRect &  bounds,
const QRect &  area,
double  start,
double  stop,
int  digits,
const QString &  unit 
) const

Draws a ruler for example around a graph.

Parameters
painterPainter context.
roOrientation.
colorColor for the ticks.
font_colorColor of the texts.
boundsBoundaries for the ruler.
areaArea available to paint texts on.
startStart value of ruler.
stopStop value of ruler.
digitsAmount of significant digits or resolution of the printed values.
unitunit string.
Returns
True on success false in case of an exception.

◆ textCross()

bool sf::Draw::textCross ( QPainter &  painter,
const QRect &  bounds,
const QString &  text,
const QColor &  color 
)

Draws a cross with text rectangle in the middle.

Parameters
painterPainter context.
boundsArea boundaries for the ruler.
textText put in a rectangle in the middle.
colorColor of the cross and text.
Returns
True on success false in case of an exception.

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