WidgetComponent.add_measurement_widget#
- WidgetComponent.add_measurement_widget(
- callback: Callable[[tuple[float, float, float], tuple[float, float, float], float], object] | None = None,
- color: ColorLike | None = None,
Interactively measure distance with a distance widget.
Creates an overlay documenting the selected line and total distance between two mouse left-click interactions.
The measurement overlay stays on the rendering until the widget is deleted. Only one measurement can be added by each widget instance.
- Parameters:
- callback
Callable[[VectorLikeFloat,VectorLikeFloat,float],object], optional The method called every time the widget calculates a distance measurement. This callback receives the start point and end point as Cartesian coordinate tuples and the calculated distance between the two points.
- color
ColorLike, optional The color of the measurement widget.
- callback
- Returns:
- vtkDistanceWidget
The newly created distance widget.