Initial import of NODEDC BIM Viewer
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/BCFMode.js | xeokit-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="View large 3D BIM models in all major browsers and collaborate on issues using BCF"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-viewer"><meta property="og:site_name" content="xeokit-viewer"><meta property="og:title" content="xeokit-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="View large 3D BIM models in all major browsers and collaborate on issues using BCF"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-viewer"><meta property="twitter:description" content="View large 3D BIM models in all major browsers and collaborate on issues using BCF"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/Controller.js~Controller.html">Controller</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/ViewerUI.js~ViewerUI.html">ViewerUI</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#explorer">explorer</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/explorer/Classes.js~Classes.html">Classes</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/explorer/Explorer.js~Explorer.html">Explorer</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/explorer/Models.js~Models.html">Models</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/explorer/Objects.js~Objects.html">Objects</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/explorer/Storeys.js~Storeys.html">Storeys</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#toolbar">toolbar</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/BCFMode.js~BCFMode.html">BCFMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/FirstPersonMode.js~FirstPersonMode.html">FirstPersonMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/FitAction.js~FitAction.html">FitAction</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/HideMode.js~HideMode.html">HideMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/NavCubeMode.js~NavCubeMode.html">NavCubeMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/OrthoMode.js~OrthoMode.html">OrthoMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/QueryMode.js~QueryMode.html">QueryMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/ResetAction.js~ResetAction.html">ResetAction</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/SectionMode.js~SectionMode.html">SectionMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/SelectMode.js~SelectMode.html">SelectMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/Toolbar.js~Toolbar.html">Toolbar</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/BCFMode.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {BCFViewpointsPlugin} from "../../lib/xeokit/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.js";
|
||||
import {math} from "../../lib/xeokit/viewer/scene/math/math.js";
|
||||
import {Controller} from "../Controller.js";
|
||||
|
||||
/**
|
||||
* @desc Manages BCF viewpoints.
|
||||
*
|
||||
* Located at {@link Toolbar#bcf}.
|
||||
*/
|
||||
class BCFMode extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
super(parent, cfg);
|
||||
this._element = document.getElementById(cfg.bcfPanelId);
|
||||
this._records = [];
|
||||
this._recordsMap = {};
|
||||
this._bcfViewpointsPlugin = new BCFViewpointsPlugin(this.viewer, {});
|
||||
}
|
||||
|
||||
createViewpoint() {
|
||||
const viewpointId = math.createUUID();
|
||||
const viewpoint = this._bcfViewpointsPlugin.getViewpoint();
|
||||
const record = {
|
||||
id: viewpointId,
|
||||
viewpoint: viewpoint
|
||||
};
|
||||
this._records.push(record);
|
||||
this._recordsMap[record.id] = record;
|
||||
this._repaint();
|
||||
}
|
||||
|
||||
clearViewpoints() {
|
||||
this._records = [];
|
||||
this._recordsMap = {};
|
||||
this._repaint();
|
||||
}
|
||||
|
||||
_repaint() {
|
||||
var h = "";
|
||||
for (var i = 0, len = this._records.length; i < len; i++) {
|
||||
const record = this._records[i];
|
||||
h += '<br><div class="panel panel-primary">';
|
||||
h += '<div class="panel-heading">';
|
||||
h += '<a id="' + record.id + '" href=""><img src="' + record.viewpoint.snapshot.snapshot_data + '" style="border: 1px solid black;" width="150", height="130"></a>';
|
||||
h += '</div>';
|
||||
h += '</div>';
|
||||
}
|
||||
const self = this;
|
||||
this._element.innerHTML = h;
|
||||
for (var i = 0, len = this._records.length; i < len; i++) {
|
||||
(function () {
|
||||
const record = self._records[i];
|
||||
$("#" + record.id).on('click', (event) => {
|
||||
self._bcfViewpointsPlugin.setViewpoint(record.viewpoint);
|
||||
event.preventDefault();
|
||||
});
|
||||
})();
|
||||
}
|
||||
}
|
||||
|
||||
/** @private */
|
||||
destroy() {
|
||||
super.destroy();
|
||||
this._bcfViewpointsPlugin.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
export {BCFMode};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,116 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/FirstPersonMode.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/FirstPersonMode.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
|
||||
/** @private */
|
||||
class FirstPersonMode extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
const buttonElement = cfg.buttonElement;
|
||||
const cameraControl = this.viewer.cameraControl;
|
||||
const cameraControlNavModeMediator = cfg.cameraControlNavModeMediator;
|
||||
|
||||
cameraControl.navMode = "orbit";
|
||||
cameraControl.followPointer = true;
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (active) {
|
||||
buttonElement.classList.add("active");
|
||||
} else {
|
||||
buttonElement.classList.remove("active");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
cameraControlNavModeMediator.setFirstPersonModeActive(active);
|
||||
if (active) {
|
||||
cameraControl.followPointer = true;
|
||||
cameraControl.pivoting = false;
|
||||
} else {
|
||||
cameraControl.pivoting = true;
|
||||
}
|
||||
});
|
||||
|
||||
buttonElement.addEventListener("click", (event) => {
|
||||
if (this.getEnabled()) {
|
||||
const active = this.getActive();
|
||||
this.setActive(!active);
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.bimViewer.on("reset", ()=>{
|
||||
this.setActive(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export {FirstPersonMode};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,124 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/FitAction.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/FitAction.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
import {math} from "@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js";
|
||||
|
||||
const tempVec3 = math.vec3();
|
||||
|
||||
/** @private */
|
||||
class FitAction extends Controller {
|
||||
|
||||
constructor(parent, cfg={}) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
const buttonElement = cfg.buttonElement;
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (active) {
|
||||
buttonElement.classList.add("active");
|
||||
} else {
|
||||
buttonElement.classList.remove("active");
|
||||
}
|
||||
});
|
||||
|
||||
buttonElement.addEventListener("click", (event) => {
|
||||
if (this.getEnabled()) {
|
||||
this.fit();
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
fit() {
|
||||
const scene = this.viewer.scene;
|
||||
const aabb = scene.getAABB(scene.visibleObjectIds);
|
||||
this.viewer.cameraFlight.flyTo({
|
||||
aabb: aabb
|
||||
});
|
||||
this.viewer.cameraControl.pivotPos = math.getAABB3Center(aabb, tempVec3);
|
||||
}
|
||||
|
||||
set fov(fov) {
|
||||
this.viewer.scene.cameraFlight.fitFOV = fov;
|
||||
}
|
||||
|
||||
get fov() {
|
||||
return this.viewer.scene.cameraFlight.fitFOV;
|
||||
}
|
||||
|
||||
set duration(duration) {
|
||||
this.viewer.scene.cameraFlight.duration = duration;
|
||||
}
|
||||
|
||||
get duration() {
|
||||
return this.viewer.scene.cameraFlight.duration;
|
||||
}
|
||||
}
|
||||
|
||||
export {FitAction};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,153 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/HideMode.js | xeokit-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-viewer"><meta property="og:site_name" content="xeokit-viewer"><meta property="og:title" content="xeokit-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/ViewerUI.js~ViewerUI.html">ViewerUI</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#ifcobjectdefaults">IFCObjectDefaults</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-IFCObjectDefaults">IFCObjectDefaults</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/HideMode.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
import {math} from "@xeokit/xeokit-sdk/src/viewer/scene/math/math.js";
|
||||
|
||||
function closeEnough(p, q) {
|
||||
const CLICK_DIST = 4;
|
||||
return (Math.abs(p[0] - q[0]) < 4) && (Math.abs(p[1] - q[1]) < CLICK_DIST);
|
||||
}
|
||||
|
||||
/** @private */
|
||||
class HideMode extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
const buttonElement = cfg.buttonElement;
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (active) {
|
||||
buttonElement.classList.add("active");
|
||||
} else {
|
||||
buttonElement.classList.remove("active");
|
||||
}
|
||||
});
|
||||
|
||||
buttonElement.addEventListener("click", (event) => {
|
||||
if (!this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
const active = this.getActive();
|
||||
this.setActive(!active);
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.viewerUI.on("reset", () => {
|
||||
this.setActive(false);
|
||||
});
|
||||
|
||||
this._initHideMode();
|
||||
}
|
||||
|
||||
_initHideMode() {
|
||||
var entity = null;
|
||||
this._onHover = this.viewer.cameraControl.on("hover", (e) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (entity) {
|
||||
entity.highlighted = false;
|
||||
entity = null;
|
||||
}
|
||||
entity = e.entity;
|
||||
entity.highlighted = true;
|
||||
});
|
||||
this._onHoverOff = this.viewer.cameraControl.on("hoverOff", (e) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (entity) {
|
||||
entity.highlighted = false;
|
||||
entity = null;
|
||||
}
|
||||
});
|
||||
const lastCoords = math.vec2();
|
||||
this._onMousedown = this.viewer.scene.input.on("mousedown", (coords) => {
|
||||
lastCoords[0] = coords[0];
|
||||
lastCoords[1] = coords[1];
|
||||
});
|
||||
this._onMouseup = this.viewer.scene.input.on("mouseup", (coords) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (entity) {
|
||||
if (!closeEnough(lastCoords, coords)) {
|
||||
entity = null;
|
||||
return;
|
||||
}
|
||||
entity.visible = false;
|
||||
entity.highlighted = false;
|
||||
entity = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export {HideMode};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,114 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/HideTool.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/HideTool.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
|
||||
/** @private */
|
||||
class HideTool extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
const buttonElement = cfg.buttonElement;
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (active) {
|
||||
buttonElement.classList.add("active");
|
||||
this.viewer.cameraControl.doublePickFlyTo = false;
|
||||
this._onPick = this.viewer.cameraControl.on("picked", (pickResult) => {
|
||||
if (!pickResult.entity) {
|
||||
return;
|
||||
}
|
||||
pickResult.entity.visible = false;
|
||||
});
|
||||
} else {
|
||||
buttonElement.classList.remove("active");
|
||||
this.viewer.cameraControl.doublePickFlyTo = false;
|
||||
if (this._onPick !== undefined) {
|
||||
this.viewer.cameraControl.off(this._onPick);
|
||||
this._onPick = undefined;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
buttonElement.addEventListener("click", (event) => {
|
||||
if (this.getEnabled()) {
|
||||
this.bimViewer._sectionTool.hideControl();
|
||||
const active = this.getActive();
|
||||
this.setActive(!active);
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.bimViewer.on("reset", () => {
|
||||
this.setActive(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export {HideTool};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,324 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/MarqueeSelectionTool.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/MarqueeSelectionTool.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
import {Frustum, frustumIntersectsAABB3, math, setFrustum} from "@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js";
|
||||
|
||||
const LEFT_TO_RIGHT = 0;
|
||||
const RIGHT_TO_LEFT = 1;
|
||||
|
||||
/** @private */
|
||||
export class MarqueeSelectionTool extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
this._objectsKdTree3 = cfg.objectsKdTree3;
|
||||
this._marquee = math.AABB2();
|
||||
this._marqueeFrustum = new Frustum();
|
||||
this._marqueeFrustumProjMat = math.mat4();
|
||||
this._marqueeDir = false;
|
||||
|
||||
const buttonElement = cfg.buttonElement;
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (active) {
|
||||
buttonElement.classList.add("active");
|
||||
const nop = this._objectsKdTree3.root; // Lazy-build the kd-tree
|
||||
} else {
|
||||
buttonElement.classList.remove("active");
|
||||
}
|
||||
});
|
||||
|
||||
buttonElement.addEventListener("click", (event) => {
|
||||
if (this.getEnabled()) {
|
||||
const active = this.getActive();
|
||||
this.setActive(!active);
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.bimViewer.on("reset", () => {
|
||||
this.setActive(false);
|
||||
});
|
||||
|
||||
const scene = this.viewer.scene;
|
||||
const canvas = scene.canvas.canvas;
|
||||
|
||||
this._marqueeElement = document.createElement('div');
|
||||
document.body.appendChild(this._marqueeElement);
|
||||
|
||||
const marqueeElement = this._marqueeElement;
|
||||
const marqueeStyle = marqueeElement.style;
|
||||
marqueeStyle.position = "absolute";
|
||||
marqueeStyle["z-index"] = "40000005";
|
||||
marqueeStyle.width = 8 + "px";
|
||||
marqueeStyle.height = 8 + "px";
|
||||
marqueeStyle.visibility = "hidden";
|
||||
marqueeStyle.top = 0 + "px";
|
||||
marqueeStyle.left = 0 + "px";
|
||||
marqueeStyle["box-shadow"] = "0 2px 5px 0 #182A3D;";
|
||||
marqueeStyle["opacity"] = 1.0;
|
||||
marqueeStyle["pointer-events"] = "none";
|
||||
|
||||
let canvasDragStartX;
|
||||
let canvasDragStartY;
|
||||
let canvasDragEndX;
|
||||
let canvasDragEndY;
|
||||
|
||||
let canvasMarqueeStartX;
|
||||
let canvasMarqueeStartY;
|
||||
let canvasMarqueeEndX;
|
||||
let canvasMarqueeEndY;
|
||||
|
||||
let isMouseDragging = false;
|
||||
let mouseWasUpOffCanvas = false;
|
||||
|
||||
canvas.addEventListener("mousedown", (e) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (e.button !== 0) { // Left button only
|
||||
return;
|
||||
}
|
||||
const input = this.bimViewer.viewer.scene.input;
|
||||
if (!input.keyDown[input.KEY_CTRL]) { // Clear selection unless CTRL down
|
||||
scene.setObjectsSelected(scene.selectedObjectIds, false);
|
||||
}
|
||||
canvasDragStartX = e.pageX;
|
||||
canvasDragStartY = e.pageY;
|
||||
marqueeStyle.visibility = "visible";
|
||||
marqueeStyle.left = `${canvasDragStartX}px`;
|
||||
marqueeStyle.top = `${canvasDragStartY}px`;
|
||||
marqueeStyle.width = "0px";
|
||||
marqueeStyle.height = "0px";
|
||||
marqueeStyle.display = "block";
|
||||
canvasMarqueeStartX = e.offsetX;
|
||||
canvasMarqueeStartY = e.offsetY;
|
||||
isMouseDragging = true;
|
||||
this.viewer.cameraControl.pointerEnabled = false; // Disable camera rotation
|
||||
});
|
||||
|
||||
canvas.addEventListener("mouseup", (e) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (!isMouseDragging && !mouseWasUpOffCanvas) {
|
||||
return
|
||||
}
|
||||
if (e.button !== 0) {
|
||||
return;
|
||||
}
|
||||
canvasDragEndX = e.pageX;
|
||||
canvasDragEndY = e.pageY;
|
||||
const width = Math.abs(canvasDragEndX - canvasDragStartX);
|
||||
const height = Math.abs(canvasDragEndY - canvasDragStartY);
|
||||
marqueeStyle.width = `${width}px`;
|
||||
marqueeStyle.height = `${height}px`;
|
||||
marqueeStyle.visibility = "hidden";
|
||||
isMouseDragging = false;
|
||||
this.viewer.cameraControl.pointerEnabled = true; // Enable camera rotation
|
||||
if (mouseWasUpOffCanvas) {
|
||||
mouseWasUpOffCanvas = false;
|
||||
}
|
||||
if (width > 3 || height > 3) { // Marquee pick if rectangle big enough
|
||||
this._marqueePick();
|
||||
}
|
||||
}); // Bubbling
|
||||
|
||||
document.addEventListener("mouseup", (e) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (e.button !== 0) { // check if left button was clicked
|
||||
return;
|
||||
}
|
||||
if (!isMouseDragging) {
|
||||
return
|
||||
}
|
||||
marqueeStyle.visibility = "hidden";
|
||||
isMouseDragging = false;
|
||||
mouseWasUpOffCanvas = true;
|
||||
this.viewer.cameraControl.pointerEnabled = true;
|
||||
}, true); // Capturing
|
||||
|
||||
canvas.addEventListener("mousemove", (e) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (e.button !== 0) { // check if left button was clicked
|
||||
return;
|
||||
}
|
||||
if (!isMouseDragging) {
|
||||
return
|
||||
}
|
||||
const x = e.pageX;
|
||||
const y = e.pageY;
|
||||
const width = x - canvasDragStartX;
|
||||
const height = y - canvasDragStartY;
|
||||
marqueeStyle.width = `${Math.abs(width)}px`;
|
||||
marqueeStyle.height = `${Math.abs(height)}px`;
|
||||
marqueeStyle.left = `${Math.min(canvasDragStartX, x)}px`;
|
||||
marqueeStyle.top = `${Math.min(canvasDragStartY, y)}px`;
|
||||
canvasMarqueeEndX = e.offsetX;
|
||||
canvasMarqueeEndY = e.offsetY;
|
||||
const marqueeDir = (canvasMarqueeStartX < canvasMarqueeEndX) ? LEFT_TO_RIGHT : RIGHT_TO_LEFT;
|
||||
this._setMarqueeDir(marqueeDir);
|
||||
this._marquee[0] = Math.min(canvasMarqueeStartX, canvasMarqueeEndX);
|
||||
this._marquee[1] = Math.min(canvasMarqueeStartY, canvasMarqueeEndY);
|
||||
this._marquee[2] = Math.max(canvasMarqueeStartX, canvasMarqueeEndX);
|
||||
this._marquee[3] = Math.max(canvasMarqueeStartY, canvasMarqueeEndY);
|
||||
});
|
||||
}
|
||||
|
||||
_setMarqueeDir(marqueeDir) {
|
||||
if (marqueeDir !== this._marqueeDir) {
|
||||
this._marqueeElement.style["background-image"] =
|
||||
marqueeDir === LEFT_TO_RIGHT
|
||||
/* Solid */ ? "url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='6' ry='6' stroke='%23333' stroke-width='4'/%3e%3c/svg%3e\")"
|
||||
/* Dashed */ : "url(\"data:image/svg+xml,%3csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='100%25' height='100%25' fill='none' rx='6' ry='6' stroke='%23333' stroke-width='4' stroke-dasharray='6%2c 14' stroke-dashoffset='0' stroke-linecap='square'/%3e%3c/svg%3e\")";
|
||||
this._marqueeDir = marqueeDir;
|
||||
}
|
||||
}
|
||||
|
||||
_marqueePick() {
|
||||
this._buildMarqueeFrustum();
|
||||
const entities1 = [];
|
||||
const visitNode = (node, intersects = Frustum.INTERSECT) => {
|
||||
if (intersects === Frustum.INTERSECT) {
|
||||
intersects = frustumIntersectsAABB3(this._marqueeFrustum, node.aabb);
|
||||
}
|
||||
if (intersects === Frustum.OUTSIDE) {
|
||||
return;
|
||||
}
|
||||
if (node.entities) {
|
||||
const entities = node.entities;
|
||||
for (let i = 0, len = entities.length; i < len; i++) {
|
||||
const entity = entities[i];
|
||||
if (!entity.visible) {
|
||||
continue;
|
||||
}
|
||||
const entityAABB = entity.aabb;
|
||||
if (this._marqueeDir === LEFT_TO_RIGHT) {
|
||||
// Select entities that are completely inside marquee
|
||||
const intersection = frustumIntersectsAABB3(this._marqueeFrustum, entityAABB);
|
||||
if (intersection === Frustum.INSIDE) {
|
||||
entities1.push(entity);
|
||||
}
|
||||
} else {
|
||||
// Select entities that are partially inside marquee
|
||||
const intersection = frustumIntersectsAABB3(this._marqueeFrustum, entityAABB);
|
||||
if (intersection !== Frustum.OUTSIDE) {
|
||||
entities1.push(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
if (node.left) {
|
||||
visitNode(node.left, intersects);
|
||||
}
|
||||
if (node.right) {
|
||||
visitNode(node.right, intersects);
|
||||
}
|
||||
}
|
||||
visitNode(this._objectsKdTree3.root);
|
||||
for (let i = 0, len = entities1.length; i < len; i++) {
|
||||
entities1[i].selected = true;
|
||||
}
|
||||
return entities1;
|
||||
}
|
||||
|
||||
_buildMarqueeFrustum() { // https://github.com/xeokit/xeokit-sdk/issues/869#issuecomment-1165375770
|
||||
const canvas = this.viewer.scene.canvas.canvas;
|
||||
const canvasWidth = canvas.clientWidth;
|
||||
const canvasHeight = canvas.clientHeight;
|
||||
const xCanvasToClip = 2.0 / canvasWidth;
|
||||
const yCanvasToClip = 2.0 / canvasHeight;
|
||||
const NEAR_SCALING = 17;
|
||||
const ratio = canvas.clientHeight / canvas.clientWidth;
|
||||
const FAR_PLANE = 10000;
|
||||
const left = this._marquee[0] * xCanvasToClip + -1;
|
||||
const right = this._marquee[2] * xCanvasToClip + -1;
|
||||
const bottom = -this._marquee[3] * yCanvasToClip + 1;
|
||||
const top = -this._marquee[1] * yCanvasToClip + 1;
|
||||
const near = this.viewer.scene.camera.frustum.near * (NEAR_SCALING * ratio);
|
||||
const far = FAR_PLANE;
|
||||
math.frustumMat4(
|
||||
left,
|
||||
right,
|
||||
bottom * ratio,
|
||||
top * ratio,
|
||||
near,
|
||||
far,
|
||||
this._marqueeFrustumProjMat,
|
||||
);
|
||||
setFrustum(this._marqueeFrustum, this.viewer.scene.camera.viewMatrix, this._marqueeFrustumProjMat);
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,91 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/NavCubeMode.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/NavCubeMode.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
import {NavCubePlugin} from "@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js";
|
||||
|
||||
/** @private */
|
||||
class NavCubeMode extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
if (!cfg.navCubeCanvasElement) {
|
||||
throw "Missing config: navCubeCanvasElement";
|
||||
}
|
||||
|
||||
const navCubeCanvasElement = cfg.navCubeCanvasElement;
|
||||
|
||||
this._navCube = new NavCubePlugin(this.viewer, {
|
||||
canvasElement: navCubeCanvasElement,
|
||||
fitVisible: true,
|
||||
color: "#CFCFCF"
|
||||
});
|
||||
|
||||
this._navCube.setVisible(this._active);
|
||||
|
||||
this.on("active", (active) => {
|
||||
this._navCube.setVisible(active);
|
||||
});
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this._navCube.destroy();
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
export {NavCubeMode};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,155 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/OrthoMode.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/OrthoMode.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
|
||||
/** @private */
|
||||
class OrthoMode extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
this._buttonElement = cfg.buttonElement;
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
this._buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
this._buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this._buttonElement.addEventListener("click", (event) => {
|
||||
if (this.getEnabled()) {
|
||||
this.setActive(!this.getActive(), () => {
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.bimViewer.on("reset", () => {
|
||||
this.setActive(false);
|
||||
});
|
||||
|
||||
this.viewer.camera.on("projection", () => {
|
||||
const isOrtho = (this.viewer.camera.projection === "ortho");
|
||||
this._active = isOrtho;
|
||||
if (this._active) {
|
||||
this._buttonElement.classList.add("active");
|
||||
} else {
|
||||
this._buttonElement.classList.remove("active");
|
||||
}
|
||||
});
|
||||
|
||||
this._active = false;
|
||||
this._buttonElement.classList.remove("active");
|
||||
}
|
||||
|
||||
setActive(active, done) {
|
||||
if (this._active === active) {
|
||||
if (done) {
|
||||
done();
|
||||
}
|
||||
return;
|
||||
}
|
||||
this._active = active;
|
||||
if (active) {
|
||||
this._buttonElement.classList.add("active");
|
||||
if (done) {
|
||||
this._enterOrthoMode(() => {
|
||||
this.fire("active", this._active);
|
||||
done();
|
||||
});
|
||||
} else {
|
||||
this._enterOrthoMode();
|
||||
this.fire("active", this._active);
|
||||
}
|
||||
} else {
|
||||
this._buttonElement.classList.remove("active");
|
||||
if (done) {
|
||||
this._exitOrthoMode(() => {
|
||||
this.fire("active", this._active);
|
||||
done();
|
||||
});
|
||||
} else {
|
||||
this._exitOrthoMode();
|
||||
this.fire("active", this._active);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_enterOrthoMode(done) {
|
||||
if (done) {
|
||||
this.viewer.cameraFlight.flyTo({projection: "ortho", duration: 0.5}, done);
|
||||
} else {
|
||||
this.viewer.cameraFlight.jumpTo({projection: "ortho"});
|
||||
}
|
||||
}
|
||||
|
||||
_exitOrthoMode(done) {
|
||||
if (done) {
|
||||
this.viewer.cameraFlight.flyTo({projection: "perspective", duration: 0.5}, done);
|
||||
} else {
|
||||
this.viewer.cameraFlight.jumpTo({projection: "perspective"});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {OrthoMode};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,159 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/QueryMode.js | xeokit-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-viewer"><meta property="og:site_name" content="xeokit-viewer"><meta property="og:title" content="xeokit-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/ViewerUI.js~ViewerUI.html">ViewerUI</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#ifcobjectdefaults">IFCObjectDefaults</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-IFCObjectDefaults">IFCObjectDefaults</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/QueryMode.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
import {math} from "@xeokit/xeokit-sdk/src/viewer/scene/math/math.js";
|
||||
|
||||
function closeEnough(p, q) {
|
||||
const CLICK_DIST = 4;
|
||||
return (Math.abs(p[0] - q[0]) < 4) && (Math.abs(p[1] - q[1]) < CLICK_DIST);
|
||||
}
|
||||
|
||||
/** @private */
|
||||
class QueryMode extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
const buttonElement = cfg.buttonElement;
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (active) {
|
||||
buttonElement.classList.add("active");
|
||||
} else {
|
||||
buttonElement.classList.remove("active");
|
||||
}
|
||||
});
|
||||
|
||||
buttonElement.addEventListener("click", (event) => {
|
||||
if (!this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
const active = this.getActive();
|
||||
this.setActive(!active);
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.viewerUI.on("reset", ()=>{
|
||||
this.setActive(false);
|
||||
});
|
||||
|
||||
this._initQueryMode();
|
||||
}
|
||||
|
||||
_initQueryMode() {
|
||||
const viewer = this.viewer;
|
||||
const cameraControl = viewer.cameraControl;
|
||||
var entity = null;
|
||||
this._onHover = cameraControl.on("hover", (e) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (entity) {
|
||||
entity.highlighted = false;
|
||||
entity = null;
|
||||
}
|
||||
entity = e.entity;
|
||||
entity.highlighted = true;
|
||||
});
|
||||
this._onHoverOff = cameraControl.on("hoverOff", (e) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (entity) {
|
||||
entity.highlighted = false;
|
||||
entity = null;
|
||||
}
|
||||
});
|
||||
const lastCoords = math.vec2();
|
||||
this._onMousedown = viewer.scene.input.on("mousedown", (coords) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
lastCoords[0] = coords[0];
|
||||
lastCoords[1] = coords[1];
|
||||
});
|
||||
this._onMouseup = viewer.scene.input.on("mouseup", (coords) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (entity) {
|
||||
if (!closeEnough(lastCoords, coords)) {
|
||||
entity = null;
|
||||
return;
|
||||
}
|
||||
this.fire("queryPicked", entity.id);
|
||||
entity = null;
|
||||
} else {
|
||||
this.fire("queryNotPicked", false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export {QueryMode};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/QueryTool.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/QueryTool.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
|
||||
/** @private */
|
||||
class QueryTool extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent);
|
||||
|
||||
// this.on("active", (active) => {
|
||||
// if (active) {
|
||||
// this._onPick = this.viewer.cameraControl.on("picked", (pickResult) => {
|
||||
// if (!pickResult.entity) {
|
||||
// return;
|
||||
// }
|
||||
// // this.queryEntity(pickResult.entity);
|
||||
// });
|
||||
// this._onPickedNothing = this.viewer.cameraControl.on("pickedNothing", () => {
|
||||
// this.fire("queryNotPicked", false);
|
||||
// });
|
||||
// } else {
|
||||
//
|
||||
// if (this._onPick !== undefined) {
|
||||
// this.viewer.cameraControl.off(this._onPick);
|
||||
// this.viewer.cameraControl.off(this._onPickedNothing);
|
||||
// this._onPick = undefined;
|
||||
// this._onPickedNothing = undefined;
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// this.bimViewer.on("reset", () => {
|
||||
// this.setActive(false);
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
export {QueryTool};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,184 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/ResetAction.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/ResetAction.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
import {ModelMemento, math} from "@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js";
|
||||
|
||||
const tempVec3a = math.vec3();
|
||||
|
||||
/** @private */
|
||||
class ResetAction extends Controller {
|
||||
|
||||
constructor(parent, cfg = {}) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
const buttonElement = cfg.buttonElement;
|
||||
const camera = this.viewer.camera;
|
||||
|
||||
this._modelMementos = {};
|
||||
|
||||
// Initial camera position - looking down negative diagonal
|
||||
|
||||
camera.eye = [0.577, 0.577, 0.577];
|
||||
camera.look = [0,0,0];
|
||||
camera.up = [-1, 1, -1];
|
||||
|
||||
this.bimViewer._modelsExplorer.on("modelLoaded", (modelId) => {
|
||||
this._saveModelMemento(modelId);
|
||||
});
|
||||
|
||||
this.bimViewer._modelsExplorer.on("modelUnloaded", (modelId) => {
|
||||
this._destroyModelMemento(modelId);
|
||||
});
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (active) {
|
||||
buttonElement.classList.add("active");
|
||||
} else {
|
||||
buttonElement.classList.remove("active");
|
||||
}
|
||||
});
|
||||
|
||||
buttonElement.addEventListener("click", (event) => {
|
||||
if (this.getEnabled()) {
|
||||
this.reset();
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
|
||||
_saveModelMemento(modelId) {
|
||||
const metaModel = this.viewer.metaScene.metaModels[modelId];
|
||||
if (!metaModel) {
|
||||
return;
|
||||
}
|
||||
const modelMemento = new ModelMemento();
|
||||
modelMemento.saveObjects(this.viewer.scene, metaModel, {
|
||||
visible: true,
|
||||
edges: true,
|
||||
xrayed: true,
|
||||
highlighted: true,
|
||||
selected: true,
|
||||
clippable: true,
|
||||
pickable: true,
|
||||
colorize: false, // We don't colorize objects yet - also messes up point clouds
|
||||
opacity: false // FIXME: Restoring opacity broken by colorize fix - details at https://github.com/xeokit/xeokit-sdk/issues/239
|
||||
});
|
||||
this._modelMementos[modelId] = modelMemento;
|
||||
}
|
||||
|
||||
_restoreModelMemento(modelId) {
|
||||
const metaModel = this.viewer.metaScene.metaModels[modelId];
|
||||
if (!metaModel) {
|
||||
return;
|
||||
}
|
||||
const modelMemento = this._modelMementos[modelId];
|
||||
modelMemento.restoreObjects(this.viewer.scene, metaModel);
|
||||
}
|
||||
|
||||
_destroyModelMemento(modelId) {
|
||||
delete this._modelMementos[modelId];
|
||||
}
|
||||
|
||||
reset() {
|
||||
const scene = this.viewer.scene;
|
||||
const modelIds = scene.modelIds;
|
||||
for (var i = 0, len = modelIds.length; i < len; i++) {
|
||||
const modelId = modelIds[i];
|
||||
this._restoreModelMemento(modelId);
|
||||
}
|
||||
this.bimViewer.unShowObjectInExplorers();
|
||||
this.fire("reset", true);
|
||||
this._resetCamera();
|
||||
}
|
||||
|
||||
_resetCamera() {
|
||||
const viewer = this.viewer;
|
||||
const scene = viewer.scene;
|
||||
const aabb = scene.getAABB(scene.visibleObjectIds);
|
||||
const diag = math.getAABB3Diag(aabb);
|
||||
const center = math.getAABB3Center(aabb, tempVec3a);
|
||||
const camera = scene.camera;
|
||||
const fitFOV = camera.perspective.fov;
|
||||
const dist = Math.abs(diag / Math.tan(45 * math.DEGTORAD));
|
||||
const dir = math.normalizeVec3((camera.yUp) ? [-0.5, -0.7071, -0.5] : [-1, 1, -1]);
|
||||
const up = math.normalizeVec3((camera.yUp) ? [-0.5, 0.7071, -0.5] : [-1, 1, 1]);
|
||||
viewer.cameraControl.pivotPos = center;
|
||||
viewer.cameraControl.planView = false;
|
||||
viewer.cameraFlight.flyTo({
|
||||
look: center,
|
||||
eye: [center[0] - (dist * dir[0]), center[1] - (dist * dir[1]), center[2] - (dist * dir[2])],
|
||||
up: up,
|
||||
orthoScale: diag * 1.3,
|
||||
projection: "perspective",
|
||||
duration: 1
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export {ResetAction};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,144 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/SectionMode.js | xeokit-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-viewer"><meta property="og:site_name" content="xeokit-viewer"><meta property="og:title" content="xeokit-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/ViewerUI.js~ViewerUI.html">ViewerUI</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#ifcobjectdefaults">IFCObjectDefaults</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-IFCObjectDefaults">IFCObjectDefaults</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/SectionMode.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
import {SectionPlanesPlugin} from "@xeokit/xeokit-sdk/src/plugins/SectionPlanesPlugin/SectionPlanesPlugin.js";
|
||||
|
||||
/** @private */
|
||||
class SectionMode extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
if (!cfg.sectionPlanesOverviewCanvasElement) {
|
||||
throw "Missing config: sectionPlanesOverviewCanvasElement";
|
||||
}
|
||||
|
||||
const buttonElement = cfg.buttonElement;
|
||||
const sectionPlanesOverviewCanvasElement = cfg.sectionPlanesOverviewCanvasElement;
|
||||
|
||||
this._sectionPlanesPlugin = new SectionPlanesPlugin(this.viewer, {
|
||||
overviewCanvas: sectionPlanesOverviewCanvasElement
|
||||
});
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (active) {
|
||||
buttonElement.classList.add("active");
|
||||
} else {
|
||||
buttonElement.classList.remove("active");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
this._sectionPlanesPlugin.setOverviewVisible(active);
|
||||
if (!active) {
|
||||
this._sectionPlanesPlugin.hideControl();
|
||||
}
|
||||
});
|
||||
|
||||
buttonElement.addEventListener("click", (event) => {
|
||||
if (!this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
const active = this.getActive();
|
||||
this.setActive(!active);
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.viewerUI.on("reset", () => {
|
||||
this.clear();
|
||||
this.setActive(false);
|
||||
});
|
||||
|
||||
this._initSectionMode();
|
||||
}
|
||||
|
||||
_initSectionMode() {
|
||||
this._onPickedSurface = this.viewer.cameraControl.on("pickedSurface", (e) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
const sectionPlane = this._sectionPlanesPlugin.createSectionPlane({
|
||||
pos: e.worldPos,
|
||||
dir: [-e.worldNormal[0], -e.worldNormal[1], -e.worldNormal[2]]
|
||||
});
|
||||
this._sectionPlanesPlugin.showControl(sectionPlane.id);
|
||||
});
|
||||
}
|
||||
|
||||
clear() {
|
||||
this._sectionPlanesPlugin.clear();
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this._sectionPlanesPlugin.destroy();
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
export {SectionMode};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,270 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/SectionTool.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/SectionTool.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
import {SectionToolContextMenu} from "./../contextMenus/SectionToolContextMenu.js";
|
||||
import {math, SectionPlanesPlugin} from "@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js";
|
||||
|
||||
/** @private */
|
||||
class SectionTool extends Controller { // XX
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
if (!cfg.menuButtonElement) {
|
||||
throw "Missing config: menuButtonElement";
|
||||
}
|
||||
|
||||
this._buttonElement = cfg.buttonElement;
|
||||
this._counterElement = cfg.counterElement;
|
||||
this._menuButtonElement = cfg.menuButtonElement;
|
||||
this._menuButtonArrowElement = cfg.menuButtonArrowElement;
|
||||
|
||||
this._sectionPlanesPlugin = new SectionPlanesPlugin(this.viewer, {});
|
||||
|
||||
this._sectionToolContextMenu = new SectionToolContextMenu({
|
||||
sectionPlanesPlugin: this._sectionPlanesPlugin,
|
||||
hideOnMouseDown: false,
|
||||
hideOnAction: false
|
||||
});
|
||||
|
||||
this._sectionPlanesPlugin.setOverviewVisible(false);
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
this._buttonElement.classList.add("disabled");
|
||||
if (this._counterElement) {
|
||||
this._counterElement.classList.add("disabled");
|
||||
}
|
||||
this._menuButtonElement.classList.add("disabled");
|
||||
this._menuButtonArrowElement.classList.add("disabled");
|
||||
} else {
|
||||
this._buttonElement.classList.remove("disabled");
|
||||
if (this._counterElement) {
|
||||
this._counterElement.classList.remove("disabled");
|
||||
}
|
||||
this._menuButtonElement.classList.remove("disabled");
|
||||
this._menuButtonArrowElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (active) {
|
||||
this._buttonElement.classList.add("active");
|
||||
if (this._counterElement) {
|
||||
this._counterElement.classList.add("active");
|
||||
}
|
||||
this._menuButtonElement.classList.add("active");
|
||||
this._menuButtonArrowElement.classList.add("active");
|
||||
} else {
|
||||
this._buttonElement.classList.remove("active");
|
||||
if (this._counterElement) {
|
||||
this._counterElement.classList.remove("active");
|
||||
}
|
||||
this._menuButtonElement.classList.remove("active");
|
||||
this._menuButtonArrowElement.classList.remove("active");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (!active) {
|
||||
this._sectionPlanesPlugin.hideControl();
|
||||
}
|
||||
});
|
||||
|
||||
this._buttonElement.addEventListener("click", (e) => {
|
||||
if (!this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (e.target === this._menuButtonElement || e.target.parentNode === this._menuButtonElement) {
|
||||
return;
|
||||
}
|
||||
const active = this.getActive();
|
||||
this.setActive(!active);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
document.addEventListener("mousedown", (e) => {
|
||||
|
||||
if (e.target.classList.contains("xeokit-context-menu-item")) {
|
||||
// Allow click on menu item
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.target === this._menuButtonElement || e.target.parentNode === this._menuButtonElement) {
|
||||
e.preventDefault();
|
||||
if (this._sectionToolContextMenu.shown) {
|
||||
this._sectionToolContextMenu.hide();
|
||||
} else {
|
||||
this._sectionToolContextMenu.context = {
|
||||
bimViewer: this.bimViewer,
|
||||
viewer: this.viewer,
|
||||
sectionTool: this
|
||||
};
|
||||
|
||||
const rect = this._menuButtonElement.getBoundingClientRect();
|
||||
|
||||
this._sectionToolContextMenu.show(rect.left, rect.bottom + 5);
|
||||
}
|
||||
} else {
|
||||
this._sectionToolContextMenu.hide();
|
||||
}
|
||||
});
|
||||
|
||||
this._sectionToolContextMenu.on("shown", () => {
|
||||
this._menuButtonArrowElement.classList.remove("xeokit-arrow-down");
|
||||
this._menuButtonArrowElement.classList.add("xeokit-arrow-up");
|
||||
});
|
||||
|
||||
this._sectionToolContextMenu.on("hidden", () => {
|
||||
this._menuButtonArrowElement.classList.remove("xeokit-arrow-up");
|
||||
this._menuButtonArrowElement.classList.add("xeokit-arrow-down");
|
||||
});
|
||||
|
||||
this.bimViewer.on("reset", () => {
|
||||
this.clear();
|
||||
this.setActive(false);
|
||||
});
|
||||
|
||||
this.viewer.scene.on("sectionPlaneCreated", () => {
|
||||
this._updateSectionPlanesCount();
|
||||
});
|
||||
|
||||
this.viewer.scene.on("sectionPlaneDestroyed", () => {
|
||||
this._updateSectionPlanesCount();
|
||||
});
|
||||
|
||||
this._initSectionMode();
|
||||
}
|
||||
|
||||
_initSectionMode() {
|
||||
|
||||
this.viewer.scene.input.on("mouseclicked", (coords) => {
|
||||
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const pickResult = this.viewer.scene.pick({
|
||||
canvasPos: coords,
|
||||
pickSurface: true // <<------ This causes picking to find the intersection point on the entity
|
||||
});
|
||||
|
||||
if (pickResult) {
|
||||
|
||||
const sectionPlane = this._sectionPlanesPlugin.createSectionPlane({
|
||||
pos: pickResult.worldPos,
|
||||
dir: math.mulVec3Scalar(pickResult.worldNormal, -1)
|
||||
});
|
||||
|
||||
this._sectionPlanesPlugin.showControl(sectionPlane.id);
|
||||
}
|
||||
});
|
||||
|
||||
this._updateSectionPlanesCount();
|
||||
}
|
||||
|
||||
_updateSectionPlanesCount() {
|
||||
if (this._counterElement) {
|
||||
this._counterElement.innerText = ("" + this.getNumSections());
|
||||
}
|
||||
}
|
||||
|
||||
getNumSections() {
|
||||
return Object.keys(this.viewer.scene.sectionPlanes).length;
|
||||
}
|
||||
|
||||
clear() {
|
||||
this._sectionPlanesPlugin.clear();
|
||||
this._updateSectionPlanesCount();
|
||||
}
|
||||
|
||||
flipSections() {
|
||||
this._sectionPlanesPlugin.flipSectionPlanes();
|
||||
}
|
||||
|
||||
enableSections() {
|
||||
const sectionPlanes = this.viewer.scene.sectionPlanes;
|
||||
for (let id in sectionPlanes) {
|
||||
const sectionPlane = sectionPlanes[id];
|
||||
sectionPlane.active = true;
|
||||
}
|
||||
}
|
||||
|
||||
disableSections() {
|
||||
const sectionPlanes = this.viewer.scene.sectionPlanes;
|
||||
for (let id in sectionPlanes) {
|
||||
const sectionPlane = sectionPlanes[id];
|
||||
sectionPlane.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
hideControl() {
|
||||
this._sectionPlanesPlugin.hideControl();
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this._sectionPlanesPlugin.destroy();
|
||||
this._sectionToolContextMenu.destroy();
|
||||
super.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
export {SectionTool};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,158 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/SelectMode.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/ViewerUI.js~ViewerUI.html">ViewerUI</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#ifcobjectdefaults">IFCObjectDefaults</a><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-IFCObjectDefaults">IFCObjectDefaults</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/SelectMode.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
import {math} from "@xeokit/xeokit-sdk/src/viewer/scene/math/math.js";
|
||||
|
||||
|
||||
function closeEnough(p, q) {
|
||||
const CLICK_DIST = 4;
|
||||
return (Math.abs(p[0] - q[0]) < 4) && (Math.abs(p[1] - q[1]) < CLICK_DIST);
|
||||
}
|
||||
|
||||
/** @private */
|
||||
class SelectMode extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
const buttonElement = cfg.buttonElement;
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (active) {
|
||||
buttonElement.classList.add("active");
|
||||
} else {
|
||||
buttonElement.classList.remove("active");
|
||||
}
|
||||
});
|
||||
|
||||
buttonElement.addEventListener("click", (event) => {
|
||||
if (!this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
const active = this.getActive();
|
||||
this.setActive(!active);
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.viewerUI.on("reset", () => {
|
||||
this.setActive(false);
|
||||
});
|
||||
|
||||
this._initSectionMode();
|
||||
}
|
||||
|
||||
_initSectionMode() {
|
||||
const viewer = this.viewer;
|
||||
const cameraControl = viewer.cameraControl;
|
||||
var entity = null;
|
||||
this._onHover = cameraControl.on("hover", (e) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (entity) {
|
||||
entity.highlighted = false;
|
||||
entity = null;
|
||||
}
|
||||
entity = e.entity;
|
||||
entity.highlighted = true;
|
||||
});
|
||||
this._onHoverOff = cameraControl.on("hoverOff", (e) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (entity) {
|
||||
entity.highlighted = false;
|
||||
entity = null;
|
||||
}
|
||||
});
|
||||
const lastCoords = math.vec2();
|
||||
this._onMousedown = viewer.scene.input.on("mousedown", (coords) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
lastCoords[0] = coords[0];
|
||||
lastCoords[1] = coords[1];
|
||||
});
|
||||
this._onMouseup = viewer.scene.input.on("mouseup", (coords) => {
|
||||
if (!this.getActive() || !this.getEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (entity) {
|
||||
if (!closeEnough(lastCoords, coords)) {
|
||||
entity = null;
|
||||
return;
|
||||
}
|
||||
entity.selected = !entity.selected;
|
||||
entity = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export {SelectMode};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,112 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/SelectionTool.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/SelectionTool.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
|
||||
/** @private */
|
||||
class SelectionTool extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
const buttonElement = cfg.buttonElement;
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this.on("active", (active) => {
|
||||
if (active) {
|
||||
buttonElement.classList.add("active");
|
||||
this._onPick = this.viewer.cameraControl.on("picked", (pickResult) => {
|
||||
if (!pickResult.entity) {
|
||||
return;
|
||||
}
|
||||
pickResult.entity.selected = !pickResult.entity.selected;
|
||||
});
|
||||
} else {
|
||||
buttonElement.classList.remove("active");
|
||||
if (this._onPick !== undefined) {
|
||||
this.viewer.cameraControl.off(this._onPick);
|
||||
this._onPick = undefined;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
buttonElement.addEventListener("click", (event) => {
|
||||
if (this.getEnabled()) {
|
||||
this.bimViewer._sectionTool.hideControl();
|
||||
const active = this.getActive();
|
||||
this.setActive(!active);
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.bimViewer.on("reset", () => {
|
||||
this.setActive(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export {SelectionTool};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,135 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/ShowSpacesMode.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/ShowSpacesMode.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
|
||||
/** @private */
|
||||
class ShowSpacesMode extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
this._buttonElement = cfg.buttonElement;
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
this._buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
this._buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this._buttonElement.addEventListener("click", (event) => {
|
||||
if (this.getEnabled()) {
|
||||
this.setActive(!this.getActive(), () => {
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.bimViewer.on("reset", () => {
|
||||
this.setActive(false); // IfcSpaces hidden by default
|
||||
});
|
||||
|
||||
this.viewer.scene.on("modelLoaded", (modelId) => {
|
||||
if (!this._active) {
|
||||
const objectIds = this.viewer.metaScene.getObjectIDsByType("IfcSpace");
|
||||
this.viewer.scene.setObjectsCulled(objectIds, true);
|
||||
}
|
||||
});
|
||||
|
||||
this._active = false;
|
||||
this._buttonElement.classList.remove("active");
|
||||
}
|
||||
|
||||
setActive(active) {
|
||||
if (this._active === active) {
|
||||
return;
|
||||
}
|
||||
this._active = active;
|
||||
if (active) {
|
||||
this._buttonElement.classList.add("active");
|
||||
this._enterShowSpacesMode();
|
||||
this.fire("active", this._active);
|
||||
} else {
|
||||
this._buttonElement.classList.remove("active");
|
||||
this._exitShowSpacesMode();
|
||||
this.fire("active", this._active);
|
||||
}
|
||||
}
|
||||
|
||||
_enterShowSpacesMode() {
|
||||
const viewer = this.viewer;
|
||||
const scene = viewer.scene;
|
||||
const metaScene = viewer.metaScene;
|
||||
const objectIds = metaScene.getObjectIDsByType("IfcSpace");
|
||||
scene.setObjectsCulled(objectIds, false);
|
||||
}
|
||||
|
||||
_exitShowSpacesMode() {
|
||||
const viewer = this.viewer;
|
||||
const scene = viewer.scene;
|
||||
const metaScene = viewer.metaScene;
|
||||
const objectIds = metaScene.getObjectIDsByType("IfcSpace");
|
||||
scene.setObjectsCulled(objectIds, true);
|
||||
}
|
||||
}
|
||||
|
||||
export {ShowSpacesMode};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,232 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/ThreeDMode.js | xeokit-bim-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="BIM viewer built on xeokit"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-bim-viewer"><meta property="og:site_name" content="xeokit-bim-viewer"><meta property="og:title" content="xeokit-bim-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="BIM viewer built on xeokit"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-bim-viewer"><meta property="twitter:description" content="BIM viewer built on xeokit"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-bim-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/BIMViewer.js~BIMViewer.html">BIMViewer</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#collision">collision</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/collision/ObjectsKdTree3.js~ObjectsKdTree3.html">ObjectsKdTree3</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/ThreeDMode.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
import {math} from "@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js";
|
||||
|
||||
const tempVec3a = math.vec3();
|
||||
|
||||
/** @private */
|
||||
class ThreeDMode extends Controller {
|
||||
|
||||
constructor(parent, cfg) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
if (!cfg.buttonElement) {
|
||||
throw "Missing config: buttonElement";
|
||||
}
|
||||
|
||||
this._saveOrthoActive = null;
|
||||
this._buttonElement = cfg.buttonElement;
|
||||
|
||||
this._cameraControlNavModeMediator = cfg.cameraControlNavModeMediator;
|
||||
|
||||
this._active = false;
|
||||
|
||||
this.on("enabled", (enabled) => {
|
||||
if (!enabled) {
|
||||
this._buttonElement.classList.add("disabled");
|
||||
} else {
|
||||
this._buttonElement.classList.remove("disabled");
|
||||
}
|
||||
});
|
||||
|
||||
this._buttonElement.addEventListener("click", (event) => {
|
||||
if (this.getEnabled()) {
|
||||
this.bimViewer._sectionTool.hideControl();
|
||||
this.setActive(!this.getActive(), () => { // Animated
|
||||
});
|
||||
}
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
this.bimViewer.on("reset", () => {
|
||||
this.setActive(true, () => { // Animated
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setEnabled(enabled) {
|
||||
super.setEnabled(enabled);
|
||||
this._saveOrthoActive = this.bimViewer._orthoMode.getActive();
|
||||
}
|
||||
|
||||
setActive(active, done) {
|
||||
if (this._active === active) {
|
||||
if (done) {
|
||||
done();
|
||||
}
|
||||
return;
|
||||
}
|
||||
this._active = active;
|
||||
if (active) {
|
||||
this._buttonElement.classList.add("active");
|
||||
if (done) {
|
||||
this._enterThreeDMode(() => {
|
||||
this.fire("active", this._active);
|
||||
done();
|
||||
});
|
||||
} else {
|
||||
this._enterThreeDMode();
|
||||
this.fire("active", this._active);
|
||||
}
|
||||
} else {
|
||||
this._buttonElement.classList.remove("active");
|
||||
if (done) {
|
||||
this._exitThreeDMode(() => {
|
||||
this.fire("active", this._active);
|
||||
done();
|
||||
});
|
||||
} else {
|
||||
this._exitThreeDMode();
|
||||
this.fire("active", this._active);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_enterThreeDMode(done) {
|
||||
|
||||
const viewer = this.viewer;
|
||||
const scene = viewer.scene;
|
||||
const aabb = scene.getAABB(scene.visibleObjectIds);
|
||||
const diag = math.getAABB3Diag(aabb);
|
||||
const center = math.getAABB3Center(aabb, tempVec3a);
|
||||
const dist = Math.abs(diag / Math.tan(65.0 / 2)); // TODO: fovy match with CameraFlight
|
||||
const camera = scene.camera;
|
||||
const dir = (camera.yUp) ? [-1, -1, -1] : [1, 1, 1];
|
||||
const up = (camera.yUp) ? [-1, 1, -1] : [-1, 1, 1];
|
||||
|
||||
viewer.cameraControl.pivotPos = center;
|
||||
|
||||
this.bimViewer._navCubeMode.setActive(true);
|
||||
this.bimViewer._firstPersonMode.setEnabled(true);
|
||||
this._cameraControlNavModeMediator.setThreeDModeActive(true);
|
||||
this.bimViewer._sectionTool.setEnabled(true);
|
||||
this.bimViewer._orthoMode.setEnabled(true);
|
||||
|
||||
if (done) {
|
||||
viewer.cameraFlight.flyTo({
|
||||
look: center,
|
||||
eye: [center[0] - (dist * dir[0]), center[1] - (dist * dir[1]), center[2] - (dist * dir[2])],
|
||||
up: up,
|
||||
orthoScale: diag * 1.3,
|
||||
duration: 1,
|
||||
projection: this._saveOrthoActive ? "ortho" : "perspective"
|
||||
}, () => {
|
||||
done();
|
||||
});
|
||||
} else {
|
||||
viewer.cameraFlight.jumpTo({
|
||||
look: center,
|
||||
eye: [center[0] - (dist * dir[0]), center[1] - (dist * dir[1]), center[2] - (dist * dir[2])],
|
||||
up: up,
|
||||
orthoScale: diag * 1.3,
|
||||
projection: this._saveOrthoActive ? "ortho" : "perspective"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_exitThreeDMode(done) {
|
||||
|
||||
const viewer = this.viewer;
|
||||
const scene = viewer.scene;
|
||||
const camera = scene.camera;
|
||||
const aabb = scene.getAABB(scene.visibleObjectIds);
|
||||
const look2 = math.getAABB3Center(aabb);
|
||||
const diag = math.getAABB3Diag(aabb);
|
||||
const fitFOV = 45; // fitFOV;
|
||||
const sca = Math.abs(diag / Math.tan(fitFOV * math.DEGTORAD));
|
||||
const orthoScale2 = diag * 1.3;
|
||||
const eye2 = tempVec3a;
|
||||
|
||||
eye2[0] = look2[0] + (camera.worldUp[0] * sca);
|
||||
eye2[1] = look2[1] + (camera.worldUp[1] * sca);
|
||||
eye2[2] = look2[2] + (camera.worldUp[2] * sca);
|
||||
|
||||
const up2 = math.mulVec3Scalar(camera.worldForward, -1, []);
|
||||
|
||||
this.bimViewer._sectionTool.setActive(false);
|
||||
this.bimViewer._firstPersonMode.setEnabled(false);
|
||||
|
||||
this._saveOrthoActive = this.bimViewer._orthoMode.getActive();
|
||||
this.bimViewer._orthoMode.setEnabled(false);
|
||||
|
||||
this._cameraControlNavModeMediator.setThreeDModeActive(false);
|
||||
|
||||
if (done) {
|
||||
viewer.cameraFlight.flyTo({
|
||||
eye: eye2,
|
||||
look: look2,
|
||||
up: up2,
|
||||
orthoScale: orthoScale2,
|
||||
projection: "ortho"
|
||||
}, () => {
|
||||
this.bimViewer._navCubeMode.setActive(false);
|
||||
});
|
||||
} else {
|
||||
viewer.cameraFlight.jumpTo({
|
||||
eye: eye2,
|
||||
look: look2,
|
||||
up: up2,
|
||||
orthoScale: orthoScale2,
|
||||
projection: "ortho"
|
||||
});
|
||||
this.bimViewer._navCubeMode.setActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export {ThreeDMode};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,177 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<base data-ice="baseUrl" href="../../../">
|
||||
<title data-ice="title">src/toolbar/Toolbar.js | xeokit-viewer</title>
|
||||
<link type="text/css" rel="stylesheet" href="css/style.css">
|
||||
<link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
|
||||
<script src="script/prettify/prettify.js"></script>
|
||||
<script src="script/manual.js"></script>
|
||||
<meta name="description" content="View large 3D BIM models in all major browsers and collaborate on issues using BCF"><meta property="og:type" content="website"><meta property="og:url" content="https://github.com/xeokit/xeokit-viewer"><meta property="og:site_name" content="xeokit-viewer"><meta property="og:title" content="xeokit-viewer"><meta property="og:image" content="./images/logo.jpg"><meta property="og:description" content="View large 3D BIM models in all major browsers and collaborate on issues using BCF"><meta property="og:author" content="http://xeolabs.com"><meta property="twitter:card" content="summary"><meta property="twitter:title" content="xeokit-viewer"><meta property="twitter:description" content="View large 3D BIM models in all major browsers and collaborate on issues using BCF"><meta property="twitter:image" content="./images/logo.jpg"></head>
|
||||
<body class="layout-container" data-ice="rootContainer">
|
||||
|
||||
<header>
|
||||
<a href="./" style="display: flex; align-items: center;"><img src="./image/brand_logo.jpg" style="width:34px;"></a>
|
||||
|
||||
<a href="identifiers.html">Reference</a>
|
||||
<a href="source.html">Source</a>
|
||||
|
||||
<div class="search-box">
|
||||
<span>
|
||||
<img src="./image/search.png">
|
||||
<span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
|
||||
</span>
|
||||
<ul class="search-result"></ul>
|
||||
</div>
|
||||
<a style="position:relative; top:3px;" href="https://github.com/xeokit/xeokit-viewer"><img width="20px" src="./image/github.png"></a></header>
|
||||
|
||||
<nav class="navigation" data-ice="nav"><div>
|
||||
<ul>
|
||||
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/Controller.js~Controller.html">Controller</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/ViewerUI.js~ViewerUI.html">ViewerUI</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#explorer">explorer</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/explorer/Classes.js~Classes.html">Classes</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/explorer/Explorer.js~Explorer.html">Explorer</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/explorer/Models.js~Models.html">Models</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/explorer/Objects.js~Objects.html">Objects</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/explorer/Storeys.js~Storeys.html">Storeys</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#server">server</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/server/Server.js~Server.html">Server</a></span></span></li>
|
||||
<li data-ice="doc"><a data-ice="dirPath" class="nav-dir-path" href="identifiers.html#toolbar">toolbar</a><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/BCFMode.js~BCFMode.html">BCFMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/FirstPersonMode.js~FirstPersonMode.html">FirstPersonMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/FitAction.js~FitAction.html">FitAction</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/HideMode.js~HideMode.html">HideMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/NavCubeMode.js~NavCubeMode.html">NavCubeMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/OrthoMode.js~OrthoMode.html">OrthoMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/QueryMode.js~QueryMode.html">QueryMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/ResetAction.js~ResetAction.html">ResetAction</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/SectionMode.js~SectionMode.html">SectionMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/SelectMode.js~SelectMode.html">SelectMode</a></span></span></li>
|
||||
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/src/toolbar/Toolbar.js~Toolbar.html">Toolbar</a></span></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="content" data-ice="content"><h1 data-ice="title">src/toolbar/Toolbar.js</h1>
|
||||
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {Controller} from "../Controller.js";
|
||||
import {SectionMode} from "./SectionMode.js";
|
||||
import {BCFMode} from "./BCFMode.js";
|
||||
import {HideMode} from "./HideMode.js";
|
||||
import {FirstPersonMode} from "./FirstPersonMode.js";
|
||||
import {OrthoMode} from "./OrthoMode.js";
|
||||
import {NavCubeMode} from "./NavCubeMode.js";
|
||||
import {FitAction} from "./FitAction.js";
|
||||
import {SelectMode} from "./SelectMode.js";
|
||||
import {QueryMode} from "./QueryMode.js";
|
||||
import {ResetAction} from "./ResetAction.js";
|
||||
|
||||
/**
|
||||
* @desc UI controller for a xeokit {@link Viewer} toolbar.
|
||||
*/
|
||||
class Toolbar extends Controller {
|
||||
|
||||
/** @private */
|
||||
constructor(parent, cfg = {}) {
|
||||
|
||||
super(parent, cfg);
|
||||
|
||||
/** Resets the viewer to the state right after the most recent model was loaded.
|
||||
* @type {ResetAction}
|
||||
*/
|
||||
this.reset = new ResetAction(this);
|
||||
|
||||
/** Flies the camera to show the entire model in view, from the current viewing angle.
|
||||
* @type {FitAction}
|
||||
*/
|
||||
this.fit = new FitAction(this);
|
||||
|
||||
/**
|
||||
* Controls first person mode.
|
||||
* @type {FirstPersonMode}
|
||||
*/
|
||||
this.firstPerson = new FirstPersonMode(this, {
|
||||
active: false
|
||||
});
|
||||
|
||||
/**
|
||||
* Controls orthographic mode.
|
||||
* @type {OrthoMode}
|
||||
*/
|
||||
this.ortho = new OrthoMode(this, {
|
||||
active: false
|
||||
});
|
||||
|
||||
/** Click-to-hide mode.
|
||||
* @type {HideMode}
|
||||
*/
|
||||
this.hide = new HideMode(this, {
|
||||
active: false
|
||||
});
|
||||
|
||||
/** Click-to-select mode.
|
||||
* @type {SelectMode}
|
||||
*/
|
||||
this.select = new SelectMode(this, {
|
||||
active: false
|
||||
});
|
||||
|
||||
/** Click-to-query-element mode.
|
||||
* @type {QueryMode}
|
||||
*/
|
||||
this.query = new QueryMode(this, {
|
||||
queryPanelId: cfg.queryPanelId,
|
||||
active: false
|
||||
});
|
||||
|
||||
/**
|
||||
* Controls section planes.
|
||||
* @type {SectionMode}
|
||||
*/
|
||||
this.section = new SectionMode(this, {
|
||||
sectionPlanesOverviewCanvasId: cfg.sectionPlanesOverviewCanvasId,
|
||||
active: false
|
||||
});
|
||||
|
||||
/**
|
||||
* Manages BCF viewpoints.
|
||||
* @type {BCFMode}
|
||||
*/
|
||||
this.bcf = new BCFMode(this, {
|
||||
bcfPanelId: cfg.bcfPanelId,
|
||||
active: false
|
||||
});
|
||||
|
||||
/**
|
||||
* Controls the NavCube.
|
||||
* @type {NavCubeMode}
|
||||
*/
|
||||
this.navCube = new NavCubeMode(this, {
|
||||
navCubeCanvasId: cfg.navCubeCanvasId,
|
||||
active: true
|
||||
});
|
||||
|
||||
this._mutexActivation([this.query, this.hide, this.select, this.section, this.bcf]);
|
||||
|
||||
this.firstPerson.setActive(false);
|
||||
this.ortho.setActive(false);
|
||||
this.navCube.setActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
export {Toolbar};</code></pre>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(1.1.0)</span><img src="./image/esdoc-logo-mini-black.png"></a>
|
||||
</footer>
|
||||
|
||||
<script src="script/search_index.js"></script>
|
||||
<script src="script/search.js"></script>
|
||||
<script src="script/pretty-print.js"></script>
|
||||
<script src="script/inherited-summary.js"></script>
|
||||
<script src="script/test-summary.js"></script>
|
||||
<script src="script/inner-link.js"></script>
|
||||
<script src="script/patch-for-local.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user