Commit abaf373c authored by Purves, Murray's avatar Purves, Murray
Browse files

#20 Renaming class to differentiate

parent 4b1e6445
......@@ -13,7 +13,7 @@
=========================================================================*/
#include "vtkPlotPoints.h"
#include "radixwidgets/vtkPlotPointsErrorBars.hh"
#include "vtkAxis.h"
#include "vtkBrush.h"
......@@ -44,7 +44,8 @@ struct vtkIndexedVector2f
vtkVector2f pos;
};
class vtkPlotPoints::VectorPIMPL : public std::vector<vtkIndexedVector2f>
class vtkPlotPointsErrorBars::VectorPIMPL
: public std::vector<vtkIndexedVector2f>
{
public:
VectorPIMPL(vtkVector2f *array, size_t n)
......@@ -62,16 +63,16 @@ class vtkPlotPoints::VectorPIMPL : public std::vector<vtkIndexedVector2f>
};
//-----------------------------------------------------------------------------
vtkStandardNewMacro(vtkPlotPoints)
vtkStandardNewMacro(vtkPlotPointsErrorBars)
//-----------------------------------------------------------------------------
vtkPlotPoints::vtkPlotPoints()
vtkPlotPointsErrorBars::vtkPlotPointsErrorBars()
{
this->Points = nullptr;
this->Sorted = nullptr;
this->BadPoints = nullptr;
this->ValidPointMask = nullptr;
this->MarkerStyle = vtkPlotPoints::CIRCLE;
this->MarkerStyle = vtkPlotPointsErrorBars::CIRCLE;
this->MarkerSize = -1.0;
this->LogX = false;
this->LogY = false;
......@@ -85,7 +86,7 @@ vtkStandardNewMacro(vtkPlotPoints)
}
//-----------------------------------------------------------------------------
vtkPlotPoints::~vtkPlotPoints()
vtkPlotPointsErrorBars::~vtkPlotPointsErrorBars()
{
if (this->Points)
{
......@@ -109,7 +110,7 @@ vtkPlotPoints::~vtkPlotPoints()
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::Update()
void vtkPlotPointsErrorBars::Update()
{
if (!this->Visible)
{
......@@ -156,10 +157,10 @@ void vtkPlotPoints::Update()
}
//-----------------------------------------------------------------------------
bool vtkPlotPoints::Paint(vtkContext2D *painter)
bool vtkPlotPointsErrorBars::Paint(vtkContext2D *painter)
{
// This is where everything should be drawn, or dispatched to other methods.
vtkDebugMacro(<< "Paint event called in vtkPlotPoints.");
vtkDebugMacro(<< "Paint event called in vtkPlotPointsErrorBars.");
if (!this->Visible || !this->Points || this->Points->GetNumberOfPoints() == 0)
{
......@@ -270,8 +271,8 @@ bool vtkPlotPoints::Paint(vtkContext2D *painter)
}
//-----------------------------------------------------------------------------
bool vtkPlotPoints::PaintLegend(vtkContext2D *painter, const vtkRectf &rect,
int)
bool vtkPlotPointsErrorBars::PaintLegend(vtkContext2D *painter,
const vtkRectf &rect, int)
{
if (this->MarkerStyle)
{
......@@ -291,7 +292,7 @@ bool vtkPlotPoints::PaintLegend(vtkContext2D *painter, const vtkRectf &rect,
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::GetBounds(double bounds[4])
void vtkPlotPointsErrorBars::GetBounds(double bounds[4])
{
if (this->Points)
{
......@@ -303,7 +304,7 @@ void vtkPlotPoints::GetBounds(double bounds[4])
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::GetUnscaledInputBounds(double bounds[4])
void vtkPlotPointsErrorBars::GetUnscaledInputBounds(double bounds[4])
{
this->CalculateUnscaledInputBounds();
for (int i = 0; i < 4; ++i)
......@@ -348,7 +349,7 @@ bool inRange(const vtkVector2f &point, const vtkVector2f &tol,
} // namespace
//-----------------------------------------------------------------------------
void vtkPlotPoints::CreateSortedPoints()
void vtkPlotPointsErrorBars::CreateSortedPoints()
{
// Sort the data if it has not been done already...
if (!this->Sorted)
......@@ -362,9 +363,9 @@ void vtkPlotPoints::CreateSortedPoints()
}
//-----------------------------------------------------------------------------
vtkIdType vtkPlotPoints::GetNearestPoint(const vtkVector2f &point,
const vtkVector2f &tol,
vtkVector2f *location)
vtkIdType vtkPlotPointsErrorBars::GetNearestPoint(const vtkVector2f &point,
const vtkVector2f &tol,
vtkVector2f *location)
{
// Right now doing a simple bisector search of the array.
if (!this->Points)
......@@ -402,7 +403,8 @@ vtkIdType vtkPlotPoints::GetNearestPoint(const vtkVector2f &point,
}
//-----------------------------------------------------------------------------
bool vtkPlotPoints::SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
bool vtkPlotPointsErrorBars::SelectPoints(const vtkVector2f &min,
const vtkVector2f &max)
{
if (!this->Points)
{
......@@ -454,7 +456,8 @@ bool vtkPlotPoints::SelectPoints(const vtkVector2f &min, const vtkVector2f &max)
}
//-----------------------------------------------------------------------------
bool vtkPlotPoints::SelectPointsInPolygon(const vtkContextPolygon &polygon)
bool vtkPlotPointsErrorBars::SelectPointsInPolygon(
const vtkContextPolygon &polygon)
{
if (!this->Points)
{
......@@ -642,7 +645,8 @@ void CopyToPointsSwitch(vtkPoints2D *points, A *a, vtkDataArray *b, int n,
} // namespace
//-----------------------------------------------------------------------------
bool vtkPlotPoints::GetDataArrays(vtkTable *table, vtkDataArray *array[2])
bool vtkPlotPointsErrorBars::GetDataArrays(vtkTable *table,
vtkDataArray *array[2])
{
if (!table)
{
......@@ -677,7 +681,7 @@ bool vtkPlotPoints::GetDataArrays(vtkTable *table, vtkDataArray *array[2])
}
//-----------------------------------------------------------------------------
bool vtkPlotPoints::UpdateTableCache(vtkTable *table)
bool vtkPlotPointsErrorBars::UpdateTableCache(vtkTable *table)
{
vtkDataArray *array[2] = {nullptr, nullptr};
if (!this->GetDataArrays(table, array))
......@@ -753,7 +757,7 @@ bool vtkPlotPoints::UpdateTableCache(vtkTable *table)
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::CalculateUnscaledInputBounds()
void vtkPlotPointsErrorBars::CalculateUnscaledInputBounds()
{
vtkTable *table = this->Data->GetInput();
vtkDataArray *array[2] = {nullptr, nullptr};
......@@ -787,7 +791,7 @@ void vtkPlotPoints::CalculateUnscaledInputBounds()
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::CalculateLogSeries()
void vtkPlotPointsErrorBars::CalculateLogSeries()
{
if (!this->XAxis || !this->YAxis)
{
......@@ -834,7 +838,7 @@ void vtkPlotPoints::CalculateLogSeries()
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::FindBadPoints()
void vtkPlotPointsErrorBars::FindBadPoints()
{
// This should be run after CalculateLogSeries as a final step.
vtkIdType n = this->Points->GetNumberOfPoints();
......@@ -898,7 +902,7 @@ void vtkPlotPoints::FindBadPoints()
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::CalculateBounds(double bounds[4])
void vtkPlotPointsErrorBars::CalculateBounds(double bounds[4])
{
// We can use the BadPoints array to skip the bad points
if (!this->Points)
......@@ -923,7 +927,7 @@ void vtkPlotPoints::CalculateBounds(double bounds[4])
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::SetLookupTable(vtkScalarsToColors *lut)
void vtkPlotPointsErrorBars::SetLookupTable(vtkScalarsToColors *lut)
{
if (this->LookupTable != lut)
{
......@@ -941,7 +945,7 @@ void vtkPlotPoints::SetLookupTable(vtkScalarsToColors *lut)
}
//-----------------------------------------------------------------------------
vtkScalarsToColors *vtkPlotPoints::GetLookupTable()
vtkScalarsToColors *vtkPlotPointsErrorBars::GetLookupTable()
{
if (this->LookupTable == nullptr)
{
......@@ -951,7 +955,7 @@ vtkScalarsToColors *vtkPlotPoints::GetLookupTable()
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::CreateDefaultLookupTable()
void vtkPlotPointsErrorBars::CreateDefaultLookupTable()
{
if (this->LookupTable)
{
......@@ -964,7 +968,7 @@ void vtkPlotPoints::CreateDefaultLookupTable()
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::SelectColorArray(const vtkStdString &arrayName)
void vtkPlotPointsErrorBars::SelectColorArray(const vtkStdString &arrayName)
{
vtkTable *table = this->Data->GetInput();
if (!table)
......@@ -991,7 +995,7 @@ void vtkPlotPoints::SelectColorArray(const vtkStdString &arrayName)
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::SelectColorArray(vtkIdType arrayNum)
void vtkPlotPointsErrorBars::SelectColorArray(vtkIdType arrayNum)
{
vtkTable *table = this->Data->GetInput();
if (!table)
......@@ -1023,10 +1027,13 @@ void vtkPlotPoints::SelectColorArray(vtkIdType arrayNum)
}
//-----------------------------------------------------------------------------
vtkStdString vtkPlotPoints::GetColorArrayName() { return this->ColorArrayName; }
vtkStdString vtkPlotPointsErrorBars::GetColorArrayName()
{
return this->ColorArrayName;
}
//-----------------------------------------------------------------------------
void vtkPlotPoints::PrintSelf(ostream &os, vtkIndent indent)
void vtkPlotPointsErrorBars::PrintSelf(ostream &os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
......@@ -49,16 +49,16 @@ class vtkImageData;
class vtkScalarsToColors;
class vtkUnsignedCharArray;
class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
class VTKCHARTSCORE_EXPORT vtkPlotPointsErrorBars : public vtkPlot
{
public:
vtkTypeMacro(vtkPlotPoints, vtkPlot);
vtkTypeMacro(vtkPlotPointsErrorBars, vtkPlot);
void PrintSelf(ostream &os, vtkIndent indent) override;
/**
* Creates a 2D Chart object.
*/
static vtkPlotPoints *New();
static vtkPlotPointsErrorBars *New();
/**
* Perform any updates to the item that may be necessary before rendering.
......@@ -188,8 +188,8 @@ class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
vtkSetMacro(ValidPointMaskName, vtkStdString)
//@}
protected : vtkPlotPoints();
~vtkPlotPoints() override;
protected : vtkPlotPointsErrorBars();
~vtkPlotPointsErrorBars() override;
/**
* Populate the data arrays ready to operate on input data.
......@@ -293,8 +293,8 @@ class VTKCHARTSCORE_EXPORT vtkPlotPoints : public vtkPlot
double UnscaledInputBounds[4];
private:
vtkPlotPoints(const vtkPlotPoints &) = delete;
void operator=(const vtkPlotPoints &) = delete;
vtkPlotPointsErrorBars(const vtkPlotPointsErrorBars &) = delete;
void operator=(const vtkPlotPointsErrorBars &) = delete;
};
#endif // RADIX_RADIXWIDGETS_VTKPLOTPOINTSERRORBARS_HH_
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