Skip to content

Commit

Permalink
remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
Connor Ivy committed Jun 27, 2024
1 parent 01f0193 commit ff39c5d
Showing 1 changed file with 0 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,75 +90,4 @@ private void YieldToUiThread()

_timerStarted = currentTime;
}

//private IReadOnlyList<string> HandleConversionResult(object conversionResult, Base originalObject, int layerIndex)
//{
// var doc = _contextStack.Current.Document;
// List<string> newObjectIds = new();
// switch (conversionResult)
// {
// case IEnumerable<IRhinoGeometryBase> list:
// {
// var group = BakeObjectsAsGroup(originalObject.id, list, layerIndex);
// newObjectIds.Add(group.Id.ToString());
// break;
// }
// case IRhinoGeometryBase newObject:
// {
// var newObjectGuid = doc.Objects.Add(newObject, _rhinoDocFactory.CreateAttributes(layerIndex));
// newObjectIds.Add(newObjectGuid.ToString());
// break;
// }
// default:
// throw new SpeckleConversionException(
// $"Unexpected result from conversion: Expected {nameof(IRhinoGeometryBase)} but instead got {conversionResult.GetType().Name}"
// );
// }

// return newObjectIds;
//}

//private IRhinoGroup BakeObjectsAsGroup(string groupName, IEnumerable<IRhinoGeometryBase> list, int layerIndex)
//{
// var doc = _contextStack.Current.Document;
// var objectIds = list.Select(obj => doc.Objects.Add(obj, _rhinoDocFactory.CreateAttributes(layerIndex)));
// var groupIndex = _contextStack.Current.Document.Groups.Add(groupName, objectIds);
// var group = _contextStack.Current.Document.Groups.FindIndex(groupIndex);
// return group;
//}

//// POC: This is the original DUI3 function, this will grow over time as we add more conversions that are missing, so it should be refactored out into an ILayerManager or some sort of service.
//private int GetAndCreateLayerFromPath(string[] path, string baseLayerName, Dictionary<string, int> cache)
//{
// var currentLayerName = baseLayerName;
// var currentDocument = _contextStack.Current.Document;

// var previousLayer = currentDocument.Layers.FindName(currentLayerName);
// foreach (var layerName in path)
// {
// currentLayerName = baseLayerName + _rhinoDocFactory.LayerPathSeparator + layerName;
// currentLayerName = currentLayerName.Replace("{", "").Replace("}", ""); // Rhino specific cleanup for gh (see RemoveInvalidRhinoChars)
// if (cache.TryGetValue(currentLayerName, out int value))
// {
// previousLayer = currentDocument.Layers.FindIndex(value);
// continue;
// }

// var cleanNewLayerName = layerName.Replace("{", "").Replace("}", "");
// var newLayer = _rhinoDocFactory.CreateLayer(cleanNewLayerName, previousLayer.Id);
// var index = currentDocument.Layers.Add(newLayer);
// cache.Add(currentLayerName, index);
// previousLayer = currentDocument.Layers.FindIndex(index); // note we need to get the correct id out, hence why we're double calling this
// }
// return previousLayer.Index;
//}

//[Pure]
//private static string[] GetLayerPath(TraversalContext context)
//{
// string[] collectionBasedPath = context.GetAscendantOfType<Collection>().Select(c => c.name).ToArray();
// string[] reverseOrderPath =
// collectionBasedPath.Length != 0 ? collectionBasedPath : context.GetPropertyPath().ToArray();
// return reverseOrderPath.Reverse().ToArray();
//}
}

0 comments on commit ff39c5d

Please sign in to comment.