Commit 0af54671 authored by Marcus D. Hanwell's avatar Marcus D. Hanwell
Browse files

ENH: Renamed 2DHistogram classes to Histogram2D.

Made the class names more consistent with others, avoid starting with a
number.

Change-Id: Ib534fef4eb53bd4ae62e5f3faf889ca51b5c99cc
parent 642f11df
......@@ -13,7 +13,6 @@ SET(KIT_INTERFACE_LIBRARIES vtkViews)
SET(KIT_LIBS vtkftgl)
SET(Kit_SRCS
vtk2DHistogramItem.cxx
vtkAbstractContextBufferId.cxx
vtkAbstractContextItem.cxx
vtkAxis.cxx
......@@ -21,7 +20,7 @@ SET(Kit_SRCS
vtkBrush.cxx
vtkChart.cxx
vtkChartLegend.cxx
vtkChart2DHistogram.cxx
vtkChartHistogram2D.cxx
vtkChartParallelCoordinates.cxx
vtkChartXY.cxx
vtkChartPie.cxx
......@@ -54,6 +53,7 @@ SET(Kit_SRCS
vtkPlot.cxx
vtkPlotBar.cxx
vtkPlotGrid.cxx
vtkPlotHistogram2D.cxx
vtkPlotLine.cxx
vtkPlotStacked.cxx
vtkPlotParallelCoordinates.cxx
......
......@@ -13,13 +13,13 @@ IF (VTK_USE_RENDERING AND VTK_USE_VIEWS)
# add tests that require data
SET(MyTests ${MyTests}
#TestContextUnicode.cxx # Disabled until Freetype unicode works
Test2DHistogram.cxx
TestBarGraph.cxx
TestContext.cxx
TestContextImage.cxx
TestDiagram.cxx
#TestFreeTypeContextUnicode.cxx
#TestFreeTypeRender.cxx
TestHistogram2D.cxx
TestLinePlot.cxx
TestLinePlotInteraction.cxx
TestMultipleChartRenderers.cxx
......
......@@ -15,8 +15,8 @@
#include "vtkRenderWindow.h"
#include "vtkSmartPointer.h"
#include "vtkChart2DHistogram.h"
#include "vtk2DHistogramItem.h"
#include "vtkChartHistogram2D.h"
#include "vtkPlotHistogram2D.h"
#include "vtkImageData.h"
#include "vtkColorTransferFunction.h"
#include "vtkContextView.h"
......@@ -25,15 +25,15 @@
#include "vtkRenderWindowInteractor.h"
//----------------------------------------------------------------------------
int Test2DHistogram( int, char * [] )
int TestHistogram2D(int, char * [])
{
// Set up a 2D scene, add an XY chart to it
int size = 401;
vtkSmartPointer<vtkContextView> view =
vtkSmartPointer<vtkContextView>::New();
view->GetRenderWindow()->SetSize(size, size);
vtkSmartPointer<vtkChart2DHistogram> chart =
vtkSmartPointer<vtkChart2DHistogram>::New();
vtkSmartPointer<vtkChartHistogram2D> chart =
vtkSmartPointer<vtkChartHistogram2D>::New();
view->GetScene()->AddItem(chart);
......
......@@ -13,7 +13,7 @@
=========================================================================*/
#include "vtkChart2DHistogram.h"
#include "vtkChartHistogram2D.h"
#include "vtkContext2D.h"
#include "vtkBrush.h"
......@@ -22,19 +22,19 @@
#include "vtkContextMouseEvent.h"
#include "vtkTextProperty.h"
#include "vtkAxis.h"
#include "vtk2DHistogramItem.h"
#include "vtkPlotHistogram2D.h"
#include "vtkColorLegend.h"
#include "vtkSmartPointer.h"
#include "vtkObjectFactory.h"
//-----------------------------------------------------------------------------
vtkStandardNewMacro(vtkChart2DHistogram);
vtkStandardNewMacro(vtkChartHistogram2D);
//-----------------------------------------------------------------------------
vtkChart2DHistogram::vtkChart2DHistogram()
vtkChartHistogram2D::vtkChartHistogram2D()
{
// Now for the 2D histogram
this->Histogram = vtkSmartPointer<vtk2DHistogramItem>::New();
this->Histogram = vtkSmartPointer<vtkPlotHistogram2D>::New();
this->AddPlot(this->Histogram);
this->RemoveItem(this->Legend);
......@@ -43,24 +43,24 @@ vtkChart2DHistogram::vtkChart2DHistogram()
}
//-----------------------------------------------------------------------------
vtkChart2DHistogram::~vtkChart2DHistogram()
vtkChartHistogram2D::~vtkChartHistogram2D()
{
}
//-----------------------------------------------------------------------------
void vtkChart2DHistogram::Update()
void vtkChartHistogram2D::Update()
{
this->Histogram->Update();
this->Legend->Update();
this->vtkChartXY::Update();
}
void vtkChart2DHistogram::SetInput(vtkImageData *data, vtkIdType z)
void vtkChartHistogram2D::SetInput(vtkImageData *data, vtkIdType z)
{
this->Histogram->SetInput(data, z);
}
void vtkChart2DHistogram::SetTransferFunction(vtkScalarsToColors *function)
void vtkChartHistogram2D::SetTransferFunction(vtkScalarsToColors *function)
{
this->Histogram->SetTransferFunction(function);
vtkColorLegend *legend = vtkColorLegend::SafeDownCast(this->Legend);
......@@ -71,7 +71,7 @@ void vtkChart2DHistogram::SetTransferFunction(vtkScalarsToColors *function)
}
//-----------------------------------------------------------------------------
bool vtkChart2DHistogram::UpdateLayout(vtkContext2D *painter)
bool vtkChartHistogram2D::UpdateLayout(vtkContext2D *painter)
{
this->vtkChartXY::UpdateLayout(painter);
vtkColorLegend *legend = vtkColorLegend::SafeDownCast(this->Legend);
......@@ -86,7 +86,7 @@ bool vtkChart2DHistogram::UpdateLayout(vtkContext2D *painter)
}
//-----------------------------------------------------------------------------
bool vtkChart2DHistogram::Hit(const vtkContextMouseEvent &mouse)
bool vtkChartHistogram2D::Hit(const vtkContextMouseEvent &mouse)
{
if (mouse.ScreenPos[0] > this->Point1[0]-10 &&
mouse.ScreenPos[0] < this->Point2[0]+10 &&
......@@ -102,7 +102,7 @@ bool vtkChart2DHistogram::Hit(const vtkContextMouseEvent &mouse)
}
//-----------------------------------------------------------------------------
void vtkChart2DHistogram::PrintSelf(ostream &os, vtkIndent indent)
void vtkChartHistogram2D::PrintSelf(ostream &os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
......@@ -25,19 +25,19 @@
#include "vtkSmartPointer.h" // For SP ivars
class vtkColorLegend;
class vtk2DHistogramItem;
class vtkPlotHistogram2D;
class vtkImageData;
class vtkScalarsToColors;
class VTK_CHARTS_EXPORT vtkChart2DHistogram : public vtkChartXY
class VTK_CHARTS_EXPORT vtkChartHistogram2D : public vtkChartXY
{
public:
vtkTypeMacro(vtkChart2DHistogram, vtkChartXY);
vtkTypeMacro(vtkChartHistogram2D, vtkChartXY);
virtual void PrintSelf(ostream &os, vtkIndent indent);
// Description:
// Creates a 2D histogram chart
static vtkChart2DHistogram* New();
static vtkChartHistogram2D* New();
// Description:
// Perform any updates to the item that may be necessary before rendering.
......@@ -53,10 +53,10 @@ public:
virtual bool Hit(const vtkContextMouseEvent &mouse);
protected:
vtkChart2DHistogram();
~vtkChart2DHistogram();
vtkChartHistogram2D();
~vtkChartHistogram2D();
vtkSmartPointer<vtk2DHistogramItem> Histogram;
vtkSmartPointer<vtkPlotHistogram2D> Histogram;
// Description:
// The point cache is marked dirty until it has been initialized.
......@@ -68,8 +68,8 @@ protected:
virtual bool UpdateLayout(vtkContext2D *painter);
private:
vtkChart2DHistogram(const vtkChart2DHistogram &); // Not implemented.
void operator=(const vtkChart2DHistogram &); // Not implemented.
vtkChartHistogram2D(const vtkChartHistogram2D &); // Not implemented.
void operator=(const vtkChartHistogram2D &); // Not implemented.
};
#endif //__vtkChart2DHistogram_h
......@@ -13,7 +13,7 @@
=========================================================================*/
#include "vtk2DHistogramItem.h"
#include "vtkPlotHistogram2D.h"
#include "vtkImageData.h"
#include "vtkScalarsToColors.h"
#include "vtkContext2D.h"
......@@ -21,25 +21,25 @@
#include "vtkObjectFactory.h"
//-----------------------------------------------------------------------------
vtkStandardNewMacro(vtk2DHistogramItem);
vtkStandardNewMacro(vtkPlotHistogram2D);
//-----------------------------------------------------------------------------
vtk2DHistogramItem::vtk2DHistogramItem()
vtkPlotHistogram2D::vtkPlotHistogram2D()
{
}
//-----------------------------------------------------------------------------
vtk2DHistogramItem::~vtk2DHistogramItem()
vtkPlotHistogram2D::~vtkPlotHistogram2D()
{
}
void vtk2DHistogramItem::Update()
void vtkPlotHistogram2D::Update()
{
this->GenerateHistogram();
}
//-----------------------------------------------------------------------------
bool vtk2DHistogramItem::Paint(vtkContext2D *painter)
bool vtkPlotHistogram2D::Paint(vtkContext2D *painter)
{
if (this->Output)
{
......@@ -63,31 +63,31 @@ bool vtk2DHistogramItem::Paint(vtkContext2D *painter)
}
//-----------------------------------------------------------------------------
void vtk2DHistogramItem::SetInput(vtkImageData *data, vtkIdType)
void vtkPlotHistogram2D::SetInput(vtkImageData *data, vtkIdType)
{
// FIXME: Store the z too, for slices.
this->Input = data;
}
//-----------------------------------------------------------------------------
vtkImageData * vtk2DHistogramItem::GetInputImageData()
vtkImageData * vtkPlotHistogram2D::GetInputImageData()
{
return this->Input;
}
//-----------------------------------------------------------------------------
void vtk2DHistogramItem::SetTransferFunction(vtkScalarsToColors *function)
void vtkPlotHistogram2D::SetTransferFunction(vtkScalarsToColors *function)
{
this->TransferFunction = function;
}
//-----------------------------------------------------------------------------
vtkScalarsToColors * vtk2DHistogramItem::GetTransferFunction()
vtkScalarsToColors * vtkPlotHistogram2D::GetTransferFunction()
{
return this->TransferFunction;
}
void vtk2DHistogramItem::GetBounds(double bounds[4])
void vtkPlotHistogram2D::GetBounds(double bounds[4])
{
if (this->Input)
{
......@@ -107,19 +107,19 @@ void vtk2DHistogramItem::GetBounds(double bounds[4])
}
//-----------------------------------------------------------------------------
void vtk2DHistogramItem::SetPosition(const vtkRectf& pos)
void vtkPlotHistogram2D::SetPosition(const vtkRectf& pos)
{
this->Position = pos;
}
//-----------------------------------------------------------------------------
vtkRectf vtk2DHistogramItem::GetPosition()
vtkRectf vtkPlotHistogram2D::GetPosition()
{
return this->Position;
}
//-----------------------------------------------------------------------------
void vtk2DHistogramItem::GenerateHistogram()
void vtkPlotHistogram2D::GenerateHistogram()
{
if (!this->Output)
{
......@@ -143,7 +143,7 @@ void vtk2DHistogramItem::GenerateHistogram()
}
//-----------------------------------------------------------------------------
void vtk2DHistogramItem::PrintSelf(ostream &os, vtkIndent indent)
void vtkPlotHistogram2D::PrintSelf(ostream &os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
......@@ -28,15 +28,15 @@
class vtkImageData;
class vtkScalarsToColors;
class VTK_CHARTS_EXPORT vtk2DHistogramItem : public vtkPlot
class VTK_CHARTS_EXPORT vtkPlotHistogram2D : public vtkPlot
{
public:
vtkTypeMacro(vtk2DHistogramItem, vtkPlot);
vtkTypeMacro(vtkPlotHistogram2D, vtkPlot);
virtual void PrintSelf(ostream &os, vtkIndent indent);
// Description:
// Creates a new object.
static vtk2DHistogramItem *New();
static vtkPlotHistogram2D *New();
// Description:
// Perform any updates to the item that may be necessary before rendering.
......@@ -76,8 +76,8 @@ public:
//BTX
protected:
vtk2DHistogramItem();
~vtk2DHistogramItem();
vtkPlotHistogram2D();
~vtkPlotHistogram2D();
// Description:
// Where all the magic happens...
......@@ -89,8 +89,8 @@ protected:
vtkRectf Position;
private:
vtk2DHistogramItem(const vtk2DHistogramItem &); // Not implemented.
void operator=(const vtk2DHistogramItem &); // Not implemented.
vtkPlotHistogram2D(const vtkPlotHistogram2D &); // Not implemented.
void operator=(const vtkPlotHistogram2D &); // Not implemented.
//ETX
};
......
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