Entropy Piano Tuner  1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
DrawerBase Class Referenceabstract

Abstract base class for drawing 2d graphics. More...

#include <drawerbase.h>

+ Inheritance diagram for DrawerBase:
+ Collaboration diagram for DrawerBase:

Public Member Functions

 DrawerBase (GraphicsViewAdapter *graphics, double intervall=1.0/24.0)
 Constructor of a drawer. More...
 
 ~DrawerBase ()
 
void redraw (bool force=false)
 Function to completely redraw the scene. More...
 
bool requestRedraw (bool force=false)
 Check whether the content has to be redrawn. More...
 

Protected Member Functions

virtual void draw ()=0
 Abstract function : draw the content. More...
 
virtual void clear ()
 Clear the whole view. More...
 

Protected Attributes

GraphicsViewAdaptermGraphics
 Pointer to the graphics view adapter. More...
 

Private Types

using system_time_point = std::chrono::time_point< std::chrono::high_resolution_clock >
 

Private Attributes

system_time_point mTimeLastDrawn
 Timeposition when last drawn. More...
 
double mRedrawIntervalInSecs
 Update time. More...
 

Detailed Description

Abstract base class for drawing 2d graphics.

A drawer is an object that draws 2d graphics by calling the methods of a GraphicsViewAdapter. A call of redraw() redraws the complete graphics.

Definition at line 40 of file drawerbase.h.

Member Typedef Documentation

using DrawerBase::system_time_point = std::chrono::time_point<std::chrono::high_resolution_clock>
private

Definition at line 56 of file drawerbase.h.

Constructor & Destructor Documentation

DrawerBase::DrawerBase ( GraphicsViewAdapter graphics,
double  intervall = 1.0/24.0 
)

Constructor of a drawer.

Parameters
graphics: Pointer to the GraphicsViewAdapter
intervall: maximal update interval in seconds

Definition at line 37 of file drawerbase.cpp.

DrawerBase::~DrawerBase ( )
inline

Definition at line 44 of file drawerbase.h.

Member Function Documentation

virtual void DrawerBase::clear ( )
inlineprotectedvirtual

Clear the whole view.

Reimplemented in FourierSpectrumGraphDrawer, and TuningIndicatorDrawer.

Definition at line 51 of file drawerbase.h.

+ Here is the call graph for this function:

virtual void DrawerBase::draw ( )
protectedpure virtual

Abstract function : draw the content.

Implemented in TuningCurveGraphDrawer, FourierSpectrumGraphDrawer, and TuningIndicatorDrawer.

void DrawerBase::redraw ( bool  force = false)

Function to completely redraw the scene.

The function first clears the scene and then calls the abstract draw() method.

Parameters
force: true if redrawing is forced.

Definition at line 57 of file drawerbase.cpp.

+ Here is the call graph for this function:

bool DrawerBase::requestRedraw ( bool  force = false)

Check whether the content has to be redrawn.

If force is set to false the function returns true on redraw timeout. If force is set to true the function will always return true. If returning true the function will automatically reset the timer.

Parameters
force: Force redrawing
Returns
true for redrawing, false otherwise

Definition at line 81 of file drawerbase.cpp.

Member Data Documentation

GraphicsViewAdapter* DrawerBase::mGraphics
protected

Pointer to the graphics view adapter.

Definition at line 53 of file drawerbase.h.

double DrawerBase::mRedrawIntervalInSecs
private

Update time.

Definition at line 58 of file drawerbase.h.

system_time_point DrawerBase::mTimeLastDrawn
private

Timeposition when last drawn.

Definition at line 57 of file drawerbase.h.


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