Skip to content

Commit

Permalink
chore(dui3): comments
Browse files Browse the repository at this point in the history
  • Loading branch information
didimitrie committed Jun 18, 2024
1 parent bfd5d21 commit 536fc6e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Core/Core/Models/Instances/IInstanceComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Speckle.Core.Models.Instances;
public interface IInstanceComponent
{
/// <summary>
/// The maximum "depth" at which this <see cref="InstanceProxy"/> or <see cref="InstanceDefinitionProxy"/> was found. It's important to get right: as instances can be composed of other instances, we need to start from the deepest instance elements first when reconstructing them, starting with definitions first.
/// The maximum "depth" at which this <see cref="InstanceProxy"/> or <see cref="InstanceDefinitionProxy"/> was found. On receive, as instances can be composed of other instances, we need to start from the deepest instance elements first when reconstructing them, starting with definitions first.
/// </summary>
public int MaxDepth { get; set; }
}
3 changes: 0 additions & 3 deletions Core/Core/Models/Instances/InstanceDefinitionProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,5 @@ public class InstanceDefinitionProxy : Base, IInstanceComponent
/// </summary>
public List<string> Objects { get; set; } // source app application ids for the objects

/// <summary>
/// The maximum "depth" at which this instance was found. It's important to get right: as instances can be composed of other instances, we need to start from the deepest instance elements first when reconstructing them.
/// </summary>
public int MaxDepth { get; set; }
}
3 changes: 0 additions & 3 deletions Core/Core/Models/Instances/InstanceProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,5 @@ public class InstanceProxy : Base, IInstanceComponent
/// </summary>
public string Units { get; set; } = Kits.Units.Meters;

/// <summary>
/// The maximum "depth" at which this instance was found. It's important to get right: as instances can be composed of other instances, we need to start from the deepest instance elements first when reconstructing them.
/// </summary>
public int MaxDepth { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ CancellationToken cancellationToken

var objectGraph = _traversalFunction.Traverse(rootObject).Where(obj => obj.Current is not Collection);

// POC: these are not captured by traversal, so we need to re-add them here
var instanceDefinitionProxies = (rootObject["instanceDefinitionProxies"] as List<object>)
?.Cast<InstanceDefinitionProxy>()
.ToList();
Expand Down Expand Up @@ -91,8 +92,10 @@ CancellationToken cancellationToken

// Stage 1: Convert atomic objects
Dictionary<string, List<Entity>> applicationIdMap = new();
var count = 0;
foreach (var (layerName, atomicObject) in atomicObjects)
{
onOperationProgressed?.Invoke("Converting objects", (double)++count / atomicObjects.Count);
try
{
var convertedObjects = ConvertObject(atomicObject, layerName).ToList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public RootObjectBuilderResult Build(
int count = 0;

var (atomicObjects, instanceProxies, instanceDefinitionProxies) = _instanceObjectsManager.UnpackSelection(objects);
// POC: until we formalise a bit more the root object
modelWithLayers["instanceDefinitionProxies"] = instanceDefinitionProxies;

List<SendConversionResult> results = new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private HostObjectBuilderResult BakeObjects(

var instanceComponents = new List<(string[] layerPath, IInstanceComponent obj)>();

// POC: these are not captured by traversal, so we need to readd them here
// POC: these are not captured by traversal, so we need to re-add them here
if (instanceDefinitionProxies != null && instanceDefinitionProxies.Count > 0)
{
var transformed = instanceDefinitionProxies.Select(proxy => (Array.Empty<string>(), proxy as IInstanceComponent));
Expand Down

0 comments on commit 536fc6e

Please sign in to comment.