MCPcopy Create free account
hub / github.com/Kitware/VTK / TestTextSource

Function TestTextSource

Filters/Sources/Testing/Cxx/TestTextSource.cxx:7–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include <vtkTextSource.h>
6
7int TestTextSource(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
8{
9 vtkSmartPointer<vtkTextSource> textSource = vtkSmartPointer<vtkTextSource>::New();
10 textSource->SetBackgroundColor(0.0, 0.0, 0.0);
11 textSource->SetForegroundColor(1.0, 1.0, 1.0);
12 textSource->BackingOn();
13
14 textSource->SetOutputPointsPrecision(vtkAlgorithm::SINGLE_PRECISION);
15
16 textSource->SetText("1234567890abcdefghijklmnopqrstuvwxyz");
17 textSource->Update();
18
19 vtkSmartPointer<vtkPolyData> polyData = textSource->GetOutput();
20 vtkSmartPointer<vtkPoints> points = polyData->GetPoints();
21
22 if (points->GetDataType() != VTK_FLOAT)
23 {
24 return EXIT_FAILURE;
25 }
26
27 textSource->SetOutputPointsPrecision(vtkAlgorithm::DOUBLE_PRECISION);
28
29 textSource->SetText("1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ");
30 textSource->Update();
31
32 polyData = textSource->GetOutput();
33 points = polyData->GetPoints();
34
35 if (points->GetDataType() != VTK_DOUBLE)
36 {
37 return EXIT_FAILURE;
38 }
39
40 return EXIT_SUCCESS;
41}

Callers

nothing calls this directly

Calls 9

NewFunction · 0.50
SetBackgroundColorMethod · 0.45
SetForegroundColorMethod · 0.45
SetTextMethod · 0.45
UpdateMethod · 0.45
GetOutputMethod · 0.45
GetPointsMethod · 0.45
GetDataTypeMethod · 0.45

Tested by

no test coverage detected