SPH
Public Member Functions | Protected Attributes | List of all members
HistogramPlot Class Reference

Differential histogram of quantities. More...

#include <Plot.h>

Inheritance diagram for HistogramPlot:
IPlot Polymorphic

Public Member Functions

 HistogramPlot (const Post::HistogramId id, const Optional< Interval > interval, const Float period, const std::string &name)
 
 HistogramPlot (const QuantityId id, const Optional< Interval > interval, const Float period)
 
virtual std::string getCaption () const override
 Returns the caption of the plot. More...
 
virtual void onTimeStep (const Storage &storage, const Statistics &stats) override
 Updates the plot with new data. More...
 
virtual void clear () override
 Clears all cached data, prepares for next run. More...
 
virtual void plot (IDrawingContext &dc) const override
 Draws the plot into the drawing context. More...
 
- Public Member Functions inherited from IPlot
Interval rangeX () const
 Returns the plotted range in x-coordinate. More...
 
Interval rangeY () const
 Returns the plotted range in y-coordinate. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Protected Attributes

Post::ExtHistogramId id
 ID of a quantity from which the histogram is constructed. More...
 
Array< Post::HistPointpoints
 Points representing the histogram. More...
 
Optional< Intervalinterval
 
Float period
 Period of redrawing the histogram. Zero means the histogram is drawn every time step. More...
 
std::string name
 Displayed name of the histogram. More...
 
Float lastTime = -INFTY
 
- Protected Attributes inherited from IPlot
struct {
   Interval   x
 
   Interval   y
 
ranges
 

Detailed Description

Differential histogram of quantities.

Plot doesn't store any history, it is drawed each timestep independently.

Definition at line 242 of file Plot.h.

Constructor & Destructor Documentation

◆ HistogramPlot() [1/2]

HistogramPlot::HistogramPlot ( const Post::HistogramId  id,
const Optional< Interval interval,
const Float  period,
const std::string &  name 
)
inline

Definition at line 264 of file Plot.h.

◆ HistogramPlot() [2/2]

HistogramPlot::HistogramPlot ( const QuantityId  id,
const Optional< Interval interval,
const Float  period 
)
inline

Definition at line 273 of file Plot.h.

Member Function Documentation

◆ clear()

void HistogramPlot::clear ( )
overridevirtual

Clears all cached data, prepares for next run.

Implements IPlot.

Definition at line 198 of file Plot.cpp.

◆ getCaption()

virtual std::string HistogramPlot::getCaption ( ) const
inlineoverridevirtual

Returns the caption of the plot.

Implements IPlot.

Definition at line 280 of file Plot.h.

◆ onTimeStep()

void HistogramPlot::onTimeStep ( const Storage storage,
const Statistics stats 
)
overridevirtual

Updates the plot with new data.

Called every time step.

Implements IPlot.

Definition at line 175 of file Plot.cpp.

◆ plot()

void HistogramPlot::plot ( IDrawingContext dc) const
overridevirtual

Draws the plot into the drawing context.

Implements IPlot.

Definition at line 202 of file Plot.cpp.

Member Data Documentation

◆ id

Post::ExtHistogramId HistogramPlot::id
protected

ID of a quantity from which the histogram is constructed.

Definition at line 245 of file Plot.h.

◆ interval

Optional<Interval> HistogramPlot::interval
protected

Interval for which the histogram is constructed.

If NOTHING, the interval is created by enclosing all x values.

Definition at line 253 of file Plot.h.

◆ lastTime

Float HistogramPlot::lastTime = -INFTY
protected

Definition at line 261 of file Plot.h.

◆ name

std::string HistogramPlot::name
protected

Displayed name of the histogram.

Definition at line 259 of file Plot.h.

◆ period

Float HistogramPlot::period
protected

Period of redrawing the histogram. Zero means the histogram is drawn every time step.

Definition at line 256 of file Plot.h.

◆ points

Array<Post::HistPoint> HistogramPlot::points
protected

Points representing the histogram.

Definition at line 248 of file Plot.h.


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