Skip to content

Commit

Permalink
Merge Objects dui3/alpha -> dev (#14)
Browse files Browse the repository at this point in the history
* merge DUI3/Alpha into sdk

* formatting

* Objects changes

* Objects tests

* Unit test project
  • Loading branch information
JR-Morgan authored Jul 8, 2024
1 parent b2883c9 commit 29e7e84
Show file tree
Hide file tree
Showing 28 changed files with 1,073 additions and 366 deletions.
4 changes: 1 addition & 3 deletions src/Speckle.Objects/BuiltElements/AdvanceSteel/AsteelBeam.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using System.Collections.Generic;
using Objects.Geometry;
using Objects.Structural.Materials;
using Objects.Structural.Properties.Profiles;
using Speckle.Core.Kits;
using Speckle.Core.Models;

namespace Objects.BuiltElements.AdvanceSteel;

public class AsteelBeam : Beam, IDisplayValue<List<Mesh>>, IHasVolume, IHasArea, IAsteelObject
public class AsteelBeam : Beam, IHasVolume, IHasArea, IAsteelObject
{
[DetachProperty]
public SectionProfile profile { get; set; }
Expand Down
83 changes: 83 additions & 0 deletions src/Speckle.Objects/BuiltElements/Archicad/ArchicadOpening.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
using System.Collections.Generic;
using Objects.Geometry;
using Speckle.Core.Kits;
using Speckle.Core.Models;

namespace Objects.BuiltElements.Archicad;

public class ArchicadOpening : Opening
{
[SchemaInfo("ArchicadOpening", "Creates an Archicad opening.", "Archicad", "Structure")]
public ArchicadOpening() { }

public string parentApplicationId { get; set; }

// Element base
public string? elementType { get; set; } /*APINullabe*/

public List<Classification>? classifications { get; set; } /*APINullabe*/
public Base? elementProperties { get; set; }
public Base? componentProperties { get; set; }

// Floor Plan Parameters
public string? floorPlanDisplayMode { get; set; } /*APINullabe*/
public string? connectionMode { get; set; } /*APINullabe*/

// Cut Surfaces Parameters
public bool? cutsurfacesUseLineOfCutElements { get; set; } /*APINullabe*/
public short? cutsurfacesLinePenIndex { get; set; } /*APINullabe*/
public string? cutsurfacesLineIndex { get; set; } /*APINullabe*/

// Outlines Parameters
public string? outlinesStyle { get; set; } /*APINullabe*/
public bool? outlinesUseLineOfCutElements { get; set; } /*APINullabe*/
public string? outlinesUncutLineIndex { get; set; } /*APINullabe*/
public string? outlinesOverheadLineIndex { get; set; } /*APINullabe*/
public short? outlinesUncutLinePenIndex { get; set; } /*APINullabe*/
public short? outlinesOverheadLinePenIndex { get; set; } /*APINullabe*/

// Opening Cover Fills Parameters
public bool? useCoverFills { get; set; } /*APINullabe*/
public bool? useFillsOfCutElements { get; set; } /*APINullabe*/
public string? coverFillIndex { get; set; } /*APINullabe*/
public short? coverFillPenIndex { get; set; } /*APINullabe*/
public short? coverFillBackgroundPenIndex { get; set; } /*APINullabe*/
public string? coverFillOrientation { get; set; } /*APINullabe*/ // Kérdéses..

// Cover Fill Transformation Parameters
public double? coverFillTransformationOrigoX { get; set; }
public double? coverFillTransformationOrigoY { get; set; }
public double? coverFillTransformationOrigoZ { get; set; }
public double? coverFillTransformationXAxisX { get; set; }
public double? coverFillTransformationXAxisY { get; set; }
public double? coverFillTransformationXAxisZ { get; set; }
public double? coverFillTransformationYAxisX { get; set; }
public double? coverFillTransformationYAxisY { get; set; }
public double? coverFillTransformationYAxisZ { get; set; }

// Reference Axis Parameters
public bool? showReferenceAxis { get; set; } /*APINullabe*/
public short? referenceAxisPenIndex { get; set; } /*APINullabe*/
public string? referenceAxisLineTypeIndex { get; set; } /*APINullabe*/
public double? referenceAxisOverhang { get; set; } /*APINullabe*/

// Extrusion Geometry Parameters
// Plane Frame
public Point extrusionGeometryBasePoint { get; set; }
public Vector extrusionGeometryXAxis { get; set; }
public Vector extrusionGeometryYAxis { get; set; }
public Vector extrusionGeometryZAxis { get; set; }

// Opening Extrustion Parameters
public string? basePolygonType { get; set; } /*APINullabe*/
public double? width { get; set; } /*APINullabe*/
public double? height { get; set; } /*APINullabe*/
public string? constraint { get; set; } /*APINullabe*/
public string? anchor { get; set; } /*APINullabe */
public int? anchorIndex { get; set; } /*APINullabe*/
public double? anchorAltitude { get; set; } /*APINullabe*/
public string? limitType { get; set; } /*APINullabe*/
public double? extrusionStartOffSet { get; set; } /*APINullabe*/
public double? finiteBodyLength { get; set; } /*APINullabe*/
public string? linkedStatus { get; set; } /*APINullabe*/
}
3 changes: 3 additions & 0 deletions src/Speckle.Objects/BuiltElements/Archicad/DirectShape.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ public DirectShape(string applicationId, List<Mesh> displayValue)

// Element base
public string elementType { get; set; }

public List<Classification> classifications { get; set; }
public Base? elementProperties { get; set; }
public Base? componentProperties { get; set; }

public ArchicadLevel level { get; set; }

Expand Down
16 changes: 15 additions & 1 deletion src/Speckle.Objects/BuiltElements/Archicad/ElementShape.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System.Collections.Generic;
using Objects.Geometry;
using Objects.Primitive;
using Speckle.Core.Kits;
using Speckle.Core.Models;
using Speckle.Newtonsoft.Json;

namespace Objects.BuiltElements.Archicad;

Expand All @@ -19,6 +21,9 @@ public ElementShape(Polyline contourPolyline, List<Polyline>? holePolylines = nu

public List<Polyline>? holePolylines { get; set; }

/// <remarks>
/// This class is only used for Archicad interop
/// </remarks>
public sealed class PolylineSegment : Base, ICurve
{
public PolylineSegment() { }
Expand All @@ -33,21 +38,30 @@ public PolylineSegment(Point startPoint, Point endPoint, double? arcAngle = null

public Point startPoint { get; set; }
public Point endPoint { get; set; }

[JsonIgnore]
public string units => Units.Meters;
public double arcAngle { get; set; }
public bool? bodyFlag { get; set; }
public double length { get; set; }
public Interval domain { get; set; } = new(0, 1);
}

/// <remarks>
/// This class is only used for Archicad interop
/// </remarks>
public sealed class Polyline : Base, ICurve
{
public Polyline() { }

public Polyline(List<PolylineSegment> segments)
{
polylineSegments = segments;
this.polylineSegments = segments;
}

[JsonIgnore]
public string units => Units.Meters;

public List<PolylineSegment> polylineSegments { get; set; } = new();
public double length { get; set; }
public Interval domain { get; set; } = new(0, 1);
Expand Down
88 changes: 88 additions & 0 deletions src/Speckle.Objects/BuiltElements/Baseline.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
using Speckle.Core.Models;
using Speckle.Newtonsoft.Json;

namespace Objects.BuiltElements;

public abstract class Baseline : Base
{
protected Baseline() { }

protected Baseline(string name, bool isFeaturelineBased)
{
this.name = name;
this.isFeaturelineBased = isFeaturelineBased;
}

/// <summary>
/// The name of this baseline
/// </summary>
public string name { get; set; }

/// <summary>
/// The horizontal component of this baseline
/// </summary>
public abstract Alignment? alignment { get; internal set; }

/// <summary>
/// The vertical component of this baseline
/// </summary>
public abstract Profile? profile { get; internal set; }

[DetachProperty]
public Featureline? featureline { get; internal set; }

public bool isFeaturelineBased { get; set; }
}

/// <summary>
/// Generic instance class
/// </summary>
public abstract class Baseline<TA, TP> : Baseline
where TA : Alignment
where TP : Profile
{
protected Baseline(string name, TA alignment, TP profile, Featureline? featureline, bool isFeaturelineBased)
: base(name, isFeaturelineBased)
{
this.name = name;
typedAlignment = alignment;
typedProfile = profile;
this.featureline = featureline;
this.isFeaturelineBased = isFeaturelineBased;
}

protected Baseline()
: base(string.Empty, false) { }

[JsonIgnore]
public TA typedAlignment { get; set; }

[JsonIgnore]
public TP typedProfile { get; set; }

[DetachProperty]
public override Alignment? alignment
{
get => typedAlignment;
internal set
{
if (value is TA typeA)
{
typedAlignment = typeA;
}
}
}

[DetachProperty]
public override Profile? profile
{
get => typedProfile;
internal set
{
if (value is TP typeP)
{
typedProfile = typeP;
}
}
}
}
19 changes: 14 additions & 5 deletions src/Speckle.Objects/BuiltElements/Beam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,31 @@

namespace Objects.BuiltElements;

public class Beam : Base, IDisplayValue<List<Mesh>>
public class Beam : Base, IDisplayValue<IReadOnlyList<Base>>
{
public Beam() { }

[SchemaInfo("Beam", "Creates a Speckle beam", "BIM", "Structure")]
public Beam([SchemaMainParam] ICurve baseLine)
public Beam(ICurve baseLine, Level? level, string? units, IReadOnlyList<Mesh>? displayValue = null)
{
this.baseLine = baseLine;
this.level = level;
this.units = units;
this.displayValue = ((IReadOnlyList<Base>?)displayValue) ?? new[] { (Base)baseLine };
}

public ICurve baseLine { get; set; }

public virtual Level? level { get; internal set; }

public string units { get; set; }
public string? units { get; set; }

[DetachProperty]
public List<Mesh> displayValue { get; set; }
public IReadOnlyList<Base> displayValue { get; set; }

#region Schema Info Constructors
[SchemaInfo("Beam", "Creates a Speckle beam", "BIM", "Structure")]
public Beam([SchemaMainParam] ICurve baseLine)
: this(baseLine, null, null) { }

#endregion
}
15 changes: 10 additions & 5 deletions src/Speckle.Objects/BuiltElements/Brace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@

namespace Objects.BuiltElements;

public class Brace : Base, IDisplayValue<List<Mesh>>
public class Brace : Base, IDisplayValue<IReadOnlyList<Base>>
{
public Brace() { }

[SchemaInfo("Brace", "Creates a Speckle brace", "BIM", "Structure")]
public Brace([SchemaMainParam] ICurve baseLine)
public Brace(ICurve baseLine, string? units, IReadOnlyList<Mesh>? displayValue = null)
{
this.baseLine = baseLine;
this.units = units;
this.displayValue = ((IReadOnlyList<Base>?)displayValue) ?? new[] { (Base)baseLine };
}

public ICurve baseLine { get; set; }

public string units { get; set; }
public string? units { get; set; }

[DetachProperty]
public List<Mesh> displayValue { get; set; }
public IReadOnlyList<Base> displayValue { get; set; }

[SchemaInfo("Brace", "Creates a Speckle brace", "BIM", "Structure")]
public Brace([SchemaMainParam] ICurve baseLine)
: this(baseLine, null) { }
}
26 changes: 26 additions & 0 deletions src/Speckle.Objects/BuiltElements/Civil/CivilAppliedAssembly.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System.Collections.Generic;
using Speckle.Core.Models;

namespace Objects.BuiltElements.Civil;

public class CivilAppliedAssembly : Base
{
public CivilAppliedAssembly() { }

public CivilAppliedAssembly(
List<CivilAppliedSubassembly> appliedSubassemblies,
double adjustedElevation,
string units
)
{
this.appliedSubassemblies = appliedSubassemblies;
this.adjustedElevation = adjustedElevation;
this.units = units;
}

public List<CivilAppliedSubassembly> appliedSubassemblies { get; set; }

public double adjustedElevation { get; set; }

public string units { get; set; }
}
37 changes: 37 additions & 0 deletions src/Speckle.Objects/BuiltElements/Civil/CivilAppliedSubassembly.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System.Collections.Generic;
using Objects.Geometry;
using Objects.Other.Civil;
using Speckle.Core.Models;

namespace Objects.BuiltElements.Civil;

public class CivilAppliedSubassembly : Base
{
public CivilAppliedSubassembly() { }

public CivilAppliedSubassembly(
string subassemblyId,
string subassemblyName,
List<CivilCalculatedShape> shapes,
Point stationOffsetElevationToBaseline,
List<CivilDataField> parameters
)
{
this.subassemblyId = subassemblyId;
this.subassemblyName = subassemblyName;
this.shapes = shapes;
this.stationOffsetElevationToBaseline = stationOffsetElevationToBaseline;
this.parameters = parameters;
}

public string subassemblyId { get; set; }

public string subassemblyName { get; set; }

public List<CivilCalculatedShape> shapes { get; set; }

public Point stationOffsetElevationToBaseline { get; set; }

[DetachProperty]
public List<CivilDataField> parameters { get; set; }
}
Loading

0 comments on commit 29e7e84

Please sign in to comment.