Skip to content

Commit

Permalink
Support groups for Rhino (#38)
Browse files Browse the repository at this point in the history
* Support groups

* Doc

* POC comment
  • Loading branch information
oguzhankoral authored Jul 17, 2024
1 parent 841054d commit 6fba41d
Show file tree
Hide file tree
Showing 42 changed files with 387 additions and 319 deletions.
20 changes: 10 additions & 10 deletions Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Connectors.Utils": "[1.0.0, )",
"Speckle.Core": "[3.0.0-dev.56, )",
"Speckle.Core": "[3.1.0-dev.63, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -396,7 +396,7 @@
"dependencies": {
"Serilog.Extensions.Logging": "[7.0.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Core": "[3.0.0-dev.56, )"
"Speckle.Core": "[3.1.0-dev.63, )"
}
},
"speckle.converters.arcgis3": {
Expand All @@ -418,7 +418,7 @@
"type": "Project",
"dependencies": {
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.0.0-dev.56, )"
"Speckle.Objects": "[3.1.0-dev.63, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -452,9 +452,9 @@
},
"Speckle.Core": {
"type": "CentralTransitive",
"requested": "[3.0.0-dev.56, )",
"resolved": "3.0.0-dev.56",
"contentHash": "4pYlMqr7iOtYx7m8ZeHzFgNTQLXJxTAcU08wd5Zw37n40FOj/pz22LDNmVIcy/78bccf2mhal1MWCWqd6IkMPw==",
"requested": "[3.1.0-dev.63, )",
"resolved": "3.1.0-dev.63",
"contentHash": "Sh+sEcdI29UUf8zVSuQ3GrwWvAiVrqTH7jqEOc7bI5CjCEE1mRFwxxWqQgNrsTnwhdbR2uJ7iJIY5uEJU2Ebxg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
Expand All @@ -476,11 +476,11 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.0.0-dev.56, )",
"resolved": "3.0.0-dev.56",
"contentHash": "cIeYKd3p9BqoTzvRk0yhzYHw1T0sOeGTYolbckm2ohHUamWZkvIaYOX6z5RlMhSvegKg/jn2o3RiA2wke4NrBA==",
"requested": "[3.1.0-dev.63, )",
"resolved": "3.1.0-dev.63",
"contentHash": "qvHuxM/h1y386Xymvv+lgREnrwf/bGVM91R+J8x5ma1CtLS9RucgSw1aCinVIofMndig+g9sqO/vrBZq6iUiXg==",
"dependencies": {
"Speckle.Core": "3.0.0-dev.56"
"Speckle.Core": "3.1.0-dev.63"
}
},
"System.Threading.Tasks.Dataflow": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Connectors.Utils": "[1.0.0, )",
"Speckle.Core": "[3.0.0-dev.56, )",
"Speckle.Core": "[3.1.0-dev.63, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -449,7 +449,7 @@
"dependencies": {
"Serilog.Extensions.Logging": "[7.0.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Core": "[3.0.0-dev.56, )"
"Speckle.Core": "[3.1.0-dev.63, )"
}
},
"speckle.converters.autocad2023": {
Expand All @@ -471,7 +471,7 @@
"type": "Project",
"dependencies": {
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.0.0-dev.56, )"
"Speckle.Objects": "[3.1.0-dev.63, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -508,9 +508,9 @@
},
"Speckle.Core": {
"type": "CentralTransitive",
"requested": "[3.0.0-dev.56, )",
"resolved": "3.0.0-dev.56",
"contentHash": "4pYlMqr7iOtYx7m8ZeHzFgNTQLXJxTAcU08wd5Zw37n40FOj/pz22LDNmVIcy/78bccf2mhal1MWCWqd6IkMPw==",
"requested": "[3.1.0-dev.63, )",
"resolved": "3.1.0-dev.63",
"contentHash": "Sh+sEcdI29UUf8zVSuQ3GrwWvAiVrqTH7jqEOc7bI5CjCEE1mRFwxxWqQgNrsTnwhdbR2uJ7iJIY5uEJU2Ebxg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
Expand All @@ -532,11 +532,11 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.0.0-dev.56, )",
"resolved": "3.0.0-dev.56",
"contentHash": "cIeYKd3p9BqoTzvRk0yhzYHw1T0sOeGTYolbckm2ohHUamWZkvIaYOX6z5RlMhSvegKg/jn2o3RiA2wke4NrBA==",
"requested": "[3.1.0-dev.63, )",
"resolved": "3.1.0-dev.63",
"contentHash": "qvHuxM/h1y386Xymvv+lgREnrwf/bGVM91R+J8x5ma1CtLS9RucgSw1aCinVIofMndig+g9sqO/vrBZq6iUiXg==",
"dependencies": {
"Speckle.Core": "3.0.0-dev.56"
"Speckle.Core": "3.1.0-dev.63"
}
},
"System.Threading.Tasks.Dataflow": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ private void UnpackInstance(BlockReference instance, int depth, Transaction tran
new()
{
applicationId = instanceIdString,
DefinitionId = definitionId.ToString(),
MaxDepth = depth,
Transform = GetMatrix(instance.BlockTransform.ToArray()),
Units = Application.DocumentManager.CurrentDocument.Database.Insunits.ToSpeckleString()
definitionId = definitionId.ToString(),
maxDepth = depth,
transform = GetMatrix(instance.BlockTransform.ToArray()),
units = Application.DocumentManager.CurrentDocument.Database.Insunits.ToSpeckleString()
};
_instanceObjectsManager.AddInstanceProxy(instanceIdString, instanceProxy);

Expand All @@ -82,9 +82,9 @@ out List<InstanceProxy> instanceProxiesWithSameDefinition
// We ensure that all previous instance proxies that have the same definition are at this max depth. I kind of have a feeling this can be done more elegantly, but YOLO
foreach (var instanceProxyWithSameDefinition in instanceProxiesWithSameDefinition)
{
if (instanceProxyWithSameDefinition.MaxDepth < depth)
if (instanceProxyWithSameDefinition.maxDepth < depth)
{
instanceProxyWithSameDefinition.MaxDepth = depth;
instanceProxyWithSameDefinition.maxDepth = depth;
}
}

Expand All @@ -94,7 +94,7 @@ out List<InstanceProxy> instanceProxiesWithSameDefinition
_instanceObjectsManager.TryGetInstanceDefinitionProxy(definitionId.ToString(), out InstanceDefinitionProxy value)
)
{
int depthDifference = depth - value.MaxDepth;
int depthDifference = depth - value.maxDepth;
if (depthDifference > 0)
{
// all MaxDepth of children definitions and its instances should be increased with difference of depth
Expand All @@ -108,9 +108,9 @@ out List<InstanceProxy> instanceProxiesWithSameDefinition
var definitionProxy = new InstanceDefinitionProxy()
{
applicationId = definitionId.ToString(),
Objects = new(),
MaxDepth = depth,
Name = definition.Name,
objects = new(),
maxDepth = depth,
name = definition.Name,
["comments"] = definition.Comments,
["units"] = definition.Units // ? not sure needed?
};
Expand All @@ -120,7 +120,7 @@ out List<InstanceProxy> instanceProxiesWithSameDefinition
{
var obj = transaction.GetObject(id, OpenMode.ForRead);
var handleIdString = obj.Handle.Value.ToString();
definitionProxy.Objects.Add(handleIdString);
definitionProxy.objects.Add(handleIdString);

if (obj is BlockReference blockReference && !blockReference.IsDynamicBlock)
{
Expand All @@ -140,7 +140,7 @@ public BakeResult BakeInstances(
)
{
var sortedInstanceComponents = instanceComponents
.OrderByDescending(x => x.obj.MaxDepth) // Sort by max depth, so we start baking from the deepest element first
.OrderByDescending(x => x.obj.maxDepth) // Sort by max depth, so we start baking from the deepest element first
.ThenBy(x => x.obj is InstanceDefinitionProxy ? 0 : 1) // Ensure we bake the deepest definition first, then any instances that depend on it
.ToList();

Expand All @@ -161,15 +161,15 @@ public BakeResult BakeInstances(
{
// TODO: create definition (block table record)
var constituentEntities = definitionProxy
.Objects.Select(id => applicationIdMap.TryGetValue(id, out List<Entity> value) ? value : null)
.objects.Select(id => applicationIdMap.TryGetValue(id, out List<Entity> value) ? value : null)
.Where(x => x is not null)
.SelectMany(ent => ent)
.ToList();

var record = new BlockTableRecord();
var objectIds = new ObjectIdCollection();
// We're expecting to have Name prop always for definitions. If there is an edge case, ask to Dim or Ogu
record.Name = $"{definitionProxy.Name}-({definitionProxy.applicationId})-{baseLayerName}";
record.Name = $"{definitionProxy.name}-({definitionProxy.applicationId})-{baseLayerName}";

foreach (var entity in constituentEntities)
{
Expand All @@ -190,10 +190,10 @@ public BakeResult BakeInstances(
}
else if (
instanceOrDefinition is InstanceProxy instanceProxy
&& definitionIdAndApplicationIdMap.TryGetValue(instanceProxy.DefinitionId, out ObjectId definitionId)
&& definitionIdAndApplicationIdMap.TryGetValue(instanceProxy.definitionId, out ObjectId definitionId)
)
{
var matrix3d = GetMatrix3d(instanceProxy.Transform, instanceProxy.Units);
var matrix3d = GetMatrix3d(instanceProxy.transform, instanceProxy.units);
var insertionPoint = Point3d.Origin.TransformBy(matrix3d);

var modelSpaceBlockTableRecord = Application.DocumentManager.CurrentDocument.Database.GetModelSpace(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Connectors.Utils": "[1.0.0, )",
"Speckle.Core": "[3.0.0-dev.56, )",
"Speckle.Core": "[3.1.0-dev.63, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -458,7 +458,7 @@
"dependencies": {
"Serilog.Extensions.Logging": "[7.0.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Core": "[3.0.0-dev.56, )"
"Speckle.Core": "[3.1.0-dev.63, )"
}
},
"speckle.converters.civil3d2024": {
Expand All @@ -481,7 +481,7 @@
"type": "Project",
"dependencies": {
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.0.0-dev.56, )"
"Speckle.Objects": "[3.1.0-dev.63, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -518,9 +518,9 @@
},
"Speckle.Core": {
"type": "CentralTransitive",
"requested": "[3.0.0-dev.56, )",
"resolved": "3.0.0-dev.56",
"contentHash": "4pYlMqr7iOtYx7m8ZeHzFgNTQLXJxTAcU08wd5Zw37n40FOj/pz22LDNmVIcy/78bccf2mhal1MWCWqd6IkMPw==",
"requested": "[3.1.0-dev.63, )",
"resolved": "3.1.0-dev.63",
"contentHash": "Sh+sEcdI29UUf8zVSuQ3GrwWvAiVrqTH7jqEOc7bI5CjCEE1mRFwxxWqQgNrsTnwhdbR2uJ7iJIY5uEJU2Ebxg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
Expand All @@ -542,11 +542,11 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.0.0-dev.56, )",
"resolved": "3.0.0-dev.56",
"contentHash": "cIeYKd3p9BqoTzvRk0yhzYHw1T0sOeGTYolbckm2ohHUamWZkvIaYOX6z5RlMhSvegKg/jn2o3RiA2wke4NrBA==",
"requested": "[3.1.0-dev.63, )",
"resolved": "3.1.0-dev.63",
"contentHash": "qvHuxM/h1y386Xymvv+lgREnrwf/bGVM91R+J8x5ma1CtLS9RucgSw1aCinVIofMndig+g9sqO/vrBZq6iUiXg==",
"dependencies": {
"Speckle.Core": "3.0.0-dev.56"
"Speckle.Core": "3.1.0-dev.63"
}
},
"System.Threading.Tasks.Dataflow": {
Expand Down
20 changes: 10 additions & 10 deletions Connectors/Revit/Speckle.Connectors.Revit2022/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Connectors.Utils": "[1.0.0, )",
"Speckle.Core": "[3.0.0-dev.56, )",
"Speckle.Core": "[3.1.0-dev.63, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -460,14 +460,14 @@
"dependencies": {
"Serilog.Extensions.Logging": "[7.0.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Core": "[3.0.0-dev.56, )"
"Speckle.Core": "[3.1.0-dev.63, )"
}
},
"speckle.converters.common": {
"type": "Project",
"dependencies": {
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.0.0-dev.56, )"
"Speckle.Objects": "[3.1.0-dev.63, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -515,9 +515,9 @@
},
"Speckle.Core": {
"type": "CentralTransitive",
"requested": "[3.0.0-dev.56, )",
"resolved": "3.0.0-dev.56",
"contentHash": "4pYlMqr7iOtYx7m8ZeHzFgNTQLXJxTAcU08wd5Zw37n40FOj/pz22LDNmVIcy/78bccf2mhal1MWCWqd6IkMPw==",
"requested": "[3.1.0-dev.63, )",
"resolved": "3.1.0-dev.63",
"contentHash": "Sh+sEcdI29UUf8zVSuQ3GrwWvAiVrqTH7jqEOc7bI5CjCEE1mRFwxxWqQgNrsTnwhdbR2uJ7iJIY5uEJU2Ebxg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
Expand All @@ -539,11 +539,11 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.0.0-dev.56, )",
"resolved": "3.0.0-dev.56",
"contentHash": "cIeYKd3p9BqoTzvRk0yhzYHw1T0sOeGTYolbckm2ohHUamWZkvIaYOX6z5RlMhSvegKg/jn2o3RiA2wke4NrBA==",
"requested": "[3.1.0-dev.63, )",
"resolved": "3.1.0-dev.63",
"contentHash": "qvHuxM/h1y386Xymvv+lgREnrwf/bGVM91R+J8x5ma1CtLS9RucgSw1aCinVIofMndig+g9sqO/vrBZq6iUiXg==",
"dependencies": {
"Speckle.Core": "3.0.0-dev.56"
"Speckle.Core": "3.1.0-dev.63"
}
},
"Speckle.Revit.API": {
Expand Down
20 changes: 10 additions & 10 deletions Connectors/Revit/Speckle.Connectors.Revit2023/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[7.0.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Connectors.Utils": "[1.0.0, )",
"Speckle.Core": "[3.0.0-dev.56, )",
"Speckle.Core": "[3.1.0-dev.63, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -460,14 +460,14 @@
"dependencies": {
"Serilog.Extensions.Logging": "[7.0.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Core": "[3.0.0-dev.56, )"
"Speckle.Core": "[3.1.0-dev.63, )"
}
},
"speckle.converters.common": {
"type": "Project",
"dependencies": {
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.0.0-dev.56, )"
"Speckle.Objects": "[3.1.0-dev.63, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -514,9 +514,9 @@
},
"Speckle.Core": {
"type": "CentralTransitive",
"requested": "[3.0.0-dev.56, )",
"resolved": "3.0.0-dev.56",
"contentHash": "4pYlMqr7iOtYx7m8ZeHzFgNTQLXJxTAcU08wd5Zw37n40FOj/pz22LDNmVIcy/78bccf2mhal1MWCWqd6IkMPw==",
"requested": "[3.1.0-dev.63, )",
"resolved": "3.1.0-dev.63",
"contentHash": "Sh+sEcdI29UUf8zVSuQ3GrwWvAiVrqTH7jqEOc7bI5CjCEE1mRFwxxWqQgNrsTnwhdbR2uJ7iJIY5uEJU2Ebxg==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
Expand All @@ -538,11 +538,11 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.0.0-dev.56, )",
"resolved": "3.0.0-dev.56",
"contentHash": "cIeYKd3p9BqoTzvRk0yhzYHw1T0sOeGTYolbckm2ohHUamWZkvIaYOX6z5RlMhSvegKg/jn2o3RiA2wke4NrBA==",
"requested": "[3.1.0-dev.63, )",
"resolved": "3.1.0-dev.63",
"contentHash": "qvHuxM/h1y386Xymvv+lgREnrwf/bGVM91R+J8x5ma1CtLS9RucgSw1aCinVIofMndig+g9sqO/vrBZq6iUiXg==",
"dependencies": {
"Speckle.Core": "3.0.0-dev.56"
"Speckle.Core": "3.1.0-dev.63"
}
},
"Speckle.Revit.API": {
Expand Down
Loading

0 comments on commit 6fba41d

Please sign in to comment.