#include <cadex/Base/ProgressScope.hxx>
#include <cadex/Base/ProgressStatus.hxx>
#include <cadex/LicenseManager_Activate.h>
#include <cadex/ModelAlgo/MeshGenerator.hxx>
#include <cadex/ModelData/Model.hxx>
#include <cadex/ModelData/ModelReader.hxx>
#include <iostream>
#include "../../mtk_license.cxx"
using namespace std;
class ProgressBarObserver : public ProgressStatus::Observer
{
public:
void ChangedValue (const ProgressStatus& theInfo) override
{
cout << theInfo.Value() << "%" << endl;
}
void Completed (const ProgressStatus& theInfo) override
{
cout << theInfo.Value() << "%: complete!" << endl;
}
};
int main (int argc, char* argv[])
{
auto aKey = MTKLicenseKey::Value();
if (!CADExLicense_Activate (aKey)) {
cerr << "Failed to activate Manufacturing Toolkit license." << endl;
return 1;
}
if (argc != 2) {
cerr << "Usage: " << argv[0] << " <input_file>, where:" << endl;
cerr << " <input_file> is a name of the file to be read" << endl;
return 1;
}
const char* aSource = argv[1];
ProgressBarObserver anObserver;
anObserver.SetAllNotifyingThreads();
ModelData::Model aModel;
ProgressStatus aStatus;
aStatus.Register (anObserver);
ProgressScope aTopScope (aStatus);
{
ProgressScope aReaderScope (aTopScope, 50);
ModelData::ModelReader aReader;
aReader.SetProgressStatus (aStatus);
aReader.Read (aSource, aModel);
}
if (!aModel.IsEmpty()) {
ProgressScope aMesherScope (aTopScope, 50);
ModelAlgo::MeshGenerator aMesher;
aMesher.SetProgressStatus (aStatus);
aMesher.Generate (aModel);
}
return 0;
}
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.