-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathscan-obb-aligner.pug
106 lines (102 loc) · 4.5 KB
/
scan-obb-aligner.pug
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
doctype html
html(lang="en")
head
title= "Scan OBB Alignment"
meta(charset= "UTF-8")
link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css')
link(rel='stylesheet', href='https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css')
link(rel='stylesheet', href='https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.3/themes/default/style.min.css')
link(rel='stylesheet', href='//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.min.css')
link(rel='stylesheet', href='//cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.4.2/jquery.contextMenu.min.css')
link(rel='stylesheet', href=`${baseUrl}/css/common.css`)
link(rel='stylesheet', href=`${baseUrl}/css/search-panel.css`)
link(rel='stylesheet', href=`${baseUrl}/css/model-viewer.css`)
body
// UI Markup
#main
#canvas
#alert.alert(style="display:none")
button.close(type="button", onclick="hideAlert()") ×
span#alertMessage
#accordion.overlay.panel-group(style='top:80px; left:10px; max-height:100vh; overflow:auto;')
.panel.panel-default
h4.panel-heading.panel-title.collapsed(data-toggle='collapse', data-target='#partsPanel') Parts
#partsPanel.panel-body.panel-collapse.collapse
p#partTypeSelectDiv
label(for="partType") Part Type
select#partType
p#labelTypeSelectDiv
label(for="labelType") Label
select#labelType
p#showSegmentsDiv
#instructionsPanel.roundBorder.grayBackground
span Instructions
p#instructions
#namesPanel.overlay.btn-group.btn-group-vertical
#nameButtonsDiv.btn-group.btn-group-vertical
script(src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js")
script(src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js")
script(src="//cdnjs.cloudflare.com/ajax/libs/jquery-contextmenu/2.4.2/jquery.contextMenu.min.js")
script(src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js")
// Special bootbox
script(src=`${baseUrl}/client/js/vendor/bootbox.form.min.js`)
script(src=`${baseUrl}/three.min.js`)
script(src=`${baseUrl}/STK.bundle.js`)
link(rel='stylesheet', href=`${baseUrl}/css/datgui-light.css`)
script.
var defaultPaletteName = 'd3_category19p';
var paletteName = STK.util.getUrlParam('palette') || defaultPaletteName;
var partType = STK.util.getUrlParam('partType') || 'surfaces';
STK.Constants.defaultPalette = STK.Colors.palettes[paletteName] || STK.Colors.palettes[defaultPaletteName];
var canvas = document.getElementById('canvas');
var modelViewer = new STK.ModelViewer({
appId: 'MultiscanObbAligner.v1-20220823',
container: canvas,
sources: ['vf'],
showSearchOptions: false,
allowCameraControlToggle: false,
allowPrevNext: false,
useNewImages: true,
saveImageModifierKey: 'ctrl',
partsPanel: {
partTypes: ['none', partType],
labelTypes: ['Label', 'Object'],
defaultPartType: partType,
defaultLabelType: 'Object',
neutralColor: STK.util.getUrlParam('neutralColor'),
useColorSequence: true,
showOBBs: true,
allowObbAdjustment: true
}
});
modelViewer.Subscribe('Launch', modelViewer, function () {
modelViewer.showLoadingIcon(true);
});
var modelId = STK.util.getUrlParam('modelId');
modelViewer.launch();
modelViewer.assetManager.registerCustomAssetGroups({
assetFiles: STK.Constants.scanAssetsFile,
filterByAssetId: modelId,
callback: function(err, res) {
if (!err) {
if (modelId != undefined) {
var modelIdParts = modelId.split('.');
modelViewer.setSourceAndSearch(modelViewer.modelSearchController, modelIdParts[0], 'fullId:' + modelId);
} else {
modelViewer.showLoadingIcon(false);
}
}
}
});
$('#partsPanel').collapse('show')
$('#images').on('shown.bs.collapse', function () {
modelViewer.modelImagesPanel.onResize();
});
$('#instructions').hide();
$('#instructionsPanel').click(function () {
$('#instructions').toggle();
});
// Make various components draggable
$('#namesPanel').draggable();
$('#instructionsPanel').draggable();
window.app = modelViewer; // For console debugging