forked from autodesk-tandem/tandem-sample-emb-viewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
214 lines (210 loc) · 15.6 KB
/
index.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html>
<head>
<title>TandemTestBed (JS)</title>
<!--<script src="node_modules/@adsk/lmv-double-trouble/build/viewer3D.js"></script>-->
<script src="https://tandem.autodesk.com/viewer/viewer3D.js"></script>
<!--<script src="https://tandem-stg.autodesk.com/viewer/viewer3D.js"></script>-->
<script src="./3rdParty/jquery-3.6.0.min.js"></script>
<script src="./3rdParty/bootstrap-4.0.0/dist/js/bootstrap.bundle.js"></script>
<!-- CSS only -->
<!--<link href="node_modules/@adsk/lmv-double-trouble/build/style.min.css" rel="stylesheet" type="text/css">-->
<link href="https://tandem.autodesk.com/viewer/style.min.css" rel="stylesheet" type="text/css">
<!--<link href="https://tandem-stg.autodesk.com/viewer/style.min.css" rel="stylesheet" type="text/css">-->
<link href="./3rdParty/bootstrap-4.0.0/dist/css/bootstrap.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- this is the Nav Bar across the top -->
<nav class="navbar navbar-light bg-light justify-content-between">
<form class="form-inline">
<a class="btn my-2 my-sm-0" target="_blank" rel="noreferrer noopener" href="https://intandem.autodesk.com">
<img src="./images/autodesk-tandem-small-social-400.png" width="30" height="30" class="d-inline-block align-top" alt="Tandem">
</a>
<h5>Tandem Test Bed (JavaScript SDK)</h5>
</form>
<form class="form-inline">
<label class="mr-sm-2" for="facilityPicker">Facility</label>
<select id="facilityPicker" class="form-control custom-select custom-select-sm" name="facilityToLoad">
<!-- Options filled in by function in index.js -->
</select>
</form>
<form class="form-inline">
<a class="btn btn-outline-success btn-sm" href="#" id="btn_login">Login</a>
<a class="btn btn-outline-dark btn-sm" href="#" id="btn_logout">Logout</a>
<a class="btn" target="_blank" rel="noreferrer noopener" href="https://accounts.autodesk.com/users/@me/view">
<img style="" src="./images/genericProfile.png" width="40" height="40" class="rounded-circle" alt="User" id="btn_userProfile"/>
</a>
<a class="btn" target="_blank" rel="noreferrer noopener" href="https://github.com/autodesk-tandem/tandem-sample-emb-viewer">
<img style="" src="https://github.githubassets.com/favicons/favicon.png"/>
</a>
</form>
</nav>
<!-- the rest is the Viewer window and the Stub Menus -->
<div class="container d-flex justify-content-start">
<div class="row">
<div style="left:0; position: absolute; display: flex; align-items: stretch; height: calc(100% - 75px); width: calc(100%);">
<div style="position:relative; flex-grow: 1;">
<div id="viewer" style="height: 100%; width: 100%;">
<!--Viewer will mount here-->
</div>
<!-- <div id="hud" style="position: absolute; top: 20px; left: 20px; z-index: 10; visibility: hidden;">
<select id="facilityPicker" style="width: 300px;"></select>
</div>-->
</div>
<div class="col-md-4" id="wo_pane">
<div class="row form-group mt-5">
<div class="col-md dropdown dropright"> <!--Dropdown menu for Tandem stubs -->
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuFacility" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Facility Stubs
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuFacility">
<button class="dropdown-item" type="button" id="btn_dumpFacilityInfo">Dump Facility Info</button>
<button class="dropdown-item" type="button" id="btn_dumpAppInfo">Dump App Info</button>
<button class="dropdown-item" type="button" id="btn_dumpDtConstants">Dump DT constants</button>
<button class="dropdown-item" type="button" id="btn_loadFacilityUsageMetrics">Load Facility Usage Metrics</button>
</div>
</div>
</div>
<div class="row form-group">
<div class="col-md dropdown dropright"> <!--Dropdown menu for Model stubs -->
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuModel" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Model Stubs
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuModel">
<button class="dropdown-item" type="button" id="btn_dumpModelInfo">Dump Model Info</button>
<button class="dropdown-item" type="button" id="btn_getModelHistory">Get Model History</button>
<button class="dropdown-item" type="button" id="btn_getModelUsageMetrics">Get Model Usage Metrics</button>
<button class="dropdown-item" type="button" id="btn_getLevels">Get Levels</button>
<button class="dropdown-item" type="button" id="btn_getRooms">Get Rooms</button>
<button class="dropdown-item" type="button" id="btn_showElementsInRoom">Show Elements In Room</button>
<button class="dropdown-item" type="button" id="btn_dbIdsToPersistentIds">Viewer Ids --> Element Ids</button>
</div>
</div>
</div>
<div class="row form-group">
<div class="col-md dropdown dropright"> <!--Dropdown menu for Property stubs -->
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuProps" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Property Stubs
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuProps">
<button class="dropdown-item" type="button" id="btn_getQualifiedPropName">Get Qualified Prop Name</button>
<button class="dropdown-item" type="button" id="btn_getProperties">Get Properties</button>
<button class="dropdown-item" type="button" id="btn_getPropertiesWithHistory">Get Properties (with history)</button>
<button class="dropdown-item" type="button" id="btn_getCommonProperties">Get Common Properties</button>
<button class="dropdown-item" type="button" id="btn_getPropertySelSet">Get Property (selSet)</button>
<button class="dropdown-item" type="button" id="btn_findElementsWherePropValueEqualsX">Find Elements Where PropValue = X</button>
<button class="dropdown-item" type="button" id="btn_setPropertySelSet">Set Property (selSet)</button>
<button class="dropdown-item" type="button" id="btn_assignClassification">Assign Classification</button>
</div>
</div>
</div>
<div class="row form-group">
<div class="col-md dropdown dropright"> <!--Dropdown menu for Tandem Document link stubs -->
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuDocs" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Document Stubs
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuDocs">
<button class="dropdown-item" type="button" id="btn_getFacilityDocuments">Get Facility Documents</button>
<button class="dropdown-item" type="button" id="btn_getDocument">Get Document</button>
<button class="dropdown-item" type="button" id="btn_deleteDocument">Delete Document</button>
</div>
</div>
</div>
<div class="row form-group">
<div class="col-md dropdown dropright"> <!--Dropdown menu for Event stubs -->
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuEv" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Event Stubs
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuEv">
<button class="dropdown-item" type="button" id="btn_addEventListeners">Add Event Listeners</button>
<button class="dropdown-item disabled" type="button" id="btn_removeEventListeners">Remove Event Listeners</button>
</div>
</div>
</div>
<div class="row form-group">
<div class="col-md dropdown dropright"> <!--Dropdown menu for Event stubs -->
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuEv" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Stream Stubs
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuEv">
<button class="dropdown-item" type="button" id="btn_dumpStreamManager">Dump Stream Manager</button>
<button class="dropdown-item" type="button" id="btn_getStreamIds">Get Stream IDs</button>
<button class="dropdown-item" type="button" id="btn_getLastReadings">Get Last Readings</button>
<button class="dropdown-item" type="button" id="btn_refreshStreamsLastReadings">Refresh Last Readings</button>
<button class="dropdown-item" type="button" id="btn_getStreamBulkRollups">Get Stream Bulk Rollups (last year)</button>
<button class="dropdown-item" type="button" id="btn_exportStreamsToJson">Export Streams to JSON</button>
<button class="dropdown-item" type="button" id="btn_getAllStreamInfos">Get All Stream Infos</button>
<button class="dropdown-item" type="button" id="btn_getAllStreamInfosFromCache">Get All Stream Infos from Cache</button>
<button class="dropdown-item" type="button" id="btn_getAllConnectedAttributes">Get All Connected Attributes</button>
<button class="dropdown-item" type="button" id="btn_getAttributeCandidates">Get Attribute Candidates</button>
<button class="dropdown-item" type="button" id="btn_getStreamSecrets">Get Stream Secrets</button>
<button class="dropdown-item" type="button" id="btn_resetStreamSecrets">Reset Stream Secrets</button>
<button class="dropdown-item" type="button" id="btn_getStreamsBulkImportTemplate">Get Stream Bulk Import Template</button>
<button class="dropdown-item" type="button" id="btn_createStream">Create Stream</button>
<button class="dropdown-item" type="button" id="btn_deleteStream">Delete Stream</button>
<button class="dropdown-item" type="button" id="btn_getStreamIngestionUrls">Get Stream Ingestion URLs</button>
</div>
</div>
</div>
<div class="row form-group">
<div class="col-md dropdown dropright"> <!-- Dropdown menu for Viewer stubs -->
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuVw" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Viewer Stubs
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuVw">
<button class="dropdown-item" type="button" id="btn_addSprites">Add Sprites (to SelSet)</button>
<button class="dropdown-item" type="button" id="btn_removeSprites">Remove Sprites</button>
<button class="dropdown-item" type="button" id="btn_getCurrentSelSet">Get Current Selection</button>
<button class="dropdown-item" type="button" id="btn_isolateCurrentSelSet">Isolate Current Selection</button>
<button class="dropdown-item" type="button" id="btn_focusCurrentSelSet">Focus / FitToView</button>
<button class="dropdown-item" type="button" id="btn_showAllObjects">Show all objects</button>
<button class="dropdown-item" type="button" id="btn_getAllElements">Get All Elements</button>
<button class="dropdown-item" type="button" id="btn_getAllVisibleDbIds">Get All Visible Elements</button>
<button class="dropdown-item" type="button" id="btn_selectAllVisibleElements">Select All Visible Elements</button>
<button class="dropdown-item" type="button" id="btn_getHiddenElementsByModel">Get Hidden Elements By Model</button>
<button class="dropdown-item" type="button" id="btn_hideModel">Hide Model</button>
<button class="dropdown-item" type="button" id="btn_showModel">Show Model</button>
<button class="dropdown-item" type="button" id="btn_scrapeGeometry">Scrape Geometry</button>
<button class="dropdown-item" type="button" id="btn_getSavedViews">Get Saved Views</button>
<button class="dropdown-item" type="button" id="btn_gotoSavedView">Go To Saved View</button>
</div>
</div>
</div>
<div class="row form-group mt-5">
<div class="col-md-8">
<p class="text-muted bg-light font-italic">NOTE: output from stub functions goes to the Chrome debugger window. Make sure to open the Chrome Developer Tools.</p>
</div>
</div>
</div>
</div>
</div>
<!-- The following mechanism loads in partial HTML that defines a modal dialog to get input for
some of the stub funcitons. It will inject the HTML from the given path and then then the
bound JS functions in index.js will retrieve the values and call the appropriate functions
with the given input -->
<script>
$(function(){
$("#stubInputInject_GetPropertyName").load("./stubInput/getPropertyName.html", "#stubInput_getPropertyName");
$("#stubInputInject_GetPropertyFilter").load("./stubInput/getPropertyFilter.html", "#stubInput_getPropertyFilter");
$("#stubInputInject_SetPropertyValue").load("./stubInput/setPropertyValue.html", "#stubInput_setPropertyValue");
$("#stubInputInject_SetClassification").load("./stubInput/setClassification.html", "#stubInput_setClassification");
$("#stubInputInject_GetURN").load("./stubInput/getURN.html", "#stubInput_getURN");
$("#stubInputInject_GetUUID").load("./stubInput/getUUID.html", "#stubInput_getUUID");
$("#stubInputInject_GetKey").load("./stubInput/getKey.html", "#stubInput_getKey");
$("#stubInputInject_GetName").load("./stubInput/getName.html", "#stubInput_getName");
$("#stubInputInject_GetInt").load("./stubInput/getInt.html", "#stubInput_getInt");
});
</script>
<div id="stubInputInject_GetPropertyName"></div>
<div id="stubInputInject_GetPropertyFilter"></div>
<div id="stubInputInject_SetPropertyValue"></div>
<div id="stubInputInject_SetClassification"></div>
<div id="stubInputInject_GetURN"></div>
<div id="stubInputInject_GetUUID"></div>
<div id="stubInputInject_GetKey"></div>
<div id="stubInputInject_GetName"></div>
<div id="stubInputInject_GetInt"></div>
<!-- this is the JS module that kicks off login and loading of the Tandem Viewer -->
<script type="module" src="./index.js"></script>
</body>
</html>