@thatopen/components
Advanced tools
Comparing version 2.0.0-alpha.4 to 2.0.0-alpha.5
import * as THREE from "three"; | ||
import * as FRAGS from "bim-fragment"; | ||
import { FragmentsGroup } from "bim-fragment"; | ||
import * as FRAGS from "@thatopen/fragments"; | ||
import { FragmentsGroup } from "@thatopen/fragments"; | ||
import { Component, Components, Disposable, Event } from "../../core"; | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
import * as FRAGS from "bim-fragment"; | ||
import * as FRAGS from "@thatopen/fragments"; | ||
import { Disposable, Component, Event, Components } from "../../core"; | ||
@@ -3,0 +3,0 @@ export interface Classification { |
@@ -1,2 +0,2 @@ | ||
import * as FRAGS from "bim-fragment"; | ||
import * as FRAGS from "@thatopen/fragments"; | ||
import { Components, Component } from "../../core"; | ||
@@ -3,0 +3,0 @@ export declare class FragmentHider extends Component { |
import * as WEBIFC from "web-ifc"; | ||
import * as FRAGS from "bim-fragment"; | ||
import * as FRAGS from "@thatopen/fragments"; | ||
import { IfcFragmentSettings } from "./src"; | ||
@@ -4,0 +4,0 @@ import { Component, Components, Event, Disposable } from "../../core"; |
import * as THREE from "three"; | ||
import * as WEBIFC from "web-ifc"; | ||
import * as FRAGS from "bim-fragment"; | ||
import * as FRAGS from "@thatopen/fragments"; | ||
export declare class CivilReader { | ||
@@ -5,0 +5,0 @@ defLineMat: THREE.LineBasicMaterial; |
@@ -1,2 +0,2 @@ | ||
import { Fragment, FragmentsGroup } from "bim-fragment"; | ||
import { Fragment, FragmentsGroup } from "@thatopen/fragments"; | ||
import * as THREE from "three"; | ||
@@ -3,0 +3,0 @@ import { Component, Components, Event, Disposable } from "../../core"; |
import * as WEBIFC from "web-ifc"; | ||
import * as FRAG from "bim-fragment"; | ||
import * as FRAG from "@thatopen/fragments"; | ||
/** | ||
@@ -4,0 +4,0 @@ * Object to export all the properties from an IFC to a JS object. |
@@ -1,3 +0,3 @@ | ||
import * as FRAGS from "bim-fragment"; | ||
import { FragmentsGroup } from "bim-fragment"; | ||
import * as FRAGS from "@thatopen/fragments"; | ||
import { FragmentsGroup } from "@thatopen/fragments"; | ||
import { Disposable, Event, Component, Components } from "../../core"; | ||
@@ -4,0 +4,0 @@ import { QueryGroup } from "./src/types"; |
@@ -1,5 +0,8 @@ | ||
import { FragmentsGroup } from "bim-fragment"; | ||
import { FragmentsGroup } from "@thatopen/fragments"; | ||
import { Disposable, Event, Component, Components } from "../../core"; | ||
interface RelationMap { | ||
[modelID: string]: Map<number, Map<number, number[]>>; | ||
import { IfcPropertiesManager } from "../IfcPropertiesManager"; | ||
interface IndexMap { | ||
[modelID: string]: { | ||
[expressID: string]: Set<number>; | ||
}; | ||
} | ||
@@ -11,68 +14,19 @@ export declare class IfcPropertiesIndexer extends Component implements Disposable { | ||
enabled: boolean; | ||
/** | ||
* All the inverse attributes this component can processes. | ||
*/ | ||
readonly inverseAttributes: string[]; | ||
inverseAttributesToProcess: string[]; | ||
private _relToAttributesMap; | ||
readonly relationMaps: RelationMap; | ||
relationsToProcess: number[]; | ||
indexMap: IndexMap; | ||
private _propertiesManager; | ||
readonly onPropertiesManagerSet: Event<IfcPropertiesManager>; | ||
set propertiesManager(manager: IfcPropertiesManager | null); | ||
get propertiesManager(): IfcPropertiesManager | null; | ||
constructor(components: Components); | ||
private onFragmentsDisposed; | ||
private getAttributeRels; | ||
private setRelMap; | ||
/** | ||
* Processes a given model to index its IFC entities relations based on predefined inverse attributes. | ||
* This method iterates through each specified inverse attribute, retrieves the corresponding relations, | ||
* and maps them in a structured way to facilitate quick access to related entities. | ||
* | ||
* The process involves querying the model for each relation type associated with the inverse attributes | ||
* and updating the internal relationMaps with the relationships found. This map is keyed by the model's UUID | ||
* and contains a nested map where each key is an entity's expressID and its value is another map. | ||
* This inner map's keys are the indices of the inverse attributes, and its values are arrays of expressIDs | ||
* of entities that are related through that attribute. | ||
* | ||
* @param model The `FragmentsGroup` model to be processed. It must have properties loaded. | ||
* @returns A promise that resolves to the relations map for the processed model. This map is a detailed | ||
* representation of the relations indexed by entity expressIDs and relation types. | ||
* @throws An error if the model does not have properties loaded. | ||
*/ | ||
process(model: FragmentsGroup): Promise<Map<number, Map<number, number[]>>>; | ||
/** | ||
* Retrieves the relations of a specific entity within a model based on the given relation name. | ||
* This method searches the indexed relation maps for the specified model and entity, | ||
* returning the IDs of related entities if a match is found. | ||
* | ||
* @param model The `FragmentsGroup` model containing the entity. | ||
* @param expressID The unique identifier of the entity within the model. | ||
* @param relationName The IFC schema inverse attribute of the relation to search for (e.g., "IsDefinedBy", "ContainsElements"). | ||
* @returns An array of express IDs representing the related entities, or `null` if no relations are found | ||
* or the specified relation name is not indexed. | ||
*/ | ||
getEntityRelations(model: FragmentsGroup, expressID: number, relationName: string): number[] | null; | ||
/** | ||
* Serializes the relations of a specific model into a JSON string. | ||
* This method iterates through the relations indexed for the given model, | ||
* organizing them into a structured object where each key is an expressID of an entity, | ||
* and its value is another object mapping relation indices to arrays of related entity expressIDs. | ||
* The resulting object is then serialized into a JSON string. | ||
* | ||
* @param model The `FragmentsGroup` model whose relations are to be serialized. | ||
* @returns A JSON string representing the serialized relations of the specified model. | ||
* If the model has no indexed relations, `null` is returned. | ||
*/ | ||
serializeModelRelations(model: FragmentsGroup): string | null; | ||
/** | ||
* Serializes all relations of every model processed by the indexer into a JSON string. | ||
* This method iterates through each model's relations indexed in `relationMaps`, organizing them | ||
* into a structured JSON object. Each top-level key in this object corresponds to a model's UUID, | ||
* and its value is another object mapping entity expressIDs to their related entities, categorized | ||
* by relation types. The structure facilitates easy access to any entity's relations across all models. | ||
* | ||
* @returns A JSON string representing the serialized relations of all models processed by the indexer. | ||
* If no relations have been indexed, an empty object is returned as a JSON string. | ||
*/ | ||
serializeRelations(): string; | ||
getRelationsMapFromJSON(json: string): Map<number, Map<number, number[]>>; | ||
dispose(): void; | ||
dispose(): Promise<void>; | ||
getProperties(model: FragmentsGroup, id: string): Promise<any[] | null>; | ||
private getNestedPsets; | ||
private getPsetProperties; | ||
process(model: FragmentsGroup): Promise<void>; | ||
private setEntityIndex; | ||
private cloneProperty; | ||
private clonePropertyArray; | ||
} | ||
export {}; |
import * as WEBIFC from "web-ifc"; | ||
import { FragmentsGroup } from "bim-fragment"; | ||
import { FragmentsGroup } from "@thatopen/fragments"; | ||
import { Component, Disposable, Event, Components } from "../../core"; | ||
@@ -53,3 +53,3 @@ type BooleanPropTypes = "IfcBoolean" | "IfcLogical"; | ||
private increaseMaxID; | ||
static getIFCSchema(model: FragmentsGroup): import("bim-fragment").IfcSchema; | ||
static getIFCSchema(model: FragmentsGroup): import("@thatopen/fragments").IfcSchema; | ||
private newGUID; | ||
@@ -56,0 +56,0 @@ private getOwnerHistory; |
@@ -1,2 +0,2 @@ | ||
import * as FRAGS from "bim-fragment"; | ||
import * as FRAGS from "@thatopen/fragments"; | ||
export declare class IfcPropertiesUtils { | ||
@@ -3,0 +3,0 @@ static getUnits(group: FRAGS.FragmentsGroup): Promise<number>; |
{ | ||
"name": "@thatopen/components", | ||
"description": "Collection of core functionalities to author BIM apps.", | ||
"version": "2.0.0-alpha.4", | ||
"version": "2.0.0-alpha.5", | ||
"author": "That Open Company", | ||
@@ -40,2 +40,3 @@ "contributors": [ | ||
"devDependencies": { | ||
"@thatopen/fragments": "2.0.0-alpha.1", | ||
"@types/jest": "27.0.0", | ||
@@ -46,3 +47,2 @@ "@types/node": "20.11.30", | ||
"@typescript-eslint/parser": "7.2.0", | ||
"bim-fragment": "1.5.0", | ||
"client-zip": "2.3.0", | ||
@@ -70,6 +70,6 @@ "eslint": "8.57.0", | ||
"peerDependencies": { | ||
"bim-fragment": "1.5.0", | ||
"@thatopen/fragments": "2.0.0-alpha.1", | ||
"three": "^0.160.1", | ||
"web-ifc": "0.0.53" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
766164
14405