Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Dec 12, 2023
1 parent 9c4459f commit 0f6b7d8
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 12 deletions.
22 changes: 17 additions & 5 deletions dist/xeokit-bim-viewer.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -11367,7 +11367,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
const cameraControl = this.angleMeasurementsPlugin.viewer.cameraControl;
const pointerLens = this.pointerLens;
let mouseHovering = false;
let mouseHoverEntity = false;
let hoveredEntity = null;
let lastMouseCanvasX = 0;
let lastMouseCanvasY = 0;
const mouseWorldPos = math.vec3();
Expand Down Expand Up @@ -11399,7 +11399,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
}
const canvasPos = event.snappedCanvasPos || event.canvasPos;
mouseHovering = true;
mouseHoverEntity = event.entity;
hoveredEntity = event.entity;
mouseWorldPos.set(event.worldPos);
mouseHoverCanvasPos.set(canvasPos);
switch (this._mouseState) {
Expand All @@ -11414,6 +11414,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
this._currentAngleMeasurement.cornerVisible = true;
this._currentAngleMeasurement.angleVisible = false;
this._currentAngleMeasurement.corner.worldPos = event.worldPos;
this._currentAngleMeasurement.corner.entity = event.entity;
}
this.markerDiv.style.marginLeft = `-10000px`;
this.markerDiv.style.marginTop = `-10000px`;
Expand All @@ -11425,6 +11426,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
this._currentAngleMeasurement.targetVisible = true;
this._currentAngleMeasurement.angleVisible = true;
this._currentAngleMeasurement.target.worldPos = event.worldPos;
this._currentAngleMeasurement.target.entity = event.entity;
}
this.markerDiv.style.marginLeft = `-10000px`;
this.markerDiv.style.marginTop = `-10000px`;
Expand Down Expand Up @@ -11455,15 +11457,12 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
this._currentAngleMeasurement = this.angleMeasurementsPlugin.createMeasurement({
id: math.createUUID(),
origin: {
entity: mouseHoverEntity,
worldPos: mouseWorldPos
},
corner: {
entity: mouseHoverEntity,
worldPos: mouseWorldPos
},
target: {
entity: mouseHoverEntity,
worldPos: mouseWorldPos
},
approximate: true
Expand All @@ -11475,6 +11474,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
this._currentAngleMeasurement.targetWireVisible = false;
this._currentAngleMeasurement.targetVisible = false;
this._currentAngleMeasurement.angleVisible = false;
this._currentAngleMeasurement.origin.entity = hoveredEntity;
this._mouseState = MOUSE_FINDING_CORNER;
this.angleMeasurementsPlugin.fire("measurementStart", this._currentAngleMeasurement);
}
Expand All @@ -11484,11 +11484,13 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
this._currentAngleMeasurement.targetWireVisible = false;
this._currentAngleMeasurement.targetVisible = true;
this._currentAngleMeasurement.angleVisible = true;
this._currentAngleMeasurement.corner.entity = hoveredEntity;
this._mouseState = MOUSE_FINDING_TARGET;
} else {
if (this._currentAngleMeasurement) {
this._currentAngleMeasurement.destroy();
this._currentAngleMeasurement = null;
hoveredEntity = null;
this._mouseState = MOUSE_FINDING_ORIGIN;
this.angleMeasurementsPlugin.fire("measurementCancel", this._currentAngleMeasurement);
}
Expand All @@ -11498,14 +11500,17 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
if (mouseHovering) {
this._currentAngleMeasurement.targetVisible = true;
this._currentAngleMeasurement.angleVisible = true;
this._currentAngleMeasurement.target.entity = hoveredEntity;
this._currentAngleMeasurement.clickable = true;
hoveredEntity = null;
this.angleMeasurementsPlugin.fire("measurementEnd", this._currentAngleMeasurement);
this._currentAngleMeasurement = null;
this._mouseState = MOUSE_FINDING_ORIGIN;
} else {
if (this._currentAngleMeasurement) {
this._currentAngleMeasurement.destroy();
this._currentAngleMeasurement = null;
hoveredEntity = null;
this._mouseState = MOUSE_FINDING_ORIGIN;
this.angleMeasurementsPlugin.fire("measurementCancel", this._currentAngleMeasurement);
}
Expand Down Expand Up @@ -43858,6 +43863,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
let pointerDownCanvasX;
let pointerDownCanvasY;
const clickTolerance = 20;
let hoveredEntity = null;

this._mouseState = MOUSE_FIRST_CLICK_EXPECTED;

Expand Down Expand Up @@ -43892,6 +43898,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
this._markerDiv.style.background = "pink";
this._markerDiv.style.border = "2px solid red";
}
hoveredEntity = event.entity;
} else {
this._markerDiv.style.marginLeft = `-10000px`;
this._markerDiv.style.marginTop = `-10000px`;
Expand Down Expand Up @@ -43930,13 +43937,16 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
}
if (this._currentDistanceMeasurement) {
if (mouseHovering) {
this._currentDistanceMeasurement.target.entity = hoveredEntity;
hoveredEntity = null;
this._currentDistanceMeasurement.clickable = true;
this.distanceMeasurementsPlugin.fire("measurementEnd", this._currentDistanceMeasurement);
this._currentDistanceMeasurement = null;
} else {
this._currentDistanceMeasurement.destroy();
this.distanceMeasurementsPlugin.fire("measurementCancel", this._currentDistanceMeasurement);
this._currentDistanceMeasurement = null;
hoveredEntity = null;
}
} else {
if (mouseHovering) {
Expand All @@ -43957,6 +43967,8 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
this._currentDistanceMeasurementInitState.wireVisible = this._currentDistanceMeasurement.wireVisible;
this._currentDistanceMeasurementInitState.targetVisible = this._currentDistanceMeasurement.targetVisible;
this._currentDistanceMeasurement.clickable = false;
this._currentDistanceMeasurement.origin.entity = hoveredEntity;
hoveredEntity = null;
this.fire("measurementStart", this._currentDistanceMeasurement);
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/xeokit-bim-viewer.min.es.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/xeokit-bim-viewer.min.umd.js

Large diffs are not rendered by default.

22 changes: 17 additions & 5 deletions dist/xeokit-bim-viewer.umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -11373,7 +11373,7 @@
const cameraControl = this.angleMeasurementsPlugin.viewer.cameraControl;
const pointerLens = this.pointerLens;
let mouseHovering = false;
let mouseHoverEntity = false;
let hoveredEntity = null;
let lastMouseCanvasX = 0;
let lastMouseCanvasY = 0;
const mouseWorldPos = math.vec3();
Expand Down Expand Up @@ -11405,7 +11405,7 @@
}
const canvasPos = event.snappedCanvasPos || event.canvasPos;
mouseHovering = true;
mouseHoverEntity = event.entity;
hoveredEntity = event.entity;
mouseWorldPos.set(event.worldPos);
mouseHoverCanvasPos.set(canvasPos);
switch (this._mouseState) {
Expand All @@ -11420,6 +11420,7 @@
this._currentAngleMeasurement.cornerVisible = true;
this._currentAngleMeasurement.angleVisible = false;
this._currentAngleMeasurement.corner.worldPos = event.worldPos;
this._currentAngleMeasurement.corner.entity = event.entity;
}
this.markerDiv.style.marginLeft = `-10000px`;
this.markerDiv.style.marginTop = `-10000px`;
Expand All @@ -11431,6 +11432,7 @@
this._currentAngleMeasurement.targetVisible = true;
this._currentAngleMeasurement.angleVisible = true;
this._currentAngleMeasurement.target.worldPos = event.worldPos;
this._currentAngleMeasurement.target.entity = event.entity;
}
this.markerDiv.style.marginLeft = `-10000px`;
this.markerDiv.style.marginTop = `-10000px`;
Expand Down Expand Up @@ -11461,15 +11463,12 @@
this._currentAngleMeasurement = this.angleMeasurementsPlugin.createMeasurement({
id: math.createUUID(),
origin: {
entity: mouseHoverEntity,
worldPos: mouseWorldPos
},
corner: {
entity: mouseHoverEntity,
worldPos: mouseWorldPos
},
target: {
entity: mouseHoverEntity,
worldPos: mouseWorldPos
},
approximate: true
Expand All @@ -11481,6 +11480,7 @@
this._currentAngleMeasurement.targetWireVisible = false;
this._currentAngleMeasurement.targetVisible = false;
this._currentAngleMeasurement.angleVisible = false;
this._currentAngleMeasurement.origin.entity = hoveredEntity;
this._mouseState = MOUSE_FINDING_CORNER;
this.angleMeasurementsPlugin.fire("measurementStart", this._currentAngleMeasurement);
}
Expand All @@ -11490,11 +11490,13 @@
this._currentAngleMeasurement.targetWireVisible = false;
this._currentAngleMeasurement.targetVisible = true;
this._currentAngleMeasurement.angleVisible = true;
this._currentAngleMeasurement.corner.entity = hoveredEntity;
this._mouseState = MOUSE_FINDING_TARGET;
} else {
if (this._currentAngleMeasurement) {
this._currentAngleMeasurement.destroy();
this._currentAngleMeasurement = null;
hoveredEntity = null;
this._mouseState = MOUSE_FINDING_ORIGIN;
this.angleMeasurementsPlugin.fire("measurementCancel", this._currentAngleMeasurement);
}
Expand All @@ -11504,14 +11506,17 @@
if (mouseHovering) {
this._currentAngleMeasurement.targetVisible = true;
this._currentAngleMeasurement.angleVisible = true;
this._currentAngleMeasurement.target.entity = hoveredEntity;
this._currentAngleMeasurement.clickable = true;
hoveredEntity = null;
this.angleMeasurementsPlugin.fire("measurementEnd", this._currentAngleMeasurement);
this._currentAngleMeasurement = null;
this._mouseState = MOUSE_FINDING_ORIGIN;
} else {
if (this._currentAngleMeasurement) {
this._currentAngleMeasurement.destroy();
this._currentAngleMeasurement = null;
hoveredEntity = null;
this._mouseState = MOUSE_FINDING_ORIGIN;
this.angleMeasurementsPlugin.fire("measurementCancel", this._currentAngleMeasurement);
}
Expand Down Expand Up @@ -43864,6 +43869,7 @@
let pointerDownCanvasX;
let pointerDownCanvasY;
const clickTolerance = 20;
let hoveredEntity = null;

this._mouseState = MOUSE_FIRST_CLICK_EXPECTED;

Expand Down Expand Up @@ -43898,6 +43904,7 @@
this._markerDiv.style.background = "pink";
this._markerDiv.style.border = "2px solid red";
}
hoveredEntity = event.entity;
} else {
this._markerDiv.style.marginLeft = `-10000px`;
this._markerDiv.style.marginTop = `-10000px`;
Expand Down Expand Up @@ -43936,13 +43943,16 @@
}
if (this._currentDistanceMeasurement) {
if (mouseHovering) {
this._currentDistanceMeasurement.target.entity = hoveredEntity;
hoveredEntity = null;
this._currentDistanceMeasurement.clickable = true;
this.distanceMeasurementsPlugin.fire("measurementEnd", this._currentDistanceMeasurement);
this._currentDistanceMeasurement = null;
} else {
this._currentDistanceMeasurement.destroy();
this.distanceMeasurementsPlugin.fire("measurementCancel", this._currentDistanceMeasurement);
this._currentDistanceMeasurement = null;
hoveredEntity = null;
}
} else {
if (mouseHovering) {
Expand All @@ -43963,6 +43973,8 @@
this._currentDistanceMeasurementInitState.wireVisible = this._currentDistanceMeasurement.wireVisible;
this._currentDistanceMeasurementInitState.targetVisible = this._currentDistanceMeasurement.targetVisible;
this._currentDistanceMeasurement.clickable = false;
this._currentDistanceMeasurement.origin.entity = hoveredEntity;
hoveredEntity = null;
this.fire("measurementStart", this._currentDistanceMeasurement);
}
}
Expand Down

0 comments on commit 0f6b7d8

Please sign in to comment.