-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1170 from xeokit/measurements-refactor
Make measurements controllers pluggable
- Loading branch information
Showing
21 changed files
with
1,144 additions
and
2,591 deletions.
There are no files selected for viewing
81 changes: 81 additions & 0 deletions
81
examples/measurement/angle_createWithMouse_nosnapping.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>xeokit Example</title> | ||
<link href="../css/pageStyle.css" rel="stylesheet"/> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js"></script> | ||
</head> | ||
<body> | ||
<input type="checkbox" id="info-button"/> | ||
<label for="info-button" class="info-button"><i class="far fa-3x fa-question-circle"></i></label> | ||
<canvas id="myCanvas"></canvas> | ||
<div class="slideout-sidebar"> | ||
<img class="info-icon" src="../../assets/images/measure_angle_icon.png"/> | ||
<h1>AngleMeasurementPlugin with AngleMeasurementsMouseControl and PointerLens</h1> | ||
<h2>Click on the model to create angle measurements, with vertex and edge snapping</h2> | ||
<p>In this example, we're loading a BIM model from the file system, then creating angle measurements wherever the | ||
user clicks on the model with the mouse.</p> | ||
<h3>Components Used</h3> | ||
<ul> | ||
<li> | ||
<a href="../../docs/class/src/viewer/Viewer.js~Viewer.html" | ||
target="_other">Viewer</a> | ||
</li> | ||
<li> | ||
<a href="../../docs/class/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.js~AngleMeasurementsPlugin.html" | ||
target="_other">AngleMeasurementsPlugin</a> | ||
</li> | ||
<li> | ||
<a href="../../docs/class/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.js~AngleMeasurementsMouseControl.html" | ||
target="_other">AngleMeasurementsMouseControl</a> | ||
</li> | ||
<li> | ||
<a href="../../docs/class/src/extras/PointerLens/PointerLens.js~PointerLens.html" | ||
target="_other">PointerLens</a> | ||
</li> | ||
</ul> | ||
<h3>Resources</h3> | ||
<ul> | ||
<li> | ||
<a href="http://openifcmodel.cs.auckland.ac.nz/Model/Details/274" | ||
target="_other">Model source</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</body> | ||
<script type="module"> | ||
|
||
import {Viewer, XKTLoaderPlugin, AngleMeasurementsPlugin, AngleMeasurementsMouseControl, PointerLens} from "../../dist/xeokit-sdk.es.js"; | ||
|
||
const viewer = new Viewer({ | ||
canvasId: "myCanvas", | ||
dtxEnabled: true | ||
}); | ||
|
||
viewer.camera.eye = [-3.93, 2.85, 27.01]; | ||
viewer.camera.look = [4.40, 3.72, 8.89]; | ||
viewer.camera.up = [-0.01, 0.99, 0.039]; | ||
|
||
const xktLoader = new XKTLoaderPlugin(viewer); | ||
|
||
const sceneModel = xktLoader.load({ | ||
id: "myModel", | ||
src: "../../assets/models/xkt/v10/glTF-Embedded/Duplex_A_20110505.glTFEmbedded.xkt", | ||
edges: true | ||
}); | ||
|
||
const angleMeasurements = new AngleMeasurementsPlugin(viewer); | ||
|
||
const angleMeasurementsMouseControl = new AngleMeasurementsMouseControl(angleMeasurements, { | ||
pointerLens : new PointerLens(viewer) | ||
}) | ||
|
||
angleMeasurementsMouseControl.snapping = false; | ||
|
||
angleMeasurementsMouseControl.activate(); | ||
|
||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.