using System;
namespace thumbnail_generation
{
class Program
{
static int Main(string[] args)
{
if (args.Length != 2)
{
Console.WriteLine("Usage: " + System.Reflection.Assembly.GetExecutingAssembly().Location
+ " <input_file> <output_file>, where:");
Console.WriteLine(" <input_file> is a name of the model file to be read");
Console.WriteLine(" <output_file> is a name of the image file to be written");
return 1;
}
string aKey = MTKLicenseKey.Value();
if (!LicenseHelper.SetupRuntimeKey())
{
return 1;
}
try
{
LicenseManager.Activate(aKey);
}
catch (LicenseError theException)
{
LicenseManager.Deactivate();
Console.WriteLine(
"Failed to activate Manufacturing Toolkit license: " + theException.
what());
return 1;
}
string aSource = args[0];
string aDest = args[1];
{
LicenseManager.Deactivate();
Console.WriteLine("Failed to read the file " + aSource);
return 1;
}
aWriterParameters.
SetImageWidth(750);
aWriterParameters.
SetImageHeight(500);
aWriterParameters.
SetViewIsFitAll(
true);
aWriterParameters.
SetViewBackground(aBackground);
aWriter.
SetParameters(aWriterParameters);
if (!aWriter.
WriteFile(aModel,
new UTF16String(aDest)))
{
LicenseManager.Deactivate();
Console.WriteLine("Failed to write the file " + aDest);
return 1;
}
Console.WriteLine("Thumbnail successfully generated: " + aDest);
LicenseManager.Deactivate();
return 0;
}
}
}
Defines an RGBA color (with alpha channel).
Definition Color.cs:19
Provides MTK data model.
Definition Model.cs:31
Reads supported formats, see Import section.
Definition ModelReader.cs:17
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition UTF16String.cs:17
Defines color background style.
Definition ColorBackgroundStyle.cs:17
Writes an image file with graphical content of a model.
Definition ImageWriter.cs:17
Defines parameters of the ImageWriter.
Definition ImageWriterParameters.cs:17
Defines classes, types, enums, and functions related to topological entities and scene graph elements...
Definition AngleUnit.cs:12
Contains classes, types, enums, and functions related to image generation.
Definition AntialiasingMode.cs:12
The mtk namespace is intended to become the primary namespace for MTK and replace direct use of the c...
Definition LicenseError.cs:12
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition BaseObject.cs:12