Initial import of NODEDC BIM Viewer

This commit is contained in:
CODEX
2026-06-04 13:25:42 +03:00
commit 9aaf82862f
2075 changed files with 3592575 additions and 0 deletions
+200
View File
@@ -0,0 +1,200 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<base data-ice="baseUrl" href="../../../">
<title data-ice="title">src/server/Server.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/server/Server.js</h1>
<pre class="source-code line-number raw-source-code"><code class="prettyprint linenums" data-ice="content">import {utils} from &quot;@xeokit/xeokit-sdk/dist/xeokit-sdk.es.js&quot;;
/**
* Default server client which loads content for a {@link BIMViewer} via HTTP from the file system.
*
* A BIMViewer is instantiated with an instance of this class.
*
* To load content from an alternative source, instantiate BIMViewer with your own custom implementation of this class.
*/
class Server {
/**
* Constructs a Server.
*
* @param {*} [cfg] Server configuration.
* @param {String} [cfg.dataDir] Base directory for content.
*/
constructor(cfg = {}) {
this._dataDir = cfg.dataDir || &quot;&quot;;
}
/**
* Gets information on all available projects.
*
* @param {Function} done Callback through which the JSON result is returned.
* @param {Function} error Callback through which an error message is returned on error.
*/
getProjects(done, error) {
const url = this._dataDir + &quot;/projects/index.json&quot;;
utils.loadJSON(url, done, error);
}
/**
* Gets information for a project.
*
* @param {String} projectId ID of the project.
* @param {Function} done Callback through which the JSON result is returned.
* @param {Function} error Callback through which an error message is returned on error.
*/
getProject(projectId, done, error) {
const url = this._dataDir + &quot;/projects/&quot; + projectId + &quot;/index.json&quot;;
utils.loadJSON(url, done, error);
}
/**
* Gets metadata for a model within a project.
*
* @param {String} projectId ID of the project.
* @param {String} modelId ID of the model.
* @param {Function} done Callback through which the JSON result is returned.
* @param {Function} error Callback through which an error message is returned on error.
*/
getMetadata(projectId, modelId, done, error) {
const url = this._dataDir + &quot;/projects/&quot; + projectId + &quot;/models/&quot; + modelId + &quot;/metadata.json&quot;;
utils.loadJSON(url, done, error);
}
/**
* Gets geometry for a model within a project.
*
* @param {String} projectId ID of the project.
* @param {String} modelId ID of the model.
* @param {Function} done Callback through which the JSON result is returned.
* @param {Function} error Callback through which an error message is returned on error.
*/
getGeometry(projectId, modelId, done, error) {
const url = this._dataDir + &quot;/projects/&quot; + projectId + &quot;/models/&quot; + modelId + &quot;/geometry.xkt&quot;;
utils.loadArraybuffer(url, done, error);
}
/**
* Gets metadata for an object within a model within a project.
*
* @param {String} projectId ID of the project.
* @param {String} modelId ID of the model.
* @param {String} objectId ID of the object.
* @param {Function} done Callback through which the JSON result is returned.
* @param {Function} error Callback through which an error message is returned on error.
*/
getObjectInfo(projectId, modelId, objectId, done, error) {
const url = this._dataDir + &quot;/projects/&quot; + projectId + &quot;/models/&quot; + modelId + &quot;/props/&quot; + objectId + &quot;.json&quot;;
utils.loadJSON(url, done, error);
}
/**
* Gets existing issues for a model within a project.
*
* @param {String} projectId ID of the project.
* @param {String} modelId ID of the model.
* @param {Function} done Callback through which the JSON result is returned.
* @param {Function} error Callback through which an error message is returned on error.
*/
getIssues(projectId, modelId, done, error) {
const url = this._dataDir + &quot;/projects/&quot; + projectId + &quot;/models/&quot; + modelId + &quot;/issues.json&quot;;
utils.loadJSON(url, done, error);
}
/**
* Gets a JSON manifest file for a model that&apos;s split into multiple XKT files (and maybe also JSON metadata files).
*
* The manifest can have an arbitrary name, and will list all the XKT (and maybe separate JSON metada files)
* that comprise the model.
*
* @param {String} projectId ID of the project.
* @param {String} modelId ID of the model.
* @param {String} manifestName Filename of the manifest.
* @param {Function} done Callback through which the JSON result is returned.
* @param {Function} error Callback through which an error message is returned on error.
*/
getSplitModelManifest(projectId, modelId, manifestName, done, error) {
const url = this._dataDir + &quot;/projects/&quot; + projectId + &quot;/models/&quot; + modelId + &quot;/&quot; + manifestName;
utils.loadJSON(url, done, error);
}
/**
* Gets one of the metadata files within a split model within a project.
*
* @param {String} projectId ID of the project.
* @param {String} modelId ID of the model.
* @param {String} metadataFileName Filename of the metadata file.
* @param {Function} done Callback through which the JSON result is returned.
* @param {Function} error Callback through which an error message is returned on error.
*/
getSplitModelMetadata(projectId, modelId, metadataFileName, done, error) {
const url = this._dataDir + &quot;/projects/&quot; + projectId + &quot;/models/&quot; + modelId + &quot;/&quot; + metadataFileName;
utils.loadJSON(url, done, error);
}
/**
* Gets one of the XKT geometry files within a split model within a project.
*
* @param {String} projectId ID of the project.
* @param {String} modelId ID of the model.
* @param {String} geometryFileName Filename of the XKT geometry file.
* @param {Function} done Callback through which the JSON result is returned.
* @param {Function} error Callback through which an error message is returned on error.
*/
getSplitModelGeometry(projectId, modelId, geometryFileName, done, error) {
const url = this._dataDir + &quot;/projects/&quot; + projectId + &quot;/models/&quot; + modelId + &quot;/&quot; + geometryFileName;
utils.loadArraybuffer(url, done, error);
}
}
export {Server};</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>