@kitware/vtk.js 22.1.2 → 22.1.3
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/Math/index.js +1 -1
- package/Common/Core/Math.js +1 -1
- package/Common/DataModel/ImageData.js +1 -1
- package/Common/DataModel/Line.js +1 -1
- package/Common/DataModel/Plane.js +1 -1
- package/Common/DataModel/Polygon.js +1 -1
- package/Common/DataModel/Triangle.js +1 -1
- package/Common/Transform/LandmarkTransform.js +1 -1
- package/Filters/General/ImageMarchingCubes.js +1 -1
- package/Filters/General/MoleculeToRepresentation.js +1 -1
- package/Filters/General/TubeFilter.js +1 -1
- package/Filters/General/WindowedSincPolyDataFilter.js +1 -1
- package/Filters/Sources/CircleSource.js +1 -1
- package/Filters/Sources/LineSource.js +1 -1
- package/Filters/Sources/PlaneSource.js +1 -1
- package/Filters/Sources/PointSource.js +1 -1
- package/Filters/Texture/TextureMapToPlane.js +1 -1
- package/Filters/Texture/TextureMapToSphere.js +1 -1
- package/Interaction/Manipulators/KeyboardCameraManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraAxisRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballPanManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraTrackballRotateManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamManipulator.js +1 -1
- package/Interaction/Manipulators/MouseCameraUnicamRotateManipulator.js +1 -1
- package/Interaction/Style/InteractorStyleMPRSlice.js +1 -1
- package/Interaction/Widgets/DistanceRepresentation.js +1 -1
- package/Interaction/Widgets/ImageCroppingRegionsRepresentation.js +1 -1
- package/Interaction/Widgets/ImageCroppingRegionsWidget.js +1 -1
- package/Interaction/Widgets/LabelRepresentation.js +1 -1
- package/Interaction/Widgets/ResliceCursor/ResliceCursor.js +1 -1
- package/Interaction/Widgets/ResliceCursor/ResliceCursorLineRepresentation.js +1 -1
- package/Interaction/Widgets/ResliceCursor/ResliceCursorRepresentation.js +1 -1
- package/Interaction/Widgets/SphereHandleRepresentation.js +1 -1
- package/Proxy/Core/View2DProxy.js +1 -1
- package/Rendering/Core/Camera.js +1 -1
- package/Rendering/Core/CellPicker.js +1 -1
- package/Rendering/Core/Light.js +1 -1
- package/Rendering/Core/Picker.js +1 -1
- package/Rendering/OpenGL/PolyDataMapper.js +1 -1
- package/Rendering/WebGPU/BufferManager.js +1 -1
- package/Rendering/WebGPU/VolumePass.js +66 -76
- package/Widgets/Core/StateBuilder/orientationMixin.js +1 -1
- package/Widgets/Manipulators/LineManipulator.js +1 -1
- package/Widgets/Manipulators/TrackballManipulator.js +1 -1
- package/Widgets/Representations/PolyLineRepresentation.js +1 -1
- package/Widgets/Representations/ResliceCursorContextRepresentation.js +1 -1
- package/Widgets/Representations/WidgetRepresentation.js +1 -1
- package/Widgets/Widgets3D/AngleWidget.js +1 -1
- package/Widgets/Widgets3D/DistanceWidget.js +1 -1
- package/Widgets/Widgets3D/LineWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/LineWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/LineWidget.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/behavior.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget/helpers.js +1 -1
- package/Widgets/Widgets3D/ResliceCursorWidget.js +1 -1
- package/Widgets/Widgets3D/ShapeWidget/behavior.js +1 -1
- package/package.json +1 -1
|
@@ -2329,4 +2329,4 @@ var vtkMath$1 = /*#__PURE__*/Object.freeze({
|
|
|
2329
2329
|
'default': vtkMath
|
|
2330
2330
|
});
|
|
2331
2331
|
|
|
2332
|
-
export { binomial as $, clampValue as A, projectVector as B, arrayRange as C, getMajorAxisIndex as D, isInf as E, rgb2hsv as F, rgb2lab as G, lab2rgb as H, floor as I, round as J, nearestPowerOfTwo as K, normalize2D as L, createUninitializedBounds as M, multiply3x3_vect3 as N, areBoundsInitialized as O, isPowerOfTwo as P, multiplyAccumulate as Q, angleBetweenVectors as R, signedAngleBetweenVectors as S, Pi as T, ceil as U, min as V, max as W, arrayMin as X, arrayMax as Y, ceilLog2 as Z, factorial as _, areMatricesEqual as a, beginCombination as a0, nextCombination as a1, randomSeed as a2, getSeed as a3, gaussian as a4, multiplyScalar2D as a5, multiplyAccumulate2D as a6, outer as a7, dot2D as a8, projectVector2D as a9, hex2float as aA, lab2xyz as aB, xyz2lab as aC, xyz2rgb as aD, rgb2xyz as aE, clampAndNormalizeValue as aF, getScalarTypeFittingRange as aG, getAdjustedScalarRange as aH, extentIsWithinOtherExtent as aI, boundsIsWithinOtherBounds as aJ, pointIsWithinBounds as aK, solve3PointCircle as aL, inf as aM, negInf as aN, isFinite as aO, isNaN as aP, floatToHex2 as aQ, floatRGB2HexCode as aR, float2CssRGBA as aS, gaussianAmplitude as aa, gaussianWeight as ab, outer2D as ac, norm2D as ad, LUFactor3x3 as ae, LUSolve3x3 as af, linearSolve3x3 as ag, multiply3x3_mat3 as ah, multiplyMatrix as ai, transpose3x3 as aj, invert3x3 as ak, identity3x3 as al, quaternionToMatrix3x3 as am, roundNumber as an, matrix3x3ToQuaternion as ao, multiplyQuaternion as ap, orthogonalize3x3 as aq, diagonalize3x3 as ar, singularValueDecomposition3x3 as as, luFactorLinearSystem as at, luSolveLinearSystem as au, invertMatrix as av, estimateMatrixCondition as aw, jacobi as ax, solveHomogeneousLeastSquares as ay, solveLeastSquares as az,
|
|
2332
|
+
export { binomial as $, clampValue as A, projectVector as B, arrayRange as C, getMajorAxisIndex as D, isInf as E, rgb2hsv as F, rgb2lab as G, lab2rgb as H, floor as I, round as J, nearestPowerOfTwo as K, normalize2D as L, createUninitializedBounds as M, multiply3x3_vect3 as N, areBoundsInitialized as O, isPowerOfTwo as P, multiplyAccumulate as Q, angleBetweenVectors as R, signedAngleBetweenVectors as S, Pi as T, ceil as U, min as V, max as W, arrayMin as X, arrayMax as Y, ceilLog2 as Z, factorial as _, areMatricesEqual as a, beginCombination as a0, nextCombination as a1, randomSeed as a2, getSeed as a3, gaussian as a4, multiplyScalar2D as a5, multiplyAccumulate2D as a6, outer as a7, dot2D as a8, projectVector2D as a9, hex2float as aA, lab2xyz as aB, xyz2lab as aC, xyz2rgb as aD, rgb2xyz as aE, clampAndNormalizeValue as aF, getScalarTypeFittingRange as aG, getAdjustedScalarRange as aH, extentIsWithinOtherExtent as aI, boundsIsWithinOtherBounds as aJ, pointIsWithinBounds as aK, solve3PointCircle as aL, inf as aM, negInf as aN, isFinite as aO, isNaN as aP, floatToHex2 as aQ, floatRGB2HexCode as aR, float2CssRGBA as aS, gaussianAmplitude as aa, gaussianWeight as ab, outer2D as ac, norm2D as ad, LUFactor3x3 as ae, LUSolve3x3 as af, linearSolve3x3 as ag, multiply3x3_mat3 as ah, multiplyMatrix as ai, transpose3x3 as aj, invert3x3 as ak, identity3x3 as al, quaternionToMatrix3x3 as am, roundNumber as an, matrix3x3ToQuaternion as ao, multiplyQuaternion as ap, orthogonalize3x3 as aq, diagonalize3x3 as ar, singularValueDecomposition3x3 as as, luFactorLinearSystem as at, luSolveLinearSystem as au, invertMatrix as av, estimateMatrixCondition as aw, jacobi as ax, solveHomogeneousLeastSquares as ay, solveLeastSquares as az, roundVector as b, computeBoundsFromPoints as c, dot as d, clampVector as e, distance2BetweenPoints as f, subtract as g, hsv2rgb as h, isNan as i, cross as j, add as k, normalize as l, determinant2x2 as m, norm as n, jacobiN as o, perpendiculars as p, vtkMath as q, radiansFromDegrees as r, solveLinearSystem as s, multiplyScalar as t, uninitializeBounds as u, vtkMath$1 as v, random as w, determinant3x3 as x, degreesFromRadians as y, areEquals as z };
|
package/Common/Core/Math.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@babel/runtime/helpers/slicedToArray';
|
|
2
2
|
import 'seedrandom';
|
|
3
3
|
import '../../macros.js';
|
|
4
|
-
export { ae as LUFactor3x3, af as LUSolve3x3, T as Pi,
|
|
4
|
+
export { ae as LUFactor3x3, af as LUSolve3x3, T as Pi, k as add, R as angleBetweenVectors, O as areBoundsInitialized, z as areEquals, a as areMatricesEqual, Y as arrayMax, X as arrayMin, C as arrayRange, a0 as beginCombination, $ as binomial, aJ as boundsIsWithinOtherBounds, U as ceil, Z as ceilLog2, aF as clampAndNormalizeValue, A as clampValue, e as clampVector, c as computeBoundsFromPoints, M as createUninitializedBounds, j as cross, q as default, y as degreesFromRadians, m as determinant2x2, x as determinant3x3, ar as diagonalize3x3, f as distance2BetweenPoints, d as dot, a8 as dot2D, aw as estimateMatrixCondition, aI as extentIsWithinOtherExtent, _ as factorial, aS as float2CssRGBA, aR as floatRGB2HexCode, aQ as floatToHex2, I as floor, a4 as gaussian, aa as gaussianAmplitude, ab as gaussianWeight, aH as getAdjustedScalarRange, D as getMajorAxisIndex, aG as getScalarTypeFittingRange, a3 as getSeed, aA as hex2float, h as hsv2rgb, al as identity3x3, aM as inf, ak as invert3x3, av as invertMatrix, aO as isFinite, E as isInf, aP as isNaN, i as isNan, P as isPowerOfTwo, ax as jacobi, o as jacobiN, H as lab2rgb, aB as lab2xyz, ag as linearSolve3x3, at as luFactorLinearSystem, au as luSolveLinearSystem, ao as matrix3x3ToQuaternion, W as max, V as min, ah as multiply3x3_mat3, N as multiply3x3_vect3, Q as multiplyAccumulate, a6 as multiplyAccumulate2D, ai as multiplyMatrix, ap as multiplyQuaternion, t as multiplyScalar, a5 as multiplyScalar2D, K as nearestPowerOfTwo, aN as negInf, a1 as nextCombination, n as norm, ad as norm2D, l as normalize, L as normalize2D, aq as orthogonalize3x3, a7 as outer, ac as outer2D, p as perpendiculars, aK as pointIsWithinBounds, B as projectVector, a9 as projectVector2D, am as quaternionToMatrix3x3, r as radiansFromDegrees, w as random, a2 as randomSeed, F as rgb2hsv, G as rgb2lab, aE as rgb2xyz, J as round, an as roundNumber, b as roundVector, S as signedAngleBetweenVectors, as as singularValueDecomposition3x3, aL as solve3PointCircle, ay as solveHomogeneousLeastSquares, az as solveLeastSquares, s as solveLinearSystem, g as subtract, aj as transpose3x3, u as uninitializeBounds, aC as xyz2lab, aD as xyz2rgb } from './Math/index.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
|
-
import {
|
|
3
|
+
import { c as computeBoundsFromPoints, b as roundVector, e as clampVector } from '../Core/Math/index.js';
|
|
4
4
|
import vtkBoundingBox from './BoundingBox.js';
|
|
5
5
|
import vtkDataSet from './DataSet.js';
|
|
6
6
|
import vtkStructuredData from './StructuredData.js';
|
package/Common/DataModel/Line.js
CHANGED
|
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import Constants from './Line/Constants.js';
|
|
4
4
|
import vtkCell from './Cell.js';
|
|
5
|
-
import { d as dot,
|
|
5
|
+
import { d as dot, f as distance2BetweenPoints, s as solveLinearSystem } from '../Core/Math/index.js';
|
|
6
6
|
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import {
|
|
2
|
+
import { g as subtract, d as dot, j as cross, k as add } from '../Core/Math/index.js';
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
4
|
|
|
5
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
|
-
import {
|
|
3
|
+
import { l as normalize, g as subtract, j as cross, k as add, d as dot, n as norm } from '../Core/Math/index.js';
|
|
4
4
|
import vtkLine from './Line.js';
|
|
5
5
|
import vtkPlane from './Plane.js';
|
|
6
6
|
import vtkPriorityQueue from '../Core/PriorityQueue.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkCell from './Cell.js';
|
|
4
|
-
import {
|
|
4
|
+
import { f as distance2BetweenPoints, d as dot, m as determinant2x2 } from '../Core/Math/index.js';
|
|
5
5
|
import vtkLine from './Line.js';
|
|
6
6
|
import vtkPlane from './Plane.js';
|
|
7
7
|
|
|
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import { mat4, mat3 } from 'gl-matrix';
|
|
3
3
|
import Constants from './LandmarkTransform/Constants.js';
|
|
4
4
|
import macro from '../../macros.js';
|
|
5
|
-
import {
|
|
5
|
+
import { o as jacobiN, p as perpendiculars } from '../Core/Math/index.js';
|
|
6
6
|
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
3
3
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
4
|
-
import {
|
|
4
|
+
import { l as normalize } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkCaseTable from './ImageMarchingCubes/caseTable.js';
|
|
6
6
|
|
|
7
7
|
var vtkErrorMacro = macro.vtkErrorMacro,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
3
3
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
4
|
-
import {
|
|
4
|
+
import { l as normalize } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import { a as atomElem } from '../../Utilities/XMLConverter/chemistry/elements.json.js';
|
|
6
6
|
|
|
7
7
|
var vtkErrorMacro = macro.vtkErrorMacro,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkCellArray from '../../Common/Core/CellArray.js';
|
|
3
3
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
4
|
-
import {
|
|
4
|
+
import { l as normalize, j as cross, n as norm, d as dot, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkPoints from '../../Common/Core/Points.js';
|
|
6
6
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
7
7
|
import { DesiredOutputPrecision } from '../../Common/DataModel/DataSetAttributes/Constants.js';
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
4
4
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
5
|
-
import {
|
|
5
|
+
import { q as vtkMath } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import { AttributeTypes } from '../../Common/DataModel/DataSetAttributes/Constants.js';
|
|
7
7
|
import vtkPoints from '../../Common/Core/Points.js';
|
|
8
8
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
@@ -3,7 +3,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
4
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
5
5
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
6
|
-
import {
|
|
6
|
+
import { t as multiplyScalar } from '../../Common/Core/Math/index.js';
|
|
7
7
|
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
3
|
-
import {
|
|
3
|
+
import { g as subtract, n as norm } from '../../Common/Core/Math/index.js';
|
|
4
4
|
|
|
5
5
|
var vtkWarningMacro = macro.vtkWarningMacro; // ----------------------------------------------------------------------------
|
|
6
6
|
// vtkLineSource methods
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
2
2
|
import { mat4, vec3 } from 'gl-matrix';
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
4
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
5
|
-
import {
|
|
5
|
+
import { g as subtract, l as normalize, d as dot, j as cross, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
7
7
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
3
|
-
import {
|
|
3
|
+
import { l as normalize, d as dot, j as cross, f as distance2BetweenPoints, x as determinant3x3 } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
5
5
|
|
|
6
6
|
var vtkErrorMacro = macro.vtkErrorMacro; // ----------------------------------------------------------------------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkDataArray from '../../Common/Core/DataArray.js';
|
|
3
|
-
import {
|
|
3
|
+
import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
5
5
|
|
|
6
6
|
var vtkErrorMacro = macro.vtkErrorMacro; // ----------------------------------------------------------------------------
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
3
3
|
import vtkCompositeKeyboardManipulator from './CompositeKeyboardManipulator.js';
|
|
4
|
-
import {
|
|
4
|
+
import { k as add, l as normalize, j as cross } from '../../Common/Core/Math/index.js';
|
|
5
5
|
|
|
6
6
|
var vtkErrorMacro = macro.vtkErrorMacro;
|
|
7
7
|
var ANIMATION_REQUESTER = 'vtkKeyboardCameraManipulator'; // ----------------------------------------------------------------------------
|
|
@@ -3,7 +3,7 @@ import { mat4, vec3 } from 'gl-matrix';
|
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
4
|
import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
|
|
5
5
|
import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
6
|
-
import { r as radiansFromDegrees,
|
|
6
|
+
import { r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
|
|
7
7
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
8
8
|
|
|
9
9
|
// vtkMouseCameraAxisRotateManipulator methods
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
|
|
3
3
|
import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
4
|
-
import {
|
|
4
|
+
import { j as cross } from '../../Common/Core/Math/index.js';
|
|
5
5
|
|
|
6
6
|
// vtkMouseCameraTrackballPanManipulator methods
|
|
7
7
|
// ----------------------------------------------------------------------------
|
|
@@ -2,7 +2,7 @@ import { mat4, vec3 } from 'gl-matrix';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkCompositeCameraManipulator from './CompositeCameraManipulator.js';
|
|
4
4
|
import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
5
|
-
import {
|
|
5
|
+
import { t as multiplyScalar, d as dot, k as add, r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
|
|
6
6
|
|
|
7
7
|
// vtkMouseCameraTrackballRotateManipulator methods
|
|
8
8
|
// ----------------------------------------------------------------------------
|
|
@@ -5,7 +5,7 @@ import vtkCompositeMouseManipulator from './CompositeMouseManipulator.js';
|
|
|
5
5
|
import vtkInteractorStyleConstants from '../../Rendering/Core/InteractorStyle/Constants.js';
|
|
6
6
|
import vtkMouseCameraUnicamRotateManipulator from './MouseCameraUnicamRotateManipulator.js';
|
|
7
7
|
import macro from '../../macros.js';
|
|
8
|
-
import {
|
|
8
|
+
import { g as subtract, t as multiplyScalar, l as normalize, d as dot, r as radiansFromDegrees, j as cross } from '../../Common/Core/Math/index.js';
|
|
9
9
|
|
|
10
10
|
var States = vtkInteractorStyleConstants.States; // ----------------------------------------------------------------------------
|
|
11
11
|
// vtkMouseCameraUnicamManipulator methods
|
|
@@ -10,7 +10,7 @@ import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
|
|
|
10
10
|
import { FieldAssociations } from '../../Common/DataModel/DataSet/Constants.js';
|
|
11
11
|
import { mat4, vec3 } from 'gl-matrix';
|
|
12
12
|
import macro from '../../macros.js';
|
|
13
|
-
import { z as areEquals,
|
|
13
|
+
import { z as areEquals, l as normalize, d as dot, A as clampValue, g as subtract, j as cross, t as multiplyScalar, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
14
14
|
|
|
15
15
|
var States = vtkInteractorStyleConstants.States; // ----------------------------------------------------------------------------
|
|
16
16
|
// vtkMouseCameraUnicamRotateManipulator methods
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
|
-
import {
|
|
3
|
+
import { l as normalize, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import vtkMatrixBuilder from '../../Common/Core/MatrixBuilder.js';
|
|
5
5
|
import vtkInteractorStyleManipulator from './InteractorStyleManipulator.js';
|
|
6
6
|
import vtkMouseCameraTrackballRotateManipulator from '../Manipulators/MouseCameraTrackballRotateManipulator.js';
|
|
@@ -3,7 +3,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
4
|
import vtkLabelRepresentation from './LabelRepresentation.js';
|
|
5
5
|
import vtkLineRepresentation from './LineRepresentation.js';
|
|
6
|
-
import {
|
|
6
|
+
import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
7
7
|
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
|
-
import {
|
|
3
|
+
import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import vtkCellPicker from '../../Rendering/Core/CellPicker.js';
|
|
5
5
|
import vtkActor from '../../Rendering/Core/Actor.js';
|
|
6
6
|
import vtkWidgetRepresentation from './WidgetRepresentation.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
|
-
import {
|
|
4
|
+
import { l as normalize, d as dot, g as subtract, B as projectVector, k as add } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkPlane from '../../Common/DataModel/Plane.js';
|
|
6
6
|
import vtkAbstractWidget from './AbstractWidget.js';
|
|
7
7
|
import vtkImageCroppingRegionsRepresentation from './ImageCroppingRegionsRepresentation.js';
|
|
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkActor from '../../Rendering/Core/Actor.js';
|
|
4
4
|
import vtkInteractorObserver from '../../Rendering/Core/InteractorObserver.js';
|
|
5
|
-
import {
|
|
5
|
+
import { g as subtract, k as add } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkPixelSpaceCallbackMapper from '../../Rendering/Core/PixelSpaceCallbackMapper.js';
|
|
7
7
|
import vtkPointSource from '../../Filters/Sources/PointSource.js';
|
|
8
8
|
import vtkHandleRepresentation from './HandleRepresentation.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import macro from '../../../macros.js';
|
|
4
|
-
import {
|
|
4
|
+
import { j as cross, l as normalize, A as clampValue } from '../../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkPolyData from '../../../Common/DataModel/PolyData.js';
|
|
6
6
|
import vtkPlane from '../../../Common/DataModel/Plane.js';
|
|
7
7
|
import vtkCellArray from '../../../Common/Core/CellArray.js';
|
|
@@ -2,7 +2,7 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
2
2
|
import macro from '../../../macros.js';
|
|
3
3
|
import vtkInteractorObserver from '../../../Rendering/Core/InteractorObserver.js';
|
|
4
4
|
import vtkLine from '../../../Common/DataModel/Line.js';
|
|
5
|
-
import {
|
|
5
|
+
import { f as distance2BetweenPoints, l as normalize, d as dot, j as cross, u as uninitializeBounds } from '../../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkMatrixBuilder from '../../../Common/Core/MatrixBuilder.js';
|
|
7
7
|
import vtkPlane from '../../../Common/DataModel/Plane.js';
|
|
8
8
|
import vtkResliceCursorActor from './ResliceCursorActor.js';
|
|
@@ -4,7 +4,7 @@ import { mat4, vec4 } from 'gl-matrix';
|
|
|
4
4
|
import vtkImageMapper from '../../../Rendering/Core/ImageMapper.js';
|
|
5
5
|
import vtkImageReslice from '../../../Imaging/Core/ImageReslice.js';
|
|
6
6
|
import vtkImageSlice from '../../../Rendering/Core/ImageSlice.js';
|
|
7
|
-
import {
|
|
7
|
+
import { k as add, g as subtract, l as normalize } from '../../../Common/Core/Math/index.js';
|
|
8
8
|
import vtkPlaneSource from '../../../Filters/Sources/PlaneSource.js';
|
|
9
9
|
import vtkWidgetRepresentation from '../WidgetRepresentation.js';
|
|
10
10
|
import { transformPlane, boundPlane } from '../../../Widgets/Widgets3D/ResliceCursorWidget/helpers.js';
|
|
@@ -5,7 +5,7 @@ import vtkCellPicker from '../../Rendering/Core/CellPicker.js';
|
|
|
5
5
|
import vtkHandleRepresentation from './HandleRepresentation.js';
|
|
6
6
|
import vtkInteractorObserver from '../../Rendering/Core/InteractorObserver.js';
|
|
7
7
|
import vtkMapper from '../../Rendering/Core/Mapper.js';
|
|
8
|
-
import {
|
|
8
|
+
import { f as distance2BetweenPoints, n as norm } from '../../Common/Core/Math/index.js';
|
|
9
9
|
import vtkProperty from '../../Rendering/Core/Property.js';
|
|
10
10
|
import vtkSphereSource from '../../Filters/Sources/SphereSource.js';
|
|
11
11
|
import { InteractionState } from './HandleRepresentation/Constants.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
2
|
import vtkMouseRangeManipulator from '../../Interaction/Manipulators/MouseRangeManipulator.js';
|
|
3
3
|
import vtkViewProxy from './ViewProxy.js';
|
|
4
|
-
import {
|
|
4
|
+
import { j as cross, D as getMajorAxisIndex } from '../../Common/Core/Math/index.js';
|
|
5
5
|
|
|
6
6
|
var DEFAULT_STEP_WIDTH = 512;
|
|
7
7
|
|
package/Rendering/Core/Camera.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import { mat4, vec4, vec3, quat } from 'gl-matrix';
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
|
-
import { r as radiansFromDegrees,
|
|
4
|
+
import { r as radiansFromDegrees, k as add, j as cross } from '../../Common/Core/Math/index.js';
|
|
5
5
|
|
|
6
6
|
var vtkDebugMacro = macro.vtkDebugMacro;
|
|
7
7
|
/* eslint-disable new-cap */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
|
-
import {
|
|
3
|
+
import { l as normalize } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import vtkPicker from './Picker.js';
|
|
5
5
|
import vtkPoints from '../../Common/Core/Points.js';
|
|
6
6
|
import vtkTriangle from '../../Common/DataModel/Triangle.js';
|
package/Rendering/Core/Light.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
|
-
import {
|
|
2
|
+
import { l as normalize, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
|
|
3
3
|
|
|
4
4
|
var LIGHT_TYPES = ['HeadLight', 'CameraLight', 'SceneLight']; // ----------------------------------------------------------------------------
|
|
5
5
|
// vtkLight methods
|
package/Rendering/Core/Picker.js
CHANGED
|
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkAbstractPicker from './AbstractPicker.js';
|
|
4
4
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
5
|
-
import { d as dot,
|
|
5
|
+
import { d as dot, l as normalize, n as norm, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import { mat4, vec4 } from 'gl-matrix';
|
|
7
7
|
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -3,7 +3,7 @@ import { mat3, mat4, vec3 } from 'gl-matrix';
|
|
|
3
3
|
import { newInstance as newInstance$1, setGet, obj, vtkErrorMacro as vtkErrorMacro$1 } from '../../macros.js';
|
|
4
4
|
import vtkHelper from './Helper.js';
|
|
5
5
|
import vtkMapper from '../Core/Mapper.js';
|
|
6
|
-
import {
|
|
6
|
+
import { l as normalize, u as uninitializeBounds } from '../../Common/Core/Math/index.js';
|
|
7
7
|
import vtkOpenGLTexture from './Texture.js';
|
|
8
8
|
import vtkProperty from '../Core/Property.js';
|
|
9
9
|
import vtkShaderProgram from './ShaderProgram.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import { newInstance as newInstance$1, obj, setGet, newTypedArray, vtkDebugMacro as vtkDebugMacro$1 } from '../../macros.js';
|
|
3
|
-
import {
|
|
3
|
+
import { j as cross, l as normalize } from '../../Common/Core/Math/index.js';
|
|
4
4
|
import vtkWebGPUBuffer from './Buffer.js';
|
|
5
5
|
import vtkWebGPUTypes from './Types.js';
|
|
6
6
|
import vtkProperty from '../Core/Property.js';
|
|
@@ -8,9 +8,10 @@ import vtkWebGPUMapperHelper from './MapperHelper.js';
|
|
|
8
8
|
import vtkWebGPURenderEncoder from './RenderEncoder.js';
|
|
9
9
|
import vtkWebGPUShaderCache from './ShaderCache.js';
|
|
10
10
|
import vtkWebGPUTexture from './Texture.js';
|
|
11
|
+
import vtkWebGPUUniformBuffer from './UniformBuffer.js';
|
|
11
12
|
import vtkWebGPUFullScreenQuad from './FullScreenQuad.js';
|
|
12
13
|
import vtkWebGPUVolumePassFSQ from './VolumePassFSQ.js';
|
|
13
|
-
import {
|
|
14
|
+
import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
14
15
|
|
|
15
16
|
var Representation = vtkProperty.Representation;
|
|
16
17
|
var BufferUsage = vtkWebGPUBufferManager.BufferUsage,
|
|
@@ -33,7 +34,7 @@ var BufferUsage = vtkWebGPUBufferManager.BufferUsage,
|
|
|
33
34
|
|
|
34
35
|
var cubeFaceTriangles = [[0, 4, 6], [0, 6, 2], [1, 3, 7], [1, 7, 5], [0, 5, 4], [0, 1, 5], [2, 6, 7], [2, 7, 3], [0, 3, 1], [0, 2, 3], [4, 5, 7], [4, 7, 6]];
|
|
35
36
|
var DepthBoundsFS = "\n//VTK::Renderer::Dec\n\n//VTK::Select::Dec\n\n//VTK::VolumePass::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output : fragmentOutput;\n\n //VTK::Select::Impl\n\n //VTK::TCoord::Impl\n\n //VTK::VolumePass::Impl\n\n // use the maximum (closest) of the current value and the zbuffer\n // the blend func will then take the min to find the farthest stop value\n var stopval: f32 = max(input.fragPos.z, textureLoad(opaquePassDepthTexture, vec2<i32>(i32(input.fragPos.x), i32(input.fragPos.y)), 0));\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";
|
|
36
|
-
var volumeCopyFragTemplate = "\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var computedColor: vec4<f32> = textureSample(volumePassSmallColorTexture,\n volumePassSmallColorTextureSampler, input.tcoordVS);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";
|
|
37
|
+
var volumeCopyFragTemplate = "\n//VTK::Renderer::Dec\n\n//VTK::Mapper::Dec\n\n//VTK::TCoord::Dec\n\n//VTK::RenderEncoder::Dec\n\n//VTK::IOStructs::Dec\n\n[[stage(fragment)]]\nfn main(\n//VTK::IOStructs::Input\n)\n//VTK::IOStructs::Output\n{\n var output: fragmentOutput;\n\n var computedColor: vec4<f32> = textureSample(volumePassSmallColorTexture,\n volumePassSmallColorTextureSampler, mapperUBO.tscale*input.tcoordVS);\n\n //VTK::RenderEncoder::Impl\n return output;\n}\n";
|
|
37
38
|
/* eslint-disable no-undef */
|
|
38
39
|
|
|
39
40
|
/* eslint-disable no-bitwise */
|
|
@@ -44,14 +45,14 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
44
45
|
model.classHierarchy.push('vtkWebGPUVolumePass'); // create the required textures, encoders, FSQ etc
|
|
45
46
|
|
|
46
47
|
publicAPI.initialize = function (viewNode) {
|
|
47
|
-
if (!model._mergeEncoder) {
|
|
48
|
-
publicAPI.createMergeEncoder(viewNode);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
48
|
if (!model._clearEncoder) {
|
|
52
49
|
publicAPI.createClearEncoder(viewNode);
|
|
53
50
|
}
|
|
54
51
|
|
|
52
|
+
if (!model._mergeEncoder) {
|
|
53
|
+
publicAPI.createMergeEncoder(viewNode);
|
|
54
|
+
}
|
|
55
|
+
|
|
55
56
|
if (!model._copyEncoder) {
|
|
56
57
|
publicAPI.createCopyEncoder(viewNode);
|
|
57
58
|
}
|
|
@@ -74,6 +75,16 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
74
75
|
model._volumeCopyQuad.setDevice(viewNode.getDevice());
|
|
75
76
|
|
|
76
77
|
model._volumeCopyQuad.setFragmentShaderTemplate(volumeCopyFragTemplate);
|
|
78
|
+
|
|
79
|
+
model._copyUBO = vtkWebGPUUniformBuffer.newInstance();
|
|
80
|
+
|
|
81
|
+
model._copyUBO.setName('mapperUBO');
|
|
82
|
+
|
|
83
|
+
model._copyUBO.addEntry('tscale', 'vec2<f32>');
|
|
84
|
+
|
|
85
|
+
model._volumeCopyQuad.setUBO(model._copyUBO);
|
|
86
|
+
|
|
87
|
+
model._volumeCopyQuad.setTextureViews([model._colorTextureView]);
|
|
77
88
|
}
|
|
78
89
|
};
|
|
79
90
|
|
|
@@ -136,13 +147,7 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
136
147
|
// if not rendering in chunks then just draw all of them at once
|
|
137
148
|
publicAPI.rayCastPass(viewNode, renNode, model.volumes);
|
|
138
149
|
} // copy back to the original color buffer
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (model.small) {
|
|
142
|
-
model._volumeCopyQuad.setTextureViews([model._smallColorTextureView]);
|
|
143
|
-
} else {
|
|
144
|
-
model._volumeCopyQuad.setTextureViews([model._largeColorTextureView]);
|
|
145
|
-
} // final composite
|
|
150
|
+
// final composite
|
|
146
151
|
|
|
147
152
|
|
|
148
153
|
model._copyEncoder.setColorTextureView(0, model.colorTextureView);
|
|
@@ -157,6 +162,18 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
157
162
|
|
|
158
163
|
model._volumeCopyQuad.setWebGPURenderer(renNode);
|
|
159
164
|
|
|
165
|
+
if (model._useSmallViewport) {
|
|
166
|
+
var width = model._colorTextureView.getTexture().getWidth();
|
|
167
|
+
|
|
168
|
+
var height = model._colorTextureView.getTexture().getHeight();
|
|
169
|
+
|
|
170
|
+
model._copyUBO.setArray('tscale', [model._smallViewportWidth / width, model._smallViewportHeight / height]);
|
|
171
|
+
} else {
|
|
172
|
+
model._copyUBO.setArray('tscale', [1.0, 1.0]);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
model._copyUBO.sendIfNeeded(device);
|
|
176
|
+
|
|
160
177
|
model._volumeCopyQuad.render(model._copyEncoder, viewNode.getDevice());
|
|
161
178
|
|
|
162
179
|
model._copyEncoder.end();
|
|
@@ -172,47 +189,38 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
172
189
|
}, publicAPI.delete);
|
|
173
190
|
|
|
174
191
|
publicAPI.computeTiming = function (viewNode) {
|
|
175
|
-
model.
|
|
192
|
+
model._useSmallViewport = false;
|
|
176
193
|
var rwi = viewNode.getRenderable().getInteractor();
|
|
177
194
|
|
|
178
195
|
if (rwi.isAnimating() && model._lastScale > 1.5) {
|
|
179
|
-
model.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
model._activeColorTextureView = model._smallColorTextureView;
|
|
184
|
-
} else {
|
|
185
|
-
model._largeColorTexture.resize(viewNode.getCanvas().width, viewNode.getCanvas().height);
|
|
196
|
+
if (!model._smallViewportHeight) {
|
|
197
|
+
model._smallViewportWidth = Math.ceil(viewNode.getCanvas().width / Math.sqrt(model._lastScale));
|
|
198
|
+
model._smallViewportHeight = Math.ceil(viewNode.getCanvas().height / Math.sqrt(model._lastScale));
|
|
199
|
+
}
|
|
186
200
|
|
|
187
|
-
model.
|
|
201
|
+
model._useSmallViewport = true;
|
|
188
202
|
}
|
|
189
203
|
|
|
204
|
+
model._colorTexture.resize(viewNode.getCanvas().width, viewNode.getCanvas().height);
|
|
205
|
+
|
|
190
206
|
if (!model._animationRateSubscription) {
|
|
191
207
|
// when the animation frame rate changes recompute the scale factor
|
|
192
208
|
model._animationRateSubscription = rwi.onAnimationFrameRateUpdate(function () {
|
|
193
209
|
var frate = rwi.getRecentAnimationFrameRate();
|
|
194
|
-
var targetScale = model._lastScale * rwi.getDesiredUpdateRate() / frate;
|
|
195
|
-
|
|
196
|
-
//
|
|
197
|
-
//
|
|
198
|
-
|
|
199
|
-
if (targetScale > 1.4 * model._lastScale || targetScale < 0.7 * model._lastScale) {
|
|
200
|
-
model._lastScale = targetScale; // clamp scale to some reasonable values.
|
|
201
|
-
// Below 1.5 we will just be using full resolution as that is close enough
|
|
202
|
-
// Above 400 seems like a lot so we limit to that 1/20th per axis
|
|
203
|
-
|
|
204
|
-
if (model._lastScale > 400) {
|
|
205
|
-
model._lastScale = 400;
|
|
206
|
-
}
|
|
210
|
+
var targetScale = model._lastScale * rwi.getDesiredUpdateRate() / frate;
|
|
211
|
+
model._lastScale = targetScale; // clamp scale to some reasonable values.
|
|
212
|
+
// Below 1.5 we will just be using full resolution as that is close enough
|
|
213
|
+
// Above 400 seems like a lot so we limit to that 1/20th per axis
|
|
207
214
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
var targetSmallWidth = 64 * Math.ceil(viewNode.getCanvas().width / (Math.sqrt(model._lastScale) * 64));
|
|
212
|
-
var targetSmallHeight = Math.ceil(targetSmallWidth * viewNode.getCanvas().height / viewNode.getCanvas().width);
|
|
215
|
+
if (model._lastScale > 400) {
|
|
216
|
+
model._lastScale = 400;
|
|
217
|
+
}
|
|
213
218
|
|
|
214
|
-
|
|
215
|
-
|
|
219
|
+
if (model._lastScale < 1.5) {
|
|
220
|
+
model._lastScale = 1.5;
|
|
221
|
+
} else {
|
|
222
|
+
model._smallViewportWidth = Math.ceil(viewNode.getCanvas().width / Math.sqrt(model._lastScale));
|
|
223
|
+
model._smallViewportHeight = Math.ceil(viewNode.getCanvas().height / Math.sqrt(model._lastScale));
|
|
216
224
|
}
|
|
217
225
|
});
|
|
218
226
|
}
|
|
@@ -220,14 +228,18 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
220
228
|
|
|
221
229
|
publicAPI.rayCastPass = function (viewNode, renNode, volumes) {
|
|
222
230
|
var encoder = model._firstGroup ? model._clearEncoder : model._mergeEncoder;
|
|
223
|
-
encoder.setColorTextureView(0, model._activeColorTextureView);
|
|
224
231
|
encoder.attachTextureViews();
|
|
225
232
|
renNode.setRenderEncoder(encoder);
|
|
226
233
|
encoder.begin(viewNode.getCommandEncoder());
|
|
227
234
|
|
|
228
|
-
var width = model.
|
|
235
|
+
var width = model._colorTextureView.getTexture().getWidth();
|
|
236
|
+
|
|
237
|
+
var height = model._colorTextureView.getTexture().getHeight();
|
|
229
238
|
|
|
230
|
-
|
|
239
|
+
if (model._useSmallViewport) {
|
|
240
|
+
width = model._smallViewportWidth;
|
|
241
|
+
height = model._smallViewportHeight;
|
|
242
|
+
}
|
|
231
243
|
|
|
232
244
|
encoder.getHandle().setViewport(0, 0, width, height, 0.0, 1.0); // set scissor
|
|
233
245
|
|
|
@@ -453,35 +465,9 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
453
465
|
};
|
|
454
466
|
|
|
455
467
|
publicAPI.createClearEncoder = function (viewNode) {
|
|
456
|
-
model.
|
|
457
|
-
// as webgpu textures have to be multiples of 256 bytes wide
|
|
458
|
-
// for data transfers (just in case)
|
|
468
|
+
model._colorTexture = vtkWebGPUTexture.newInstance();
|
|
459
469
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
model._smallColorTexture.create(viewNode.getDevice(), {
|
|
463
|
-
width: targetSmallWidth,
|
|
464
|
-
height: Math.ceil(targetSmallWidth * viewNode.getCanvas().height / viewNode.getCanvas().width),
|
|
465
|
-
format: 'bgra8unorm',
|
|
466
|
-
|
|
467
|
-
/* eslint-disable no-undef */
|
|
468
|
-
|
|
469
|
-
/* eslint-disable no-bitwise */
|
|
470
|
-
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_SRC
|
|
471
|
-
});
|
|
472
|
-
|
|
473
|
-
model._smallColorTextureView = model._smallColorTexture.createView();
|
|
474
|
-
|
|
475
|
-
model._smallColorTextureView.setName('volumePassSmallColorTexture');
|
|
476
|
-
|
|
477
|
-
model._smallColorTextureView.addSampler(viewNode.getDevice(), {
|
|
478
|
-
minFilter: 'linear',
|
|
479
|
-
magFilter: 'linear'
|
|
480
|
-
});
|
|
481
|
-
|
|
482
|
-
model._largeColorTexture = vtkWebGPUTexture.newInstance();
|
|
483
|
-
|
|
484
|
-
model._largeColorTexture.create(viewNode.getDevice(), {
|
|
470
|
+
model._colorTexture.create(viewNode.getDevice(), {
|
|
485
471
|
width: viewNode.getCanvas().width,
|
|
486
472
|
height: viewNode.getCanvas().height,
|
|
487
473
|
format: 'bgra8unorm',
|
|
@@ -492,17 +478,19 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
492
478
|
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_SRC
|
|
493
479
|
});
|
|
494
480
|
|
|
495
|
-
model.
|
|
481
|
+
model._colorTextureView = model._colorTexture.createView();
|
|
496
482
|
|
|
497
|
-
model.
|
|
483
|
+
model._colorTextureView.setName('volumePassSmallColorTexture');
|
|
498
484
|
|
|
499
|
-
model.
|
|
485
|
+
model._colorTextureView.addSampler(viewNode.getDevice(), {
|
|
500
486
|
minFilter: 'linear',
|
|
501
487
|
magFilter: 'linear'
|
|
502
488
|
});
|
|
503
489
|
|
|
504
490
|
model._clearEncoder = vtkWebGPURenderEncoder.newInstance();
|
|
505
491
|
|
|
492
|
+
model._clearEncoder.setColorTextureView(0, model._colorTextureView);
|
|
493
|
+
|
|
506
494
|
model._clearEncoder.setDescription({
|
|
507
495
|
colorAttachments: [{
|
|
508
496
|
view: null,
|
|
@@ -573,6 +561,8 @@ function vtkWebGPUVolumePass(publicAPI, model) {
|
|
|
573
561
|
publicAPI.createMergeEncoder = function (viewNode) {
|
|
574
562
|
model._mergeEncoder = vtkWebGPURenderEncoder.newInstance();
|
|
575
563
|
|
|
564
|
+
model._mergeEncoder.setColorTextureView(0, model._colorTextureView);
|
|
565
|
+
|
|
576
566
|
model._mergeEncoder.setDescription({
|
|
577
567
|
colorAttachments: [{
|
|
578
568
|
view: null,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import macro from '../../../macros.js';
|
|
2
|
-
import {
|
|
2
|
+
import { l as normalize, j as cross } from '../../../Common/Core/Math/index.js';
|
|
3
3
|
|
|
4
4
|
function eq(v1, v2) {
|
|
5
5
|
return v1.length === 3 && v2.length === 3 && v1[0] === v2[0] && v1[1] === v2[1] && v1[2] === v2[2];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import macro from '../../macros.js';
|
|
2
|
-
import {
|
|
2
|
+
import { g as subtract, j as cross, d as dot, t as multiplyScalar, k as add } from '../../Common/Core/Math/index.js';
|
|
3
3
|
|
|
4
4
|
function projectDisplayToLine(x, y, lineOrigin, lineDirection, renderer, glRenderWindow) {
|
|
5
5
|
var near = glRenderWindow.displayToWorld(x, y, 0, renderer);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mat4, vec3 } from 'gl-matrix';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
|
-
import {
|
|
3
|
+
import { j as cross, r as radiansFromDegrees } from '../../Common/Core/Math/index.js';
|
|
4
4
|
|
|
5
5
|
function trackballRotate(prevX, prevY, curX, curY, origin, direction, renderer, glRenderWindow) {
|
|
6
6
|
var dx = curX - prevX;
|
|
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkActor from '../../Rendering/Core/Actor.js';
|
|
4
4
|
import vtkMapper from '../../Rendering/Core/Mapper.js';
|
|
5
|
-
import { z as areEquals,
|
|
5
|
+
import { z as areEquals, f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
6
6
|
import vtkBoundingBox from '../../Common/DataModel/BoundingBox.js';
|
|
7
7
|
import vtkPolyData from '../../Common/DataModel/PolyData.js';
|
|
8
8
|
import vtkTubeFilter from '../../Filters/General/TubeFilter.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
3
|
import macro from '../../macros.js';
|
|
4
|
-
import {
|
|
4
|
+
import { g as subtract, Q as multiplyAccumulate, l as normalize, j as cross } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkActor from '../../Rendering/Core/Actor.js';
|
|
6
6
|
import vtkCylinderSource from '../../Filters/Sources/CylinderSource.js';
|
|
7
7
|
import vtkMapper from '../../Rendering/Core/Mapper.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import vtkProp from '../../Rendering/Core/Prop.js';
|
|
4
|
-
import {
|
|
4
|
+
import { g as subtract, d as dot } from '../../Common/Core/Math/index.js';
|
|
5
5
|
import { Behavior } from './WidgetRepresentation/Constants.js';
|
|
6
6
|
import { RenderingTypes } from '../Core/WidgetManager/Constants.js';
|
|
7
7
|
import { CATEGORIES } from '../../Rendering/Core/Mapper/CoincidentTopologyHelper.js';
|
|
@@ -3,7 +3,7 @@ import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
|
3
3
|
import vtkPlanePointManipulator from '../Manipulators/PlaneManipulator.js';
|
|
4
4
|
import vtkPolyLineRepresentation from '../Representations/PolyLineRepresentation.js';
|
|
5
5
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
6
|
-
import {
|
|
6
|
+
import { g as subtract, R as angleBetweenVectors } from '../../Common/Core/Math/index.js';
|
|
7
7
|
import widgetBehavior from './AngleWidget/behavior.js';
|
|
8
8
|
import generateState from './AngleWidget/state.js';
|
|
9
9
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
@@ -3,7 +3,7 @@ import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
|
3
3
|
import vtkPlanePointManipulator from '../Manipulators/PlaneManipulator.js';
|
|
4
4
|
import vtkPolyLineRepresentation from '../Representations/PolyLineRepresentation.js';
|
|
5
5
|
import vtkSphereHandleRepresentation from '../Representations/SphereHandleRepresentation.js';
|
|
6
|
-
import {
|
|
6
|
+
import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
7
7
|
import widgetBehavior from './DistanceWidget/behavior.js';
|
|
8
8
|
import generateState from './DistanceWidget/state.js';
|
|
9
9
|
import { ViewTypes } from '../Core/WidgetManager/Constants.js';
|
|
@@ -2,7 +2,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
|
2
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
3
3
|
import Constants from './Constants.js';
|
|
4
4
|
import macro from '../../../macros.js';
|
|
5
|
-
import {
|
|
5
|
+
import { g as subtract, k as add, l as normalize } from '../../../Common/Core/Math/index.js';
|
|
6
6
|
import { getNumberOfPlacedHandles, isHandlePlaced, calculateTextPosition, updateTextPosition, getPoint } from './helpers.js';
|
|
7
7
|
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as subtract, t as multiplyScalar, k as add, z as areEquals } from '../../../Common/Core/Math/index.js';
|
|
2
2
|
|
|
3
3
|
function calculateTextPosition(model) {
|
|
4
4
|
var vector = [0, 0, 0];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as distance2BetweenPoints } from '../../Common/Core/Math/index.js';
|
|
2
2
|
import macro from '../../macros.js';
|
|
3
3
|
import generateState from './LineWidget/state.js';
|
|
4
4
|
import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
@@ -3,7 +3,7 @@ import macro from '../../../macros.js';
|
|
|
3
3
|
import vtkBoundingBox from '../../../Common/DataModel/BoundingBox.js';
|
|
4
4
|
import vtkLine from '../../../Common/DataModel/Line.js';
|
|
5
5
|
import vtkPlanePointManipulator from '../../Manipulators/PlaneManipulator.js';
|
|
6
|
-
import {
|
|
6
|
+
import { t as multiplyScalar, g as subtract, l as normalize, d as dot, j as cross, Q as multiplyAccumulate, S as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
|
|
7
7
|
import { updateState, getAssociatedLinesName, boundPointOnPlane, rotateVector } from './helpers.js';
|
|
8
8
|
import { InteractionMethodsName, ScrollingMethods } from './Constants.js';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ import vtkBoundingBox, { STATIC } from '../../../Common/DataModel/BoundingBox.js
|
|
|
3
3
|
import vtkCubeSource from '../../../Filters/Sources/CubeSource.js';
|
|
4
4
|
import vtkCutter from '../../../Filters/Core/Cutter.js';
|
|
5
5
|
import vtkPlane from '../../../Common/DataModel/Plane.js';
|
|
6
|
-
import {
|
|
6
|
+
import { g as subtract, l as normalize, j as cross, Q as multiplyAccumulate, S as signedAngleBetweenVectors } from '../../../Common/Core/Math/index.js';
|
|
7
7
|
import vtkMatrixBuilder from '../../../Common/Core/MatrixBuilder.js';
|
|
8
8
|
import { ViewTypes } from '../../Core/WidgetManager/Constants.js';
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ import vtkAbstractWidgetFactory from '../Core/AbstractWidgetFactory.js';
|
|
|
4
4
|
import vtkPlane from '../../Common/DataModel/Plane.js';
|
|
5
5
|
import vtkPlaneSource from '../../Filters/Sources/PlaneSource.js';
|
|
6
6
|
import vtkResliceCursorContextRepresentation from '../Representations/ResliceCursorContextRepresentation.js';
|
|
7
|
-
import {
|
|
7
|
+
import { f as distance2BetweenPoints, Q as multiplyAccumulate, g as subtract, l as normalize, t as multiplyScalar, k as add } from '../../Common/Core/Math/index.js';
|
|
8
8
|
import widgetBehavior from './ResliceCursorWidget/behavior.js';
|
|
9
9
|
import generateState from './ResliceCursorWidget/state.js';
|
|
10
10
|
import { updateState, transformPlane, boundPlane } from './ResliceCursorWidget/helpers.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import macro from '../../../macros.js';
|
|
4
|
-
import {
|
|
4
|
+
import { q as vtkMath } from '../../../Common/Core/Math/index.js';
|
|
5
5
|
import vtkBoundingBox from '../../../Common/DataModel/BoundingBox.js';
|
|
6
6
|
import vtkPlane from '../../../Common/DataModel/Plane.js';
|
|
7
7
|
import { ShapeBehavior, BehaviorCategory, TextPosition } from './Constants.js';
|