-
Notifications
You must be signed in to change notification settings - Fork 208
/
ChangedElements.ts
97 lines (92 loc) · 3.58 KB
/
ChangedElements.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/**
* @packageDocumentation
* @module Entities
*/
import { DbOpcode, Id64String } from "@itwin/core-bentley";
import { AxisAlignedBox3dProps } from "./geometry/Placement";
// cspell:ignore bboxes
/** Bitflags describing which aspects of an [Element]($backend) changed as part of a [[ChangedElements]].
* @public
* @extensions
*/
export enum TypeOfChange {
/** Element contains no changes */
NoChange = 0,
/** A property in the element changed */
Property = 0b1,
/** The geometry stream of a [GeometricElement]($backend) changed */
Geometry = 0b10,
/** The [[Placement]] of a [GeometricElement]($backend) changed */
Placement = 0b100,
/** Indirect change occurred to this element by a related instance */
Indirect = 0b1000,
/** Hidden properties of the element changed */
Hidden = 0b10000,
/** The top-most parent of the element has changed */
Parent = 0b100000,
}
/** Changed elements found in a changeset or between a range of changesets.
* All arrays in this object will have the same number of items.
* Each index for those arrays refer to the same element, e.g. to get the class Id of
* the element given by element Id changedElements.elements[index], you can use changedElements.classIds[index].
* @public
* @extensions
*/
export interface ChangedElements {
/** Ids of elements that changed */
elements: Id64String[];
/** ECClass Ids of elements that changed */
classIds: Id64String[];
/** Operation that occurred on the element. Whether the element was inserted, updated or deleted.
* See [DbOpcode]($core-bentley)
*/
opcodes: DbOpcode[];
/** Type of change bitflags, see [[TypeOfChange]] */
type: TypeOfChange[];
/** Model Ids of the changed elements
* This may be undefined if the agent that did the processing job did not export model Ids
*/
modelIds?: Id64String[];
/** Property accessor strings of properties that changed, if any, for each changed element
* This may be undefined if the agent that did the processing job did not export properties
*/
properties?: string[][];
/** Before state checksums of the property value
* Useful to determine if property values have changed
* between the versions being inspected
* This may be undefined if the agent that did the processing job did not export checksums
*/
oldChecksums?: number[][];
/** After state checksums of the property value
* Useful to determine if property values have changed
* between the versions being inspected
* This may be undefined if the agent that did the processing job did not export checksums
*/
newChecksums?: number[][];
/**
* Parent ids of the changed elements
* Will be "0" if the element has no parent
* This may be undefined if the agent that did the processing job did not export parent information
*/
parentIds?: Id64String[];
/**
* Parent ECClass Ids of the changed elements
* Will be "0" if the element has no parent
* This may be undefined if the agent that did the processing job did not export parent information
*/
parentClassIds?: Id64String[];
}
/** @internal */
export interface ChangedModels {
modelIds: Id64String[];
bboxes: AxisAlignedBox3dProps[];
}
/** @internal */
export interface ChangeData {
changedElements: ChangedElements;
changedModels: ChangedModels;
}