Skip to content

Commit

Permalink
Fixed the sandbox (#2147)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandruPopovici authored Mar 19, 2024
1 parent b62b5a6 commit e406c5d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
4 changes: 3 additions & 1 deletion packages/viewer-sandbox/src/Extensions/CameraPlanes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export class CameraPlanes extends Extension {

public constructor(viewer: IViewer) {
super(viewer)
this.camerController = viewer.getExtension(CameraController)
this.camerController = viewer.getExtension(
CameraController as new () => CameraController
)
}

public onEarlyUpdate(): void {
Expand Down
28 changes: 1 addition & 27 deletions packages/viewer-sandbox/src/Sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ export default class Sandbox {
title: 'Screenshot'
})
screenshot.on('click', async () => {
// console.warn(await this.viewer.screenshot())
console.warn(await this.viewer.screenshot())
// const start = performance.now()
// const nodes = this.viewer.getWorldTree().root.all(
// // eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand All @@ -465,22 +465,6 @@ export default class Sandbox {
// this.viewer.cancelLoad(
// 'https://latest.speckle.dev/streams/97750296c2/objects/c3138e24a866d447eb86b2a8107b2c09'
// )
'3841e3cbc45d52c47bc2f1b7b0ad4eb9'
const selectedObjects = this.viewer
.getExtension(SelectionExtension)
.getSelectedObjects()
.map((obj: { id: unknown }) => obj.id)
if (selectedObjects.length)
this.viewer.getExtension(SelectionExtension).clearSelection()
const filteringState = this.viewer
.getExtension(FilteringExtension)
.hideObjects(['3841e3cbc45d52c47bc2f1b7b0ad4eb9'], 'default', true, false)
if (!filteringState.selectedObjects)
filteringState.selectedObjects = selectedObjects

this.viewer
.getExtension(SelectionExtension)
.selectObjects(filteringState.selectedObjects)
})

const rotate = this.tabs.pages[0].addButton({
Expand Down Expand Up @@ -984,17 +968,7 @@ export default class Sandbox {
const data = this.properties.find((value) => {
return value.key === this.filterParams.filterBy
}) as PropertyInfo
data.min = 90.37
data.max = 258.17
this.viewer.getExtension(FilteringExtension).setColorFilter(data)
// this.viewer
// .getExtension(FilteringExtension)
// .isolateObjects(['2f2ab0d53fc998bd34581e6ac8593eaa'], 'isolate', true, true)
// this.viewer
// .getExtension(FilteringExtension)
// .setUserObjectColors([
// { objectIds: ['2f2ab0d53fc998bd34581e6ac8593eaa'], color: '#ff0000' }
// ])
this.pane.refresh()
})

Expand Down
2 changes: 1 addition & 1 deletion packages/viewer-sandbox/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ const getStream = () => {
// 'https://latest.speckle.dev/streams/aea12cab71/commits/787ade768e'
// 'https://speckle.xyz/streams/a29e5c7772/commits/a8cfae2645'
// 'https://latest.speckle.dev/streams/9d71f041b2/commits/01279333e5'
'https://latest.speckle.dev/streams/65c512f4ea/commits/cc2490830a'
// 'https://latest.speckle.dev/streams/65c512f4ea/commits/cc2490830a'
// 'https://latest.speckle.dev/streams/65c512f4ea/objects/882497528d1fa06660c28c1fd6aa15e0'
// 'https://speckle.xyz/streams/b4086833f8/commits/94df4c6d16'

Expand Down

0 comments on commit e406c5d

Please sign in to comment.