copper3d 1.15.6 → 1.15.7
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/dist/Controls/Copper3dTrackballControls.js +37 -49
- package/dist/Controls/Copper3dTrackballControls.js.map +1 -1
- package/dist/bundle.esm.js +38 -50
- package/dist/bundle.umd.js +38 -50
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/Controls/Copper3dTrackballControls1.d.ts +0 -45
- package/dist/Controls/Copper3dTrackballControls1.js +0 -531
- package/dist/Controls/Copper3dTrackballControls1.js.map +0 -1
- package/dist/types/Controls/Copper3dTrackballControls1.d.ts +0 -45
package/dist/bundle.umd.js
CHANGED
|
@@ -45252,7 +45252,7 @@
|
|
|
45252
45252
|
this.maxDistance = Infinity;
|
|
45253
45253
|
this.minZoom = 0;
|
|
45254
45254
|
this.maxZoom = Infinity;
|
|
45255
|
-
this.keys = ["KeyA"
|
|
45255
|
+
this.keys = ["KeyA" /*A*/, "KeyS" /*S*/, "KeyD" /*D*/];
|
|
45256
45256
|
this.mouseButtons = {
|
|
45257
45257
|
LEFT: MOUSE.ROTATE,
|
|
45258
45258
|
MIDDLE: MOUSE.DOLLY,
|
|
@@ -45270,11 +45270,10 @@
|
|
|
45270
45270
|
this.position0 = this.object.position.clone();
|
|
45271
45271
|
this.up0 = this.object.up.clone();
|
|
45272
45272
|
this.zoom0 = this.object.zoom;
|
|
45273
|
-
//
|
|
45273
|
+
// methods
|
|
45274
45274
|
this.handleResize = function () {
|
|
45275
45275
|
const box = scope.domElement.getBoundingClientRect();
|
|
45276
|
-
// adjustments come from similar code in the jquery
|
|
45277
|
-
// get root element
|
|
45276
|
+
// adjustments come from similar code in the jquery offset() function
|
|
45278
45277
|
const d = scope.domElement.ownerDocument.documentElement;
|
|
45279
45278
|
scope.screen.left = box.left + window.pageXOffset - d.clientLeft;
|
|
45280
45279
|
scope.screen.top = box.top + window.pageYOffset - d.clientTop;
|
|
@@ -45289,18 +45288,11 @@
|
|
|
45289
45288
|
};
|
|
45290
45289
|
})();
|
|
45291
45290
|
const getMouseOnCircle = (function () {
|
|
45292
|
-
/**
|
|
45293
|
-
* convert screen coordinates to threejs coordinates ratio
|
|
45294
|
-
*/
|
|
45295
45291
|
const vector = new Vector2();
|
|
45296
|
-
return function
|
|
45297
|
-
vector.set(
|
|
45298
|
-
|
|
45299
|
-
|
|
45300
|
-
(scope.screen.width * 0.5),
|
|
45301
|
-
// the height radius of the circle diameter
|
|
45302
|
-
(scope.screen.height + 2 * (scope.screen.top - pageY)) /
|
|
45303
|
-
scope.screen.width //screen.width intentional
|
|
45292
|
+
return function getMouseOnCircle(pageX, pageY) {
|
|
45293
|
+
vector.set((pageX - scope.screen.width * 0.5 - scope.screen.left) /
|
|
45294
|
+
(scope.screen.width * 0.5), (scope.screen.height + 2 * (scope.screen.top - pageY)) /
|
|
45295
|
+
scope.screen.width // screen.width intentional
|
|
45304
45296
|
);
|
|
45305
45297
|
return vector;
|
|
45306
45298
|
};
|
|
@@ -45309,26 +45301,20 @@
|
|
|
45309
45301
|
const axis = new Vector3(), quaternion = new Quaternion(), eyeDirection = new Vector3(), objectUpDirection = new Vector3(), objectSidewaysDirection = new Vector3(), moveDirection = new Vector3();
|
|
45310
45302
|
return function rotateCamera() {
|
|
45311
45303
|
moveDirection.set(_moveCurr.x - _movePrev.x, _moveCurr.y - _movePrev.y, 0);
|
|
45312
|
-
// Computes the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z).
|
|
45313
45304
|
let angle = moveDirection.length();
|
|
45314
45305
|
if (angle) {
|
|
45315
|
-
// .sub Subtracts v from this vector.
|
|
45316
45306
|
_eye.copy(scope.object.position).sub(scope.target);
|
|
45317
|
-
// .normalize() Convert this vector to a unit vector - that is, sets it equal to a vector with the same direction as this one, but length 1.
|
|
45318
45307
|
eyeDirection.copy(_eye).normalize();
|
|
45319
45308
|
objectUpDirection.copy(scope.object.up).normalize();
|
|
45320
|
-
// .crossVectors Sets this vector to cross product of a and b.
|
|
45321
45309
|
objectSidewaysDirection
|
|
45322
45310
|
.crossVectors(objectUpDirection, eyeDirection)
|
|
45323
45311
|
.normalize();
|
|
45324
|
-
// .setLength Set this vector to a vector with the same direction as this one, but length l.
|
|
45325
45312
|
objectUpDirection.setLength(_moveCurr.y - _movePrev.y);
|
|
45326
45313
|
objectSidewaysDirection.setLength(_moveCurr.x - _movePrev.x);
|
|
45327
45314
|
moveDirection.copy(objectUpDirection.add(objectSidewaysDirection));
|
|
45328
45315
|
axis.crossVectors(moveDirection, _eye).normalize();
|
|
45329
45316
|
angle *= scope.rotateSpeed;
|
|
45330
45317
|
quaternion.setFromAxisAngle(axis, angle);
|
|
45331
|
-
// Applies a Quaternion transform to this vector.
|
|
45332
45318
|
_eye.applyQuaternion(quaternion);
|
|
45333
45319
|
scope.object.up.applyQuaternion(quaternion);
|
|
45334
45320
|
_lastAxis.copy(axis);
|
|
@@ -45383,15 +45369,15 @@
|
|
|
45383
45369
|
const mouseChange = new Vector2(), objectUp = new Vector3(), pan = new Vector3();
|
|
45384
45370
|
return function panCamera() {
|
|
45385
45371
|
mouseChange.copy(_panEnd).sub(_panStart);
|
|
45386
|
-
// .lengthSq() Computes the squared length of this vector. If you are comparing the lengths of vectors, you should compare the length squared instead as it is slightly more efficient to calculate.
|
|
45387
45372
|
if (mouseChange.lengthSq()) {
|
|
45388
45373
|
if (scope.object.isOrthographicCamera) {
|
|
45389
|
-
const
|
|
45390
|
-
|
|
45391
|
-
|
|
45374
|
+
const scale_x = (scope.object.right -
|
|
45375
|
+
scope.object.left) /
|
|
45376
|
+
scope.object.zoom /
|
|
45392
45377
|
scope.domElement.clientWidth;
|
|
45393
|
-
const scale_y = (
|
|
45394
|
-
|
|
45378
|
+
const scale_y = (scope.object.top -
|
|
45379
|
+
scope.object.bottom) /
|
|
45380
|
+
scope.object.zoom /
|
|
45395
45381
|
scope.domElement.clientWidth;
|
|
45396
45382
|
mouseChange.x *= scale_x;
|
|
45397
45383
|
mouseChange.y *= scale_y;
|
|
@@ -45477,9 +45463,10 @@
|
|
|
45477
45463
|
return;
|
|
45478
45464
|
if (_pointers.length === 0) {
|
|
45479
45465
|
scope.domElement.setPointerCapture(event.pointerId);
|
|
45480
|
-
scope.domElement.addEventListener("pointermove", onPointerMove
|
|
45481
|
-
scope.domElement.addEventListener("pointerup", onPointerUp
|
|
45466
|
+
scope.domElement.addEventListener("pointermove", onPointerMove);
|
|
45467
|
+
scope.domElement.addEventListener("pointerup", onPointerUp);
|
|
45482
45468
|
}
|
|
45469
|
+
//
|
|
45483
45470
|
addPointer(event);
|
|
45484
45471
|
if (event.pointerType === "touch") {
|
|
45485
45472
|
onTouchStart(event);
|
|
@@ -45507,11 +45494,12 @@
|
|
|
45507
45494
|
else {
|
|
45508
45495
|
onMouseUp();
|
|
45509
45496
|
}
|
|
45497
|
+
//
|
|
45510
45498
|
removePointer(event);
|
|
45511
45499
|
if (_pointers.length === 0) {
|
|
45512
45500
|
scope.domElement.releasePointerCapture(event.pointerId);
|
|
45513
|
-
scope.domElement.removeEventListener("pointermove", onPointerMove
|
|
45514
|
-
scope.domElement.removeEventListener("pointerup", onPointerUp
|
|
45501
|
+
scope.domElement.removeEventListener("pointermove", onPointerMove);
|
|
45502
|
+
scope.domElement.removeEventListener("pointerup", onPointerUp);
|
|
45515
45503
|
}
|
|
45516
45504
|
}
|
|
45517
45505
|
function onPointerCancel(event) {
|
|
@@ -45534,11 +45522,11 @@
|
|
|
45534
45522
|
_keyState = STATE.PAN;
|
|
45535
45523
|
}
|
|
45536
45524
|
}
|
|
45537
|
-
function keyup(
|
|
45525
|
+
function keyup() {
|
|
45538
45526
|
if (scope.enabled === false)
|
|
45539
45527
|
return;
|
|
45540
45528
|
_keyState = STATE.NONE;
|
|
45541
|
-
window.addEventListener("keydown", keydown
|
|
45529
|
+
window.addEventListener("keydown", keydown);
|
|
45542
45530
|
}
|
|
45543
45531
|
function onMouseDown(event) {
|
|
45544
45532
|
if (_state === STATE.NONE) {
|
|
@@ -45582,7 +45570,7 @@
|
|
|
45582
45570
|
_panEnd.copy(getMouseOnScreen(event.pageX, event.pageY));
|
|
45583
45571
|
}
|
|
45584
45572
|
}
|
|
45585
|
-
function onMouseUp(
|
|
45573
|
+
function onMouseUp() {
|
|
45586
45574
|
_state = STATE.NONE;
|
|
45587
45575
|
scope.dispatchEvent(_endEvent$2);
|
|
45588
45576
|
}
|
|
@@ -45716,7 +45704,7 @@
|
|
|
45716
45704
|
function removePointer(event) {
|
|
45717
45705
|
delete _pointerPositions[event.pointerId];
|
|
45718
45706
|
for (let i = 0; i < _pointers.length; i++) {
|
|
45719
|
-
if (_pointers[i].pointerId
|
|
45707
|
+
if (_pointers[i].pointerId == event.pointerId) {
|
|
45720
45708
|
_pointers.splice(i, 1);
|
|
45721
45709
|
return;
|
|
45722
45710
|
}
|
|
@@ -45737,21 +45725,21 @@
|
|
|
45737
45725
|
return _pointerPositions[pointer.pointerId];
|
|
45738
45726
|
}
|
|
45739
45727
|
this.dispose = function () {
|
|
45740
|
-
scope.domElement.removeEventListener("contextmenu", contextmenu
|
|
45741
|
-
scope.domElement.removeEventListener("pointerdown", onPointerDown
|
|
45742
|
-
scope.domElement.removeEventListener("pointercancel", onPointerCancel
|
|
45743
|
-
scope.domElement.removeEventListener("wheel", onMouseWheel
|
|
45744
|
-
scope.domElement.removeEventListener("pointermove", onPointerMove
|
|
45745
|
-
scope.domElement.removeEventListener("pointerup", onPointerUp
|
|
45746
|
-
window.removeEventListener("keydown", keydown
|
|
45747
|
-
window.removeEventListener("keyup", keyup
|
|
45728
|
+
scope.domElement.removeEventListener("contextmenu", contextmenu);
|
|
45729
|
+
scope.domElement.removeEventListener("pointerdown", onPointerDown);
|
|
45730
|
+
scope.domElement.removeEventListener("pointercancel", onPointerCancel);
|
|
45731
|
+
scope.domElement.removeEventListener("wheel", onMouseWheel);
|
|
45732
|
+
scope.domElement.removeEventListener("pointermove", onPointerMove);
|
|
45733
|
+
scope.domElement.removeEventListener("pointerup", onPointerUp);
|
|
45734
|
+
window.removeEventListener("keydown", keydown);
|
|
45735
|
+
window.removeEventListener("keyup", keyup);
|
|
45748
45736
|
};
|
|
45749
|
-
this.domElement.addEventListener("contextmenu", contextmenu
|
|
45750
|
-
this.domElement.addEventListener("pointerdown", onPointerDown
|
|
45751
|
-
this.domElement.addEventListener("pointercancel", onPointerCancel
|
|
45737
|
+
this.domElement.addEventListener("contextmenu", contextmenu);
|
|
45738
|
+
this.domElement.addEventListener("pointerdown", onPointerDown);
|
|
45739
|
+
this.domElement.addEventListener("pointercancel", onPointerCancel);
|
|
45752
45740
|
this.domElement.addEventListener("wheel", onMouseWheel, { passive: false });
|
|
45753
|
-
window.addEventListener("keydown", keydown
|
|
45754
|
-
window.addEventListener("keyup", keyup
|
|
45741
|
+
window.addEventListener("keydown", keydown);
|
|
45742
|
+
window.addEventListener("keyup", keyup);
|
|
45755
45743
|
this.handleResize();
|
|
45756
45744
|
// force an update at start
|
|
45757
45745
|
this.update();
|
|
@@ -69779,8 +69767,8 @@
|
|
|
69779
69767
|
}
|
|
69780
69768
|
|
|
69781
69769
|
// import * as kiwrious from "copper3d_plugin_heart_k";
|
|
69782
|
-
const REVISION = "v1.15.
|
|
69783
|
-
console.log("%cCopper3D Visualisation %cBeta:v1.15.
|
|
69770
|
+
const REVISION = "v1.15.7";
|
|
69771
|
+
console.log("%cCopper3D Visualisation %cBeta:v1.15.7", "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25");
|
|
69784
69772
|
|
|
69785
69773
|
exports.CameraViewPoint = CameraViewPoint;
|
|
69786
69774
|
exports.Copper3dTrackballControls = Copper3dTrackballControls;
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ import { nrrd_tools } from "./Utils/nrrd_tool";
|
|
|
16
16
|
import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls";
|
|
17
17
|
import { nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, paintImageType, exportPaintImageType, IOptVTKLoader } from "./types/types";
|
|
18
18
|
import "./css/style.css";
|
|
19
|
-
export declare const REVISION = "v1.15.
|
|
19
|
+
export declare const REVISION = "v1.15.7";
|
|
20
20
|
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, nrrd_tools, loading, Copper3dTrackballControls, createTexture2D_NRRD, };
|
|
21
21
|
export type { positionType, screenPosType, optsType, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, paintImageType, exportPaintImageType, IOptVTKLoader, };
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import kiwrious from "./Utils/kiwrious/configKiwrious";
|
|
|
16
16
|
import { nrrd_tools } from "./Utils/nrrd_tool";
|
|
17
17
|
import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls";
|
|
18
18
|
import "./css/style.css";
|
|
19
|
-
export const REVISION = "v1.15.
|
|
20
|
-
console.log("%cCopper3D Visualisation %cBeta:v1.15.
|
|
19
|
+
export const REVISION = "v1.15.7";
|
|
20
|
+
console.log("%cCopper3D Visualisation %cBeta:v1.15.7", "padding: 3px;color:white; background:#023047", "padding: 3px;color:white; background:#f50a25");
|
|
21
21
|
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, nrrd_tools, loading, Copper3dTrackballControls, createTexture2D_NRRD, };
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ import { nrrd_tools } from "./Utils/nrrd_tool";
|
|
|
16
16
|
import { Copper3dTrackballControls } from "./Controls/Copper3dTrackballControls";
|
|
17
17
|
import { nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, paintImageType, exportPaintImageType, IOptVTKLoader } from "./types/types";
|
|
18
18
|
import "./css/style.css";
|
|
19
|
-
export declare const REVISION = "v1.15.
|
|
19
|
+
export declare const REVISION = "v1.15.7";
|
|
20
20
|
export { copperRenderer, copperRendererOnDemond, copperMSceneRenderer, setHDRFilePath, addLabelToScene, convert3DPostoScreenPos, convertScreenPosto3DPos, addBoxHelper, fullScreenListenner, configKiwriousHeart, copperScene, copperSceneOnDemond, copperMScene, CameraViewPoint, kiwrious, nrrd_tools, loading, Copper3dTrackballControls, createTexture2D_NRRD, };
|
|
21
21
|
export type { positionType, screenPosType, optsType, nrrdMeshesType, nrrdSliceType, SensorDecodedValue_kiwrious, SensorReadResult_kiwrious, HeartRateResult_kiwrious, loadingBarType, paintImageType, exportPaintImageType, IOptVTKLoader, };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "copper3d",
|
|
3
3
|
"description": "A 3d visualisation package base on threejs provides multiple scenes and Nrrd image load funtion.",
|
|
4
|
-
"version": "1.15.
|
|
4
|
+
"version": "1.15.7",
|
|
5
5
|
"main": "dist/bundle.umd.js",
|
|
6
6
|
"moudle": "dist/bundle.esm.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { EventDispatcher, MOUSE, Vector3, PerspectiveCamera, OrthographicCamera } from "three";
|
|
2
|
-
declare class Copper3dTrackballControls1 extends EventDispatcher {
|
|
3
|
-
object: PerspectiveCamera | OrthographicCamera;
|
|
4
|
-
domElement: HTMLElement;
|
|
5
|
-
enabled: boolean;
|
|
6
|
-
screen: {
|
|
7
|
-
left: number;
|
|
8
|
-
top: number;
|
|
9
|
-
width: number;
|
|
10
|
-
height: number;
|
|
11
|
-
};
|
|
12
|
-
rotateSpeed: number;
|
|
13
|
-
zoomSpeed: number;
|
|
14
|
-
panSpeed: number;
|
|
15
|
-
noRotate: boolean;
|
|
16
|
-
noZoom: boolean;
|
|
17
|
-
noPan: boolean;
|
|
18
|
-
staticMoving: boolean;
|
|
19
|
-
dynamicDampingFactor: number;
|
|
20
|
-
minDistance: number;
|
|
21
|
-
maxDistance: number;
|
|
22
|
-
minZoom: number;
|
|
23
|
-
maxZoom: number;
|
|
24
|
-
keys: ["KeyA", "KeyS", "KeyD"];
|
|
25
|
-
mouseButtons: {
|
|
26
|
-
LEFT: MOUSE.ROTATE;
|
|
27
|
-
MIDDLE: MOUSE.DOLLY;
|
|
28
|
-
RIGHT: MOUSE.PAN;
|
|
29
|
-
};
|
|
30
|
-
target: Vector3;
|
|
31
|
-
target0: Vector3;
|
|
32
|
-
position0: Vector3;
|
|
33
|
-
up0: Vector3;
|
|
34
|
-
zoom0: number;
|
|
35
|
-
handleResize: () => void;
|
|
36
|
-
rotateCamera: () => void;
|
|
37
|
-
zoomCamera: () => void;
|
|
38
|
-
panCamera: () => void;
|
|
39
|
-
checkDistances: () => void;
|
|
40
|
-
update: () => void;
|
|
41
|
-
reset: () => void;
|
|
42
|
-
dispose: () => void;
|
|
43
|
-
constructor(object: PerspectiveCamera | OrthographicCamera, domElement: HTMLElement);
|
|
44
|
-
}
|
|
45
|
-
export { Copper3dTrackballControls1 };
|