/
BisCoreSchema.ts
61 lines (56 loc) · 2.14 KB
/
BisCoreSchema.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Schema
*/
import * as path from "path";
import * as categoryMod from "./Category";
import { ClassRegistry } from "./ClassRegistry";
import * as elementMod from "./Element";
import * as aspectMod from "./ElementAspect";
import * as externalSourceMod from "./ExternalSource";
import { KnownLocations } from "./IModelHost";
import * as materialMod from "./Material";
import * as modelMod from "./Model";
import * as linkMod from "./Relationship";
import { Schema, Schemas } from "./Schema";
import * as textureMod from "./Texture";
import * as viewMod from "./ViewDefinition";
import * as displayStyleMod from "./DisplayStyle";
/**
* The [BisCore]($docs/bis/guide/fundamentals/schemas-domains.md) schema is the lowest level Schema in an iModel.
*
* It is automatically registered when [[IModelHost.startup]] is called.
*
* ** Example:**
* ``` ts
* [[include:BisCore.registerSchemaAndGetClass]]
* ```
* @public
*/
export class BisCoreSchema extends Schema {
public static override get schemaName(): string { return "BisCore"; }
public static get schemaFilePath(): string { return path.join(KnownLocations.nativeAssetsDir, "ECSchemas", "Dgn", `${BisCoreSchema.schemaName}.ecschema.xml`); }
/** @internal */
public static registerSchema() {
if (this === Schemas.getRegisteredSchema(this.schemaName))
return;
Schemas.unregisterSchema(this.schemaName);
Schemas.registerSchema(this);
// this list should include all backend .ts files with implementations of Entity-based classes. Order does not matter.
[
elementMod,
aspectMod,
modelMod,
categoryMod,
viewMod,
linkMod,
textureMod,
materialMod,
externalSourceMod,
displayStyleMod,
].forEach((module) => ClassRegistry.registerModule(module, this));
}
}