@thatopen/components 2.2.0-alpha.1 → 2.2.0
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/Viewpoints/index.d.ts +20 -0
- package/dist/core/Viewpoints/src/Viewpoint.d.ts +147 -0
- package/dist/ifc/IfcPropertiesManager/index.d.ts +12 -1
- package/dist/index.cjs +71 -2127
- package/dist/index.mjs +7521 -15633
- package/dist/namespace.d.ts +1460 -1399
- package/dist/openbim/BCFTopics/index.d.ts +20 -2
- package/dist/openbim/BCFTopics/src/Comment.d.ts +5 -0
- package/dist/openbim/BCFTopics/src/Topic.d.ts +0 -6
- package/dist/openbim/BCFTopics/src/importers/extensions.d.ts +2 -0
- package/dist/openbim/BCFTopics/src/importers/index.d.ts +1 -0
- package/dist/openbim/BCFTopics/src/index.d.ts +1 -4
- package/dist/openbim/BCFTopics/src/types.d.ts +56 -0
- package/package.json +58 -58
- package/dist/openbim/BCFTopics/src/TopicComments/index.d.ts +0 -12
- package/dist/openbim/BCFTopics/src/TopicComments/src/template.d.ts +0 -20
- package/dist/openbim/BCFTopics/src/TopicForm/index.d.ts +0 -10
- package/dist/openbim/BCFTopics/src/TopicForm/src/template.d.ts +0 -20
- package/dist/openbim/BCFTopics/src/TopicPanel/index.d.ts +0 -12
- package/dist/openbim/BCFTopics/src/TopicPanel/src/template.d.ts +0 -46
- package/dist/openbim/BCFTopics/src/TopicsList/index.d.ts +0 -12
- package/dist/openbim/BCFTopics/src/TopicsList/src/template.d.ts +0 -29
- package/dist/openbim/BCFTopics/src/ViewpointsList/index.d.ts +0 -12
- package/dist/openbim/BCFTopics/src/ViewpointsList/src/template.d.ts +0 -19
|
@@ -7,6 +7,7 @@ import { BCFViewpoint, Viewpoint } from "./src";
|
|
|
7
7
|
interface ViewpointsConfig {
|
|
8
8
|
/**
|
|
9
9
|
* Indicates whether to overwrite the fragments colors when applying viewpoints.
|
|
10
|
+
* @remarks BCF Viewpoints comes with information to indicate the colors to be applied to components, if any.
|
|
10
11
|
* @default false
|
|
11
12
|
*/
|
|
12
13
|
overwriteColors: boolean;
|
|
@@ -14,7 +15,19 @@ interface ViewpointsConfig {
|
|
|
14
15
|
export declare class Viewpoints extends Component implements Disposable, Configurable<ViewpointsConfig> {
|
|
15
16
|
static readonly uuid: "ee867824-a796-408d-8aa0-4e5962a83c66";
|
|
16
17
|
enabled: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* A DataMap that stores Viewpoint instances, indexed by their unique identifiers (guid).
|
|
20
|
+
* This map is used to manage and retrieve Viewpoint instances within the Viewpoints component.
|
|
21
|
+
*/
|
|
17
22
|
readonly list: DataMap<string, Viewpoint>;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new Viewpoint instance and adds it to the list.
|
|
25
|
+
*
|
|
26
|
+
* @param world - The world in which the Viewpoint will be created.
|
|
27
|
+
* @param data - Optional partial data for the Viewpoint. If not provided, default data will be used.
|
|
28
|
+
*
|
|
29
|
+
* @returns The newly created Viewpoint instance.
|
|
30
|
+
*/
|
|
18
31
|
create(world: World, data?: Partial<BCFViewpoint>): Viewpoint;
|
|
19
32
|
constructor(components: Components);
|
|
20
33
|
isSetup: boolean;
|
|
@@ -22,6 +35,13 @@ export declare class Viewpoints extends Component implements Disposable, Configu
|
|
|
22
35
|
onSetup: Event<unknown>;
|
|
23
36
|
config: Required<ViewpointsConfig>;
|
|
24
37
|
readonly onDisposed: Event<unknown>;
|
|
38
|
+
/**
|
|
39
|
+
* Disposes of the Viewpoints component and its associated resources.
|
|
40
|
+
*
|
|
41
|
+
* This method is responsible for cleaning up any resources held by the Viewpoints component,
|
|
42
|
+
* such as disposing of the DataMap of Viewpoint instances and triggering and resetting the
|
|
43
|
+
* onDisposed event.
|
|
44
|
+
*/
|
|
25
45
|
dispose(): void;
|
|
26
46
|
}
|
|
27
47
|
export * from "./src";
|
|
@@ -8,36 +8,183 @@ import { SimplePlane } from "../../Clipper";
|
|
|
8
8
|
export declare class Viewpoint implements BCFViewpoint {
|
|
9
9
|
title?: string;
|
|
10
10
|
guid: string;
|
|
11
|
+
/**
|
|
12
|
+
* ClippingPlanes can be used to define a subsection of a building model that is related to the topic.
|
|
13
|
+
* Each clipping plane is defined by Location and Direction.
|
|
14
|
+
* The Direction vector points in the invisible direction meaning the half-space that is clipped.
|
|
15
|
+
*/
|
|
11
16
|
clippingPlanes: DataSet<SimplePlane>;
|
|
12
17
|
camera: ViewpointPerspectiveCamera | ViewpointOrthographicCamera;
|
|
18
|
+
/**
|
|
19
|
+
* A list of components GUIDs to hide when defaultVisibility = true or to show when defaultVisibility = false
|
|
20
|
+
*/
|
|
13
21
|
readonly exceptionComponents: DataSet<string>;
|
|
22
|
+
/**
|
|
23
|
+
* A list of components GUIDs that should be selected (highlighted) when displaying a viewpoint.
|
|
24
|
+
*/
|
|
14
25
|
readonly selectionComponents: DataSet<string>;
|
|
26
|
+
/**
|
|
27
|
+
* A map of colors and components GUIDs that should be colorized when displaying a viewpoint.
|
|
28
|
+
* For this to work, call viewpoint.colorize()
|
|
29
|
+
*/
|
|
15
30
|
readonly componentColors: DataMap<string, string[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Boolean flags to allow fine control over the visibility of spaces.
|
|
33
|
+
* A typical use of these flags is when DefaultVisibility=true but spaces should remain hidden.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
16
36
|
spacesVisible: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Boolean flags to allow fine control over the visibility of space boundaries.
|
|
39
|
+
* A typical use of these flags is when DefaultVisibility=true but space boundaries should remain hidden.
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
17
42
|
spaceBoundariesVisible: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Boolean flags to allow fine control over the visibility of openings.
|
|
45
|
+
* A typical use of these flags is when DefaultVisibility=true but openings should remain hidden.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
18
48
|
openingsVisible: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* When true, all components should be visible unless listed in the exceptions
|
|
51
|
+
* When false all components should be invisible unless listed in the exceptions
|
|
52
|
+
*/
|
|
19
53
|
defaultVisibility: boolean;
|
|
20
54
|
private get _selectionModelIdMap();
|
|
21
55
|
private get _exceptionModelIdMap();
|
|
56
|
+
/**
|
|
57
|
+
* A list of components that should be selected (highlighted) when displaying a viewpoint.
|
|
58
|
+
* @returns The fragmentIdMap for components marked as selections.
|
|
59
|
+
*/
|
|
22
60
|
get selection(): FRAGS.FragmentIdMap;
|
|
61
|
+
/**
|
|
62
|
+
* A list of components to hide when defaultVisibility = true or to show when defaultVisibility = false
|
|
63
|
+
* @returns The fragmentIdMap for components marked as exceptions.
|
|
64
|
+
*/
|
|
23
65
|
get exception(): FRAGS.FragmentIdMap;
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves the projection type of the viewpoint's camera.
|
|
68
|
+
*
|
|
69
|
+
* @returns A string representing the projection type of the viewpoint's camera.
|
|
70
|
+
* It can be either 'Perspective' or 'Orthographic'.
|
|
71
|
+
*/
|
|
24
72
|
get projection(): CameraProjection;
|
|
73
|
+
/**
|
|
74
|
+
* Retrieves the position vector of the viewpoint's camera.
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* The position vector represents the camera's position in the world coordinate system.
|
|
78
|
+
* The function applies the base coordinate system transformation to the position vector.
|
|
79
|
+
*
|
|
80
|
+
* @returns A THREE.Vector3 representing the position of the viewpoint's camera.
|
|
81
|
+
*/
|
|
25
82
|
get position(): THREE.Vector3;
|
|
83
|
+
/**
|
|
84
|
+
* Retrieves the direction vector of the viewpoint's camera.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* The direction vector represents the direction in which the camera is pointing.
|
|
88
|
+
* It is calculated by extracting the x, y, and z components from the camera's direction property.
|
|
89
|
+
*
|
|
90
|
+
* @returns A THREE.Vector3 representing the direction of the viewpoint's camera.
|
|
91
|
+
*/
|
|
26
92
|
get direction(): THREE.Vector3;
|
|
27
93
|
private _components;
|
|
94
|
+
/**
|
|
95
|
+
* Represents the world in which the viewpoints are created and managed.
|
|
96
|
+
*/
|
|
28
97
|
readonly world: World;
|
|
29
98
|
private get _managerVersion();
|
|
99
|
+
/**
|
|
100
|
+
* Retrieves the list of BCF topics associated with the current viewpoint.
|
|
101
|
+
*
|
|
102
|
+
* @remarks
|
|
103
|
+
* This function retrieves the BCFTopics manager from the components,
|
|
104
|
+
* then filters the list of topics to find those associated with the current viewpoint.
|
|
105
|
+
*
|
|
106
|
+
* @returns An array of BCF topics associated with the current viewpoint.
|
|
107
|
+
*/
|
|
30
108
|
get topics(): import("../../../openbim/BCFTopics").Topic[];
|
|
31
109
|
constructor(components: Components, world: World, _config?: {
|
|
32
110
|
data?: Partial<BCFViewpoint>;
|
|
33
111
|
setCamera?: boolean;
|
|
34
112
|
});
|
|
113
|
+
/**
|
|
114
|
+
* Adds components to the viewpoint based on the provided fragment ID map.
|
|
115
|
+
*
|
|
116
|
+
* @param fragmentIdMap - A map containing fragment IDs as keys and arrays of express IDs as values.
|
|
117
|
+
*
|
|
118
|
+
* @returns A Promise that resolves when the components have been added to the viewpoint.
|
|
119
|
+
*/
|
|
35
120
|
addComponentsFromMap(fragmentIdMap: FRAGS.FragmentIdMap): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Sets the properties of the viewpoint with the provided data.
|
|
123
|
+
*
|
|
124
|
+
* @remarks The guid will be ommited as it shouldn't change after it has been initially set.
|
|
125
|
+
*
|
|
126
|
+
* @param data - An object containing the properties to be set.
|
|
127
|
+
* The properties not included in the object will remain unchanged.
|
|
128
|
+
*
|
|
129
|
+
* @returns The viewpoint instance with the updated properties.
|
|
130
|
+
*/
|
|
36
131
|
set(data: Partial<BCFViewpoint>): this;
|
|
132
|
+
/**
|
|
133
|
+
* Sets the viewpoint of the camera in the world.
|
|
134
|
+
*
|
|
135
|
+
* @remarks
|
|
136
|
+
* This function calculates the target position based on the viewpoint information.
|
|
137
|
+
* It sets the visibility of the viewpoint components and then applies the viewpoint using the camera's controls.
|
|
138
|
+
*
|
|
139
|
+
* @param transition - Indicates whether the camera movement should have a transition effect.
|
|
140
|
+
* Default value is `true`.
|
|
141
|
+
*
|
|
142
|
+
* @throws An error if the world's camera does not have camera controls.
|
|
143
|
+
*
|
|
144
|
+
* @returns A Promise that resolves when the camera has been set.
|
|
145
|
+
*/
|
|
37
146
|
go(transition?: boolean): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* Updates the camera settings of the viewpoint based on the current world's camera and renderer.
|
|
149
|
+
*
|
|
150
|
+
* @remarks
|
|
151
|
+
* This function retrieves the camera's position, direction, and aspect ratio from the world's camera and renderer.
|
|
152
|
+
* It then calculates the camera's perspective or orthographic settings based on the camera type.
|
|
153
|
+
* Finally, it updates the viewpoint's camera settings and updates the viewpoint to the Viewpoints manager.
|
|
154
|
+
*
|
|
155
|
+
* @throws An error if the world's camera does not have camera controls.
|
|
156
|
+
* @throws An error if the world's renderer is not available.
|
|
157
|
+
*/
|
|
38
158
|
updateCamera(): void;
|
|
159
|
+
/**
|
|
160
|
+
* Applies color to the components in the viewpoint based on their GUIDs.
|
|
161
|
+
*
|
|
162
|
+
* This function iterates through the `componentColors` map, retrieves the fragment IDs
|
|
163
|
+
* corresponding to each color, and then uses the `Classifier` to apply the color to those fragments.
|
|
164
|
+
*
|
|
165
|
+
* @remarks
|
|
166
|
+
* The color is applied using the `Classifier.setColor` method, which sets the color of the specified fragments.
|
|
167
|
+
* The color is provided as a hexadecimal string, prefixed with a '#'.
|
|
168
|
+
*/
|
|
39
169
|
colorize(): void;
|
|
170
|
+
/**
|
|
171
|
+
* Resets the colors of all components in the viewpoint to their original color.
|
|
172
|
+
* This method iterates through the `componentColors` map, retrieves the fragment IDs
|
|
173
|
+
* corresponding to each color, and then uses the `Classifier` to reset the color of those fragments.
|
|
174
|
+
*/
|
|
40
175
|
resetColors(): void;
|
|
41
176
|
private createComponentTags;
|
|
177
|
+
/**
|
|
178
|
+
* Serializes the viewpoint into a buildingSMART compliant XML string for export.
|
|
179
|
+
*
|
|
180
|
+
* @param version - The version of the BCF Manager to use for serialization.
|
|
181
|
+
* If not provided, the current version of the manager will be used.
|
|
182
|
+
*
|
|
183
|
+
* @returns A Promise that resolves to an XML string representing the viewpoint.
|
|
184
|
+
* The XML string follows the BCF VisualizationInfo schema.
|
|
185
|
+
*
|
|
186
|
+
* @throws An error if the world's camera does not have camera controls.
|
|
187
|
+
* @throws An error if the world's renderer is not available.
|
|
188
|
+
*/
|
|
42
189
|
serialize(version?: import("../../../openbim/BCFTopics").BCFVersion): Promise<string>;
|
|
43
190
|
}
|
|
@@ -111,7 +111,7 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
111
111
|
*/
|
|
112
112
|
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema;
|
|
113
113
|
/**
|
|
114
|
-
* Method to
|
|
114
|
+
* Method to add or update entity attributes in the model.
|
|
115
115
|
*
|
|
116
116
|
* @param model - The FragmentsGroup model in which to set the properties.
|
|
117
117
|
* @param dataToSave - An array of objects representing the properties to be saved.
|
|
@@ -233,6 +233,17 @@ export declare class IfcPropertiesManager extends Component implements Disposabl
|
|
|
233
233
|
* @throws Will throw an error if any issues occur during the saving process.
|
|
234
234
|
*/
|
|
235
235
|
saveToIfc(model: FragmentsGroup, ifcToSaveOn: Uint8Array): Promise<Uint8Array>;
|
|
236
|
+
/**
|
|
237
|
+
* Retrieves all the entities of a specific type from the model and returns their express IDs wrapped in Handles.
|
|
238
|
+
* This is used to make references of an entity inside another entity attributes.
|
|
239
|
+
*
|
|
240
|
+
* @param model - The FragmentsGroup model from which to retrieve the entities.
|
|
241
|
+
* @param type - The type of the entities to retrieve. This should be the express ID of the IFC type.
|
|
242
|
+
*
|
|
243
|
+
* @returns A promise that resolves with an array of Handles, each containing the express ID of an entity of the specified type.
|
|
244
|
+
* @returns null if the model doesn't have any entity of that type
|
|
245
|
+
*/
|
|
246
|
+
getEntityRef(model: FragmentsGroup, type: number): Promise<WEBIFC.Handle<unknown>[] | null>;
|
|
236
247
|
/**
|
|
237
248
|
* Sets an attribute listener for a specific attribute of an entity in the model.
|
|
238
249
|
* The listener will trigger an event whenever the attribute's value changes.
|