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

Function setupTextActor

Rendering/Matplotlib/Testing/Python/TestMathTextActor.py:34–47  ·  view source on GitHub ↗
(actor, anchor)

Source from the content-addressed store, hash-verified

32import vtkmodules.vtkRenderingUI
33
34def setupTextActor(actor, anchor):
35 p = actor.GetTextProperty()
36 label = (str(p.GetVerticalJustificationAsString()[0]) +
37 str(p.GetJustificationAsString()[0]) + " " +
38 "$\\theta = " + str(round(p.GetOrientation())) + "$")
39 actor.SetInput(label)
40
41 # Add the anchor point:
42 pos = actor.GetPosition()
43 col = p.GetColor()
44 ptId = reference((anchor.GetPoints().InsertNextPoint(pos[0], pos[1], 0.),))
45 anchor.GetVerts().InsertNextCell(1, ptId)
46 anchor.GetCellData().GetScalars().InsertNextTuple4(
47 col[0] * 255, col[1] * 255, col[2] * 255, 255)
48
49ren = vtkRenderer()
50

Callers 1

Calls 15

strFunction · 0.85
referenceFunction · 0.85
GetVertsMethod · 0.80
InsertNextTuple4Method · 0.80
roundFunction · 0.50
GetTextPropertyMethod · 0.45
GetOrientationMethod · 0.45
SetInputMethod · 0.45
GetPositionMethod · 0.45
GetColorMethod · 0.45
InsertNextPointMethod · 0.45
GetPointsMethod · 0.45

Tested by

no test coverage detected