Commit 8e25b4fe authored by Lefebvre, Jordan's avatar Lefebvre, Jordan
Browse files

Cleaning up vtkPlotErrorBars.

parent b9a2ace2
......@@ -32,9 +32,9 @@ vtkCxxSetObjectMacro(vtkPlotErrorBars, YAxis, vtkAxis);
//-----------------------------------------------------------------------------
vtkPlotErrorBars::vtkPlotErrorBars()
: ShiftScale(0.0, 0.0, 1.0, 1.0)
{
this->Pen = vtkSmartPointer<vtkPen>::New();
vtkPlot::ShiftScale = vtkRectd(0.0, 0.0, 1.0, 1.0);
this->Pen = vtkSmartPointer<vtkPen>::New();
this->Pen->SetWidth(2.0);
this->Brush = vtkSmartPointer<vtkBrush>::New();
......
......@@ -69,7 +69,7 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
* used by Plots that return more than one label.
*/
virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf &rect,
int legendIndex);
int legendIndex) override;
//@{
/**
......@@ -84,24 +84,24 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
* Any other characters or unrecognized format tags are printed in the
* tooltip label verbatim.
*/
virtual void SetTooltipLabelFormat(const vtkStdString &label);
virtual vtkStdString GetTooltipLabelFormat();
virtual void SetTooltipLabelFormat(const vtkStdString &label) override;
virtual vtkStdString GetTooltipLabelFormat() override;
//@}
//@{
/**
* Sets/gets the tooltip notation style.
*/
virtual void SetTooltipNotation(int notation);
virtual int GetTooltipNotation();
virtual void SetTooltipNotation(int notation) override;
virtual int GetTooltipNotation() override;
//@}
//@{
/**
* Sets/gets the tooltip precision.
*/
virtual void SetTooltipPrecision(int precision);
virtual int GetTooltipPrecision();
virtual void SetTooltipPrecision(int precision) override;
virtual int GetTooltipPrecision() override;
//@}
/**
......@@ -110,7 +110,7 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
*/
virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos,
vtkIdType seriesIndex,
vtkIdType segmentIndex);
vtkIdType segmentIndex) override;
/**
* Function to query a plot for the nearest point to the specified coordinate.
......@@ -119,38 +119,39 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
*/
virtual vtkIdType GetNearestPoint(const vtkVector2f &point,
const vtkVector2f &tolerance,
vtkVector2f *location);
vtkVector2f *location) override;
/**
* Select all points in the specified rectangle.
*/
virtual bool SelectPoints(const vtkVector2f &min, const vtkVector2f &max);
virtual bool SelectPoints(const vtkVector2f &min,
const vtkVector2f &max) override;
/**
* Select all points in the specified polygon.
*/
virtual bool SelectPointsInPolygon(const vtkContextPolygon &polygon);
virtual bool SelectPointsInPolygon(const vtkContextPolygon &polygon) override;
//@{
/**
* Set the plot color
*/
virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
unsigned char a);
virtual void SetColor(double r, double g, double b);
virtual void GetColor(double rgb[3]);
unsigned char a) override;
virtual void SetColor(double r, double g, double b) override;
virtual void GetColor(double rgb[3]) override;
void GetColor(unsigned char rgb[3]);
//@}
/**
* Set the width of the line.
*/
virtual void SetWidth(float width);
virtual void SetWidth(float width) override;
/**
* Get the width of the line.
*/
virtual float GetWidth();
virtual float GetWidth() override;
//@{
/**
......@@ -189,29 +190,29 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
/**
* Set the label of this plot.
*/
virtual void SetLabel(const vtkStdString &label);
virtual void SetLabel(const vtkStdString &label) override;
/**
* Get the label of this plot.
*/
virtual vtkStdString GetLabel();
virtual vtkStdString GetLabel() override;
/**
* Set the plot labels, these are used for stacked chart variants, with the
* index referring to the stacking index.
*/
virtual void SetLabels(vtkStringArray *labels);
virtual void SetLabels(vtkStringArray *labels) override;
/**
* Get the plot labels. If this array has a length greater than 1 the index
* refers to the stacked objects in the plot. See vtkPlotBar for example.
*/
virtual vtkStringArray *GetLabels();
virtual vtkStringArray *GetLabels() override;
/**
* Get the number of labels associated with this plot.
*/
virtual int GetNumberOfLabels();
virtual int GetNumberOfLabels() override;
/**
* Get the label at the specified index.
......@@ -228,7 +229,7 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
/**
* Get the indexed labels array.
*/
virtual vtkStringArray *GetIndexedLabels();
virtual vtkStringArray *GetIndexedLabels() override;
/**
* Get the data object that the plot will draw.
......@@ -256,9 +257,9 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
* This is a convenience function to set the input table and the x, y column
* for the plot.
*/
virtual void SetInputData(vtkTable *table);
virtual void SetInputData(vtkTable *table) override;
virtual void SetInputData(vtkTable *table, const vtkStdString &xColumn,
const vtkStdString &yColumn);
const vtkStdString &yColumn) override;
void SetInputData(vtkTable *table, vtkIdType xColumn, vtkIdType yColumn);
virtual void SetInputData(vtkTable *table, const vtkStdString &xColumn,
const vtkStdString &yColumn,
......@@ -271,14 +272,14 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
/**
* Get the input table used by the plot.
*/
virtual vtkTable *GetInput();
virtual vtkTable *GetInput() override;
/**
* Convenience function to set the input arrays. For most plots index 0
* is the x axis, and index 1 is the y axis. The name is the name of the
* column in the vtkTable.
*/
virtual void SetInputArray(int index, const vtkStdString &name);
virtual void SetInputArray(int index, const vtkStdString &name) override;
//@{
/**
......@@ -298,7 +299,7 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
* If Selectable is false, then this method does nothing.
* \sa SetSelectable()
*/
virtual void SetSelection(vtkIdTypeArray *id);
virtual void SetSelection(vtkIdTypeArray *id) override;
vtkGetObjectMacro(Selection, vtkIdTypeArray);
//@}
......@@ -307,7 +308,7 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
* Get/set the X axis associated with this plot.
*/
vtkGetObjectMacro(XAxis, vtkAxis);
virtual void SetXAxis(vtkAxis *axis);
virtual void SetXAxis(vtkAxis *axis) override;
//@}
//@{
......@@ -315,7 +316,7 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
* Get/set the Y axis associated with this plot.
*/
vtkGetObjectMacro(YAxis, vtkAxis);
virtual void SetYAxis(vtkAxis *axis);
virtual void SetYAxis(vtkAxis *axis) override;
//@}
//@{
......@@ -334,7 +335,7 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
* See \a GetUnscaledInputBounds for more information.
*/
virtual void GetBounds(double bounds[4])
virtual void GetBounds(double bounds[4]) override
{
bounds[0] = bounds[1] = bounds[2] = bounds[3] = 0.0;
}
......@@ -363,7 +364,7 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
* The returned \a bounds are stored as (Xmin, Xmax, Ymin, Ymax).
*/
virtual void GetUnscaledInputBounds(double bounds[4])
virtual void GetUnscaledInputBounds(double bounds[4]) override
{
// Implemented here by calling GetBounds() to support plot
// subclasses that do no log-scaling or plot orientation.
......@@ -376,15 +377,16 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
* subclasses must add checks to avoid rebuilding of cache, unless necessary.
* Default implementation is empty.
*/
virtual void UpdateCache() {}
virtual void UpdateCache() override {}
//@{
/**
* A General setter/getter that should be overridden. It can silently drop
* options, case is important
*/
virtual void SetProperty(const vtkStdString &property, const vtkVariant &var);
virtual vtkVariant GetProperty(const vtkStdString &property);
virtual void SetProperty(const vtkStdString &property,
const vtkVariant &var) override;
virtual vtkVariant GetProperty(const vtkStdString &property) override;
//@}
protected:
......@@ -396,97 +398,6 @@ class VTKCHARTSCORE_EXPORT vtkPlotErrorBars : public vtkPlot
*/
vtkStdString GetNumber(double position, vtkAxis *axis);
/**
* This object stores the vtkPen that controls how the plot is drawn.
*/
vtkSmartPointer<vtkPen> Pen;
/**
* This object stores the vtkBrush that controls how the plot is drawn.
*/
vtkSmartPointer<vtkBrush> Brush;
/**
* This object stores the vtkPen that controls how the selected elements
* of the plot are drawn.
*/
vtkSmartPointer<vtkPen> SelectionPen;
/**
* This object stores the vtkBrush that controls how the selected elements
* of the plot are drawn.
*/
vtkSmartPointer<vtkBrush> SelectionBrush;
/**
* Plot labels, used by legend.
*/
vtkSmartPointer<vtkStringArray> Labels;
/**
* Holds Labels when they're auto-created
*/
vtkSmartPointer<vtkStringArray> AutoLabels;
/**
* Holds Labels when they're auto-created
*/
vtkSmartPointer<vtkStringArray> IndexedLabels;
/**
* Use the Y array index for the X value. If true any X column setting will be
* ignored, and the X values will simply be the index of the Y column.
*/
bool UseIndexForXSeries;
/**
* This data member contains the data that will be plotted, it inherits
* from vtkAlgorithm.
*/
vtkSmartPointer<vtkContextMapper2D> Data;
/**
* Whether plot points can be selected or not.
*/
bool Selectable;
/**
* Selected indices for the table the plot is rendering
*/
vtkIdTypeArray *Selection;
/**
* The X axis associated with this plot.
*/
vtkAxis *XAxis;
/**
* The X axis associated with this plot.
*/
vtkAxis *YAxis;
/**
* A printf-style string to build custom tooltip labels from.
* See the accessor/mutator functions for full documentation.
*/
vtkStdString TooltipLabelFormat;
/**
* The default printf-style string to build custom tooltip labels from.
* See the accessor/mutator functions for full documentation.
*/
vtkStdString TooltipDefaultLabelFormat;
int TooltipNotation;
int TooltipPrecision;
/**
* The current shift in origin and scaling factor applied to the plot.
*/
vtkRectd ShiftScale;
bool LegendVisibility;
private:
vtkPlotErrorBars(const vtkPlotErrorBars &) = delete;
void operator=(const vtkPlotErrorBars &) = delete;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment