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

Function setupTextActor3D

Rendering/Matplotlib/Testing/Python/TestMathTextActor3D.py:35–48  ·  view source on GitHub ↗
(actor, anchor)

Source from the content-addressed store, hash-verified

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

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