From 7a4d4df4c0ca3f76b552edb5f01f9d4b95c0885d Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 12 Feb 2018 13:05:42 -0800 Subject: [PATCH] Rename ILibraryContentItem -> ILibraryObject3D - Rename member .GetContent() -> .GetObject3D() --- Library/ContentProviders/MeshContentProvider.cs | 8 ++++---- Library/Export/GCodeExport.cs | 2 +- Library/Export/MeshExport.cs | 4 ++-- Library/Interfaces/ILibraryItem.cs | 4 ++-- Library/Interfaces/LibraryExtensionMethods.cs | 2 +- Library/Providers/GeneratorItem.cs | 4 ++-- Library/Providers/LibraryConfig.cs | 2 +- Library/Widgets/ListView/ListViewItemBase.cs | 2 +- PartPreviewWindow/SelectedObjectPanel.cs | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Library/ContentProviders/MeshContentProvider.cs b/Library/ContentProviders/MeshContentProvider.cs index ec61324e1..a4a9bd69e 100644 --- a/Library/ContentProviders/MeshContentProvider.cs +++ b/Library/ContentProviders/MeshContentProvider.cs @@ -74,8 +74,8 @@ namespace MatterHackers.MatterControl } else { - var contentInterface = item as ILibraryContentItem; - loadedItem = await contentInterface?.GetContent(progressReporter); + var contentInterface = item as ILibraryObject3D; + loadedItem = await contentInterface?.GetObject3D(progressReporter); } } catch { } @@ -106,9 +106,9 @@ namespace MatterHackers.MatterControl // TODO: Wire up limits for thumbnail generation. If content is too big, return null allowing the thumbnail to fall back to content default object3D = await contentModel.CreateContent(); } - else if (item is ILibraryContentItem) + else if (item is ILibraryObject3D) { - object3D = await (item as ILibraryContentItem)?.GetContent(null); + object3D = await (item as ILibraryObject3D)?.GetObject3D(null); } if (object3D != null) diff --git a/Library/Export/GCodeExport.cs b/Library/Export/GCodeExport.cs index 1c2e0226a..823f7cffd 100644 --- a/Library/Export/GCodeExport.cs +++ b/Library/Export/GCodeExport.cs @@ -139,7 +139,7 @@ namespace MatterHackers.MatterControl.Library.Export return Slicer.SliceItem(context.Content, context.GCodeFilePath, printer, reporter, cancellationToken); }); - // - Return + // Return gcode path fileToProcess = context.GCodeFilePath; } diff --git a/Library/Export/MeshExport.cs b/Library/Export/MeshExport.cs index 9448edb1e..05b8c40e8 100644 --- a/Library/Export/MeshExport.cs +++ b/Library/Export/MeshExport.cs @@ -42,10 +42,10 @@ namespace MatterHackers.MatterControl.Library.Export { try { - if (source is ILibraryContentItem contentItem) + if (source is ILibraryObject3D contentItem) { // If the content is an IObject3D, the we need to load it and MeshFileIO save to the target path - var content = await contentItem.GetContent(null); + var content = await contentItem.GetObject3D(null); return MeshFileIo.Save(content, filePathToSave, CancellationToken.None); } else if (source is ILibraryContentStream streamContent) diff --git a/Library/Interfaces/ILibraryItem.cs b/Library/Interfaces/ILibraryItem.cs index fd3f31bda..c200ac533 100644 --- a/Library/Interfaces/ILibraryItem.cs +++ b/Library/Interfaces/ILibraryItem.cs @@ -41,9 +41,9 @@ namespace MatterHackers.MatterControl.Library bool IsVisible { get; } } - public interface ILibraryContentItem : ILibraryAsset + public interface ILibraryObject3D : ILibraryAsset { - Task GetContent(Action reportProgress); + Task GetObject3D(Action reportProgress); } public interface ILibraryContentStream : ILibraryAsset diff --git a/Library/Interfaces/LibraryExtensionMethods.cs b/Library/Interfaces/LibraryExtensionMethods.cs index a6dd14cec..6f0a5a0d2 100644 --- a/Library/Interfaces/LibraryExtensionMethods.cs +++ b/Library/Interfaces/LibraryExtensionMethods.cs @@ -47,7 +47,7 @@ namespace MatterHackers.MatterControl.Library public static bool IsContentFileType(this ILibraryItem item) { - return item is ILibraryContentItem + return item is ILibraryObject3D || item is SDCardFileItem || item is PrintHistoryItem || (item is ILibraryContentStream contentStream diff --git a/Library/Providers/GeneratorItem.cs b/Library/Providers/GeneratorItem.cs index 1a932b50f..358456bf3 100644 --- a/Library/Providers/GeneratorItem.cs +++ b/Library/Providers/GeneratorItem.cs @@ -67,7 +67,7 @@ namespace MatterHackers.MatterControl.Library } } - public class GeneratorItem : ILibraryContentItem + public class GeneratorItem : ILibraryObject3D { private Func nameResolver; @@ -110,7 +110,7 @@ namespace MatterHackers.MatterControl.Library public bool LocalContentExists => true; - public Task GetContent(Action reportProgress) + public Task GetObject3D(Action reportProgress) { var result = collector?.Invoke(); diff --git a/Library/Providers/LibraryConfig.cs b/Library/Providers/LibraryConfig.cs index 6f3d2992f..effff9b63 100644 --- a/Library/Providers/LibraryConfig.cs +++ b/Library/Providers/LibraryConfig.cs @@ -128,7 +128,7 @@ namespace MatterHackers.MatterControl.Library public IContentProvider GetContentProvider(ILibraryItem item) { - string contentType = (item as ILibraryContentStream)?.ContentType ?? (item as ILibraryContentItem)?.ContentType; + string contentType = (item as ILibraryContentStream)?.ContentType ?? (item as ILibraryObject3D)?.ContentType; if (contentType == null) { return null; diff --git a/Library/Widgets/ListView/ListViewItemBase.cs b/Library/Widgets/ListView/ListViewItemBase.cs index ed21b1650..a2e3e1e3f 100644 --- a/Library/Widgets/ListView/ListViewItemBase.cs +++ b/Library/Widgets/ListView/ListViewItemBase.cs @@ -201,7 +201,7 @@ namespace MatterHackers.MatterControl.CustomWidgets { get { - bool isContentItem = listViewItem.Model is ILibraryContentItem; + bool isContentItem = listViewItem.Model is ILibraryObject3D; bool isValidStream = (listViewItem.Model is ILibraryContentStream stream && ApplicationController.Instance.Library.IsContentFileType(stream.FileName)); bool isContainerLink = listViewItem.Model is ILibraryContainerLink; diff --git a/PartPreviewWindow/SelectedObjectPanel.cs b/PartPreviewWindow/SelectedObjectPanel.cs index 52be11c60..87777a348 100644 --- a/PartPreviewWindow/SelectedObjectPanel.cs +++ b/PartPreviewWindow/SelectedObjectPanel.cs @@ -469,7 +469,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow }); } - public class InMemoryItem : ILibraryContentItem + public class InMemoryItem : ILibraryObject3D { private IObject3D existingItem; @@ -494,7 +494,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow public string AssetPath { get; set; } - public Task GetContent(Action reportProgress) + public Task GetObject3D(Action reportProgress) { return Task.FromResult(existingItem); }