Rename ILibraryContentItem -> ILibraryObject3D

- Rename member .GetContent() -> .GetObject3D()
This commit is contained in:
John Lewin 2018-02-12 13:05:42 -08:00
parent 995d5c18bf
commit 7a4d4df4c0
9 changed files with 16 additions and 16 deletions

View file

@ -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)

View file

@ -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;
}

View file

@ -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)

View file

@ -41,9 +41,9 @@ namespace MatterHackers.MatterControl.Library
bool IsVisible { get; }
}
public interface ILibraryContentItem : ILibraryAsset
public interface ILibraryObject3D : ILibraryAsset
{
Task<IObject3D> GetContent(Action<double, string> reportProgress);
Task<IObject3D> GetObject3D(Action<double, string> reportProgress);
}
public interface ILibraryContentStream : ILibraryAsset

View file

@ -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

View file

@ -67,7 +67,7 @@ namespace MatterHackers.MatterControl.Library
}
}
public class GeneratorItem : ILibraryContentItem
public class GeneratorItem : ILibraryObject3D
{
private Func<string> nameResolver;
@ -110,7 +110,7 @@ namespace MatterHackers.MatterControl.Library
public bool LocalContentExists => true;
public Task<IObject3D> GetContent(Action<double, string> reportProgress)
public Task<IObject3D> GetObject3D(Action<double, string> reportProgress)
{
var result = collector?.Invoke();

View file

@ -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;

View file

@ -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;

View file

@ -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<IObject3D> GetContent(Action<double, string> reportProgress)
public Task<IObject3D> GetObject3D(Action<double, string> reportProgress)
{
return Task.FromResult(existingItem);
}