Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/viewer/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ let primMap: { [path: string]: ComposedObject } = {};
let currentPathMapping: any = null;
let rootPrim: ComposedObject | null = null;

export function getPostCompositionJson() {
return rootPrim;
}

let selectedObject: any = null;
let selectedDom: HTMLElement | null = null;

Expand Down
30 changes: 28 additions & 2 deletions web/viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
background: #666;
line-height: 2em;
border-bottom: solid 1px #555;
overflow: hidden;
}

.header h1 {
Expand Down Expand Up @@ -217,12 +218,32 @@
.error-modal .message::before {
content: '\26A0 \A0 \A0';
}

#showComposition {
float: right;
display: inline-flex;
align-items: center;
justify-content: center;
height: 100%;
aspect-ratio: 1;
color: #eee;
text-decoration: none;
border-left: solid 1px #555;
background: #ffffff12;
}

#showComposition:hover {
background: #ffffff24;
}
</style>
</head>

<body>
<div class="container">
<div class="header"><h1>IFC5 view <span>BETA - IFC 5 is still heavily under development. Software tools (including this viewer), the IFC 5 datamodel, schema and examples are under constant change.</span></h1></div>
<div class="header">
<a href="#" id="showComposition" class="material-symbols-outlined" title="Show post-composition JSON">code</a>
<h1>IFC5 view <span>BETA - IFC 5 is still heavily under development. Software tools (including this viewer), the IFC 5 datamodel, schema and examples are under constant change.</span></h1>
</div>
<div class='layers'>
<h2>Layer browser (lower takes priority)</h2>
<div></div>
Expand Down Expand Up @@ -261,7 +282,12 @@ <h2>Selection attributes</h2>
}
</script>
<script type="module">
import addModel from './render.mjs';
import addModel, { getPostCompositionJson } from './render.mjs';

document.querySelector('#showComposition').addEventListener('click', (event) => {
event.preventDefault();
window.open(URL.createObjectURL(new Blob([JSON.stringify(getPostCompositionJson(), null, 2)], { type: 'application/json' })));
});

document.querySelector('#fileForm').addEventListener('submit', function(event) {
event.preventDefault();
Expand Down