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
StroboscopicViewAdapterForQt Class Reference

Stroboscopic view adapter for Qt. More...

#include <stroboscopicviewadapterforqt.h>

+ Inheritance diagram for StroboscopicViewAdapterForQt:
+ Collaboration diagram for StroboscopicViewAdapterForQt:

Public Member Functions

 StroboscopicViewAdapterForQt (QWidget *parent, DrawerBase *drawer, QRectF sceneRect)
 Constructor with no stroboscope in the beginning. More...
 
 ~StroboscopicViewAdapterForQt ()
 Destructor, deleting the stroboscope if existent. More...
 
virtual void drawStroboscope (const ComplexVector &data) overridefinal
 StroboscopicViewAdapterForQt::drawStroboscope. More...
 
void clear () overridefinal
 Clear view of stroboscope and spectral indicator. More...
 
- Public Member Functions inherited from GraphicsViewAdapterForQt
 GraphicsViewAdapterForQt (QWidget *parent, DrawerBase *drawer, QRectF sceneRect)
 Constructor. More...
 
 ~GraphicsViewAdapterForQt ()
 Destructor, removing all graphics items from the list. More...
 
void setSceneRect (const QRectF &rect)
 Setter function for the scene rectangle. More...
 
QPointF convertRelToAbs (const QPointF &p) const
 Converting from relative to absolute coordinates. More...
 
QSizeF convertRelToAbs (const QSizeF &s) const
 Converting from relative to absolute coordinates. More...
 
QLineF convertRelToAbsLine (qreal x1, qreal y1, qreal x2, qreal y2) const
 Converting of a line from relative to absolute coordinates. More...
 
QPointF convertAbsToRel (const QPointF &p) const
 Converting from absolute to relative coordinates. More...
 
- Public Member Functions inherited from GraphicsViewAdapter
 GraphicsViewAdapter ()
 Empty constructor. More...
 
 ~GraphicsViewAdapter ()
 Destructor clearing the view. More...
 
GraphicItemsListgetGraphicItems ()
 Get the list of the graphic items. More...
 
const GraphicItemsListgetGraphicItems () const
 Get a constant list of the graphic items. More...
 
GraphicsItemgetGraphicItem (int keyIndex, RoleType role)
 Get a single graphics element specified by its index and its role. More...
 
GraphicsItemgetGraphicItemByRole (RoleType role)
 Get the first of all graphics elements with a given role. More...
 
GraphicItemsList getGraphicItems (int keyIndex)
 Get a list of graphic items that match with the keyIndex. More...
 
GraphicItemsList getGraphicItemsByRole (RoleType role)
 Get a list of graphic items that match with the given role. More...
 
GraphicItemsList getGraphicItems (int keyIndex, RoleType role)
 Get the list of all graphics elements of a given key and role. More...
 

Private Attributes

QGraphicsPixmapItem * mStroboscopeItem
 Pointer to the stroboscope. More...
 

Additional Inherited Members

- Public Types inherited from GraphicsViewAdapter
enum  PenType {
  PEN_THIN_BLACK, PEN_MEDIUM_BLACK, PEN_THIN_VERY_LIGHT_GRAY, PEN_THIN_LIGHT_GRAY,
  PEN_THIN_DARK_GRAY, PEN_MEDIUM_LIGHT_GRAY, PEN_MEDIUM_DARK_GRAY, PEN_MEDIUM_GRAY,
  PEN_THIN_CYAN, PEN_MEDIUM_CYAN, PEN_MEDIUM_ORANGE, PEN_MEDIUM_MAGENTA,
  PEN_THIN_MAGENTA, PEN_THIN_RED, PEN_MEDIUM_RED, PEN_THIN_BLUE,
  PEN_THIN_TRANSPARENT, PEN_MEDIUM_DARK_GREEN
}
 Available pen types for drawing. More...
 
