Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(vtkpicker): update doc and typing #2985

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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[];

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This methods should not be removed
Capture d’écran du 2024-01-13 10-44-04

/**
* 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.
*/
finetjul marked this conversation as resolved.
Show resolved Hide resolved
//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;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be removed, it's part of the methods
Capture d’écran du 2024-01-13 10-41-22

/**
* 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
finetjul marked this conversation as resolved.
Show resolved Hide resolved
* 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
Loading