diff --git a/Sources/Rendering/Core/CellPicker/index.d.ts b/Sources/Rendering/Core/CellPicker/index.d.ts index 5b64e3d148c..92fb59eac3b 100755 --- a/Sources/Rendering/Core/CellPicker/index.d.ts +++ b/Sources/Rendering/Core/CellPicker/index.d.ts @@ -85,38 +85,6 @@ export interface vtkCellPicker extends vtkPicker { * @param {vtkRenderer} renderer The vtkRenderer instance. */ pick(selection: any, renderer: vtkRenderer): void; - - /** - * - * @param {Vector3} p1 - * @param {Vector3} p2 - * @param {Number} tolerance - * @param {Nullable} actor - * @param {vtkMapper} mapper The vtkMapper instance. - */ - intersectWithLine(p1: Vector3, p2: Vector3, tolerance: number, actor: Nullable, mapper: vtkMapper): number; - - /** - * - * @param {Vector3} p1 - * @param {Vector3} p2 - * @param {Number} t1 - * @param {Number} t2 - * @param {Number} tolerance - * @param {vtkMapper} mapper The vtkMapper instance. - */ - intersectActorWithLine(p1: Vector3, p2: Vector3, t1: number, t2: number, tolerance: number, mapper: vtkMapper): number; - - /** - * - * @param {Vector3} p1 - * @param {Vector3} p2 - * @param {Number} t1 - * @param {Number} t2 - * @param {Number} tolerance - * @param {vtkMapper} mapper The vtkMapper instance. - */ - intersectVolumeWithLine(p1: Vector3, p2: Vector3, t1: number, t2: number, tolerance: number, mapper: vtkMapper): number; } /** diff --git a/Sources/Rendering/Core/CellPicker/index.js b/Sources/Rendering/Core/CellPicker/index.js index 710451cd568..3c0dbf3cc1f 100644 --- a/Sources/Rendering/Core/CellPicker/index.js +++ b/Sources/Rendering/Core/CellPicker/index.js @@ -172,7 +172,7 @@ function vtkCellPicker(publicAPI, model) { return pickResult; }; - publicAPI.intersectWithLine = (p1, p2, tolerance, actor, mapper) => { + model.intersectWithLine = (p1, p2, tolerance, prop, mapper) => { let tMin = Number.MAX_VALUE; let t1 = 0.0; let t2 = 1.0; @@ -201,7 +201,7 @@ function vtkCellPicker(publicAPI, model) { } else if (mapper.isA('vtkVolumeMapper')) { // we calculate here the parametric intercept points between the ray and the bounding box, so // if the application defines for some reason a too large ray length (1e6), it restrict the calculation - // to the vtkVolume actor bounding box + // to the vtkVolume prop bounding box const interceptionObject = vtkBox.intersectWithLine( mapper.getBounds(), p1, @@ -217,23 +217,9 @@ function vtkCellPicker(publicAPI, model) { ? interceptionObject.t2 : clipLine.t2; - tMin = publicAPI.intersectVolumeWithLine( - p1, - p2, - t1, - t2, - tolerance, - actor - ); + tMin = model.intersectVolumeWithLine(p1, p2, t1, t2, tolerance, prop); } else if (mapper.isA('vtkMapper')) { - tMin = publicAPI.intersectActorWithLine( - p1, - p2, - t1, - t2, - tolerance, - mapper - ); + tMin = model.intersectActorWithLine(p1, p2, t1, t2, tolerance, mapper); } if (tMin < model.globalTMin) { @@ -280,7 +266,7 @@ function vtkCellPicker(publicAPI, model) { return tMin; }; - publicAPI.intersectVolumeWithLine = (p1, p2, t1, t2, tolerance, volume) => { + model.intersectVolumeWithLine = (p1, p2, t1, t2, tolerance, volume) => { let tMin = Number.MAX_VALUE; const mapper = volume.getMapper(); const imageData = mapper.getInputData(); @@ -402,7 +388,7 @@ function vtkCellPicker(publicAPI, model) { return tMin; }; - publicAPI.intersectActorWithLine = (p1, p2, t1, t2, tolerance, mapper) => { + model.intersectActorWithLine = (p1, p2, t1, t2, tolerance, mapper) => { let tMin = Number.MAX_VALUE; const minXYZ = [0, 0, 0]; let pDistMin = Number.MAX_VALUE; diff --git a/Sources/Rendering/Core/Picker/index.d.ts b/Sources/Rendering/Core/Picker/index.d.ts index 75b9887edab..30790f5816f 100755 --- a/Sources/Rendering/Core/Picker/index.d.ts +++ b/Sources/Rendering/Core/Picker/index.d.ts @@ -68,17 +68,6 @@ export interface vtkPicker extends vtkAbstractPicker { */ onPickChange(callback: OnPickChangeCallback): vtkSubscription; - /** - * Intersect data with specified ray. - * Project the center point of the mapper onto the ray and determine its parametric value - * @param {Vector3} p1 - * @param {Vector3} p2 - * @param {Number} tolerance - * @param {Nullable} prop - * @param {vtkMapper} mapper - */ - intersectWithLine(p1: Vector3, p2: Vector3, tolerance: number, prop: Nullable, mapper: vtkMapper): number; - /** * Perform pick operation with selection point provided. * @param {Vector3} selection First two values should be x-y pixel coordinate, the third is usually zero. diff --git a/Sources/Rendering/Core/Picker/index.js b/Sources/Rendering/Core/Picker/index.js index 8c7a4ae0269..02592682b61 100644 --- a/Sources/Rendering/Core/Picker/index.js +++ b/Sources/Rendering/Core/Picker/index.js @@ -157,8 +157,7 @@ function vtkPicker(publicAPI, model) { if (vtkBoundingBox.intersectBox(bounds, p1Mapper, ray, hitPosition, [])) { mat4.getScaling(transformScale, model.transformMatrix); - // TODO: better naming? - const t = publicAPI.intersectWithLine( + const t = model.intersectWithLine( p1Mapper, p2Mapper, tolerance * @@ -224,7 +223,7 @@ function vtkPicker(publicAPI, model) { // Intersect data with specified ray. // Project the center point of the mapper onto the ray and determine its parametric value - publicAPI.intersectWithLine = (p1, p2, tolerance, prop, mapper) => { + model.intersectWithLine = (p1, p2, tolerance, prop, mapper) => { if (!mapper) { return Number.MAX_VALUE; } diff --git a/Sources/Rendering/Core/PointPicker/index.d.ts b/Sources/Rendering/Core/PointPicker/index.d.ts index 8dc62e1b5ea..d927c549784 100755 --- a/Sources/Rendering/Core/PointPicker/index.d.ts +++ b/Sources/Rendering/Core/PointPicker/index.d.ts @@ -33,26 +33,6 @@ export interface vtkPointPicker extends vtkPicker { */ getUseCells(): boolean; - /** - * - * @param {Vector3} p1 - * @param {Vector3} p2 - * @param {Number} tolerance - * @param {vtkProp3D} actor - * @param {vtkMapper} mapper - */ - intersectWithLine(p1: Vector3, p2: Vector3, tolerance: number, actor: Nullable, mapper: vtkMapper): number; - - /** - * - * @param {Vector3} p1 - * @param {Vector3} p2 - * @param {Number} tolerance - * @param {vtkProp3D} actor - * @param {vtkMapper} mapper - */ - intersectActorWithLine(p1: Vector3, p2: Vector3, tolerance: number, mapper: vtkMapper): number; - /** * Specify whether the point search should be based on cell points or directly on the point list. * @param useCells diff --git a/Sources/Rendering/Core/PointPicker/index.js b/Sources/Rendering/Core/PointPicker/index.js index ccb77501d38..20af75ecd47 100644 --- a/Sources/Rendering/Core/PointPicker/index.js +++ b/Sources/Rendering/Core/PointPicker/index.js @@ -12,7 +12,7 @@ function vtkPointPicker(publicAPI, model) { // Set our className model.classHierarchy.push('vtkPointPicker'); - publicAPI.intersectWithLine = (p1, p2, tolerance, actor, mapper) => { + model.intersectWithLine = (p1, p2, tolerance, prop, mapper) => { let tMin = Number.MAX_VALUE; if (mapper.isA('vtkImageMapper') || mapper.isA('vtkImageArrayMapper')) { @@ -22,13 +22,13 @@ function vtkPointPicker(publicAPI, model) { model.pointIJK = pickData.ijk; } } else if (mapper.isA('vtkMapper')) { - tMin = publicAPI.intersectActorWithLine(p1, p2, tolerance, mapper); + tMin = model.intersectActorWithLine(p1, p2, tolerance, mapper); } return tMin; }; - publicAPI.intersectActorWithLine = (p1, p2, tolerance, mapper) => { + model.intersectActorWithLine = (p1, p2, tolerance, mapper) => { // Get dataset const input = mapper.getInputData();