vtkAbstractWidget is an abstract class to construct a widget.
Methods
activateHandle
Activate a handle, identified by both a state and a representation. Will also invoke appropriate events.
Argument
Type
Required
Description
locator
Yes
An object describing the handle to activate.
deactivateAllHandles
Deactivate all the handles on the widget instance.
extend
Method used to decorate a given object (publicAPI+model) with vtkAbstractWidget characteristics.
Argument
Type
Required
Description
publicAPI
Yes
object on which methods will be bounds (public)
model
Yes
object on which data structure will be bounds (protected)
initialValues
Yes
(default: {})
getBounds
Get the bounds of the widget
getContextVisibility
Get the context visibility.
getHandleVisibility
Returns true if the handles are visible, false otherwise.
getNestedProps
Get all representations of the widget.
getPlaceFactor
Get the place factor.
getRepresentationFromActor
Get the vtkWidgetRepresentation instance associated with the given vtkActor instance.
Argument
Type
Required
Description
actor
vtkProp
Yes
getRepresentations
Get all the representations of the widget instance.
getViewWidgets
Get all the underlyings view widgets.
getWidgetManager
Get the widget manager associated with the widget instance.
getWidgetState
Get the the state of the widget instance.
grabFocus
Make the widget instance grab the focus. Should not be called directly or this will lead to unexpected behavior. To grab the focus on a widget, one should call vtkWidgetManager.grabFocus(widgetInstanceToGiveFocusTo)
hasActor
Returns true if the widget instance holds the given actor, false otherwise.
Argument
Type
Required
Description
actor
vtkProp
Yes
hasFocus
Returns true if the widget instance holds the focus, false otherwise.
invokeActivateHandle
Invoke the ActivateHandle event with the given payload.
Argument
Type
Required
Description
args
Yes
The event payload
loseFocus
Make the widget instance release the focus.
newInstance
Method used to create a new instance of vtkAbstractWidget
Argument
Type
Required
Description
initialValues
Yes
For pre-setting some of its content
onActivateHandle
Register a callback to be invoked when the ActivateHandle event occurs.
Argument
Type
Required
Description
cb
EventHandler
Yes
The callback to register
priority
Number
No
Priority of this subscription
placeWidget
Place a widget at the given bounds.
Argument
Type
Required
Description
bounds
Bounds
Yes
setContextVisibility
Set the context visibility.
Argument
Type
Required
Description
visible
Boolean
Yes
setHandleVisibility
Defines if the handles should be visible or not.
Argument
Type
Required
Description
visible
Boolean
Yes
setPlaceFactor
Set the place factor.
Argument
Type
Required
Description
factor
Number
Yes
The place factor.
setWidgetManager
Set the widget manager associated with the widget instance.
export interface vtkAbstractWidget extends vtkProp, vtkInteractorObserver { /** * Get the bounds of the widget */ getBounds(): Bounds;
/** * Get all representations of the widget. */ getNestedProps(): vtkWidgetRepresentation[];
/** * Activate a handle, identified by both a state and a representation. * Will also invoke appropriate events. * * @param locator An object describing the handle to activate. */ activateHandle(locator: { selectedState: vtkWidgetState; representation: vtkWidgetRepresentation; }): void;
/** * Deactivate all the handles on the widget instance. */ deactivateAllHandles(): void;
/** * Returns true if the widget instance holds the given actor, false otherwise. * * @param {vtkProp} actor */ hasActor(actor: vtkProp): boolean;
/** * Make the widget instance grab the focus. * Should not be called directly or this will lead to unexpected behavior. * To grab the focus on a widget, one should call `vtkWidgetManager.grabFocus(widgetInstanceToGiveFocusTo)` */ grabFocus(): void;
/** * Make the widget instance release the focus. */ loseFocus(): void;
/** * Returns true if the widget instance holds the focus, false otherwise. */ hasFocus(): boolean;
/** * Place a widget at the given bounds. * * @param {Bounds} bounds */ placeWidget(bounds: Bounds): void;
/** * Get the place factor. */ getPlaceFactor(): number;
/** * Set the place factor. * * @param {Number} factor The place factor. */ setPlaceFactor(factor: number): void;
/** * Get the `vtkWidgetRepresentation` instance associated with the given `vtkActor` instance. * * @param {vtkProp} actor */ getRepresentationFromActor(actor: vtkProp): vtkWidgetRepresentation;
/** * Update all the widget representations for render. * * @param {RenderingTypes} renderingType Default value if `RenderingTypes.FRONT_BUFFER` */ updateRepresentationForRender(renderingType: RenderingTypes): void;
/** * Get all the underlyings view widgets. */ getViewWidgets(): vtkAbstractWidget[];
/** * Set the context visibility. * * @param {Boolean} visible */ setContextVisibility(visible: boolean): void;
/** * Get the context visibility. */ getContextVisibility(): boolean;
/** * Defines if the handles should be visible or not. * * @param {Boolean} visible */ setHandleVisibility(visible: boolean): void;
/** * Returns true if the handles are visible, false otherwise. */ getHandleVisibility(): boolean;
/** * Set the widget manager associated with the widget instance. * * @param {vtkWidgetManager} wm The widget manager instance */ setWidgetManager(wm: vtkWidgetManager): void;
/** * Get the widget manager associated with the widget instance. */ getWidgetManager(): vtkWidgetManager;
/** * Get all the representations of the widget instance. */ getRepresentations(): vtkWidgetRepresentation[];
/** * Get the the state of the widget instance. */ getWidgetState(): vtkWidgetState;
/** * Register a callback to be invoked when the `ActivateHandle` event occurs. * * @param {EventHandler} cb The callback to register * @param {Number} [priority] Priority of this subscription */ onActivateHandle( cb: EventHandler, priority?: number ): Readonly<vtkSubscription>;
/** * Invoke the `ActivateHandle` event with the given payload. * * @param args The event payload */ invokeActivateHandle(...args: unknown[]): void; }
/** * Method used to decorate a given object (publicAPI+model) with vtkAbstractWidget characteristics. * * @param publicAPI object on which methods will be bounds (public) * @param model object on which data structure will be bounds (protected) * @param initialValues (default: {}) */ exportfunctionextend( publicAPI: object, model: object, initialValues?: object ): void;
/** * Method used to create a new instance of vtkAbstractWidget * * @param initialValues For pre-setting some of its content */ exportfunctionnewInstance(initialValues?: object): vtkAbstractWidget;
/** * vtkAbstractWidget is an abstract class to construct a widget. */ export declare constvtkAbstractWidget: { newInstance: typeof newInstance; extend: typeof extend; };