Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into DUI3-474-DirectShape-P…
Browse files Browse the repository at this point in the history
…oints
  • Loading branch information
Connor Ivy committed Jul 17, 2024
2 parents b15b0aa + 7bad788 commit 5aea912
Show file tree
Hide file tree
Showing 51 changed files with 414 additions and 326 deletions.
18 changes: 15 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_namespace_declarations = file_scoped
csharp_style_namespace_declarations = file_scoped:silent

# Newline settings
csharp_new_line_before_open_brace = all
Expand Down Expand Up @@ -134,7 +134,7 @@ csharp_preserve_single_line_blocks = true
# Non-private fields are PascalCase
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = warning
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_readonly_field_style
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = pascal_case_style

dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
Expand Down Expand Up @@ -186,7 +186,7 @@ dotnet_naming_style.camel_case_style.capitalization = camel_case
# Local functions are PascalCase
dotnet_naming_rule.local_functions_should_be_pascal_case.severity = warning
dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style
dotnet_naming_rule.local_functions_should_be_pascal_case.style = pascal_case_style

dotnet_naming_symbols.local_functions.applicable_kinds = local_function

Expand Down Expand Up @@ -233,6 +233,9 @@ dotnet_diagnostic.ide0042.severity = suggestion # Deconstruct variable declarati
dotnet_diagnostic.ide0028.severity = suggestion # Use collection initializers: Subjective
dotnet_diagnostic.ide0072.severity = suggestion # Populate switch statement: Subjective
dotnet_diagnostic.ide0074.severity = suggestion # Use compound assignment: Subjective
dotnet_diagnostic.ide0300.severity = suggestion # collection can be simplied
dotnet_diagnostic.ide0005.severity = error # usings
dotnet_diagnostic.ide0290.severity = suggestion # primary constructors

# Maintainability rules
dotnet_diagnostic.ca1501.severity = warning # Avoid excessive inheritance
Expand Down Expand Up @@ -302,8 +305,17 @@ dotnet_diagnostic.NUnit2036.severity = warning # Consider using Assert.That(coll
dotnet_diagnostic.NUnit2037.severity = warning # Consider using Assert.That(collection, Does.Contain(instance)) instead of Assert.Contains(instance, collection)
dotnet_diagnostic.NUnit2038.severity = warning # Consider using Assert.That(actual, Is.InstanceOf(expected)) instead of Assert.IsInstanceOf(expected, actual)
dotnet_diagnostic.NUnit2039.severity = warning # Consider using Assert.That(actual, Is.Not.InstanceOf(expected)) instead of Assert.IsNotInstanceOf(expected, actual)
csharp_prefer_simple_using_statement = true:suggestion
csharp_prefer_braces = true:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
csharp_indent_labels = one_less_than_current
csharp_style_expression_bodied_lambdas = true:silent

[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,cc,cginc,compute,cp,cpp,cs,cshtml,cu,cuh,cxx,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,nuspec,paml,razor,resw,resx,shader,skin,tpp,usf,ush,vb,xaml,xamlx,xoml,xsd}]
indent_style = space
indent_size = 2
tab_width = 2
dotnet_style_operator_placement_when_wrapping = beginning_of_line
end_of_line = crlf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Speckle.Converters.Common;
using Speckle.Core.Logging;
using Speckle.Core.Models;
using Speckle.Core.Models.Collections;
using Speckle.Core.Models.GraphTraversal;
using RasterLayer = Objects.GIS.RasterLayer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Speckle.Converters.Common;
using Speckle.Core.Logging;
using Speckle.Core.Models;
using Speckle.Core.Models.Collections;

namespace Speckle.Connectors.ArcGis.Operations.Send;

Expand Down
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.68, )",
"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.68, )"
}
},
"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.68, )"
}
},
"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.68, )",
"resolved": "3.1.0-dev.68",
"contentHash": "+N3hCSKPXz2Qm2rEFXBv/cEiAfO9c2VicULm4CUoyyqSvwh+k+k5qJnEkzAd0yuWQtvJHyub8TsarBjes34eww==",
"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.68, )",
"resolved": "3.1.0-dev.68",
"contentHash": "zeDL5zAbjRWsEMCgkhcKK6DDs/S9PrD6Rpx1AWiq+Ix7ThD3LstR+JsN9qLyCJ2i02tnHnHxi9nhxA/v2c7eWA==",
"dependencies": {
"Speckle.Core": "3.0.0-dev.56"
"Speckle.Core": "3.1.0-dev.68"
}
},
"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.68, )",
"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.68, )"
}
},
"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.68, )"
}
},
"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.68, )",
"resolved": "3.1.0-dev.68",
"contentHash": "+N3hCSKPXz2Qm2rEFXBv/cEiAfO9c2VicULm4CUoyyqSvwh+k+k5qJnEkzAd0yuWQtvJHyub8TsarBjes34eww==",
"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.68, )",
"resolved": "3.1.0-dev.68",
"contentHash": "zeDL5zAbjRWsEMCgkhcKK6DDs/S9PrD6Rpx1AWiq+Ix7ThD3LstR+JsN9qLyCJ2i02tnHnHxi9nhxA/v2c7eWA==",
"dependencies": {
"Speckle.Core": "3.0.0-dev.56"
"Speckle.Core": "3.1.0-dev.68"
}
},
"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
@@ -1,7 +1,7 @@
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.LayerManager;
using Speckle.Core.Models;
using Speckle.Core.Models.Collections;
using Speckle.Core.Models.GraphTraversal;

namespace Speckle.Connectors.Autocad.HostApp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Speckle.Converters.Common;
using Speckle.Core.Logging;
using Speckle.Core.Models;
using Speckle.Core.Models.Collections;
using Speckle.Core.Models.GraphTraversal;
using Speckle.Core.Models.Instances;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Diagnostics;
using System.Diagnostics;
using Autodesk.AutoCAD.DatabaseServices;
using Speckle.Connectors.Autocad.HostApp;
using Speckle.Connectors.Utils.Builders;
Expand All @@ -8,6 +8,7 @@
using Speckle.Converters.Common;
using Speckle.Core.Logging;
using Speckle.Core.Models;
using Speckle.Core.Models.Collections;
using Speckle.Core.Models.Instances;

namespace Speckle.Connectors.Autocad.Operations.Send;
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.68, )",
"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.68, )"
}
},
"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.68, )"
}
},
"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.68, )",
"resolved": "3.1.0-dev.68",
"contentHash": "+N3hCSKPXz2Qm2rEFXBv/cEiAfO9c2VicULm4CUoyyqSvwh+k+k5qJnEkzAd0yuWQtvJHyub8TsarBjes34eww==",
"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.68, )",
"resolved": "3.1.0-dev.68",
"contentHash": "zeDL5zAbjRWsEMCgkhcKK6DDs/S9PrD6Rpx1AWiq+Ix7ThD3LstR+JsN9qLyCJ2i02tnHnHxi9nhxA/v2c7eWA==",
"dependencies": {
"Speckle.Core": "3.0.0-dev.56"
"Speckle.Core": "3.1.0-dev.68"
}
},
"System.Threading.Tasks.Dataflow": {
Expand Down
Loading

0 comments on commit 5aea912

Please sign in to comment.