Skip to content

Commit

Permalink
docs(vtkpicker): update doc and typing
Browse files Browse the repository at this point in the history
  • Loading branch information
bourdaisj committed Jan 12, 2024
1 parent e6f025e commit 1411330
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions Sources/Rendering/Core/Picker/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Vector3 } from "../../../types";
import { Vector3, Nullable } from "../../../types";
import vtkAbstractPicker, { IAbstractPickerInitialValues } from "../AbstractPicker";
import vtkActor from "../Actor";
import vtkMapper from '../Mapper';
Expand All @@ -21,39 +21,34 @@ export interface vtkPicker extends vtkAbstractPicker {
getActors(): vtkActor[];

/**
* Get a pointer to the dataset that was picked (if any).
* Get the dataset that was picked (if any).
*/
getDataSet(): any;

/**
* Get mapper that was picked (if any)
*/
getMapper(): null | vtkMapper;
getMapper(): Nullable<vtkMapper>;

/**
* Get position in mapper (i.e., non-transformed) coordinates of pick point.
*/
getMapperPosition(): number[];
getMapperPosition(): Vector3;

/**
*
* Get a list of the points the actors returned by getActors were intersected at.
*/
getMapperPositionByReference(): number[];

/**
* Get a list of the points the actors returned by GetProp3Ds were intersected at.
*/
getPickedPositions(): number[];
getPickedPositions(): Vector3[];

/**
* Get tolerance for performing pick operation.
*/
getTolerance(): number;

/**
* FIXME: this needs to be check again
* Invoke a pick change event.
*/
//invokePickChange(pickedPositions: number[]): any;
invokePickChange(pickedPositions: number[]): unknown;

/**
* FIXME: this needs to be check again
Expand All @@ -72,10 +67,10 @@ export interface vtkPicker extends vtkAbstractPicker {

/**
* Perform pick operation with selection point provided.
* @param selection
* @param {vtkRenderer} renderer The vtkRenderer instance.
* @param {Vector3} selection First two values should be x-y pixel coordinate, the third is usually zero.
* @param {vtkRenderer} renderer The renderer on which you want to do picking.
*/
pick(selection: any, renderer: vtkRenderer): any;
pick(selection: Vector3, renderer: vtkRenderer): void;

/**
* Set position in mapper coordinates of pick point.
Expand All @@ -86,13 +81,9 @@ export interface vtkPicker extends vtkAbstractPicker {
setMapperPosition(x: number, y: number, z: number): boolean;

/**
* Set position in mapper coordinates of pick point.
* @param {Vector3} mapperPosition The mapper coordinates of pick point.
*/
setMapperPositionFrom(mapperPosition: Vector3): boolean;

/**
* Specify tolerance for performing pick operation.
* Specify tolerance for performing pick operation. Tolerance is specified
* as fraction of rendering window size. (Rendering window size is measured
* across diagonal.)
* @param {Number} tolerance The tolerance value.
*/
setTolerance(tolerance: number): boolean;
Expand Down Expand Up @@ -127,6 +118,11 @@ export function newInstance(initialValues?: IPickerInitialValues): vtkPicker;
* the prop itself, the data set, and the mapper.
* For vtkPicker the closest prop is the one whose center point (i.e., center of bounding box) projected on the view ray is closest
* to the camera. Subclasses of vtkPicker use other methods for computing the pick point.
*
* vtkPicker is used for quick geometric picking. If you desire more precise
* picking of points or cells based on the geometry of any vtkProp3D, use the
* subclasses vtkPointPicker or vtkCellPicker. For hardware-accelerated
* picking of any type of vtkProp, use vtkPropPicker or vtkWorldPointPicker.
*/
export declare const vtkPicker: {
newInstance: typeof newInstance,
Expand Down

0 comments on commit 1411330

Please sign in to comment.