Commit a855cab0 authored by Kitware Robot's avatar Kitware Robot Committed by Ken Martin

Replace many NULL and 0 occurances with nullptr

This topic is the result of running clang-tidy to
modernize our usage of NULL and 0 to nullptr. It also
includes some manual and semi manual changes where
clang-tidy would not be expected to work (such as in
comments, or classes not compiled on this build)

There are definitely many comments and occurances that
this topic misses that we will need to fix over time.
parent 113ef091

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -56,7 +56,7 @@ int TestAxes(int , char * [])
axis->SetPoint1(vtkVector2f(i * 69 + 30, 10));
axis->SetPoint2(vtkVector2f(i * 69 + 30, 290));
axis->SetPosition((i % 2) ? vtkAxis::LEFT : vtkAxis::RIGHT);
axis->SetRange(NULL); // check that NULL pointers don't cause trouble
axis->SetRange(nullptr); // check that null pointers don't cause trouble
axis->SetRange(-1, 50);
view->GetScene()->AddItem(axis);
......@@ -169,7 +169,7 @@ int TestAxes(int , char * [])
logAxis->SetScene(view->GetScene());
logAxis->SetUnscaledRange(plainRange);
logAxis->LogScaleOn();
logAxis->GetUnscaledRange(NULL); // Insure NULL pointers are ignored.
logAxis->GetUnscaledRange(nullptr); // Insure null pointers are ignored.
logAxis->GetUnscaledRange(logRange);
if ((logRange[0] != plainRange[0]) || (logRange[1] != plainRange[1]))
{
......
......@@ -553,7 +553,7 @@ public:
* must be of the same length. Returns true on success, false on failure.
*/
virtual bool SetCustomTickPositions(vtkDoubleArray* positions,
vtkStringArray* labels = 0);
vtkStringArray* labels = nullptr);
/**
* Request the space the axes require to be drawn. This is returned as a
......
......@@ -31,8 +31,8 @@ vtkCategoryLegend::vtkCategoryLegend()
this->SetHorizontalAlignment(vtkChartLegend::RIGHT);
this->SetVerticalAlignment(vtkChartLegend::BOTTOM);
this->ScalarsToColors = NULL;
this->Values = NULL;
this->ScalarsToColors = nullptr;
this->Values = nullptr;
this->TitleProperties->SetColor(this->LabelProperties->GetColor());
this->TitleProperties->SetFontSize(this->LabelProperties->GetFontSize());
......@@ -54,7 +54,7 @@ vtkCategoryLegend::~vtkCategoryLegend()
//-----------------------------------------------------------------------------
bool vtkCategoryLegend::Paint(vtkContext2D* painter)
{
if (!this->Visible || this->ScalarsToColors == NULL || this->Values == NULL)
if (!this->Visible || this->ScalarsToColors == nullptr || this->Values == nullptr)
{
return true;
}
......
......@@ -60,7 +60,7 @@ vtkChart::vtkChart()
this->TitleProperties->SetColor(0.0, 0.0, 0.0);
this->TitleProperties->SetFontSize(12);
this->TitleProperties->SetFontFamilyToArial();
this->AnnotationLink = NULL;
this->AnnotationLink = nullptr;
this->LayoutStrategy = vtkChart::FILL_SCENE;
this->RenderEmpty = false;
this->BackgroundBrush = vtkSmartPointer<vtkBrush>::New();
......@@ -89,7 +89,7 @@ vtkChart::~vtkChart()
//-----------------------------------------------------------------------------
vtkPlot * vtkChart::AddPlot(int)
{
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------------
......@@ -129,7 +129,7 @@ void vtkChart::ClearPlots()
//-----------------------------------------------------------------------------
vtkPlot* vtkChart::GetPlot(vtkIdType)
{
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------------
......@@ -141,7 +141,7 @@ vtkIdType vtkChart::GetNumberOfPlots()
//-----------------------------------------------------------------------------
vtkAxis* vtkChart::GetAxis(int)
{
return NULL;
return nullptr;
}
//-----------------------------------------------------------------------------
......@@ -190,7 +190,7 @@ bool vtkChart::GetShowLegend()
vtkChartLegend * vtkChart::GetLegend()
{
return 0;
return nullptr;
}
//-----------------------------------------------------------------------------
......@@ -403,7 +403,7 @@ int vtkChart::GetClickActionToButton(int action)
//-----------------------------------------------------------------------------
void vtkChart::SetBackgroundBrush(vtkBrush *brush)
{
if(brush == NULL)
if(brush == nullptr)
{
// set to transparent white if brush is null
this->BackgroundBrush->SetColorF(1, 1, 1, 0);
......
......@@ -218,7 +218,7 @@ public:
//@}
/**
* Get the legend for the chart, if available. Can return NULL if there is no
* Get the legend for the chart, if available. Can return null if there is no
* legend.
*/
virtual vtkChartLegend * GetLegend();
......
......@@ -95,7 +95,7 @@ vtkChartBox::vtkChartBox()
//-----------------------------------------------------------------------------
vtkChartBox::~vtkChartBox()
{
this->Storage->Plot->SetSelection(NULL);
this->Storage->Plot->SetSelection(nullptr);
delete this->Storage;
this->Selection->Delete();
this->VisibleColumns->Delete();
......@@ -165,7 +165,7 @@ bool vtkChartBox::Paint(vtkContext2D *painter)
this->UpdateGeometry(painter);
// Handle selections
vtkIdTypeArray *idArray = 0;
vtkIdTypeArray *idArray = nullptr;
if (this->AnnotationLink)
{
vtkSelection *selection = this->AnnotationLink->GetCurrentSelection();
......
......@@ -117,7 +117,7 @@ vtkPlot* vtkChartHistogram2D::GetPlot(vtkIdType index)
return this->Histogram;
}
return 0;
return nullptr;
}
//-----------------------------------------------------------------------------
......
......@@ -82,8 +82,8 @@ vtkChartLegend::vtkChartLegend()
vtkChartLegend::~vtkChartLegend()
{
delete this->Storage;
this->Storage = NULL;
this->Point = NULL;
this->Storage = nullptr;
this->Point = nullptr;
}
//-----------------------------------------------------------------------------
......
......@@ -245,7 +245,7 @@ vtkChart* vtkChartMatrix::GetChart(const vtkVector2i &position)
if (position.GetX() < this->Size.GetX() && position.GetY() < this->Size.GetY())
{
size_t index = position.GetY() * this->Size.GetX() + position.GetX();
if (this->Private->Charts[index] == NULL)
if (this->Private->Charts[index] == nullptr)
{
vtkNew<vtkChartXY> chart;
this->Private->Charts[index] = chart.GetPointer();
......@@ -256,7 +256,7 @@ vtkChart* vtkChartMatrix::GetChart(const vtkVector2i &position)
}
else
{
return NULL;
return nullptr;
}
}
......
......@@ -122,7 +122,7 @@ public:
virtual bool SetChart(const vtkVector2i& position, vtkChart* chart);
/**
* Get the specified chart element, if the element does not exist NULL will be
* Get the specified chart element, if the element does not exist nullptr will be
* returned. If the chart element has not yet been allocated it will be at
* this point.
*/
......
......@@ -88,7 +88,7 @@ vtkChartParallelCoordinates::vtkChartParallelCoordinates()
//-----------------------------------------------------------------------------
vtkChartParallelCoordinates::~vtkChartParallelCoordinates()
{
this->Storage->Plot->SetSelection(NULL);
this->Storage->Plot->SetSelection(nullptr);
delete this->Storage;
this->Selection->Delete();
}
......@@ -172,16 +172,16 @@ bool vtkChartParallelCoordinates::Paint(vtkContext2D *painter)
this->UpdateGeometry();
// Handle selections
vtkIdTypeArray *idArray = 0;
vtkIdTypeArray *idArray = nullptr;
if (this->AnnotationLink)
{
vtkSelection *selection = this->AnnotationLink->GetCurrentSelection();
if (this->AnnotationLink->GetMTime() > this->Storage->Plot->GetMTime())
{
vtkSelectionNode *node = selection->GetNumberOfNodes() > 0?
selection->GetNode(0) : NULL;
selection->GetNode(0) : nullptr;
idArray = node? vtkArrayDownCast<vtkIdTypeArray>(node->GetSelectionList())
: NULL;
: nullptr;
this->Storage->Plot->SetSelection(idArray);
}
}
......@@ -362,7 +362,7 @@ vtkAxis* vtkChartParallelCoordinates::GetAxis(int index)
}
else
{
return NULL;
return nullptr;
}
}
......@@ -507,11 +507,11 @@ bool vtkChartParallelCoordinates::MouseMoveEvent(const vtkContextMouseEvent &mou
vtkAxis* leftAxis = this->Storage->CurrentAxis > 0 ?
this->Storage->Axes[this->Storage->CurrentAxis-1] :
NULL;
nullptr;
vtkAxis* rightAxis =
this->Storage->CurrentAxis < static_cast<int>(this->Storage->Axes.size())-1 ?
this->Storage->Axes[this->Storage->CurrentAxis+1] : NULL;
this->Storage->Axes[this->Storage->CurrentAxis+1] : nullptr;
if (leftAxis && axis->GetPoint1()[0] < leftAxis->GetPoint1()[0])
{
......
......@@ -159,7 +159,7 @@ vtkPlot* vtkChartPie::GetPlot(vtkIdType index)
return this->Private->Plot;