enum  FillTypes {
  FILL_TRANSPARENT, FILL_LIGHT_GRAY, FILL_RED, FILL_ORANGE,
  FILL_GREEN, FILL_LIGHT_GREEN, FILL_BLUE
}
 Available filling colors (e.g. to fill rectangles) More...
 
using RoleType = GraphicsItem::RoleType
 
using ComplexVector = std::vector< std::complex< double >>
 Abstract function: Draw stroboscope. More...
 
- Protected Member Functions inherited from GraphicsViewAdapterForQt
void showEvent (QShowEvent *event) override
 Show the scene (reimplemented show event). More...
 
void resizeEvent (QResizeEvent *event) override
 Resize the scene (reimplemented resize event). More...
 
virtual GraphicsItemdrawLine (double x1, double y1, double x2, double y2, PenType pen) override
 Abstract function: Draw a line. More...
 
virtual GraphicsItemdrawChart (const std::vector< Point > &points, PenType pen) override
 Abstract function: Draw a chart (polygon). More...
 
virtual GraphicsItemdrawFilledRect (double x, double y, double w, double h, PenType pen, FillTypes fill) override
 Abstract function: Draw a filled rectangle. More...
 
- Protected Attributes inherited from GraphicsViewAdapterForQt
DrawerBasemDrawer
 The drawer of this GraphicsViewAdapterForQt. More...
 
QGraphicsScene mScene
 The QGraphicsScene. More...
 
QRectF mSceneRect
 The scene rect. More...
 

Detailed Description

Stroboscopic view adapter for Qt.

This is the implementation of the stroboscopic view adapter for Qt. The essential function is drawStroboscope, which depends on a vector of complex numbers. The stroboscope shows stripes of rainbow colorscales with an intensity proportional to the absolute values of the complex numbers and a horizontal shift proportional to the phase of the complex numbers. This function is time-critical and uses direct memory access.

This class is derived from GraphicsViewAdapterForQt. It is therefore a special type of GraphicsView which is able to display a stroboscope.

See also
GraphicsViewAdapterForQt

Definition at line 45 of file stroboscopicviewadapterforqt.h.

Constructor & Destructor Documentation

StroboscopicViewAdapterForQt::StroboscopicViewAdapterForQt ( QWidget *  parent,
DrawerBase drawer,
QRectF  sceneRect 
)

Constructor with no stroboscope in the beginning.

Parameters
parent: The parent widget
drawer: The drawer that draws into this graphics view
sceneRect: The scene rectange for QGraphicsView

This function calls the constructor of the base class and resets the pointer to the stroboscope, meaning that the stroboscope is not yet active.

Definition at line 45 of file stroboscopicviewadapterforqt.cpp.

StroboscopicViewAdapterForQt::~StroboscopicViewAdapterForQt ( )

Destructor, deleting the stroboscope if existent.

Definition at line 62 of file stroboscopicviewadapterforqt.cpp.

Member Function Documentation

void StroboscopicViewAdapterForQt::clear ( )
finaloverridevirtual

Clear view of stroboscope and spectral indicator.

Reimplemented from GraphicsViewAdapterForQt.

Definition at line 80 of file stroboscopicviewadapterforqt.cpp.

+ Here is the call graph for this function:

void StroboscopicViewAdapterForQt::drawStroboscope ( const ComplexVector data)
finaloverridevirtual

StroboscopicViewAdapterForQt::drawStroboscope.

This function depends on a vector of complex numbers. It draws rainbow-like strips with an intensity proportional to the absolute values of the complex numbers and a horizontal shift proportional to the phase of the complex numbers. This function is time-critical and uses direct memory access.

Parameters
data: Vector of complex numbers holding the stroboscopic information

Reimplemented from GraphicsViewAdapterForQt.

Definition at line 104 of file stroboscopicviewadapterforqt.cpp.

+ Here is the call graph for this function:

Member Data Documentation

QGraphicsPixmapItem* StroboscopicViewAdapterForQt::mStroboscopeItem
private

Pointer to the stroboscope.

Definition at line 57 of file stroboscopicviewadapterforqt.h.


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