-
Notifications
You must be signed in to change notification settings - Fork 1
/
ifc-debug.html
107 lines (84 loc) · 4.52 KB
/
ifc-debug.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
<meta content="xeokit - SDK for Browser-Based 3D BIM Visualization" name="description">
<meta content="Lindsay Kay" name="author">
<meta content="BIM,IFC,WebGL,JavaScript,Browser,BCF,Web,xeolabs,3D,3D Viewer,Lindsay Kay,xeokit,MedViz,ArchViz,Open Source,Browser,Viewer"
name="keywords">
<title>xeokit - 3D Web Programming Toolkit for BIM and Engineering Visualization</title>
<link href="./vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="./css/business-frontpage.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Rubik" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="./css/viewer.css" rel="stylesheet">
<script src="./vendor/jquery/jquery.min.js"></script>
<script src="./vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
</head>
<body data-offset="50" data-spy="scroll" data-target=".navbar">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top ">
<span style="color: #ffffff;"><a class="navbar-home" href="http://xeolabs.com">xeolabs</a>/<a class="navbar-parent"
href="https://xeokit.io">xeokit SDK</a>/<a
class="navbar-parent" href="./ifc-index.html">Model Conversion</a>/<a class="navbar-parent" href="./ifc-tests.html">IFC Conversion Tests</a>/</span><span
class="navbar-brand" href="./ifc-debug.html">Debug XKT</span>
</nav>
<div id="body">
<div class="row no-gutters pl-0">
<div class="col-12 pt-3">
<div id="modelConversionInfo"><h1 class="pl-3"><a href="./ifc-tests.html"><<</a> Loading page...</h1>
<a class="pl-3" href="./convertedModels/ifc/projects/${projectId}/models/${modelId}/log.txt">Conversion Log</a><br><br></div>
</div>
</div>
<div class="row no-gutters">
<div class="col-3 pl-2">
<div class="input-group mb-3">
<input type="text" id="isolateInput" class="form-control" placeholder="Enter object ID...">
<div class="input-group-append">
<button class="btn btn-primary" type="button" id="isolateButton">Isolate object</button>
</div>
</div>
<h5 class="pt-2 pl-2" id="infoArea">IFC Types:</h5>
<div id="treeViewContainer"></div>
</div>
<div class="col-9 text-center">
<canvas id="viewerCanvas"/>
</div>
</div>
<canvas id="navCubeCanvas"></canvas>
</div>
</body>
<script type="module">
document.getElementById("modelConversionInfo").innerHTML = `<h1 class="pl-3"><a href="./ifc-tests.html"><<</a> Loading scripts...</h1><a class="pl-3">Conversion Log</a><br><br>`;
const reqParams = getRequestParams();
const projectId = reqParams.projectId;
const modelId = reqParams.modelId;
import {createViewer, isolateObject} from "./lib/viewer.js";
function getRequestParams() {
const vars = {};
window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, (m, key, value) => {
vars[key] = value;
});
return vars;
}
document.getElementById("modelConversionInfo").innerHTML = `<h1 class="pl-3"><a href="./ifc-tests.html"><<</a> Loading model...</h1><a class="pl-3" href="">Conversion Log</a><br><br>`;
const {viewer, xktLoader} = createViewer({
canvasId: "viewerCanvas",
navCubeCanvasId: "navCubeCanvas",
treeViewContainerId: "treeViewContainer",
manifestSrc: `./convertedModels/ifc/projects/${projectId}/models/${modelId}/model.xkt.manifest.json`,
onLoaded:()=>{
document.getElementById("modelConversionInfo").innerHTML = `<h1 class="pl-3"><a href="./ifc-tests.html"><<</a> ${modelId}</h1><a class="pl-3" href="./convertedModels/ifc/projects/${projectId}/models/${modelId}/log.txt">Conversion Log</a><br><br>`;
}
});
function doIsolate() {
const searchText = document.getElementById('isolateInput').value.trim();
if (searchText.trim() === '') {
return;
}
isolateObject(searchText)
}
document.getElementById('isolateButton').addEventListener('click', doIsolate);
window.viewer = viewer;
</script>
</html>