using cadex.Materials;
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
{
}
{
Console.WriteLine(
"Failed to activate Manufacturing Toolkit license: " + theException.
what());
return 1;
}
string aSource = args[0];
string aDest = args[1];
{
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)))
{
Console.WriteLine("Failed to write the file " + aDest);
return 1;
}
Console.WriteLine("Thumbnail successfully generated: " + aDest);
return 0;
}
}
}
Provides MTK data model.
Definition Model.hxx:39
Reads supported formats, see Import section.
Definition ModelReader.hxx:32
Defines a Unicode (UTF-16) string wrapping a standard string.
Definition UTF16String.hxx:29
Defines color background style.
Definition BackgroundStyle.hxx:37
Writes an image file with graphical content of a model.
Definition ImageWriter.hxx:43
Defines parameters of the ImageWriter.
Definition ImageWriterParameters.hxx:32
Defines an exception thrown by a license manager when a valid license could not be acquired.
Definition LicenseError.hxx:37
const char * what() const noexcept override
Returns an error string.
Definition LicenseError.cxx:50
Provides MTK licensing activation and deactivation API.
Definition LicenseManager.hxx:33
static bool Deactivate()
Closes the active licensing session.
Definition LicenseManager.cxx:640
static bool Activate(const std::string &theDeveloperKey)
Activates MTK licensing using the development license key.
Definition LicenseManager.cxx:191
Defines classes, types, enums, and functions related to topological entities and scene graph elements...
Contains classes, types, enums, and functions related to image generation.
The mtk namespace is intended to become the primary namespace for MTK and replace direct use of the c...
Definition LicenseError.hxx:27
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition LicenseError.hxx:27