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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7f5e214
Remove the need to calculate PseudoIds again in the Converter
jsdbroughton Jun 2, 2023
148c404
Reducing Bindings complexity
jsdbroughton Jun 2, 2023
1af4d46
Remove ViewProxy object class
jsdbroughton Jun 2, 2023
7ce27aa
Adding name to Properties Base class for FE2 goodness
jsdbroughton Jun 2, 2023
71027c9
Removing placeholder code
jsdbroughton Jun 2, 2023
9fa66cb
Add Constants class for rationalisation
jsdbroughton Jun 2, 2023
7e89802
Invokers class + 2 implementations
jsdbroughton Jun 2, 2023
cad9fa7
refactor: SelectionBuilder and Elements class extracted from SendStream
jsdbroughton Jun 2, 2023
291f402
Remove the PseudoId juggling from Utilities
jsdbroughton Jun 2, 2023
ab3ccaa
refactor: Namespace Consistency
jsdbroughton Jun 2, 2023
92434e3
Default pane size improved
jsdbroughton Jun 2, 2023
e98aee7
Reflects the namespace and rationalisation refactoring
jsdbroughton Jun 2, 2023
6c5f2a9
New Setting to request the full model hierarchy
jsdbroughton Jun 2, 2023
48d713d
Reduction of Send method complexity
jsdbroughton Jun 2, 2023
99110df
Merge remote-tracking branch 'origin/dev' into navis/jsdb/full-tree
jsdbroughton Jun 5, 2023
264cd52
Add Element class methods for creating and resolving elements by pseu…
jsdbroughton Jun 6, 2023
8124f2b
Refactor selection builder to improve performance
jsdbroughton Jun 6, 2023
3f82050
Refactor code to improve readability and maintainability
jsdbroughton Jun 6, 2023
cc82b65
Add FilterTypes and amend SelectionBuilder classes
jsdbroughton Jun 7, 2023
580aefc
Invoking SavedView to CurrentView on Main
jsdbroughton Jun 7, 2023
971daab
Refactor SelectionBuilder.cs to improve code readability
jsdbroughton Jun 7, 2023
9bb5b31
Cleanup
jsdbroughton Jun 7, 2023
2034d7f
Cleanup code for Navisworks converter
jsdbroughton Jun 7, 2023
781c140
Sending views either/or
jsdbroughton Jun 7, 2023
817e715
Improve progress bar functionality and add descriptive messages
jsdbroughton Jun 7, 2023
d4bfb4c
Refactor code to handle saved viewpoints in Navisworks
jsdbroughton Jun 7, 2023
c5be549
Progress reporting to always conclude with 100%
jsdbroughton Jun 7, 2023
0000315
Method descriptors
jsdbroughton Jun 7, 2023
47664c4
Removed unused code and commented out lines.
jsdbroughton Jun 7, 2023
f192596
Document ISpeckleConverter interface
jsdbroughton Jun 8, 2023
6d7353f
Merge branch 'dev' into navis/jsdb/full-tree
jsdbroughton Jun 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Autodesk.Navisworks.Api;
using DesktopUI2.Models;
using DesktopUI2.ViewModels;
using static Speckle.ConnectorNavisworks.Utilities;

namespace Speckle.ConnectorNavisworks.Bindings;

Expand All @@ -29,30 +28,21 @@ private void SetsChangedEvent(object sender, EventArgs e)
// This will happen automatically if a document is newly created or opened.
private void DocumentChangedEvent(object sender, EventArgs e)
{
var doc = sender as Document;

try
// As ConnectorNavisworks is Send only, There is little use for a new empty document.
if (sender is not Document doc || doc.IsClear)
{
// As ConnectorNavisworks is Send only, There is little use for a new empty document.
if (doc == null || doc.IsClear)
{
UpdateSavedStreams?.Invoke(new List<StreamState>());
MainViewModel.GoHome();
return;
}
UpdateSavedStreams?.Invoke(new List<StreamState>());
MainViewModel.GoHome();
return;
}

var streams = GetStreamsInFile();
UpdateSavedStreams?.Invoke(streams);
var streams = GetStreamsInFile();
UpdateSavedStreams?.Invoke(streams);

UpdateSelectedStream?.Invoke();
UpdateSelectedStream?.Invoke();

MainViewModel.GoHome();
MainViewModel.GoHome();

_navisworksConverter.SetContextDocument(doc);
}
catch (Exception ex)
{
ErrorLog($"Something went wrong: {ex.Message}");
}
_navisworksConverter.SetContextDocument(doc);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private static TreeNode GetViews(SavedItem savedItem)
// TODO: This is a defensive measure to prevent sending millions of objects that are hidden in the
// current view but not hidden explicitly in the saved view. Optionally if this is not the case we could send visible items in the
// current view with the viewpoint as it is saved.
case false when !((SavedViewpoint)savedItem).ContainsVisibilityOverrides:
case false when savedItem is SavedViewpoint { ContainsVisibilityOverrides: false }:
return null;
case false:
return treeNode;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Linq;
using System.Windows.Forms;
using Autodesk.Navisworks.Api;
using static Speckle.ConnectorNavisworks.Utilities;
using Speckle.ConnectorNavisworks.Other;
using Application = Autodesk.Navisworks.Api.Application;
using Cursor = System.Windows.Forms.Cursor;

Expand All @@ -27,21 +27,14 @@ public override List<string> GetSelectedObjects()
// Storing as a Set for consistency with the converter's handling of fragments and paths.
var selectedObjects = new HashSet<string>();

var selectedItems = appSelectedItems;
var visible = selectedItems.Where(IsElementVisible);
//.SelectMany(x=>x.DescendantsAndSelf)
var visible = appSelectedItems.Where(IsElementVisible);
var visibleItems = visible.ToList();
var ids = visibleItems.Select(GetPseudoId).Where(x => x != null);
var ids = visibleItems.Select(i => new Element().GetElement(i).PseudoId).Where(x => x != null);

selectedObjects.UnionWith(ids);

Cursor.Current = Cursors.Default;

if (visibleItems.Any() && selectedObjects.Count == 0)
{
// Handle Root Node Selection
}

return selectedObjects.ToList();
}

Expand Down
Loading