SPH
Public Member Functions | Protected Attributes | List of all members
SpatialPlot< TDerived > Class Template Reference

Base class for plots showing a dependence of given quantity on a spatial coordinate. More...

#include <Plot.h>

Inheritance diagram for SpatialPlot< TDerived >:
IPlot Polymorphic

Public Member Functions

 SpatialPlot (const QuantityId id, const Optional< Size > binCnt=NOTHING)
 Constructs the spatial plot. More...
 
virtual std::string getCaption () const override
 Returns the caption of the plot. More...
 
virtual void onTimeStep (const Storage &storage, const Statistics &UNUSED(stats)) override
 
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...
 
virtual void onTimeStep (const Storage &storage, const Statistics &stats)=0
 Updates the plot with new data. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Protected Attributes

QuantityId id
 
Array< PlotPointpoints
 
Optional< SizebinCnt
 
- Protected Attributes inherited from IPlot
struct {
   Interval   x
 
   Interval   y
 
ranges
 

Detailed Description

template<typename TDerived>
class SpatialPlot< TDerived >

Base class for plots showing a dependence of given quantity on a spatial coordinate.

Currently only works with scalar quantities.

Todo:
Needs to limit the number of drawn points - we definitely dont want to draw 10^5 points.

Definition at line 113 of file Plot.h.

Constructor & Destructor Documentation

◆ SpatialPlot()

template<typename TDerived >
SpatialPlot< TDerived >::SpatialPlot ( const QuantityId  id,
const Optional< Size binCnt = NOTHING 
)
inlineexplicit

Constructs the spatial plot.

Parameters
idQuantity to plot
binCntNumber of points in the plot; if NOTHING, each particle is plotted as a point.

Definition at line 123 of file Plot.h.

Member Function Documentation

◆ clear()

template<typename TDerived >
void SpatialPlot< TDerived >::clear ( )
overridevirtual

Clears all cached data, prepares for next run.

Implements IPlot.

Definition at line 62 of file Plot.cpp.

◆ getCaption()

template<typename TDerived >
virtual std::string SpatialPlot< TDerived >::getCaption ( ) const
inlineoverridevirtual

Returns the caption of the plot.

Implements IPlot.

Definition at line 127 of file Plot.h.

◆ onTimeStep()

template<typename TDerived >
NAMESPACE_SPH_BEGIN void SpatialPlot< TDerived >::onTimeStep ( const Storage storage,
const Statistics UNUSEDstats 
)
overridevirtual
Note
SpatialPlot should be only used through derived classes, so it's ok to put templated functions here

Definition at line 17 of file Plot.cpp.

◆ plot()

template<typename TDerived >
void SpatialPlot< TDerived >::plot ( IDrawingContext dc) const
overridevirtual

Draws the plot into the drawing context.

Implements IPlot.

Definition at line 68 of file Plot.cpp.

Member Data Documentation

◆ binCnt

template<typename TDerived >
Optional<Size> SpatialPlot< TDerived >::binCnt
protected

Definition at line 117 of file Plot.h.

◆ id

template<typename TDerived >
QuantityId SpatialPlot< TDerived >::id
protected

Definition at line 115 of file Plot.h.

◆ points

template<typename TDerived >
Array<PlotPoint> SpatialPlot< TDerived >::points
protected

Definition at line 116 of file Plot.h.


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