-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DUI3-295 track non native received objects for the full report (#3497)
* introduce ConverionTracker; simplify variables * track conversions up to writing groups into dataset * throw exceptions for failed datasets. TODO: write to results * correct results * correct result order * properly updating Trackers * more comments * remove fake Exception from GIS layers * Move BUILD function to the top
- Loading branch information
1 parent
cc70758
commit f6a23eb
Showing
6 changed files
with
237 additions
and
87 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
Empty file removed
0
DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/ArcGISProjectUtils.cs
Empty file.
88 changes: 88 additions & 0 deletions
88
DUI3-DX/Converters/ArcGIS/Speckle.Converters.ArcGIS3/Utils/ConversionTracker.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,88 @@ | ||
using ArcGIS.Desktop.Mapping; | ||
using Speckle.Core.Models; | ||
|
||
namespace Speckle.Converters.ArcGIS3.Utils; | ||
|
||
/// <summary> | ||
/// Container connecting the received Base object, converted hostApp object, dataset it was written to, | ||
/// URI of the layer mapped from the dataset and, if applicable, feature/row id. | ||
/// </summary> | ||
public struct ObjectConversionTracker | ||
{ | ||
public Base Base { get; set; } | ||
public string NestedLayerName { get; set; } | ||
public ACG.Geometry? HostAppGeom { get; set; } | ||
public MapMember? HostAppMapMember { get; set; } | ||
public string? DatasetId { get; set; } | ||
public int? DatasetRow { get; set; } | ||
public string? MappedLayerURI { get; set; } | ||
public Exception? Exception { get; set; } | ||
|
||
public void AddException(Exception ex) | ||
{ | ||
Exception = ex; | ||
HostAppGeom = null; | ||
DatasetId = null; | ||
DatasetRow = null; | ||
MappedLayerURI = null; | ||
} | ||
|
||
public void AddDatasetId(string datasetId) | ||
{ | ||
DatasetId = datasetId; | ||
} | ||
|
||
public void AddDatasetRow(int datasetRow) | ||
{ | ||
DatasetRow = datasetRow; | ||
} | ||
|
||
public void AddConvertedMapMember(MapMember mapMember) | ||
{ | ||
HostAppMapMember = mapMember; | ||
} | ||
|
||
public void AddLayerURI(string layerURIstring) | ||
{ | ||
MappedLayerURI = layerURIstring; | ||
} | ||
|
||
/// <summary> | ||
/// Initializes a new instance of <see cref="ObjectConversionTracker"/>. | ||
/// </summary> | ||
/// <param name="baseObj">Original received Base object.</param> | ||
/// <param name="nestedLayerName">String with the full traversed path to the object. Will be used to create nested layer structure in the TOC.</param> | ||
public ObjectConversionTracker(Base baseObj, string nestedLayerName) | ||
{ | ||
Base = baseObj; | ||
NestedLayerName = nestedLayerName; | ||
} | ||
|
||
/// <summary> | ||
/// Constructor for received non-GIS geometries. | ||
/// Initializes a new instance of <see cref="ObjectConversionTracker"/>, accepting converted hostApp geometry. | ||
/// </summary> | ||
/// <param name="baseObj">Original received Base object.</param> | ||
/// <param name="nestedLayerName">String with the full traversed path to the object. Will be used to create nested layer structure in the TOC.</param> | ||
/// <param name="hostAppGeom">Converted ArcGIS.Core.Geometry.</param> | ||
public ObjectConversionTracker(Base baseObj, string nestedLayerName, ACG.Geometry hostAppGeom) | ||
{ | ||
Base = baseObj; | ||
NestedLayerName = nestedLayerName; | ||
HostAppGeom = hostAppGeom; | ||
} | ||
|
||
/// <summary> | ||
/// Constructor for received native GIS layers. | ||
/// Initializes a new instance of <see cref="ObjectConversionTracker"/>, accepting datasetID of a coverted Speckle layer. | ||
/// </summary> | ||
/// <param name="baseObj">Original received Base object.</param> | ||
/// <param name="nestedLayerName">String with the full traversed path to the object. Will be used to create nested layer structure in the TOC.</param> | ||
/// <param name="datasetId">ID of the locally written dataset, created from received Speckle layer.</param> | ||
public ObjectConversionTracker(Base baseObj, string nestedLayerName, string datasetId) | ||
{ | ||
Base = baseObj; | ||
NestedLayerName = nestedLayerName; | ||
DatasetId = datasetId; | ||
} | ||
} |
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.