using System;
namespace progress_bar
{
class Program
{
static int Main(string[] args)
{
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;
}
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;
}
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);
}
}
}
}
LicenseManager.Deactivate();
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...
The mtk namespace is intended to become the primary namespace for MTK and replace direct use of the c...
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.