OpenCurves  0.9
plotslice.h
1 //
2 // author Kazys Stepanas
3 //
4 // Copyright (c) CSIRO 2015
5 //
6 #ifndef __PLOTSLICE_H_
7 #define __PLOTSLICE_H_
8 
9 #include "plotsconfig.h"
10 
11 #include "plotexpression.h"
12 
13 class PlotSample;
14 
53 class PlotSlice : public PlotExpression
54 {
55 public:
68 
70  ~PlotSlice();
71 
74  inline const PlotExpression *indexee() const { return _indexee; }
77  inline const PlotExpression *indexerStart() const { return _indexerStart; }
80  inline const PlotExpression *indexerEnd() const { return _indexerEnd; }
81 
85  double sample(double sampleTime) const override;
86 
105  BindResult bind(const QList<PlotInstance *> &curves, PlotBindingTracker &bindTracker, PlotExpressionBindDomain &domain, bool repeatLastBinding = false) override;
106 
108  void unbind() override;
109 
112  PlotExpression *clone() const override;
113 
116  inline bool explicitTime() const override { return true; }
117 
118 private:
121  QString stringExpression() const override;
122 
123  PlotExpression *_indexee;
124  PlotExpression *_indexerStart;
125  PlotExpression *_indexerEnd;
126  PlotExpressionBindDomain _sliceDomain;
129 };
130 
131 
132 #endif // __PLOTSLICE_H_
bool explicitTime() const override
Is the generated expression sensitive to changes in the time domain?
Definition: plotslice.h:116
const PlotExpression * indexerEnd() const
Accessor for the index end expression.
Definition: plotslice.h:80
Supports multiple bindings of the same expression to different curves.
Definition: plotbindingtracker.h:34
~PlotSlice()
Destructor.
Core data for binding a PlotExpression.
Definition: plotexpressionbinddomain.h:49
The slice expression supports taking a slice out of another expression.
Definition: plotslice.h:53
BindResult
Return values for the PlotExpression::bind() method.
Definition: plotexpressionbinddomain.h:15
void unbind() override
Unbinds the sampling state.
double sample(double sampleTime) const override
Samples the indexee() at sampleTime.
BindResult bind(const QList< PlotInstance * > &curves, PlotBindingTracker &bindTracker, PlotExpressionBindDomain &domain, bool repeatLastBinding=false) override
Attempts to binds the slice expression.
This expression class binds and references an existing curve.
Definition: plotsample.h:95
const PlotExpression * indexee() const
Accessor for the indexee expression.
Definition: plotslice.h:74
PlotSlice(PlotExpression *indexee, PlotExpression *indexerStart, PlotExpression *indexerEnd)
Defines the slice expression.
A PlotExpression represents an operation in a plot equation.
Definition: plotexpression.h:91
PlotExpression * clone() const override
Performs a deep clone.
const PlotExpression * indexerStart() const
Accessor for the index start expression.
Definition: plotslice.h:77