@thatopen/components 2.2.0-alpha.0 → 2.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Types/src/data-map.d.ts +12 -1
- package/dist/core/Types/src/data-set.d.ts +12 -2
- package/dist/core/Viewpoints/index.d.ts +16 -2
- package/dist/core/Viewpoints/src/Viewpoint.d.ts +10 -4
- package/dist/core/Viewpoints/src/types.d.ts +1 -1
- package/dist/index.cjs +411 -262
- package/dist/index.mjs +6380 -5937
- package/dist/namespace.d.ts +2265 -2152
- package/dist/openbim/BCFTopics/index.d.ts +6 -0
- package/dist/openbim/BCFTopics/src/Comment.d.ts +2 -0
- package/dist/openbim/BCFTopics/src/Topic.d.ts +4 -4
- package/dist/openbim/BCFTopics/src/TopicComments/index.d.ts +12 -0
- package/dist/openbim/BCFTopics/src/TopicComments/src/template.d.ts +20 -0
- package/dist/openbim/BCFTopics/src/TopicForm/index.d.ts +1 -1
- package/dist/openbim/BCFTopics/src/TopicPanel/index.d.ts +1 -1
- package/dist/openbim/BCFTopics/src/TopicPanel/src/template.d.ts +10 -1
- package/dist/openbim/BCFTopics/src/TopicsList/index.d.ts +1 -1
- package/dist/openbim/BCFTopics/src/TopicsList/src/template.d.ts +15 -23
- package/dist/openbim/BCFTopics/src/ViewpointsList/index.d.ts +12 -0
- package/dist/openbim/BCFTopics/src/ViewpointsList/src/template.d.ts +19 -0
- package/dist/openbim/BCFTopics/src/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ export declare class DataMap<K, V> extends Map<K, V> {
|
|
|
23
23
|
/**
|
|
24
24
|
* An event triggered when an item is deleted from the map.
|
|
25
25
|
*/
|
|
26
|
-
readonly onItemDeleted: Event<
|
|
26
|
+
readonly onItemDeleted: Event<K>;
|
|
27
27
|
/**
|
|
28
28
|
* An event triggered when the map is cleared.
|
|
29
29
|
*/
|
|
@@ -46,6 +46,17 @@ export declare class DataMap<K, V> extends Map<K, V> {
|
|
|
46
46
|
* @returns The DataMap instance.
|
|
47
47
|
*/
|
|
48
48
|
set(key: K, value: V): this;
|
|
49
|
+
/**
|
|
50
|
+
* A function that acts as a guard for adding items to the set.
|
|
51
|
+
* It determines whether a given value should be allowed to be added to the set.
|
|
52
|
+
*
|
|
53
|
+
* @param key - The key of the entry to be checked against the guard.
|
|
54
|
+
* @param value - The value of the entry to be checked against the guard.
|
|
55
|
+
* @returns A boolean indicating whether the value should be allowed to be added to the set.
|
|
56
|
+
* By default, this function always returns true, allowing all values to be added.
|
|
57
|
+
* You can override this behavior by providing a custom implementation.
|
|
58
|
+
*/
|
|
59
|
+
guard: (key: K, value: V) => boolean;
|
|
49
60
|
/**
|
|
50
61
|
* Deletes the specified key from the map and triggers the onItemDeleted event if the key was found.
|
|
51
62
|
*
|
|
@@ -29,12 +29,22 @@ export declare class DataSet<T> extends Set<T> {
|
|
|
29
29
|
*/
|
|
30
30
|
clear(): void;
|
|
31
31
|
/**
|
|
32
|
-
* Adds
|
|
32
|
+
* Adds one or multiple values to the set and triggers the onItemAdded event per each.
|
|
33
33
|
*
|
|
34
34
|
* @param value - The value to add to the set.
|
|
35
35
|
* @returns - The set instance.
|
|
36
36
|
*/
|
|
37
|
-
add(value: T): this;
|
|
37
|
+
add(...value: T[]): this;
|
|
38
|
+
/**
|
|
39
|
+
* A function that acts as a guard for adding items to the set.
|
|
40
|
+
* It determines whether a given value should be allowed to be added to the set.
|
|
41
|
+
*
|
|
42
|
+
* @param value - The value to be checked against the guard.
|
|
43
|
+
* @returns A boolean indicating whether the value should be allowed to be added to the set.
|
|
44
|
+
* By default, this function always returns true, allowing all values to be added.
|
|
45
|
+
* You can override this behavior by providing a custom implementation.
|
|
46
|
+
*/
|
|
47
|
+
guard: (value: T) => boolean;
|
|
38
48
|
/**
|
|
39
49
|
* Deletes a value from the set and triggers the onItemDeleted event.
|
|
40
50
|
*
|
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
import { World, Component, Disposable, Event, DataMap } from "../Types";
|
|
1
|
+
import { World, Component, Disposable, Event, DataMap, Configurable } from "../Types";
|
|
2
2
|
import { Components } from "../Components";
|
|
3
3
|
import { BCFViewpoint, Viewpoint } from "./src";
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Configuration interface for the Viewpoints general behavior.
|
|
6
|
+
*/
|
|
7
|
+
interface ViewpointsConfig {
|
|
8
|
+
/**
|
|
9
|
+
* Indicates whether to overwrite the fragments colors when applying viewpoints.
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
overwriteColors: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class Viewpoints extends Component implements Disposable, Configurable<ViewpointsConfig> {
|
|
5
15
|
static readonly uuid: "ee867824-a796-408d-8aa0-4e5962a83c66";
|
|
6
16
|
enabled: boolean;
|
|
7
17
|
readonly list: DataMap<string, Viewpoint>;
|
|
8
18
|
create(world: World, data?: Partial<BCFViewpoint>): Viewpoint;
|
|
9
19
|
constructor(components: Components);
|
|
20
|
+
isSetup: boolean;
|
|
21
|
+
setup(): void;
|
|
22
|
+
onSetup: Event<unknown>;
|
|
23
|
+
config: Required<ViewpointsConfig>;
|
|
10
24
|
readonly onDisposed: Event<unknown>;
|
|
11
25
|
dispose(): void;
|
|
12
26
|
}
|
|
@@ -3,15 +3,16 @@ import * as FRAGS from "@thatopen/fragments";
|
|
|
3
3
|
import { BCFViewpoint, ViewpointOrthographicCamera, ViewpointPerspectiveCamera } from "./types";
|
|
4
4
|
import { CameraProjection } from "../../OrthoPerspectiveCamera";
|
|
5
5
|
import { Components } from "../../Components";
|
|
6
|
-
import { DataSet, World } from "../../Types";
|
|
6
|
+
import { DataMap, DataSet, World } from "../../Types";
|
|
7
7
|
import { SimplePlane } from "../../Clipper";
|
|
8
8
|
export declare class Viewpoint implements BCFViewpoint {
|
|
9
|
-
|
|
9
|
+
title?: string;
|
|
10
10
|
guid: string;
|
|
11
11
|
clippingPlanes: DataSet<SimplePlane>;
|
|
12
12
|
camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
|
|
13
13
|
readonly exceptionComponents: DataSet<string>;
|
|
14
14
|
readonly selectionComponents: DataSet<string>;
|
|
15
|
+
readonly componentColors: DataMap<string, string[]>;
|
|
15
16
|
spacesVisible: boolean;
|
|
16
17
|
spaceBoundariesVisible: boolean;
|
|
17
18
|
openingsVisible: boolean;
|
|
@@ -27,11 +28,16 @@ export declare class Viewpoint implements BCFViewpoint {
|
|
|
27
28
|
readonly world: World;
|
|
28
29
|
private get _managerVersion();
|
|
29
30
|
get topics(): import("../../../openbim/BCFTopics").Topic[];
|
|
30
|
-
constructor(components: Components, world: World
|
|
31
|
+
constructor(components: Components, world: World, _config?: {
|
|
32
|
+
data?: Partial<BCFViewpoint>;
|
|
33
|
+
setCamera?: boolean;
|
|
34
|
+
});
|
|
31
35
|
addComponentsFromMap(fragmentIdMap: FRAGS.FragmentIdMap): Promise<void>;
|
|
32
|
-
set(data: Partial<BCFViewpoint>):
|
|
36
|
+
set(data: Partial<BCFViewpoint>): this;
|
|
33
37
|
go(transition?: boolean): Promise<void>;
|
|
34
38
|
updateCamera(): void;
|
|
39
|
+
colorize(): void;
|
|
40
|
+
resetColors(): void;
|
|
35
41
|
private createComponentTags;
|
|
36
42
|
serialize(version?: import("../../../openbim/BCFTopics").BCFVersion): Promise<string>;
|
|
37
43
|
}
|
|
@@ -20,7 +20,7 @@ export interface ViewpointOrthographicCamera extends ViewpointCamera {
|
|
|
20
20
|
viewToWorldScale: number;
|
|
21
21
|
}
|
|
22
22
|
export interface BCFViewpoint {
|
|
23
|
-
|
|
23
|
+
title?: string;
|
|
24
24
|
guid: string;
|
|
25
25
|
camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
|
|
26
26
|
selectionComponents: Iterable<string>;
|