-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 47704: Filling out VOs and Adapters for 3D Points, Lines, a…
…nd Rectangles Filling out and making symmetric our set of VOs and adapters for: - Point3D (MathNET and Windows) - Line3D (MathNET) - Rect3D (Windows) And handling all combinations of T, Nullable<T>, and List<T>. Added descriptions to all configuration properties for these. Related work items: #132887
- Loading branch information
Showing
21 changed files
with
490 additions
and
291 deletions.
There are no files selected for viewing
29 changes: 0 additions & 29 deletions
29
...ces/Visualization/Microsoft.Psi.Visualization.Windows/Adapters/CoordinateSystemAdapter.cs
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
...Visualization/Microsoft.Psi.Visualization.Windows/Adapters/Line3DListToNullableAdapter.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Microsoft.Psi.Visualization.Adapters | ||
{ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using MathNet.Spatial.Euclidean; | ||
using Microsoft.Psi.Visualization.Data; | ||
|
||
/// <summary> | ||
/// Used to adapt streams of lists of <see cref="Line3D"/> to lists of nullable <see cref="Line3D"/>. | ||
/// </summary> | ||
[StreamAdapter] | ||
public class Line3DListToNullableAdapter : StreamAdapter<List<Line3D>, List<Line3D?>> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Line3DListToNullableAdapter"/> class. | ||
/// </summary> | ||
public Line3DListToNullableAdapter() | ||
: base(Adapter) | ||
{ | ||
} | ||
|
||
private static List<Line3D?> Adapter(List<Line3D> value, Envelope env) | ||
{ | ||
return value?.Select(p => p as Line3D?).ToList(); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...ces/Visualization/Microsoft.Psi.Visualization.Windows/Adapters/Line3DToNullableAdapter.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Microsoft.Psi.Visualization.Adapters | ||
{ | ||
using MathNet.Spatial.Euclidean; | ||
using Microsoft.Psi.Visualization.Data; | ||
|
||
/// <summary> | ||
/// Used to adapt streams of <see cref="Line3D"/> into nullable <see cref="Line3D"/>. | ||
/// </summary> | ||
[StreamAdapter] | ||
public class Line3DToNullableAdapter : StreamAdapter<Line3D, Line3D?> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Line3DToNullableAdapter"/> class. | ||
/// </summary> | ||
public Line3DToNullableAdapter() | ||
: base(Adapter) | ||
{ | ||
} | ||
|
||
private static Line3D? Adapter(Line3D value, Envelope env) | ||
{ | ||
return value; | ||
} | ||
} | ||
} |
36 changes: 0 additions & 36 deletions
36
...si.Visualization.Windows/Adapters/MathNetNullableLine3DToLine3DListVisualizationObject.cs
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
...ization.Windows/Adapters/MathNetNullablePoint3DListToWindowsNullablePoint3DListAdapter.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Microsoft.Psi.Visualization.Adapters | ||
{ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Microsoft.Psi.Visualization.Data; | ||
|
||
using MathNet = MathNet.Spatial.Euclidean; | ||
using Windows = System.Windows.Media.Media3D; | ||
|
||
/// <summary> | ||
/// Used to adapt streams of lists of nullable <see cref="MathNet.Point3D"/> into lists of nullable <see cref="Windows.Point3D"/>. | ||
/// </summary> | ||
[StreamAdapter] | ||
public class MathNetNullablePoint3DListToWindowsNullablePoint3DListAdapter : StreamAdapter<List<MathNet.Point3D?>, List<Windows.Point3D?>> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="MathNetNullablePoint3DListToWindowsNullablePoint3DListAdapter"/> class. | ||
/// </summary> | ||
public MathNetNullablePoint3DListToWindowsNullablePoint3DListAdapter() | ||
: base(Adapter) | ||
{ | ||
} | ||
|
||
private static List<Windows.Point3D?> Adapter(List<MathNet.Point3D?> value, Envelope env) | ||
{ | ||
return value?.Select(p => p.HasValue ? new Windows.Point3D(p.Value.X, p.Value.Y, p.Value.Z) as Windows.Point3D? : null).ToList(); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...i.Visualization.Windows/Adapters/MathNetNullablePoint3DToWindowsNullablePoint3DAdapter.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Microsoft.Psi.Visualization.Adapters | ||
{ | ||
using Microsoft.Psi.Visualization.Data; | ||
|
||
using MathNet = MathNet.Spatial.Euclidean; | ||
using Windows = System.Windows.Media.Media3D; | ||
|
||
/// <summary> | ||
/// Used to adapt streams of nullable <see cref="MathNet.Point3D"/> into nullable <see cref="Windows.Point3D"/>. | ||
/// </summary> | ||
[StreamAdapter] | ||
public class MathNetNullablePoint3DToWindowsNullablePoint3DAdapter : StreamAdapter<MathNet.Point3D?, Windows.Point3D?> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="MathNetNullablePoint3DToWindowsNullablePoint3DAdapter"/> class. | ||
/// </summary> | ||
public MathNetNullablePoint3DToWindowsNullablePoint3DAdapter() | ||
: base(Adapter) | ||
{ | ||
} | ||
|
||
private static Windows.Point3D? Adapter(MathNet.Point3D? value, Envelope env) | ||
{ | ||
return value.HasValue ? new Windows.Point3D(value.Value.X, value.Value.Y, value.Value.Z) as Windows.Point3D? : null; | ||
} | ||
} | ||
} |
33 changes: 0 additions & 33 deletions
33
...t.Psi.Visualization.Windows/Adapters/MathNetNullablePoint3DToWindowsPoint3DListAdapter.cs
This file was deleted.
Oops, something went wrong.
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
30 changes: 30 additions & 0 deletions
30
...osoft.Psi.Visualization.Windows/Adapters/MathNetPoint3DToWindowsNullablePoint3DAdapter.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Microsoft.Psi.Visualization.Adapters | ||
{ | ||
using Microsoft.Psi.Visualization.Data; | ||
|
||
using MathNet = MathNet.Spatial.Euclidean; | ||
using Windows = System.Windows.Media.Media3D; | ||
|
||
/// <summary> | ||
/// Used to adapt streams of <see cref="MathNet.Point3D"/> into nullable <see cref="Windows.Point3D"/>. | ||
/// </summary> | ||
[StreamAdapter] | ||
public class MathNetPoint3DToWindowsNullablePoint3DAdapter : StreamAdapter<MathNet.Point3D, Windows.Point3D?> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="MathNetPoint3DToWindowsNullablePoint3DAdapter"/> class. | ||
/// </summary> | ||
public MathNetPoint3DToWindowsNullablePoint3DAdapter() | ||
: base(Adapter) | ||
{ | ||
} | ||
|
||
private static Windows.Point3D? Adapter(MathNet.Point3D value, Envelope env) | ||
{ | ||
return new Windows.Point3D(value.X, value.Y, value.Z); | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...Visualization/Microsoft.Psi.Visualization.Windows/Adapters/Rect3DListToNullableAdapter.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Microsoft.Psi.Visualization.Adapters | ||
{ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Windows.Media.Media3D; | ||
using Microsoft.Psi.Visualization.Data; | ||
|
||
/// <summary> | ||
/// Used to adapt streams of lists of <see cref="Rect3D"/> to lists of nullable <see cref="Rect3D"/>. | ||
/// </summary> | ||
[StreamAdapter] | ||
public class Rect3DListToNullableAdapter : StreamAdapter<List<Rect3D>, List<Rect3D?>> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Rect3DListToNullableAdapter"/> class. | ||
/// </summary> | ||
public Rect3DListToNullableAdapter() | ||
: base(Adapter) | ||
{ | ||
} | ||
|
||
private static List<Rect3D?> Adapter(List<Rect3D> value, Envelope env) | ||
{ | ||
return value?.Select(p => p as Rect3D?).ToList(); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...ces/Visualization/Microsoft.Psi.Visualization.Windows/Adapters/Rect3DToNullableAdapter.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Microsoft.Psi.Visualization.Adapters | ||
{ | ||
using System.Windows.Media.Media3D; | ||
using Microsoft.Psi.Visualization.Data; | ||
|
||
/// <summary> | ||
/// Used to adapt streams of <see cref="Rect3D"/> into nullable <see cref="Rect3D"/>. | ||
/// </summary> | ||
[StreamAdapter] | ||
public class Rect3DToNullableAdapter : StreamAdapter<Rect3D, Rect3D?> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="Rect3DToNullableAdapter"/> class. | ||
/// </summary> | ||
public Rect3DToNullableAdapter() | ||
: base(Adapter) | ||
{ | ||
} | ||
|
||
private static Rect3D? Adapter(Rect3D value, Envelope env) | ||
{ | ||
return value; | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...ation/Microsoft.Psi.Visualization.Windows/Adapters/WindowsPoint3DListToNullableAdapter.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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Microsoft.Psi.Visualization.Adapters | ||
{ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Windows.Media.Media3D; | ||
using Microsoft.Psi.Visualization.Data; | ||
|
||
/// <summary> | ||
/// Used to adapt streams of lists of <see cref="Point3D"/> to lists of nullable <see cref="Point3D"/>. | ||
/// </summary> | ||
[StreamAdapter] | ||
public class WindowsPoint3DListToNullableAdapter : StreamAdapter<List<Point3D>, List<Point3D?>> | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="WindowsPoint3DListToNullableAdapter"/> class. | ||
/// </summary> | ||
public WindowsPoint3DListToNullableAdapter() | ||
: base(Adapter) | ||
{ | ||
} | ||
|
||
private static List<Point3D?> Adapter(List<Point3D> value, Envelope env) | ||
{ | ||
return value?.Select(p => p as Point3D?).ToList(); | ||
} | ||
} | ||
} |
Oops, something went wrong.