How to programmatically add the EllipseWidget?

Hello!

I have a well-configured functionality for adding a LineWidget by hand and thanks to vtk support I also can add this widgets programmatically by simply calling the lineWidget.updateHandleVisibility(0) and lineWidget.updateHandleVisibility(1) for two handlers to do them visible and responsive. However, now I need to add the same functionality for EllipseWidget and the problem is that the ellipseWidget does not have an updateHandleVisibility method.

Here is my code for lineWidget:

  const lineWidget = vtkLineWidget.newInstance()

  const currentHandle = measuresWidgetManager.addWidget(
    lineWidget,
    ViewTypes.SLICE
  )

  const lineWidgetState = currentHandle.getWidgetState()

  lineWidgetState.setLineThickness(1.5)
  lineWidgetState.getHandle1().setScale1(22)
  lineWidgetState.getHandle1().setShape(LineConstants.ShapeType.VIEWFINDER)
  lineWidgetState.getHandle2().setScale1(22)
  lineWidgetState.getMoveHandle().setVisible(false)
  lineWidgetState.getHandle2().setShape(LineConstants.ShapeType.VIEWFINDER)
  lineWidgetState.getPositionOnLine().setPosOnLine(1)
  lineWidgetState
    .getHandle1()
    .setOrigin(4.4889630000000125, -45.22037573007856, 9.716660438253825)
  lineWidgetState
    .getHandle2()
    .setOrigin(4.4889630000000125, 107.44763421995941, -132.89689485306604)
  lineWidget
    .getWidgetState()
    .getText()
    .setOrigin(4.4889630000000125, 107.44763421995941, -132.89689485306604)
  currentHandle.setText(lineWidget.getDistance().toFixed(2) + ' mm')

  currentHandle.updateHandleVisibility(0)
  currentHandle.updateHandleVisibility(1)

  setupSVG(lineWidget, renderer)

  ...

At the same time currentHandle of ellipseWidget have the following fields:



image

That is, there is no updateHandleVisibility method here. I would like to know if this happen by accident and actually updateHandleVisibility should be included in the ellipseWidget or if there is another special way to make the ellipseWidget visible after adding it not by hand, but by clicking on a button, for example.

Thanks.