(actor, anchor)
| 33 | import vtkmodules.vtkRenderingUI |
| 34 | |
| 35 | def 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 | |
| 50 | ren = vtkRenderer() |
| 51 |
no test coverage detected