Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KatKatKateryna committed Jun 28, 2024
1 parent 79e22de commit 7320352
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ await QueuedTask

private List<MapMemberFeature> GetMapMembers(List<ObjectID> objectIds, MapView mapView)
{
// find the layer on the map (from the objectID) and add the featureID is available
List<MapMemberFeature> mapMembersFeatures = new();

foreach (ObjectID objectId in objectIds)
Expand Down Expand Up @@ -161,6 +162,8 @@ private void SelectMapMembersAndFeatures(List<MapMemberFeature> mapMembersFeatur
{
// query features by ID
var objectIDfield = layer.GetFeatureClass().GetDefinition().GetObjectIDField();

// FeatureID range starts from 0, but auto-assigned IDs in the layer start from 1
QueryFilter anotherQueryFilter = new() { WhereClause = $"{objectIDfield} = {mapMemberFeat.FeatureId + 1}" };
using (Selection onlyOneSelection = layer.Select(anotherQueryFilter, SelectionCombinationMethod.New)) { }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ private void AddResultsFromTracker(ObjectConversionTracker trackerItem, List<Rec
}
else
{
// encode layer ID and ID of its feature in 1 object represented as string
ObjectID objectId = new(trackerItem.MappedLayerURI, trackerItem.DatasetRow);
if (trackerItem.HostAppGeom != null) // individual hostAppGeometry
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

namespace Speckle.Connectors.ArcGIS.Utils;

// bind together a layer object on the map, and auto-assigned ID if the specific feature
public readonly struct MapMemberFeature
{
public int? FeatureId { get; }
public MapMember MapMember { get; }
public int? FeatureId { get; } // unique feature id (start from 0) of a feature in the layer
public MapMember MapMember { get; } // layer object on the Map

public MapMemberFeature(MapMember mapMember, int? featureId)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
namespace Speckle.Connectors.ArcGIS.Utils;

// this struct is needed to be able to parse single-string value into IDs of both a layer, and it's individual feature
public struct ObjectID
{
private const string FEATURE_ID_SEPARATOR = "__speckleFeatureId__";
public string MappedLayerURI { get; }
public int? FeatureId { get; }
public string MappedLayerURI { get; } // unique ID of the layer on the map
public int? FeatureId { get; } // unique feature id (start from 0) of a feature in the layer

public ObjectID(string encodedId)
{
Expand Down

0 comments on commit 7320352

Please sign in to comment.