-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91d2336
commit 1b1e2d6
Showing
22 changed files
with
223 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 17 additions & 15 deletions
32
DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/EllipseToHostConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 11 additions & 3 deletions
14
DUI3-DX/Converters/Rhino/Speckle.Converters.Rhino7/ToHost/Raw/IntervalToHostConverter.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
using Speckle.Converters.Common.Objects; | ||
using Speckle.Rhino7.Interfaces; | ||
|
||
namespace Speckle.Converters.Rhino7.ToHost.Raw; | ||
|
||
public class IntervalToHostConverter : ITypedConverter<SOP.Interval, RG.Interval> | ||
public class IntervalToHostConverter : ITypedConverter<SOP.Interval, IRhinoInterval> | ||
{ | ||
private readonly IRhinoIntervalFactory _rhinoIntervalFactory; | ||
|
||
public IntervalToHostConverter(IRhinoIntervalFactory rhinoIntervalFactory) | ||
{ | ||
_rhinoIntervalFactory = rhinoIntervalFactory; | ||
} | ||
|
||
/// <summary> | ||
/// Converts a Speckle Interval object to a Rhino.Geometry.Interval object. | ||
/// </summary> | ||
/// <param name="target">The Speckle Interval to convert.</param> | ||
/// <returns>The converted Rhino.Geometry.Interval object.</returns> | ||
/// <exception cref="ArgumentException">Thrown when the start or end value of the Interval is null.</exception> | ||
/// <remarks>⚠️ This conversion does NOT perform scaling.</remarks> | ||
public RG.Interval Convert(SOP.Interval target) | ||
public IRhinoInterval Convert(SOP.Interval target) | ||
{ | ||
if (!target.start.HasValue || !target.end.HasValue) // POC: CNX-9272 Interval start and end being nullable makes no sense. | ||
{ | ||
throw new ArgumentException("Interval start/end cannot be null"); | ||
} | ||
|
||
return new RG.Interval(target.start.Value, target.end.Value); | ||
return _rhinoIntervalFactory.Create(target.start.Value, target.end.Value); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.