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

fix(react-components): Update fit view so it uses only visual object #4734

Merged
merged 8 commits into from
Aug 30, 2024

Conversation

nilscognite
Copy link
Contributor

@nilscognite nilscognite commented Aug 29, 2024

Type of change

Bug

Description 📝

  • Added ToggleAllModelsVisibleCommand. For time being only used for testing.
  • In RevealRenderTarget, made several bounding box function for different usage, changed some naming. Update fitView to only take the visual object in the scene.
  • In Range1/Range3, added makeEmpty function., That was missing. Fix empty box when copy()
  • In GroupTreeView, added fix for infinite recursion. Renamed old needsUpdate() to needsUpdateCore()
  • In AxisTreeView and PlaneTreeView , updated code to handle empty bounding boxes.
  • In FitModelsButton, use the new fitCameraToSceneBoundingBox in Reveal.
  • In useCameraNavigation.tsx, added fitCameraToVisualSceneBoundingBox, to be used in fusion
  • Also upgrade to new version

How has this been tested? 🔍

In storybook/architecture:

Turn on axis
Toogle off all model visualization (Eye icon)
See that the axis is gone.
Try fix view (shouldn't do anything)
Toogle on all model visualization
See that the axis is coming back.
Try fix view

Try the same with a measurement box.

Checklist ☑️

  • I am proud of this feature.
  • I have performed a self-review of my own code.
  • I have added PR type (Feat, Bug, Chore, Test, Docs, Style, Refactor) to the PR title.
  • I have manually tested this for different scenarios (different models, formats, devices, browsers).
  • I have commented my code in hard-to-understand areas.
  • I have made corresponding changes to the public documentation.
  • I have added unit and visuals tests to prove that my feature works to the best of my ability.
  • I have refactored the code for readability to the best of my ability.
  • I have checked that my changes do not introduce regressions in the public documentation.
  • I have outlined any known defects / lacking capabilities in the contents of this PR.
  • I have listed any remaining work that should follow this PR in the description or jira/miro/etc.
  • I have added TSDoc to any public facing changes.
  • I have added "developer documentation" in any package README.md that is related / applicable to this PR.
  • I have noted down and am currently tracking any technical debt introduced in this PR.
  • I have thoroughly thought about the architecture of this implementation.
  • I have asked peers to test this feature.

@@ -237,11 +255,7 @@ export class RevealRenderTarget {
// ==================================================

public fitView(): boolean {
const boundingBox = this.clippedSceneBoundingBox;
if (boundingBox.isEmpty()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure that this check is not need any more?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the viewer is now like this (I have change it, and merged to master)

fitCameraToBoundingBox(boundingBox: THREE.Box3, duration?: number, radiusFactor: number = 2): void {
    if (boundingBox.isEmpty()) {
      return;
    }
    this._activeCameraManager.fitCameraToBoundingBox(boundingBox, duration, radiusFactor);
  }

@nilscognite nilscognite merged commit ed730ce into master Aug 30, 2024
14 checks passed
@nilscognite nilscognite deleted the np/fix-models-in-react-component branch August 30, 2024 06:38
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.

2 participants