How to modify the handle shape and color of vtkAngleWidget ?

How to modify the handle shape and color of vtkAngleWidget ?

You need to set the color of the move handle (widget.getWidgetState().getMoveHandle().setColor(0.5)). If you want more control over the color, the ‘color3’ mixin should be used instead of ‘color’.

Regarding the shape, you would need to change getRepresentationsForViewType() to not return a vtkSphereHandleRepresentation but something else.

Can angleWidget now add angle tag?
image

I think there are 2 approaches:

  • Modify CircleContextRepresentation to support an arc (and therefore modify vtkCircleSource to support an arc)
  • Create an ArcContextRepresentation and a vtkArcSource (see the C++ version here)

Add one of those representations to the AngleWidget.

Sorry, I am a beginner in VTK

I can’t find how to modify the return value of getRepresentationsForViewType();
I tried using WidgetHandle. getWidgetState(). getHandle(). setShape (“viewFinder”), but it was useful for lineWidgets and not for angleWidgets。

You need to: modify directly vtkAngleWidget (PR is welcome) or create a subclass to override getRepresentationsForViewType()