-
Notifications
You must be signed in to change notification settings - Fork 0
/
AnalysisFrameRenderer.h
58 lines (41 loc) · 1.24 KB
/
AnalysisFrameRenderer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers (this file is usually all you
// need because it includes almost all "standard" wxWidgets headers)
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include <memory>
#include "PollingProject.h"
class ElectionAnalyser;
class AnalysisFrameRenderer {
public:
AnalysisFrameRenderer(PollingProject const& project, wxDC& dc, ElectionAnalyser const& electionAnalyser, wxSize dimensions, wxPoint textOffset);
void render();
// clears the drawing area.
static void clearDC(wxDC& dc);
private:
struct DisplayVariables {
float DCwidth;
float DCheight;
float displayTop;
float displayBottom;
};
// sets the brush and pen to a particular colour.
void setBrushAndPen(wxColour currentColour) const;
void drawBackground() const;
void drawText() const;
void drawClusters() const;
float backgroundHeight() const;
// defines the basic variables that represent the pixel limits of the graph.
void defineBackgroundLimits();
PollingProject const& project;
wxDC& dc;
ElectionAnalyser const& electionAnalyser;
wxPoint textOffset;
DisplayVariables dv;
};