import java.util.*;
public class thumbnail_generation {
static {
try {
System.loadLibrary("MTKCore");
System.loadLibrary("MTKView");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String[] args) {
if (args.length != 2) {
System.err.println("Usage: " + " <input_file> <output_file>, where:");
System.err.println(" <input_file> is a name of the model file to be read");
System.err.println(" <output_file> is a name of the image file to be written");
System.exit(1);
}
String aKey = MTKLicenseKey.Value();
if (!LicenseHelper.SetupRuntimeKey()) {
System.exit(1);
}
try {
LicenseManager.Activate(aKey);
} catch (LicenseError theException) {
LicenseManager.Deactivate();
System.out.println("Failed to activate Manufacturing Toolkit license: " + theException.what());
System.exit(1);
}
String aSource = args[0];
String aDest = args[1];
Model aModel = new Model();
ModelReader aReader = new ModelReader();
if (!new ModelReader().Read(new UTF16String(aSource), aModel)) {
LicenseManager.Deactivate();
System.err.println("Failed to read the file " + aSource);
System.exit(1);
}
ImageWriter aWriter = new ImageWriter();
ImageWriterParameters aWriterParameters = new ImageWriterParameters();
aWriterParameters.SetImageWidth(750);
aWriterParameters.SetImageHeight(500);
aWriterParameters.SetViewIsFitAll(true);
ColorBackgroundStyle aColorBackgroundStyle = new ColorBackgroundStyle(new Color(255, 255, 255));
aWriterParameters.SetViewBackground(aColorBackgroundStyle);
aWriter.SetParameters(aWriterParameters);
if (!aWriter.WriteFile(aModel, new UTF16String(aDest))) {
LicenseManager.Deactivate();
System.err.println("Failed to write the file " + aDest);
System.exit(1);
}
System.out.println("Completed: " + aDest);
LicenseManager.Deactivate();
}
}
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