VTK  9.5.20251129
TestParallelCoordinatesUtilities.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "vtkDoubleArray.h"
5#include "vtkNew.h"
6#include "vtkSmartPointer.h"
7#include "vtkTable.h"
8
9namespace
10{
11
12inline vtkSmartPointer<vtkTable> CreateDummyData()
13{
14 vtkNew<vtkTable> table;
15
17 arrX->SetName("x");
18 table->AddColumn(arrX);
20 arrC->SetName("cosine");
21 table->AddColumn(arrC);
23 arrS->SetName("sine");
24 table->AddColumn(arrS);
26 arrS2->SetName("tangent");
27 table->AddColumn(arrS2);
28
29 int numPoints = 200;
30 float inc = 7.5 / (numPoints - 1);
31 table->SetNumberOfRows(numPoints);
32 for (int i = 0; i < numPoints; ++i)
33 {
34 table->SetValue(i, 0, i * inc);
35 table->SetValue(i, 1, cos(i * inc));
36 table->SetValue(i, 2, sin(i * inc));
37 table->SetValue(i, 3, tan(i * inc) + 0.5);
38 }
39
40 return table;
41}
42
43}
Allocate and hold a VTK object.
Definition vtkNew.h:167
Hold a reference to a vtkObjectBase instance.