-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pass pullMerge to getIModelProps which causes extents to be loaded from the database instead of the cached value #7187
base: master
Are you sure you want to change the base?
Changes from 3 commits
ef92ce2
33f7abd
0d5db65
2aaa285
eeab6bb
51ed0c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"changes": [ | ||
{ | ||
"packageName": "@itwin/core-backend", | ||
"comment": "pulling a changeset with project extents changes now updates the extents of the opened imodel", | ||
"type": "none" | ||
} | ||
], | ||
"packageName": "@itwin/core-backend" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -305,6 +305,13 @@ export abstract class IModelDb extends IModel { | |
GeoCoordConfig.loadForImodel(this.workspace.settings); // load gcs data specified by iModel's settings dictionaries, must be done before calling initializeIModelDb | ||
|
||
this.initializeIModelDb(); | ||
this.onChangesetApplied.addListener(() => { | ||
const extents = this.queryFilePropertyString({ name: "Extents", namespace: "dgn_Db" }); | ||
// TODO: What if extents is undefined? And was previously defined? Is this a possibility? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any thoughts on this? My guess is that it is unlikely for an imodel to go from having project extents to no project extents so it is not worth handling, but not sure. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont think its possible to from defined extents to undefined, the other way around yes |
||
// Note: updateProjectExtents will return early if the extents are the same as the current extents. | ||
if (extents) | ||
this[_nativeDb].updateProjectExtents(extents, true); | ||
}); | ||
IModelDb._openDbs.set(this._fileKey, this); | ||
|
||
if (undefined === IModelDb._shutdownListener) { // the first time we create an IModelDb, add a listener to close any orphan files at shutdown. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initializeIModelDb()
is called after pullMerge() after applying all change set. It internally calls following. If I understand correctly, you want to notify native side of any change to project extent or ecf location. If this is the case, you should not listen to apply change set event, rather just do that in initializeIModelDb(). You may want to add parameter toinitializeIModelDb(when: "pullMerge" | undefined)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to passing pullMerge into intializeIModelDb