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

feature(Navisworks): Enhance Selection Handling and Hierarchy Population #2641

Merged
merged 31 commits into from
Jun 12, 2023

Conversation

jsdbroughton
Copy link
Contributor

@jsdbroughton jsdbroughton commented Jun 5, 2023

tldr; The SelectionBuilder refactor shuffles much code around and lightens the Send Binding. If you are hell-bent on a code review, look at SelectionBuilder, Elements, and ConnectorNavsiworksBindings.Send for the meat and potatoes.

Description & motivation

This pull request focuses on enhancing the user experience and feedback during selection, conversion, and send operations in the Navisworks Connector. The primary goal is to improve the responsiveness and feedback provided to users during these operations, ensuring a more seamless and informative user experience.

The move from Depth-First conversion to Stack and rebuild allows for the granularity of feedback that is preferable at some small cost in setup and tree reconstruction.

Adding the Invoker class as a wrapper for anything that needs processing on the main thread may reopen the door to aggressive multithreading for everything that doesn't touch volatile memory.

Changes:

The main changes include:

  • Progress Feedback Improvements: The ProgressInvoker implementation (ProgressInvoker.cs) has been updated to address the issue of delayed UI updates during selection and conversion operations. Previously, selecting a root node would not update the UI until the entire hierarchy had been converted. The new implementation introduces a depth-first search and conversion approach, allowing the UI to update incrementally as elements are selected and converted. This improvement provides real-time feedback to users, making the process more transparent and responsive.

  • Selection and Conversion Handling: The SelectionBuilder class (SelectionBuilder.cs) has been introduced to handle the selection filtering and retrieval of model items. With this enhancement, the selection process is optimized, allowing for more efficient and accurate selection of elements. The updated selection handling improves the overall performance and usability of the connector. Added the SelectionBuilder class (SelectionBuilder.cs) to filter and retrieve model items based on different selection criteria, such as manual selection, saved sets, views, and clashes. This improves the selection process by making it more efficient and accurate.

  • Added a new Invoker class and refactored out of the Send method: The ProgressInvoker implementation (Invokers.cs) provides better feedback and improves the user experience during selection, conversion, and send operations. The previous implementation caused delays in UI updates, especially when selecting a root node, as the entire hierarchy needed to be converted before updating the UI. The new implementation updates the UI incrementally, providing real-time feedback and improving responsiveness.

  • User Interface Updates: The Ribbon UI (Ribbon.xaml.cs) has been refined to provide a more intuitive and user-friendly interface. The UI updates enhance the overall navigation and interaction with the connector, contributing to a more seamless workflow. Refined the Ribbon UI (Ribbon.xaml.cs) to enhance navigation and interaction with the Navisworks Connector. The updates improve the user experience by making the UI more intuitive and user-friendly, allowing users to access and utilize the connector's functionalities easily. Updated the SpeckleNavisworksCommand class (SpeckleNavisworksCommand.cs) to adjust the size of the docking pane to accommodate the connector's UI elements better, providing a more optimal viewing experience for users.

  • Housekeeping: Removed the ViewProxy class (ViewProxy.cs) as it was no longer needed and had become obsolete in the updated implementation.

Fixes and Implementations:

#2599 - Default Pane size increased
#2299 - Granular Feedback
#2298 - Cancelling during conversions
#2515 - Full Hierarchical sends

Improvements to previous fixes

#2272 - Improves previous enhancement
#2270 - Improves previous enhancement

@jsdbroughton jsdbroughton changed the title Navis/jsdb/full tree feature(Navisworks): Enhance Selection Handling and Hierarchy Population Jun 5, 2023
@jsdbroughton jsdbroughton marked this pull request as ready for review June 5, 2023 13:43
@jsdbroughton jsdbroughton marked this pull request as draft June 5, 2023 15:25
…doId or ModelItem. Also add methods for building a nested object hierarchy from a dictionary of flat key-value pairs.

Add Element class methods for creating and resolving elements by pseudoId or ModelItem. Also add methods for building a nested object hierarchy from a dictionary of flat key-value pairs.
This commit refactors the SelectionBuilder class to improve its performance. The changes include adding a HashSet for visited nodes, updating progress bar messages, and optimizing the PopulateHierarchyAndOmitHidden method. Additionally, a new method called ValidateStartNodes has been added to remove hidden nodes from the starting list of nodes if they are not visible in the model.
The changes in this commit refactor the code to improve its readability and maintainability. The changes include removing unnecessary parameters, renaming variables for clarity, and improving error handling.
This commit adds two new classes, FilterTypes and amends SelectionBuilder. The FilterTypes class contains constants for different types of filters, while the SelectionBuilder class handles getting objects from a filter and populating a hierarchy while omitting hidden items.
It makes the view active on the main thread, adds a check for null or empty _uniqueModelItems, and omits hidden items from the hierarchy. Additionally, it replaces some of the if statements with more concise expressions.
@jsdbroughton jsdbroughton force-pushed the navis/jsdb/full-tree branch from b9f9e9d to 580aefc Compare June 7, 2023 01:17
@jsdbroughton jsdbroughton added bug Something isn't working enhancement New feature or request navisworks issues related to Navisworks labels Jun 7, 2023
@jsdbroughton jsdbroughton force-pushed the navis/jsdb/full-tree branch from 876d4dc to 580aefc Compare June 7, 2023 08:23
This commit refactors the SelectionBuilder class in ConnectorNavisworks/Other/SelectionBuilder.cs. The changes include removing unused code, adding comments for clarity, and improving variable names. These changes should make the code easier to read and maintain.
Cleanup: Remove unnecessary comments and whitespace, according to cleanup task
It now only sends the current view if no other views are selected regardless of the options setting
This commit improves the progress bar functionality by adding a fraction of remaining time to the ProgressLooper method. It also adds more descriptive messages to the ProgressBar.BeginSubOperation method in SelectionHandler class.
This commit refactors the ConnectorNavisworksBindings.Send.cs and ConverterNavisworks.ToSpeckle.cs files to handle saved viewpoints in Navisworks. The changes include creating a new SelectionHandler class, resolving saved viewpoints, and converting them to base objects.
Updates with an inheritance annotation.
@jsdbroughton jsdbroughton requested a review from JR-Morgan June 8, 2023 13:26
@jsdbroughton jsdbroughton self-assigned this Jun 8, 2023
@jsdbroughton jsdbroughton added this to the 2.15 milestone Jun 8, 2023
@jsdbroughton jsdbroughton requested a review from teocomi June 8, 2023 22:20
@jsdbroughton jsdbroughton force-pushed the navis/jsdb/full-tree branch from fa0228e to f192596 Compare June 10, 2023 12:19
Copy link
Contributor

@AlanRynne AlanRynne left a comment

Choose a reason for hiding this comment

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

Since this is touching only your connector, I'm approving this in the hopes it will be tested with the next WIP

@AlanRynne AlanRynne merged commit 2a91108 into dev Jun 12, 2023
@AlanRynne AlanRynne deleted the navis/jsdb/full-tree branch June 12, 2023 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment