Skip to content
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

Z scaling #937

Merged
merged 25 commits into from Mar 25, 2021
Merged

Z scaling #937

merged 25 commits into from Mar 25, 2021

Conversation

MarcNeely
Copy link
Contributor

No description provided.

@MarcNeely MarcNeely requested a review from pmconne March 10, 2021 18:47
@@ -198,11 +228,13 @@ class PrimaryTreeReference extends TileTreeReference {
public get treeOwner(): TileTreeOwner {
const newId = this.createTreeId(this.view, this._id.modelId, this._id.treeId.animationTransformNodeId);
if (0 !== compareIModelTileTreeIds(newId, this._id.treeId)) {
Copy link
Member

@pmconne pmconne Mar 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the only thing that changed is this._forceNoInstancing then you're not going to update your Id.
The viewport already invalidates the scene when the display transform provider changes so you don't have to worry about that - you just need to make sure you compute a correct tree Id.

Probably check this._forceNoInstancing !== this._id.forceNoInstancing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check it where, in the listener and then if it changed create a new id? How does that make the tiles reload?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right here where you are checking compareIModelTileTreeIds.
TileTreeReference.treeOwner is called whenever we want access to the reference's TileTree. We compute an Id here based on the reference's current state, and ask for that tree. If the reference's state changed, we may get back a different tree - e.g., one with instancing disabled.

@MarcNeely MarcNeely marked this pull request as ready for review March 22, 2021 21:08
@MarcNeely MarcNeely requested review from kabentley and a team as code owners March 22, 2021 21:08
@@ -400,6 +400,34 @@ export abstract class Tile {
return false;
}

private computePixelSizeScaleFactor(args: TileDrawArgs): number {
// Check to see if a model display transform with non-uniform scaling is being used.
const tf = args.context.viewport.view.getModelDisplayTransform(args.tree.modelId, Transform.createIdentity());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to obtain the model display transform vs just pulling the scale out of the TileDrawArgs' transform?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it this way to just pull out the model display transform rather than looking at the full model to world transform which may have other scaling in it.

@@ -418,7 +446,8 @@ export abstract class Tile {
return TileVisibility.Visible;
}

const pixelSize = args.getPixelSize(this);
const scale = this.computePixelSizeScaleFactor(args);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you avoid computing this for every tile by, e.g., computing in TileDrawArgs constructor and storing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I was wondering if I should do something like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@pmconne pmconne requested a review from bbastings March 22, 2021 22:11
@pmconne
Copy link
Member

pmconne commented Mar 22, 2021

@bbastings please take a look at the tool/AccuSnap changes.

@bbastings
Copy link
Contributor

@bbastings please take a look at the tool/AccuSnap changes.

Looks ok, I may revisit the MeasureDistanceTool changes after this merges...

@MarcNeely MarcNeely merged commit ef34c10 into master Mar 25, 2021
@MarcNeely MarcNeely deleted the z-scaling branch March 25, 2021 19:37
pmconne added a commit that referenced this pull request Mar 31, 2021
* Add saveChanges to ensure the updated DbGuid is persisted (#1029)

* Update xmldom (#1015)

* update xmldom to 0.5.0

Co-authored-by: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com>

* 2.15.0-dev.7

* Added NativeHost.settingsStore (#1018)

* wip

* cleanup

* move NativeApp to beta

* rush change

* Saving & restoring Electron main window size, position & maximized state

* extract-api

* extract-api

* rush change

* fix NativeAppStorage tests

* Saving & restoring as number & boolean values

* Better type checking of StorageValue

* Added type checking methods to NativeAppStorage. Using one storage file for ElectronWindowState with setting namespaces.

* further cleanup of NativeAppStorage

* add NativeHost.settingsStore

* change table name to app_settings

* Fixed lint, extract-api and cover issues

* fix lint errors

* extract-api

* extract-api

* rush change

* Added @packageDocumentation for NativeAppStorage

* NextVersion.md

Co-authored-by: Keith Bentley <33296803+kabentley@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fix number editor used in tool settings (#1034)

* Fix numberEditor by blocking editor container from processing enter key

* rush change

* extract-api

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Drop deprecated ldclient-js package (#1033)

* Drop deprecated ldclient-js package

* Update immer to ^9.0.1 (#1027)

* Fix color picker hue slider (#1040)

* fix hue display in DR by removing webkit prefix. Adjust max slider value.

* rush change

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fallback to use V1 checkpoints when a V2 checkpoint contains invalid dbGuid (#1042)

* Clarify misleading log messages in RpcBriefcaseUtility.open

* Update SnapshotDb.openCheckpointV2 to throw when mismatched dbGuids are detected.

* rush change.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Z scaling (#937)

* modify model transform keyin to take scaling

* test

* fix instancing

* Compare forceNoInstancing

* restore deleted property.

* Remove unnecessary invalidateScene and requestRedraw calls.

* Cleanup & make work nicer with Z offset

* fix rgb axes in measure distance tool

* Remove debug

* lint & typo

* Modify tessellation for nonuniform scaling

* rush change

* extract-api

* Replace use of System.instance with IModelApp.rSys

* move scaleFactor calc to TileDrawArgs constructor

Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add an option to use the virtual cursor to help with element locate w/touch input. (#1038)

* Add an option to use the virtual cursor to help with element locate w/touch input.

* Not sure what happened to ToolSettings.enableVirtualCursorForLocate...

* re-run extract-api

* Put back the beta tag...

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add settings page to set UI Settings (#984)

* UI Settings Pages sets colorTheme, autoHideUi, useProximityOpacity, snapWidgetOpacity, dragInteraction, frameworkVersion, widgetOpacity.

* Renamed IModelAppUiSettings to UserSettingStorage

* Added LocalSettingsStorage and deprecated LocalUiSettings

* Added SessionSettingsStorage and deprecate SessionUiSettings

* Added UiSettingsStorage interface and aliased UiSettings to it to maintain compatibility

* Renamed SettingsProvider to SettingsTabsProvider

* Added support for registering classes that implement UserSettingsProvider so they are called when UiSettingStorage is set so they can load their default from the storage location.

* Move AppUiSettings from ui-test-app to ui-framework 

* Renamed QuantityFormatSettingsPanel to QuantityFormatSettingsPage

* updated index.html in ui-test-app to add overflow: hidden to avoid scroll bars during login processing.

* Updated SignIn component to avoid button moving during sign-in processing.

* clean-up Electron sign-in and update index.html to prevent scrollbar during log-in

* 2.15.0-dev.8

* Fix IModelHost onAfterStartup event and automatic shutdown. (#1043)

* Fix IModelHost onAfterStartup event and automatic shutdown.

* Add a comment about use of this in IModelHost.shutdown

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Added 'quote' argument to SaveViewTool (#1049)

* Added quote=1 argument.

* change log.

* Fixed comments and set max args to 1.

* Update README

* extract-api

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>

* Rename/deprecate BriefcaseIdValue.Standalone to BriefcaseIdVaue.Unassigned (#1051)

* Fixes for desktop and iOS applications.  (#1032)

* Querying for cached briefcases needs to
include fileSize.

DesktopAuthorization must call onuserStateChanged when
token is set (signIn/refreshed), unset (signOut).

Refined arguments to IOSHost.startup()

Moved rpcInterfaces as an option to NativeHost instead
of ElectronHost so that all native applications (iOS,
Android and Desktops) can use it.

* Change logs.

* fixes

* reverse breaking change. Add rpcInterface to mobileHost

* Fixed iOSHost.startup() and setup ui-test-app to use
recent changes.

* Setup default RPC interfaces in mobile and electron
hosts.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Keith Bentley <33296803+kabentley@users.noreply.github.com>

* 2.15.0-dev.9

* UI: Fix SelectionMode.Multiple in controlled tree (#1036)

* Improve `TreeSelectionManager` tests

* Fix a crash when using `SelectionMode.Multiple` and there are placeholder nodes

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* 2.15.0-dev.10

* 2.15.0-dev.11

* UI: Fix compatibility issue when multiple versions of rxjs are in use (#1052)

* Fix orbitgt pointcloud position (#966)

* Fix orbitgt pointcloud position

* Added distance check and fixed comment

* Add deprecated tags to API summaries (#1002)

* Separately handle deprecated APIs in summary
* Update API changes

* UI: Publish APIs in ui packages that are used by iTwinViewer (#1055)

* Publish APIs used by iTwinViewer

* Rush change

* Fix reference to @beta APIs from @public

* Extract-api

* Extract-api

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fix edge and polyline z (#1059)

* fix z for edges and polylines

* rush change

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fix unit conversion tests and add checking if base units matches for conversions (#1025)

* Check if base units matches for unit conversion and moved conversion tests to test folder

* Added checking base units matches for conversion tests

* Move expected parser data to json file for linting and use deserialize helper method

* Ran rush change and extract-api

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Fix for RPC memory leak (#1044)

* Clear current invocation once resolved
* Interfaces may not be registered -- unauthorized access or tests scenarios -- so try/catch

* Fix logging in tests (#1060)

* fix for logging being disabled after test for worker threads

* rush change

* 2.15.0-dev.12

* Refactor the terrain and reality mesh display to use a single optimized rendering technique.   (#1012)

* Fix argument parsing

* Reduce object creation

* WIP:  non LUT mesh for reality models

* WIP.

* WIP: create primitive for simple mesh

* Simple version with RealityMesh

* Support for non-optimized reality meshes

* Reality mesh through terrain

* Refactor  TerrainMesh => RealityMesh

* Refactor rename TerrainMesh to RealityMesh

* Use typed arrays for terrain mesh

* Fix parameterization of planar patch with skirts.

* Fix translucent reality mesh classificaiton

* Optimize normal support for reality mesh

* Handle 32 bit GLTF indices

* Rename reality mesh color uniform.

* Implement terrain transparency through model appearance override

* Apply mis-stashed changes

* Hiliting for classified reality models

* Implement nonLocatable map with feature override.

* Handle map masks for models that are not currently displayed

* Fix planar transparency masking

* Fix reality mesh transparency override

* Refactor color mixing for reality mesh overriddes

* Extract-api

* Back out unused changes.

* Remove unused change

* Dont override if 0 transparency

* Changes

* Fix import

* Revert incidental changes.

* Revert incidental api changes

* Revert incidental api changes

* Fix symbology instanced test.  Refactor RealityMesh to void webgl dependency

* Remove obsolete test for map tiles not having feature table - they do now.

* Create symbology overrides

* Add earlyZFlags for RealityMesh technique

* Reinstate feature test.

* Track reality mesh memory seperately from terrain meshes

* extract-api

Co-authored-by: Ray.Bentley <rbbentley@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Properly declare changeSetId as string (not GuidString) (#1054)

* Properly type changeSetId variables as string (not GuidString)

* Remove unused imports

* rush extract-api

* rush change

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Changed Elements Test Fix (#1069)

* fix: test changed elements processing by starting at baseline since now we only support rolling forward.

* rush change

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* GridInView changes to address mysterious disappearing grid. (#1045)

* GridInView changes to address mysterious disappearing grid.
1) If grid plane polygon has negative area, reverse it (rather than flipping normal of planes)
2) new option to suppress clipping to the grid plane polygon.
3) when applying grid space range limiters, consider any point in front half of z depth as strong point
   (instead of only points exactly on front)

* Bug in ConvexClipPlaneSet construction -- "negate" method on vector is not "in place"!!
Earlin's preferred GridDisplayOptions:  perspectiveCull=2, clipping along line = 0, lineLimit = 2000

* api

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add tests to check for V1CheckpointManager fixing dbGuid if mis-match. (#1064)

* Add tests to check for V1CheckpointManager fixing dbGuid if mis-match.

* View creator 2d update (#800)

* modelType now optional

* changelog + api sig

* Revert "changelog + api sig"

This reverts commit 13c3a0e.

* modelType removed

* changelog + api signature

Co-authored-by: roopksaini <roopksaini@users.noreply.github.com>
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Update to only update branches with previously successful builds (#1050)

* Update to only update branches with previously successful builds instead of continuously.

* Add support for Safari & Mac testing to dpta #584788 (#1058)

* Fix for flaky RPC/IPC test (#1077)

* Ensure startipctest has finished before sendipcmessage

* 2.15.0-dev.13

* Presentation: Test app improvements (#1070)

* Add Ipc handler to delete/update element

* Initialize presentation-backed in ReadWrite mode

* Throw error when using ipc calls in non IpcApp

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Update several tags in common and frontend @beta to public (#1068)

* update common and frontend tags to @public

* rush change

* make StandaloneDb public

* doc cleanup

* spelling errors

* doc link errors

* update ColorDef doc

* rush change

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Minor agent test cleanup to use new standard methods (#1075)

* Temporarily disable TxnManager tests (#1084)

* temporarily disable TxnManager tests

* rush change

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add integration test that uses IModelTransformer to replay history and exclude deletes (#1053)

* Add integration test that replays iModel history

* rush change

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>

* Promote thematic display API to public (#1089)

* Promote thematic display API to public.

* rush change

* Providing clarification of what 'thematic display' does, why a user would want to use it, and what it indicates about the scene.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

* Add support to generate full API summary report behind a flag (#1062)

* Add support for full API summary report

* @bentley/imodeljs-native 2.15.1

* Promote bentleyjs-core APIs (#1090)

* Promote APIs to public.

* extract-api

* nested list => header

* typo.

* clean up API merge conflicts.

Co-authored-by: Caleb Shafer <31107829+calebmshafer@users.noreply.github.com>
Co-authored-by: DaumantasJankauskas <47949861+DaumantasJankauskas@users.noreply.github.com>
Co-authored-by: imodeljs-admin <38288322+imodeljs-admin@users.noreply.github.com>
Co-authored-by: Dan East <51122937+DanEastBentley@users.noreply.github.com>
Co-authored-by: Keith Bentley <33296803+kabentley@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: bsteinbk <65047615+bsteinbk@users.noreply.github.com>
Co-authored-by: Robert Lukasonok <70327485+roluk@users.noreply.github.com>
Co-authored-by: Bill Goehrig <33036725+wgoehrig@users.noreply.github.com>
Co-authored-by: MarcNeely <36053767+MarcNeely@users.noreply.github.com>
Co-authored-by: bbastings <65233531+bbastings@users.noreply.github.com>
Co-authored-by: Michel D'Astous <mdastous-bentley@users.noreply.github.com>
Co-authored-by: ramanujam-raman <32458710+ramanujam-raman@users.noreply.github.com>
Co-authored-by: Grigas <35135765+grigasp@users.noreply.github.com>
Co-authored-by: lerzeel2 <69574322+lerzeel2@users.noreply.github.com>
Co-authored-by: NancyMcCallB <45079789+NancyMcCallB@users.noreply.github.com>
Co-authored-by: Ivan Kok <ivanjayk@gmail.com>
Co-authored-by: swbsi <69857376+swbsi@users.noreply.github.com>
Co-authored-by: RBBentley <ray.bentley@bentley.com>
Co-authored-by: Ray.Bentley <rbbentley@users.noreply.github.com>
Co-authored-by: scsewall <36768600+scsewall@users.noreply.github.com>
Co-authored-by: Diego Pinate <4107657+diegopinate@users.noreply.github.com>
Co-authored-by: EarlinLutz <69321059+EarlinLutz@users.noreply.github.com>
Co-authored-by: roopksaini <68084841+roopksaini@users.noreply.github.com>
Co-authored-by: roopksaini <roopksaini@users.noreply.github.com>
Co-authored-by: hnn0003 <18196761+hnn0003@users.noreply.github.com>
Co-authored-by: Saulius Skliutas <24278440+saskliutas@users.noreply.github.com>
Co-authored-by: markschlosseratbentley <47000437+markschlosseratbentley@users.noreply.github.com>
@pmconne pmconne mentioned this pull request Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants