public class progress_bar {
static {
try {
System.loadLibrary("CadExMTK");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String[] args) {
String aKey = MTKLicenseKey.Value();
if (!LicenseManager.Activate(aKey)) {
System.out.println("Failed to activate Manufacturing Toolkit license.");
System.exit(1);
}
if (args.length != 1) {
System.out.println("Usage: " + " <input_file>, where:");
System.out.println(" <input_file> is a name of the file to be read");
System.exit(1);
}
String aSource = args[0];
Model aModel = new Model();
ProgressBarObserver anObserver = new ProgressBarObserver();
anObserver.SetAllNotifyingThreads();
try (ProgressStatus aStatus = new ProgressStatus()) {
aStatus.Register(anObserver);
try (ProgressScope aTopScope = new ProgressScope(aStatus))
{
try (ProgressScope aReaderScope = new ProgressScope(aTopScope, 50))
{
ModelReader aReader = new ModelReader();
aReader.SetProgressStatus(aStatus);
aReader.Read(new UTF16String(aSource), aModel);
}
if (!aModel.IsEmpty() && !aStatus.WasCanceled()) {
try (ProgressScope aMesherScope = new ProgressScope(aTopScope, -1))
{
MeshGenerator aMesher = new MeshGenerator();
aMesher.SetProgressStatus(aStatus);
aMesher.Generate(aModel);
}
}
}
}
}
}
class ProgressBarObserver extends ProgressStatus.Observer {
@Override
public void ChangedValue(ProgressStatus theInfo) {
System.out.println(theInfo.Value());
}
@Override
public void Completed(ProgressStatus theInfo) {
System.out.println(theInfo.Value() + ": complete!");
}
}
Contains classes, and functions related to model processing.
Defines classes, types, enums, and functions related to topological entities and scene graph elements...
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition LicenseManager_LicenseError.hxx:30