@@ -74,6 +74,7 @@ class XYLine
74
74
public:
75
75
/* * Creates a line from vectors of x and y values */
76
76
XYLine (std::vector<float > x, std::vector<float > y);
77
+ virtual ~XYLine () = default ;
77
78
78
79
/* * Sets the colour of the line*/
79
80
void setColour (Colour c);
@@ -92,15 +93,15 @@ class XYLine
92
93
93
94
/* * Renders the line. Stretches Y such that ymin->0 and ymax->plotHeight
94
95
and only display points between [xmin and xmax] */
95
- void draw (Graphics& g, XYRange& range, int width, int height);
96
+ virtual void draw (Graphics& g, XYRange& range, int width, int height);
96
97
97
98
/* * The x values */
98
99
std::vector<float > x;
99
100
100
101
/* * The x values */
101
102
std::vector<float > y;
102
103
103
- private :
104
+ protected :
104
105
/* * The parameters of this line */
105
106
Colour colour;
106
107
float width;
@@ -121,7 +122,7 @@ class Axis : public Component
121
122
Axis ();
122
123
123
124
/* * Destructor */
124
- ~Axis () {}
125
+ ~Axis () override {}
125
126
126
127
/* * Sets the min / max range, and number of ticks between them */
127
128
void setRange (float minvalue, float maxvalue, int numTicks = 10 );
@@ -179,7 +180,7 @@ class XAxis : public Axis
179
180
XAxis () {}
180
181
181
182
/* * Renders the axis */
182
- void paint (Graphics& g);
183
+ void paint (Graphics& g) override ;
183
184
};
184
185
185
186
/* *
@@ -194,7 +195,7 @@ class YAxis : public Axis
194
195
YAxis () {}
195
196
196
197
/* * Renders the axis */
197
- void paint (Graphics& g);
198
+ void paint (Graphics& g) override ;
198
199
};
199
200
200
201
/* *
@@ -210,7 +211,7 @@ class PLUGIN_API DrawComponent : public Component
210
211
DrawComponent (Axis* x, Axis* y);
211
212
212
213
/* * Destructor */
213
- ~DrawComponent () {}
214
+ ~DrawComponent () override {}
214
215
215
216
/* * Adds a line to be drawn */
216
217
void add (XYLine* line);
@@ -250,9 +251,9 @@ class PLUGIN_API DrawComponent : public Component
250
251
OwnedArray<XYLine> lines;
251
252
252
253
/* * Mouse listeners */
253
- void mouseDown (const juce::MouseEvent& event);
254
- void mouseDrag (const juce::MouseEvent& event);
255
- void mouseWheelMove (const MouseEvent& event, const MouseWheelDetails& wheel);
254
+ void mouseDown (const juce::MouseEvent& event) override ;
255
+ void mouseDrag (const juce::MouseEvent& event) override ;
256
+ void mouseWheelMove (const MouseEvent& event, const MouseWheelDetails& wheel) override ;
256
257
257
258
// std::vector<float> computeSamplePositions(int subsample);
258
259
std::list<XYRange> rangeMemory;
@@ -263,7 +264,7 @@ class PLUGIN_API DrawComponent : public Component
263
264
264
265
void drawGrid (Graphics& g);
265
266
266
- void paint (Graphics& g);
267
+ void paint (Graphics& g) override ;
267
268
268
269
XYRange range, limit, originalRange;
269
270
@@ -292,15 +293,15 @@ class PLUGIN_API InteractivePlot : public Component,
292
293
InteractivePlot ();
293
294
294
295
/* * Destructor */
295
- ~InteractivePlot () {}
296
+ ~InteractivePlot () override {}
296
297
297
298
/* * Adds a line based on X and Y values */
298
- void plot (std::vector<float > x,
299
- std::vector<float > y,
300
- Colour c = Colours::white,
301
- float width = 1 .0f ,
302
- float opacity = 1 .0f ,
303
- PlotType type = PlotType::LINE);
299
+ virtual void plot (std::vector<float > x,
300
+ std::vector<float > y,
301
+ Colour c = Colours::white,
302
+ float width = 1 .0f ,
303
+ float opacity = 1 .0f ,
304
+ PlotType type = PlotType::LINE);
304
305
305
306
/* * Clears all lines from the plot */
306
307
void clear ();
@@ -345,11 +346,11 @@ class PLUGIN_API InteractivePlot : public Component,
345
346
void getRange (XYRange& range);
346
347
347
348
/* * Called when size of plot is changed */
348
- void resized ();
349
+ void resized () override ;
349
350
350
- private :
351
+ protected :
351
352
/* * Respond to button clicks */
352
- void buttonClicked (Button* btn);
353
+ void buttonClicked (Button* btn) override ;
353
354
354
355
FontOptions font;
355
356
juce::Colour backgroundColour;
0 commit comments