using System;
namespace progress_bar
{
class Program
{
static int Main(string[] args)
{
string aKey = MTKLicenseKey.Value();
if (!LicenseManager.Activate(aKey))
{
Console.WriteLine("Failed to activate Manufacturing Toolkit license.");
return 1;
}
if (args.Length != 1)
{
Console.WriteLine("Usage: " + System.Reflection.Assembly.GetExecutingAssembly().Location
+ " <input_file>, where:");
Console.WriteLine(" <input_file> is a name of the file to be read");
return 1;
}
UTF16String aSource = new UTF16String(args[0]);
ProgressBarObserver anObserver = new ProgressBarObserver();
anObserver.SetAllNotifyingThreads();
Model aModel = new Model();
using (ProgressStatus aStatus = new ProgressStatus())
{
aStatus.Register(anObserver);
using (ProgressScope aTopScope = new ProgressScope(aStatus))
{
using (ProgressScope aReaderScope = new ProgressScope(aTopScope, 50))
{
ModelReader aReader = new ModelReader();
aReader.SetProgressStatus(aStatus);
aReader.Read(aSource, aModel);
}
if (!aModel.IsEmpty() && !aStatus.WasCanceled())
{
using (ProgressScope aMesherScope = new ProgressScope(aTopScope, -1))
{
MeshGenerator aMesher = new MeshGenerator();
aMesher.SetProgressStatus(aStatus);
aMesher.Generate(aModel);
}
}
}
}
return 0;
}
class ProgressBarObserver : ProgressStatus.Observer
{
public override void ChangedValue(ProgressStatus theInfo)
{
Console.WriteLine(theInfo.Value() + "%");
}
public override void Completed(ProgressStatus theInfo)
{
Console.WriteLine(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.