@kitware/vtk.js 34.11.3 → 34.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Common/Core/CellArray.d.ts +5 -0
- package/Common/Core/CellArray.js +1 -0
- package/Common/Core/Math/index.js +1 -1
- package/Common/Core/Math.d.ts +2 -1
- package/Common/Core/Math.js +1 -1
- package/Common/Core/MatrixBuilder.d.ts +1 -0
- package/Common/DataModel/BoundingBox.js +1 -0
- package/Common/DataModel/DataSet.js +57 -32
- package/Common/DataModel/DataSetAttributes/FieldData.js +2 -2
- package/Common/DataModel/ImageData.js +1 -1
- package/Common/DataModel/IncrementalOctreeNode.js +1 -1
- package/Common/DataModel/IncrementalOctreePointLocator.js +1 -1
- package/Common/DataModel/Line.js +1 -1
- package/Common/DataModel/MergePoints.js +2 -2
- package/Common/DataModel/Planes.js +1 -1
- package/Common/DataModel/PointLocator.js +1 -1
- package/Common/DataModel/PolyData.d.ts +9 -3
- package/Common/DataModel/PolyData.js +10 -1
- package/Common/DataModel/Polygon.js +1 -1
- package/Common/DataModel/Quad.js +1 -1
- package/Common/DataModel/Triangle.js +1 -1
- package/Common/Transform/Transform.d.ts +1 -0
- package/Common/Transform/Transform.js +1 -1
- package/Filters/Core/CleanPolyData.d.ts +208 -0
- package/Filters/Core/CleanPolyData.js +399 -0
- package/Filters/Core/PolyDataNormals.js +1 -1
- package/Filters/Core/ThresholdPoints.js +2 -2
- package/Filters/Core.js +5 -1
- package/Filters/General/ClipClosedSurface.js +1 -1
- package/Filters/General/ContourTriangulator/helper.js +1 -1
- package/Filters/General/TubeFilter.js +1 -1
- package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
- package/Filters/Sources/ArcSource.js +1 -1
- package/Filters/Sources/EllipseArcSource.js +1 -1
- package/Filters/Sources/FrustumSource.js +1 -1
- package/Filters/Sources/TorusSource.js +107 -0
- package/Filters/Sources.js +3 -1
- package/Filters/Texture/TextureMapToPlane.js +1 -1
- package/Filters/Texture/TextureMapToSphere.js +1 -1
- package/Imaging/Core/ImageReslice.d.ts +2 -1
- package/Imaging/Core/ImageReslice.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
- package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
- package/Interaction/Style/InteractorStyleManipulator.js +1 -0
- package/Proxy/Representations/GlyphRepresentationProxy.js +1 -0
- package/Rendering/Core/CellPicker.js +1 -1
- package/Rendering/Core/Picker.js +1 -1
- package/Rendering/Core/Prop3D.js +10 -0
- package/Rendering/Core/Renderer.js +13 -11
- package/Rendering/OpenGL/ImageResliceMapper.js +1 -1
- package/Rendering/WebGPU/VolumePass.js +1 -1
- package/Widgets/Core/StateBuilder/originMixin.js +1 -1
- package/Widgets/Core/WidgetManager.js +1 -1
- package/Widgets/Manipulators/PlaneManipulator.js +2 -2
- package/Widgets/Manipulators.js +2 -2
- package/Widgets/Representations/RotateTransformHandleRepresentation.js +46 -0
- package/Widgets/Representations/ScaleTransformHandleRepresentation.js +57 -0
- package/Widgets/Representations/TranslateTransformHandleRepresentation/TransformHandleSource.js +85 -0
- package/Widgets/Representations/TranslateTransformHandleRepresentation.js +57 -0
- package/Widgets/Representations.js +6 -0
- package/Widgets/Widgets3D/AngleWidget.js +2 -2
- package/Widgets/Widgets3D/EllipseWidget.js +2 -2
- package/Widgets/Widgets3D/ImageCroppingWidget.js +3 -3
- package/Widgets/Widgets3D/ImplicitPlaneWidget.js +2 -2
- package/Widgets/Widgets3D/LabelWidget.js +2 -2
- package/Widgets/Widgets3D/LineWidget.js +3 -3
- package/Widgets/Widgets3D/PaintWidget.js +2 -2
- package/Widgets/Widgets3D/PolyLineWidget.js +2 -2
- package/Widgets/Widgets3D/RectangleWidget.js +2 -2
- package/Widgets/Widgets3D/ResliceCursorWidget.js +3 -3
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/SphereWidget.js +3 -3
- package/Widgets/Widgets3D/SplineWidget.js +2 -2
- package/Widgets/Widgets3D/TransformControlsWidget/behavior.js +180 -0
- package/Widgets/Widgets3D/TransformControlsWidget/constants.js +15 -0
- package/Widgets/Widgets3D/TransformControlsWidget/state.js +157 -0
- package/Widgets/Widgets3D/TransformControlsWidget.js +147 -0
- package/Widgets/Widgets3D.js +3 -1
- package/index.d.ts +1 -0
- package/package.json +4 -4
|
@@ -8,7 +8,7 @@ import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
|
|
|
8
8
|
import { FieldAssociations } from '../../Common/DataModel/DataSet/Constants.js';
|
|
9
9
|
import { mat4, vec3 } from 'gl-matrix';
|
|
10
10
|
import { m as macro } from '../../macros2.js';
|
|
11
|
-
import { E as areEquals, l as normalize, d as dot, F as clampValue, s as subtract, j as cross, x as multiplyScalar,
|
|
11
|
+
import { E as areEquals, l as normalize, d as dot, F as clampValue, s as subtract, j as cross, x as multiplyScalar, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
12
12
|
|
|
13
13
|
const {
|
|
14
14
|
States
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import { l as normalize, E as areEquals,
|
|
2
|
+
import { l as normalize, E as areEquals, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
3
3
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
4
4
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
5
5
|
import vtkInteractorStyleManipulator from './InteractorStyleManipulator.js';
|
|
@@ -355,6 +355,7 @@ function vtkInteractorStyleManipulator(publicAPI, model) {
|
|
|
355
355
|
if (!model._interactor.isPointerLocked()) {
|
|
356
356
|
model.currentManipulator = null;
|
|
357
357
|
}
|
|
358
|
+
model._interactor.cancelAnimation(publicAPI.onButtonDown);
|
|
358
359
|
publicAPI.invokeEndInteractionEvent(END_INTERACTION_EVENT);
|
|
359
360
|
}
|
|
360
361
|
};
|
|
@@ -25,6 +25,7 @@ import '../../Filters/Sources/PointSource.js';
|
|
|
25
25
|
import '../../Filters/Sources/RTAnalyticSource.js';
|
|
26
26
|
import '../../Filters/Sources/SLICSource.js';
|
|
27
27
|
import '../../Filters/Sources/SphereSource.js';
|
|
28
|
+
import '../../Filters/Sources/TorusSource.js';
|
|
28
29
|
|
|
29
30
|
// ----------------------------------------------------------------------------
|
|
30
31
|
// vtkGlyphRepresentationProxy methods
|
|
@@ -5,7 +5,7 @@ import vtkPicker from './Picker.js';
|
|
|
5
5
|
import vtkPolyLine from '../../Common/DataModel/PolyLine.js';
|
|
6
6
|
import vtkTriangle from '../../Common/DataModel/Triangle.js';
|
|
7
7
|
import vtkQuad from '../../Common/DataModel/Quad.js';
|
|
8
|
-
import { l as normalize,
|
|
8
|
+
import { l as normalize, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
9
9
|
import { CellType } from '../../Common/DataModel/CellTypes/Constants.js';
|
|
10
10
|
import { vec3, vec4 } from 'gl-matrix';
|
|
11
11
|
import vtkBox from '../../Common/DataModel/Box.js';
|
package/Rendering/Core/Picker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkAbstractPicker from './AbstractPicker.js';
|
|
3
3
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
4
|
-
import { d as dot, l as normalize, s as subtract,
|
|
4
|
+
import { d as dot, l as normalize, s as subtract, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import { vec3, mat4, vec4 } from 'gl-matrix';
|
|
6
6
|
|
|
7
7
|
const {
|
package/Rendering/Core/Prop3D.js
CHANGED
|
@@ -83,6 +83,16 @@ function vtkProp3D(publicAPI, model) {
|
|
|
83
83
|
publicAPI.modified();
|
|
84
84
|
return true;
|
|
85
85
|
};
|
|
86
|
+
publicAPI.setOrientationFromQuaternion = q => {
|
|
87
|
+
const rotation = mat4.create();
|
|
88
|
+
mat4.fromQuat(rotation, q);
|
|
89
|
+
if (!areMatricesEqual(rotation, model.rotation)) {
|
|
90
|
+
model.rotation = rotation;
|
|
91
|
+
publicAPI.modified();
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
95
|
+
};
|
|
86
96
|
publicAPI.setUserMatrix = matrix => {
|
|
87
97
|
if (areMatricesEqual(model.userMatrix, matrix)) {
|
|
88
98
|
return false;
|
|
@@ -362,17 +362,19 @@ function vtkRenderer(publicAPI, model) {
|
|
|
362
362
|
|
|
363
363
|
// default so that the bounding sphere fits within the view fustrum
|
|
364
364
|
|
|
365
|
-
//
|
|
366
|
-
//
|
|
367
|
-
//
|
|
368
|
-
//
|
|
369
|
-
//
|
|
370
|
-
//
|
|
371
|
-
//
|
|
372
|
-
//
|
|
373
|
-
//
|
|
374
|
-
// the
|
|
375
|
-
//
|
|
365
|
+
// Viewing the scene from the side in 2D:
|
|
366
|
+
// Draw a circle representing the bounding sphere containing all pixels.
|
|
367
|
+
// Then, draw a horizontal line going out from the center of the circle.
|
|
368
|
+
// The camera is somewhere on this line.
|
|
369
|
+
// Picture the view frustrum, moving through the circle.
|
|
370
|
+
// Draw a line from the intersection of the view frustrum and the bounding sphere to line the camera is on, ensuring that the line is tangent to the circle.
|
|
371
|
+
// Draw the radius from the tangent point to the center of the circle.
|
|
372
|
+
// You will note that this forms a right triangle with sides:
|
|
373
|
+
// - radius
|
|
374
|
+
// - the line formed by the intersection of the view frustrum and the bounding sphere
|
|
375
|
+
// - the target distance for the camera.
|
|
376
|
+
// We can use trigonometry to solve for that distance.
|
|
377
|
+
|
|
376
378
|
const angle = radiansFromDegrees(model.activeCamera.getViewAngle());
|
|
377
379
|
const parallelScale = radius;
|
|
378
380
|
const distance = radius / Math.sin(angle * 0.5);
|
|
@@ -5,7 +5,7 @@ import vtkCutter from '../../Filters/Core/Cutter.js';
|
|
|
5
5
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
6
6
|
import vtkHelper from './Helper.js';
|
|
7
7
|
import vtkImageDataOutlineFilter from '../../Filters/General/ImageDataOutlineFilter.js';
|
|
8
|
-
import {
|
|
8
|
+
import { b as vtkMath } from '../../Common/Core/Math/index.js';
|
|
9
9
|
import vtkOpenGLTexture from './Texture.js';
|
|
10
10
|
import vtkPlane from '../../Common/DataModel/Plane.js';
|
|
11
11
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
@@ -10,7 +10,7 @@ import vtkWebGPUTexture from './Texture.js';
|
|
|
10
10
|
import vtkWebGPUUniformBuffer from './UniformBuffer.js';
|
|
11
11
|
import vtkWebGPUFullScreenQuad from './FullScreenQuad.js';
|
|
12
12
|
import vtkWebGPUVolumePassFSQ from './VolumePassFSQ.js';
|
|
13
|
-
import {
|
|
13
|
+
import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
14
14
|
|
|
15
15
|
const {
|
|
16
16
|
Representation
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../../macros2.js';
|
|
2
|
-
import {
|
|
2
|
+
import { b as vtkMath } from '../../../Common/Core/Math/index.js';
|
|
3
3
|
import { getPixelWorldHeightAtCoord } from '../WidgetManager.js';
|
|
4
4
|
|
|
5
5
|
// ----------------------------------------------------------------------------
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as vtkMath } from '../../Common/Core/Math/index.js';
|
|
2
2
|
import { FieldAssociations } from '../../Common/DataModel/DataSet/Constants.js';
|
|
3
3
|
import { m as macro } from '../../macros2.js';
|
|
4
4
|
import WidgetManagerConst from './WidgetManager/Constants.js';
|
|
@@ -44,10 +44,10 @@ const newInstance = macro.newInstance(extend, 'vtkPlaneManipulator');
|
|
|
44
44
|
|
|
45
45
|
// ----------------------------------------------------------------------------
|
|
46
46
|
|
|
47
|
-
var
|
|
47
|
+
var vtkPlaneManipulator$1 = {
|
|
48
48
|
intersectDisplayWithPlane,
|
|
49
49
|
extend,
|
|
50
50
|
newInstance
|
|
51
51
|
};
|
|
52
52
|
|
|
53
|
-
export {
|
|
53
|
+
export { vtkPlaneManipulator$1 as default, extend, intersectDisplayWithPlane, newInstance };
|
package/Widgets/Manipulators.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import vtkPickerManipulator from './Manipulators/PickerManipulator.js';
|
|
2
2
|
import vtkLineManipulator from './Manipulators/LineManipulator.js';
|
|
3
|
-
import
|
|
3
|
+
import vtkPlaneManipulator from './Manipulators/PlaneManipulator.js';
|
|
4
4
|
import vtkTrackballManipulator from './Manipulators/TrackballManipulator.js';
|
|
5
5
|
|
|
6
6
|
var Manipulators = {
|
|
7
7
|
vtkPickerManipulator,
|
|
8
8
|
vtkLineManipulator,
|
|
9
|
-
vtkPlaneManipulator
|
|
9
|
+
vtkPlaneManipulator,
|
|
10
10
|
vtkTrackballManipulator
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { m as macro } from '../../macros2.js';
|
|
2
|
+
import vtkGlyphRepresentation from './GlyphRepresentation.js';
|
|
3
|
+
import vtkTorusSource from '../../Filters/Sources/TorusSource.js';
|
|
4
|
+
|
|
5
|
+
// ----------------------------------------------------------------------------
|
|
6
|
+
// vtkRotateTransformHandleRepresentation methods
|
|
7
|
+
// ----------------------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
function vtkRotateTransformHandleRepresentation(publicAPI, model) {
|
|
10
|
+
// Set our className
|
|
11
|
+
model.classHierarchy.push('vtkRotateTransformHandleRepresentation');
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// ----------------------------------------------------------------------------
|
|
15
|
+
// Object factory
|
|
16
|
+
// ----------------------------------------------------------------------------
|
|
17
|
+
|
|
18
|
+
// ----------------------------------------------------------------------------
|
|
19
|
+
function defaultValues(initialValues) {
|
|
20
|
+
return {
|
|
21
|
+
_pipeline: {
|
|
22
|
+
glyph: vtkTorusSource.newInstance({})
|
|
23
|
+
},
|
|
24
|
+
...initialValues
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function extend(publicAPI, model) {
|
|
28
|
+
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
29
|
+
vtkGlyphRepresentation.extend(publicAPI, model, defaultValues(initialValues));
|
|
30
|
+
|
|
31
|
+
// Object specific methods
|
|
32
|
+
vtkRotateTransformHandleRepresentation(publicAPI, model);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ----------------------------------------------------------------------------
|
|
36
|
+
|
|
37
|
+
const newInstance = macro.newInstance(extend, 'vtkRotateTransformHandleRepresentation');
|
|
38
|
+
|
|
39
|
+
// ----------------------------------------------------------------------------
|
|
40
|
+
|
|
41
|
+
var vtkRotateTransformHandleRepresentation$1 = {
|
|
42
|
+
newInstance,
|
|
43
|
+
extend
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { vtkRotateTransformHandleRepresentation$1 as default, extend, newInstance };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { m as macro } from '../../macros2.js';
|
|
2
|
+
import vtkGlyphRepresentation from './GlyphRepresentation.js';
|
|
3
|
+
import vtkCubeSource from '../../Filters/Sources/CubeSource.js';
|
|
4
|
+
import vtkTransformHandleSource from './TranslateTransformHandleRepresentation/TransformHandleSource.js';
|
|
5
|
+
|
|
6
|
+
// ----------------------------------------------------------------------------
|
|
7
|
+
// vtkScaleTransformHandleRepresentation methods
|
|
8
|
+
// ----------------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
function vtkScaleTransformHandleRepresentation(publicAPI, model) {
|
|
11
|
+
// Set our className
|
|
12
|
+
model.classHierarchy.push('vtkScaleTransformHandleRepresentation');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// ----------------------------------------------------------------------------
|
|
16
|
+
// Object factory
|
|
17
|
+
// ----------------------------------------------------------------------------
|
|
18
|
+
|
|
19
|
+
// ----------------------------------------------------------------------------
|
|
20
|
+
function defaultValues(initialValues) {
|
|
21
|
+
const source = vtkTransformHandleSource.newInstance({
|
|
22
|
+
height: initialValues.height ?? 1,
|
|
23
|
+
radius: initialValues.radius ?? 1,
|
|
24
|
+
resolution: initialValues.glyphResolution ?? 12,
|
|
25
|
+
direction: [0, 0, 1]
|
|
26
|
+
});
|
|
27
|
+
const cube1 = vtkCubeSource.newInstance(initialValues.cubeSource);
|
|
28
|
+
const cube2 = vtkCubeSource.newInstance(initialValues.cubeSource);
|
|
29
|
+
source.addInputConnection(cube1.getOutputPort());
|
|
30
|
+
source.addInputConnection(cube2.getOutputPort());
|
|
31
|
+
return {
|
|
32
|
+
_pipeline: {
|
|
33
|
+
glyph: source
|
|
34
|
+
},
|
|
35
|
+
...initialValues
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function extend(publicAPI, model) {
|
|
39
|
+
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
40
|
+
vtkGlyphRepresentation.extend(publicAPI, model, defaultValues(initialValues));
|
|
41
|
+
|
|
42
|
+
// Object specific methods
|
|
43
|
+
vtkScaleTransformHandleRepresentation(publicAPI, model);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// ----------------------------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
const newInstance = macro.newInstance(extend, 'vtkScaleTransformHandleRepresentation');
|
|
49
|
+
|
|
50
|
+
// ----------------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
var vtkScaleTransformHandleRepresentation$1 = {
|
|
53
|
+
newInstance,
|
|
54
|
+
extend
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { vtkScaleTransformHandleRepresentation$1 as default, extend, newInstance };
|
package/Widgets/Representations/TranslateTransformHandleRepresentation/TransformHandleSource.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { m as macro } from '../../../macros2.js';
|
|
2
|
+
import vtkMatrixBuilder from '../../../Common/Core/MatrixBuilder.js';
|
|
3
|
+
import vtkAppendPolyData from '../../../Filters/General/AppendPolyData.js';
|
|
4
|
+
import vtkCylinderSource from '../../../Filters/Sources/CylinderSource.js';
|
|
5
|
+
|
|
6
|
+
function rotatePolyData(pd, direction) {
|
|
7
|
+
const points = pd.getPoints().getData();
|
|
8
|
+
vtkMatrixBuilder.buildFromRadian().rotateFromDirections([0, 1, 0], direction).apply(points);
|
|
9
|
+
pd.getPoints().modified();
|
|
10
|
+
pd.modified();
|
|
11
|
+
}
|
|
12
|
+
function translatePolyData(pd, translation) {
|
|
13
|
+
const points = pd.getPoints().getData();
|
|
14
|
+
vtkMatrixBuilder.buildFromRadian().translate(...translation).apply(points);
|
|
15
|
+
pd.modified();
|
|
16
|
+
}
|
|
17
|
+
function vtkTransformHandleSource(publicAPI, model) {
|
|
18
|
+
// Set our className
|
|
19
|
+
model.classHierarchy.push('vtkTransformHandleSource');
|
|
20
|
+
function requestData(inData, outData) {
|
|
21
|
+
const cylinderSource = vtkCylinderSource.newInstance({
|
|
22
|
+
height: model.height,
|
|
23
|
+
initAngle: model.initAngle,
|
|
24
|
+
radius: model.radius,
|
|
25
|
+
resolution: model.resolution,
|
|
26
|
+
capping: model.capping,
|
|
27
|
+
pointType: model.pointType,
|
|
28
|
+
center: [0, 0, 0],
|
|
29
|
+
direction: [0, 1, 0]
|
|
30
|
+
});
|
|
31
|
+
const appendFilter = vtkAppendPolyData.newInstance();
|
|
32
|
+
appendFilter.setInputConnection(cylinderSource.getOutputPort(), 0);
|
|
33
|
+
if (inData[0]) {
|
|
34
|
+
translatePolyData(inData[0], [0, model.height / 2, 0]);
|
|
35
|
+
appendFilter.addInputData(inData[0]);
|
|
36
|
+
}
|
|
37
|
+
if (inData[1]) {
|
|
38
|
+
rotatePolyData(inData[1], [0, -1, 0]);
|
|
39
|
+
translatePolyData(inData[1], [0, -model.height / 2, 0]);
|
|
40
|
+
appendFilter.addInputData(inData[1]);
|
|
41
|
+
}
|
|
42
|
+
const poly = appendFilter.getOutputData();
|
|
43
|
+
const points = poly.getPoints().getData();
|
|
44
|
+
|
|
45
|
+
// Apply transformation to the points coordinates
|
|
46
|
+
vtkMatrixBuilder.buildFromRadian().translate(...model.center).rotateFromDirections([0, 1, 0], model.direction).translate(...model.center.map(c => c * -1)).apply(points);
|
|
47
|
+
|
|
48
|
+
// Update output
|
|
49
|
+
outData[0] = poly;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Expose methods
|
|
53
|
+
publicAPI.requestData = requestData;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ----------------------------------------------------------------------------
|
|
57
|
+
// Object factory
|
|
58
|
+
// ----------------------------------------------------------------------------
|
|
59
|
+
|
|
60
|
+
const DEFAULT_VALUES = {
|
|
61
|
+
capPolyData: null
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// ----------------------------------------------------------------------------
|
|
65
|
+
|
|
66
|
+
function extend(publicAPI, model) {
|
|
67
|
+
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
68
|
+
Object.assign(model, DEFAULT_VALUES, initialValues);
|
|
69
|
+
vtkCylinderSource.extend(publicAPI, model, initialValues);
|
|
70
|
+
macro.algo(publicAPI, model, 2, 1);
|
|
71
|
+
vtkTransformHandleSource(publicAPI, model);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// ----------------------------------------------------------------------------
|
|
75
|
+
|
|
76
|
+
const newInstance = macro.newInstance(extend, 'vtkTransformHandleSource');
|
|
77
|
+
|
|
78
|
+
// ----------------------------------------------------------------------------
|
|
79
|
+
|
|
80
|
+
var vtkTransformHandleSource$1 = {
|
|
81
|
+
newInstance,
|
|
82
|
+
extend
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export { vtkTransformHandleSource$1 as default, extend, newInstance };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { m as macro } from '../../macros2.js';
|
|
2
|
+
import vtkGlyphRepresentation from './GlyphRepresentation.js';
|
|
3
|
+
import vtkConeSource from '../../Filters/Sources/ConeSource.js';
|
|
4
|
+
import vtkTransformHandleSource from './TranslateTransformHandleRepresentation/TransformHandleSource.js';
|
|
5
|
+
|
|
6
|
+
// ----------------------------------------------------------------------------
|
|
7
|
+
// vtkTranslateTransformHandleRepresentation methods
|
|
8
|
+
// ----------------------------------------------------------------------------
|
|
9
|
+
|
|
10
|
+
function vtkTranslateTransformHandleRepresentation(publicAPI, model) {
|
|
11
|
+
// Set our className
|
|
12
|
+
model.classHierarchy.push('vtkTranslateTransformHandleRepresentation');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// ----------------------------------------------------------------------------
|
|
16
|
+
// Object factory
|
|
17
|
+
// ----------------------------------------------------------------------------
|
|
18
|
+
|
|
19
|
+
// ----------------------------------------------------------------------------
|
|
20
|
+
function defaultValues(initialValues) {
|
|
21
|
+
const source = vtkTransformHandleSource.newInstance({
|
|
22
|
+
height: initialValues.height ?? 1,
|
|
23
|
+
radius: initialValues.radius ?? 1,
|
|
24
|
+
resolution: initialValues.glyphResolution ?? 12,
|
|
25
|
+
direction: [0, 0, 1]
|
|
26
|
+
});
|
|
27
|
+
const cone1 = vtkConeSource.newInstance(initialValues.coneSource);
|
|
28
|
+
const cone2 = vtkConeSource.newInstance(initialValues.coneSource);
|
|
29
|
+
source.addInputConnection(cone1.getOutputPort());
|
|
30
|
+
source.addInputConnection(cone2.getOutputPort());
|
|
31
|
+
return {
|
|
32
|
+
_pipeline: {
|
|
33
|
+
glyph: source
|
|
34
|
+
},
|
|
35
|
+
...initialValues
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function extend(publicAPI, model) {
|
|
39
|
+
let initialValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
40
|
+
vtkGlyphRepresentation.extend(publicAPI, model, defaultValues(initialValues));
|
|
41
|
+
|
|
42
|
+
// Object specific methods
|
|
43
|
+
vtkTranslateTransformHandleRepresentation(publicAPI, model);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// ----------------------------------------------------------------------------
|
|
47
|
+
|
|
48
|
+
const newInstance = macro.newInstance(extend, 'vtkTranslateTransformHandleRepresentation');
|
|
49
|
+
|
|
50
|
+
// ----------------------------------------------------------------------------
|
|
51
|
+
|
|
52
|
+
var vtkTranslateTransformHandleRepresentation$1 = {
|
|
53
|
+
newInstance,
|
|
54
|
+
extend
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { vtkTranslateTransformHandleRepresentation$1 as default, extend, newInstance };
|
|
@@ -8,8 +8,11 @@ import vtkImplicitPlaneRepresentation from './Representations/ImplicitPlaneRepre
|
|
|
8
8
|
import vtkLineHandleRepresentation from './Representations/LineHandleRepresentation.js';
|
|
9
9
|
import vtkOutlineContextRepresentation from './Representations/OutlineContextRepresentation.js';
|
|
10
10
|
import vtkPolyLineRepresentation from './Representations/PolyLineRepresentation.js';
|
|
11
|
+
import vtkRotateTransformHandleRepresentation from './Representations/RotateTransformHandleRepresentation.js';
|
|
12
|
+
import vtkScaleTransformHandleRepresentation from './Representations/ScaleTransformHandleRepresentation.js';
|
|
11
13
|
import vtkSphereHandleRepresentation from './Representations/SphereHandleRepresentation.js';
|
|
12
14
|
import vtkSplineContextRepresentation from './Representations/SplineContextRepresentation.js';
|
|
15
|
+
import vtkTranslateTransformHandleRepresentation from './Representations/TranslateTransformHandleRepresentation.js';
|
|
13
16
|
import vtkWidgetRepresentation from './Representations/WidgetRepresentation.js';
|
|
14
17
|
|
|
15
18
|
var Representations = {
|
|
@@ -23,8 +26,11 @@ var Representations = {
|
|
|
23
26
|
vtkLineHandleRepresentation,
|
|
24
27
|
vtkOutlineContextRepresentation,
|
|
25
28
|
vtkPolyLineRepresentation,
|
|
29
|
+
vtkRotateTransformHandleRepresentation,
|
|
30
|
+
vtkScaleTransformHandleRepresentation,
|
|
26
31
|
vtkSphereHandleRepresentation,
|
|
27
32
|
vtkSplineContextRepresentation,
|
|
33
|
+
vtkTranslateTransformHandleRepresentation,
|
|
28
34
|
vtkWidgetRepresentation
|
|
29
35
|
};
|
|
30
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
3
|
-
import
|
|
3
|
+
import vtkPlaneManipulator from '../Manipulators/PlaneManipulator.js';
|
|
4
4
|
import vtkPolyLineRepresentation from '../Representations/PolyLineRepresentation.js';
|
|
5
5
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
6
6
|
import { s as subtract, Z as angleBetweenVectors } from '../../Common/Core/Math/index.js';
|
|
@@ -69,7 +69,7 @@ function vtkAngleWidget(publicAPI, model) {
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
// Default manipulator
|
|
72
|
-
publicAPI.setManipulator(model.manipulator ||
|
|
72
|
+
publicAPI.setManipulator(model.manipulator || vtkPlaneManipulator.newInstance({
|
|
73
73
|
useCameraNormal: true
|
|
74
74
|
}));
|
|
75
75
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkCircleContextRepresentation from '../Representations/CircleContextRepresentation.js';
|
|
3
|
-
import
|
|
3
|
+
import vtkPlaneManipulator from '../Manipulators/PlaneManipulator.js';
|
|
4
4
|
import vtkShapeWidget from './ShapeWidget.js';
|
|
5
5
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
6
6
|
import widgetBehavior from './EllipseWidget/behavior.js';
|
|
@@ -39,7 +39,7 @@ function vtkEllipseWidget(publicAPI, model) {
|
|
|
39
39
|
// initialization
|
|
40
40
|
// --------------------------------------------------------------------------
|
|
41
41
|
|
|
42
|
-
publicAPI.setManipulator(model.manipulator ||
|
|
42
|
+
publicAPI.setManipulator(model.manipulator || vtkPlaneManipulator.newInstance({
|
|
43
43
|
useCameraNormal: true
|
|
44
44
|
}));
|
|
45
45
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
3
|
-
import
|
|
3
|
+
import vtkPlaneManipulator from '../Manipulators/PlaneManipulator.js';
|
|
4
4
|
import vtkLineManipulator from '../Manipulators/LineManipulator.js';
|
|
5
5
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
6
6
|
import vtkCroppingOutlineRepresentation from '../Representations/CroppingOutlineRepresentation.js';
|
|
@@ -129,10 +129,10 @@ function vtkImageCroppingWidget(publicAPI, model) {
|
|
|
129
129
|
// initialization
|
|
130
130
|
// --------------------------------------------------------------------------
|
|
131
131
|
|
|
132
|
-
publicAPI.setCornerManipulator(
|
|
132
|
+
publicAPI.setCornerManipulator(vtkPlaneManipulator.newInstance({
|
|
133
133
|
useCameraNormal: true
|
|
134
134
|
}));
|
|
135
|
-
publicAPI.setEdgeManipulator(
|
|
135
|
+
publicAPI.setEdgeManipulator(vtkPlaneManipulator.newInstance());
|
|
136
136
|
publicAPI.setFaceManipulator(vtkLineManipulator.newInstance());
|
|
137
137
|
}
|
|
138
138
|
|
|
@@ -4,7 +4,7 @@ import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
|
4
4
|
import vtkImplicitPlaneRepresentation from '../Representations/ImplicitPlaneRepresentation.js';
|
|
5
5
|
import vtkLineManipulator from '../Manipulators/LineManipulator.js';
|
|
6
6
|
import vtkTrackballManipulator from '../Manipulators/TrackballManipulator.js';
|
|
7
|
-
import
|
|
7
|
+
import vtkPlaneManipulator from '../Manipulators/PlaneManipulator.js';
|
|
8
8
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
9
9
|
|
|
10
10
|
// ----------------------------------------------------------------------------
|
|
@@ -145,7 +145,7 @@ function widgetBehavior(publicAPI, model) {
|
|
|
145
145
|
// --------------------------------------------------------------------------
|
|
146
146
|
|
|
147
147
|
model.lineManipulator = vtkLineManipulator.newInstance();
|
|
148
|
-
model.planeManipulator =
|
|
148
|
+
model.planeManipulator = vtkPlaneManipulator.newInstance();
|
|
149
149
|
model.trackballManipulator = vtkTrackballManipulator.newInstance();
|
|
150
150
|
}
|
|
151
151
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
3
3
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
4
|
-
import
|
|
4
|
+
import vtkPlaneManipulator from '../Manipulators/PlaneManipulator.js';
|
|
5
5
|
import widgetBehavior from './LabelWidget/behavior.js';
|
|
6
6
|
import generateState from './LabelWidget/state.js';
|
|
7
7
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
@@ -45,7 +45,7 @@ function vtkLabelWidget(publicAPI, model) {
|
|
|
45
45
|
// --------------------------------------------------------------------------
|
|
46
46
|
|
|
47
47
|
// Default manipulator
|
|
48
|
-
publicAPI.setManipulator(model.manipulator ||
|
|
48
|
+
publicAPI.setManipulator(model.manipulator || vtkPlaneManipulator.newInstance({
|
|
49
49
|
useCameraNormal: true
|
|
50
50
|
}));
|
|
51
51
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
2
2
|
import { m as macro } from '../../macros2.js';
|
|
3
3
|
import generateState from './LineWidget/state.js';
|
|
4
4
|
import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
5
5
|
import vtkArrowHandleRepresentation from '../Representations/ArrowHandleRepresentation.js';
|
|
6
|
-
import
|
|
6
|
+
import vtkPlaneManipulator from '../Manipulators/PlaneManipulator.js';
|
|
7
7
|
import vtkPolyLineRepresentation from '../Representations/PolyLineRepresentation.js';
|
|
8
8
|
import widgetBehavior from './LineWidget/behavior.js';
|
|
9
9
|
import { Behavior } from '../Representations/WidgetRepresentation/Constants.js';
|
|
@@ -145,7 +145,7 @@ function vtkLineWidget(publicAPI, model) {
|
|
|
145
145
|
});
|
|
146
146
|
|
|
147
147
|
// Default manipulator
|
|
148
|
-
publicAPI.setManipulator(model.manipulator ||
|
|
148
|
+
publicAPI.setManipulator(model.manipulator || vtkPlaneManipulator.newInstance({
|
|
149
149
|
useCameraNormal: true
|
|
150
150
|
}));
|
|
151
151
|
publicAPI.delete = macro.chain(publicAPI.delete, () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
3
3
|
import vtkCircleContextRepresentation from '../Representations/CircleContextRepresentation.js';
|
|
4
|
-
import
|
|
4
|
+
import vtkPlaneManipulator from '../Manipulators/PlaneManipulator.js';
|
|
5
5
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
6
6
|
import widgetBehavior from './PaintWidget/behavior.js';
|
|
7
7
|
import generateState from './PaintWidget/state.js';
|
|
@@ -57,7 +57,7 @@ function vtkPaintWidget(publicAPI, model) {
|
|
|
57
57
|
// --------------------------------------------------------------------------
|
|
58
58
|
|
|
59
59
|
// Default manipulator
|
|
60
|
-
publicAPI.setManipulator(model.manipulator ||
|
|
60
|
+
publicAPI.setManipulator(model.manipulator || vtkPlaneManipulator.newInstance({
|
|
61
61
|
useCameraNormal: true
|
|
62
62
|
}));
|
|
63
63
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
2
|
import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
3
|
-
import
|
|
3
|
+
import vtkPlaneManipulator from '../Manipulators/PlaneManipulator.js';
|
|
4
4
|
import vtkPolyLineRepresentation from '../Representations/PolyLineRepresentation.js';
|
|
5
5
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
6
6
|
import widgetBehavior from './PolyLineWidget/behavior.js';
|
|
@@ -54,7 +54,7 @@ function vtkPolyLineWidget(publicAPI, model) {
|
|
|
54
54
|
// --------------------------------------------------------------------------
|
|
55
55
|
|
|
56
56
|
// Default manipulator
|
|
57
|
-
publicAPI.setManipulator(model.manipulator ||
|
|
57
|
+
publicAPI.setManipulator(model.manipulator || vtkPlaneManipulator.newInstance({
|
|
58
58
|
useCameraFocalPoint: true,
|
|
59
59
|
useCameraNormal: true
|
|
60
60
|
}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as macro } from '../../macros2.js';
|
|
2
|
-
import
|
|
2
|
+
import vtkPlaneManipulator from '../Manipulators/PlaneManipulator.js';
|
|
3
3
|
import vtkShapeWidget from './ShapeWidget.js';
|
|
4
4
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
5
5
|
import vtkRectangleContextRepresentation from '../Representations/RectangleContextRepresentation.js';
|
|
@@ -39,7 +39,7 @@ function vtkRectangleWidget(publicAPI, model) {
|
|
|
39
39
|
// initialization
|
|
40
40
|
// --------------------------------------------------------------------------
|
|
41
41
|
|
|
42
|
-
model.manipulator =
|
|
42
|
+
model.manipulator = vtkPlaneManipulator.newInstance({
|
|
43
43
|
useCameraNormal: true
|
|
44
44
|
});
|
|
45
45
|
}
|