Skip to content

Commit

Permalink
fix: FragmentTree must not be a tool (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
HoyosJuan authored Jan 17, 2024
1 parent 29313fb commit 50c0f3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
5 changes: 1 addition & 4 deletions resources/openbim-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -104482,7 +104482,6 @@ class FragmentTree extends Component {
this.onHovered = new Event();
this._title = "Model Tree";
this.uiElement = new UIElement();
this.components.tools.add(FragmentTree.uuid, this);
}
get() {
if (!this._tree) {
Expand All @@ -104505,7 +104504,7 @@ class FragmentTree extends Component {
if (this._tree) {
await this._tree.dispose();
}
await this.onDisposed.trigger(FragmentTree.uuid);
await this.onDisposed.trigger();
this.onDisposed.reset();
}
async update(groupSystems) {
Expand Down Expand Up @@ -104563,8 +104562,6 @@ class FragmentTree extends Component {
return groups;
}
}
FragmentTree.uuid = "5af6ebe1-26fc-4053-936a-801b6c7cb37e";
ToolComponent.libraryUUIDs.add(FragmentTree.uuid);

// TODO: Clean up
// TODO: Improve UI element
Expand Down
12 changes: 3 additions & 9 deletions src/fragments/FragmentTree/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ import {
UIElement,
} from "../../base-types";
import { FragmentTreeItem } from "./src/tree-item";
import { Components, ToolComponent } from "../../core";
import { Components } from "../../core";
import { FragmentClassifier } from "../FragmentClassifier";
import { Button, FloatingWindow } from "../../ui";

export class FragmentTree
extends Component<FragmentTreeItem>
implements UI, Disposable
{
static readonly uuid = "5af6ebe1-26fc-4053-936a-801b6c7cb37e" as const;

/** {@link Disposable.onDisposed} */
readonly onDisposed = new Event<string>();
readonly onDisposed = new Event<undefined>();

enabled: boolean = true;
onSelected = new Event<{ items: FragmentIdMap; visible: boolean }>();
Expand All @@ -31,8 +29,6 @@ export class FragmentTree

constructor(components: Components) {
super(components);

this.components.tools.add(FragmentTree.uuid, this);
}

get(): FragmentTreeItem {
Expand Down Expand Up @@ -63,7 +59,7 @@ export class FragmentTree
if (this._tree) {
await this._tree.dispose();
}
await this.onDisposed.trigger(FragmentTree.uuid);
await this.onDisposed.trigger();
this.onDisposed.reset();
}

Expand Down Expand Up @@ -136,5 +132,3 @@ export class FragmentTree
return groups;
}
}

ToolComponent.libraryUUIDs.add(FragmentTree.uuid);

0 comments on commit 50c0f3f

Please sign in to comment.