#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;
{
public:
{
cout << theInfo.
Value() <<
"%" << endl;
}
{
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();
{
aReader.
SetProgressStatus (aStatus);
aReader.
Read (aSource, aModel);
}
aMesher.
SetProgressStatus (aStatus);
aMesher.
Generate (aModel);
}
return 0;
}
Generates a polygonal mesh for a B-Rep body.
Definition MeshGenerator.hxx:39
Provides MTK data model.
Definition Model.hxx:40
bool IsEmpty() const
Returns true if the model is empty.
Definition Model.cxx:173
Reads STEP and native format.
Definition ModelReader.hxx:33
bool Read(const UTF16String &theFilePath, ModelData::Model &theModel)
Reads the file at the specified path into the specified model.
Definition ModelReader.cxx:276
Represents a node in a hierarchy of progress scopes.
Definition ProgressScope.hxx:35
Base abstract class for observers registered in ProgressStatus.
Definition ProgressStatus.hxx:35
Provides progress status and notification mechanism.
Definition ProgressStatus.hxx:32
double Value() const
Returns a current value.
Definition ProgressStatus.cxx:237
void Register(Observer &theObserver, double theValueThreshold=0.1f, unsigned int theTimeThreshold=20U)
Adds an observer that will be notified when the progress status has changed.
Definition ProgressStatus.cxx:257
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition LicenseManager_LicenseError.hxx:30