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

Function TestStringToPath

Rendering/Matplotlib/Testing/Cxx/TestStringToPath.cxx:37–59  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

35
36//------------------------------------------------------------------------------
37int TestStringToPath(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
38{
39 // Set up a 2D context view, context test object and add it to the scene
40 vtkNew<vtkContextView> view;
41 view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
42 view->GetRenderWindow()->SetSize(325, 150);
43 vtkNew<StringToPathContextTest> test;
44 view->GetScene()->AddItem(test);
45
46 vtkNew<vtkPath> path;
47 vtkNew<vtkTextProperty> tprop;
48
49 vtkMathTextUtilities::GetInstance()->StringToPath(
50 "$\\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}$", path, tprop, view->GetRenderWindow()->GetDPI());
51
52 test->SetPath(path);
53
54 view->GetRenderWindow()->SetMultiSamples(0);
55 view->GetInteractor()->Initialize();
56 view->GetInteractor()->Start();
57
58 return EXIT_SUCCESS;
59}
60
61// Make our new derived class to draw a diagram
62vtkStandardNewMacro(StringToPathContextTest);

Callers

nothing calls this directly

Calls 11

SetMultiSamplesMethod · 0.80
GetRendererMethod · 0.45
SetSizeMethod · 0.45
GetRenderWindowMethod · 0.45
AddItemMethod · 0.45
GetSceneMethod · 0.45
StringToPathMethod · 0.45
SetPathMethod · 0.45
InitializeMethod · 0.45
GetInteractorMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected