open_iA 2024.9
Loading...
Searching...
No Matches
iAPlot Class Referenceabstract

Interface for a plot which is drawable in a chart. More...

#include <iAPlot.h>

Inheritance diagram for iAPlot:
[legend]
Collaboration diagram for iAPlot:
[legend]

Public Member Functions

 iAPlot (std::shared_ptr< iAPlotData > data, QColor const &color)
 
virtual ~iAPlot ()
 
QColor const color () const
 Get plot color.
 
virtual std::shared_ptr< iAPlotDatadata ()
 Retrieves the data used for drawing.
 
virtual void draw (QPainter &painter, size_t startBin, size_t endBin, iAMapper const &xMapper, iAMapper const &yMapper) const =0
 Draws the plot.
 
virtual void drawLegendItem (QPainter &painter, QRect const &rect)
 Draws a legend item for the plot.
 
virtual void setColor (QColor const &color)
 Set plot color.
 
virtual void setVisible (bool visible)
 Sets whether the plot should be currently drawn or not.
 
virtual bool visible () const
 Whether the plot is currently being drawn.
 

Protected Attributes

std::shared_ptr< iAPlotDatam_data
 
bool m_visible
 

Detailed Description

Interface for a plot which is drawable in a chart.

Encapsulates both the data of the plot and the drawing method

Constructor & Destructor Documentation

◆ iAPlot()

iAPlot::iAPlot ( std::shared_ptr< iAPlotData > data,
QColor const & color )

◆ ~iAPlot()

iAPlot::~iAPlot ( )
virtual

Member Function Documentation

◆ color()

QColor const iAPlot::color ( ) const

Get plot color.

◆ data()

std::shared_ptr< iAPlotData > iAPlot::data ( )
virtual

Retrieves the data used for drawing.

Reimplemented in iAPlotCollection.

◆ draw()

virtual void iAPlot::draw ( QPainter & painter,
size_t startBin,
size_t endBin,
iAMapper const & xMapper,
iAMapper const & yMapper ) const
pure virtual

Draws the plot.

Implemented in iABarGraphPlot, iAPlotCollection, and iASelectedBinPlot.

◆ drawLegendItem()

void iAPlot::drawLegendItem ( QPainter & painter,
QRect const & rect )
virtual

Draws a legend item for the plot.

Reimplemented in iABarGraphPlot.

◆ setColor()

void iAPlot::setColor ( QColor const & color)
virtual

Set plot color.

Reimplemented in iAPlotCollection.

◆ setVisible()

void iAPlot::setVisible ( bool visible)
virtual

Sets whether the plot should be currently drawn or not.

◆ visible()

bool iAPlot::visible ( ) const
virtual

Whether the plot is currently being drawn.

Member Data Documentation

◆ m_data

std::shared_ptr<iAPlotData> iAPlot::m_data
protected

◆ m_visible

bool iAPlot::m_visible
protected

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