@thatopen/components 2.4.0-alpha.3 → 2.4.0-alpha.31

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.
@@ -6,7 +6,7 @@ export declare class Components implements Disposable {
6
6
  /**
7
7
  * The version of the @thatopen/components library.
8
8
  */
9
- static readonly release = "2.4.0-alpha.1";
9
+ static readonly release = "2.4.0-alpha.12";
10
10
  /** {@link Disposable.onDisposed} */
11
11
  readonly onDisposed: Event<void>;
12
12
  /**
@@ -1,11 +1,14 @@
1
1
  import { ControlsSchema, ControlEntry } from "../../Types";
2
2
  import { Components } from "../../Components";
3
- export declare abstract class Configurator<T, U extends ControlsSchema> {
3
+ export declare abstract class Configurator<T = any, U extends ControlsSchema = ControlsSchema> {
4
4
  protected abstract _config: U;
5
5
  protected _component: T;
6
6
  name: string;
7
7
  uuid: string;
8
8
  get controls(): U;
9
9
  constructor(component: T, components: Components, name: string, uuid?: string);
10
+ set(data: Partial<U>): void;
11
+ export(): any;
12
+ import(serializedData: any): void;
10
13
  copyEntry(controlEntry: ControlEntry): ControlEntry;
11
14
  }
@@ -35,8 +35,10 @@ export declare class SimpleRaycaster implements Disposable {
35
35
  * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
36
36
  * to query. If not provided, it will query all the meshes stored in
37
37
  * {@link Components.meshes}.
38
+ * @param position - the screen position to use for raycasting. If not provided,
39
+ * the last pointer (mouse/touch) position will be used.
38
40
  */
39
- castRay(items?: THREE.Object3D[]): THREE.Intersection | null;
41
+ castRay(items?: THREE.Object3D[], position?: THREE.Vector2): THREE.Intersection | null;
40
42
  /**
41
43
  * Casts a ray from a given origin in a given direction and returns the first item found.
42
44
  * This method also takes into account the clipping planes used by the renderer.
@@ -1,11 +1,16 @@
1
1
  import { Component } from "./component";
2
+ import { Configurator } from "../../ConfigManager";
3
+ import { Components } from "../../Components";
2
4
  export type ComponentUIElement = {
3
5
  name: string;
6
+ id: string;
7
+ icon: string;
4
8
  componentID: string;
5
- attributes: {
6
- [name: string]: string;
9
+ get: (components: Components) => {
10
+ element: HTMLElement;
11
+ config?: Configurator;
12
+ dispose?: () => void;
7
13
  };
8
- get: () => HTMLElement;
9
14
  };
10
15
  export declare abstract class ComponentWithUI extends Component {
11
16
  abstract name: string;
@@ -35,7 +35,7 @@ export declare class Viewpoint implements BCFViewpoint {
35
35
  * A map of colors and components GUIDs that should be colorized when displaying a viewpoint.
36
36
  * For this to work, call viewpoint.colorize()
37
37
  */
38
- readonly componentColors: DataMap<string, string[]>;
38
+ readonly componentColors: DataMap<THREE.Color, string[]>;
39
39
  /**
40
40
  * Boolean flags to allow fine control over the visibility of spaces.
41
41
  * A typical use of these flags is when DefaultVisibility=true but spaces should remain hidden.
@@ -163,6 +163,7 @@ export declare class Viewpoint implements BCFViewpoint {
163
163
  * @throws An error if the world's renderer is not available.
164
164
  */
165
165
  updateCamera(): void;
166
+ applyVisibility(): void;
166
167
  /**
167
168
  * Applies color to the components in the viewpoint based on their GUIDs.
168
169
  *
@@ -173,14 +174,13 @@ export declare class Viewpoint implements BCFViewpoint {
173
174
  * The color is applied using the `Classifier.setColor` method, which sets the color of the specified fragments.
174
175
  * The color is provided as a hexadecimal string, prefixed with a '#'.
175
176
  */
176
- colorize(): void;
177
+ applyColors(): void;
177
178
  /**
178
179
  * Resets the colors of all components in the viewpoint to their original color.
179
- * This method iterates through the `componentColors` map, retrieves the fragment IDs
180
- * corresponding to each color, and then uses the `Classifier` to reset the color of those fragments.
181
180
  */
182
181
  resetColors(): void;
183
182
  private createComponentTags;
183
+ private createColorTags;
184
184
  /**
185
185
  * Serializes the viewpoint into a buildingSMART compliant XML string for export.
186
186
  *
@@ -21,6 +21,17 @@ export interface Classification {
21
21
  };
22
22
  };
23
23
  }
24
+ interface ExportedClassification {
25
+ [system: string]: {
26
+ [groupName: string]: {
27
+ map: {
28
+ [name: string]: number[];
29
+ };
30
+ name: string;
31
+ id: number | null;
32
+ };
33
+ };
34
+ }
24
35
  /**
25
36
  * The Classifier component is responsible for classifying and categorizing fragments based on various criteria. It provides methods to add, remove, find, and filter fragments based on their classification. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Classifier). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Classifier).
26
37
  */
@@ -170,5 +181,16 @@ export declare class Classifier extends Component implements Disposable {
170
181
  * @throws Will throw an error if the fragment with the specified ID is not found.
171
182
  */
172
183
  resetColor(items: FRAGS.FragmentIdMap): void;
184
+ /**
185
+ * Exports the computed classification to persists them and import them back
186
+ * later for faster loading.
187
+ */
188
+ export(): ExportedClassification;
189
+ /**
190
+ * Imports a classification previously exported with .export().
191
+ * @param data the serialized classification to import.
192
+ */
193
+ import(data: ExportedClassification): void;
173
194
  protected saveItem(group: FRAGS.FragmentsGroup, systemName: string, className: string, expressID: number, parentID?: number | null): void;
174
195
  }
196
+ export {};
@@ -98,5 +98,6 @@ export declare class IfcGeometryTiler extends Component implements Disposable {
98
98
  private getGeometry;
99
99
  private streamAssets;
100
100
  private streamGeometries;
101
+ private outputGeometries;
101
102
  private registerGeometryData;
102
103
  }