#include <cadex/DFMMachining_Analyzer.hxx>
#include <cadex/DFMMachining_DeepBoredHoleIssue.hxx>
#include <cadex/DFMMachining_DeepHoleIssue.hxx>
#include <cadex/DFMMachining_DeepPocketIssue.hxx>
#include <cadex/DFMMachining_DrillingAnalyzerParameters.hxx>
#include <cadex/DFMMachining_FlatBottomHoleIssue.hxx>
#include <cadex/DFMMachining_HighBossIssue.hxx>
#include <cadex/DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue.hxx>
#include <cadex/DFMMachining_IntersectingCavityHoleIssue.hxx>
#include <cadex/DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue.hxx>
#include <cadex/DFMMachining_LargeMilledPartIssue.hxx>
#include <cadex/DFMMachining_LargeTurnedPartIssue.hxx>
#include <cadex/DFMMachining_LongSlenderTurnedPartIssue.hxx>
#include <cadex/DFMMachining_NonSymmetricalAxialSlotIssue.hxx>
#include <cadex/DFMMachining_MilledPartExternalEdgeFilletIssue.hxx>
#include <cadex/DFMMachining_MilledPartSize.hxx>
#include <cadex/DFMMachining_MillingAnalyzerParameters.hxx>
#include <cadex/DFMMachining_NonPerpendicularHoleIssue.hxx>
#include <cadex/DFMMachining_NonPerpendicularMilledPartShapeIssue.hxx>
#include <cadex/DFMMachining_NonStandardDiameterHoleIssue.hxx>
#include <cadex/DFMMachining_NonStandardDrillPointAngleBlindHoleIssue.hxx>
#include <cadex/DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue.hxx>
#include <cadex/DFMMachining_PartialHoleIssue.hxx>
#include <cadex/DFMMachining_SmallDepthBlindBoredHoleReliefIssue.hxx>
#include <cadex/DFMMachining_SmallDiameterHoleIssue.hxx>
#include <cadex/DFMMachining_SmallRadiusMilledPartInternalCornerIssue.hxx>
#include <cadex/DFMMachining_SmallRadiusTurnedPartInternalCornerIssue.hxx>
#include <cadex/DFMMachining_SmallWallThicknessIssue.hxx>
#include <cadex/DFMMachining_SquareEndKeywayIssue.hxx>
#include <cadex/DFMMachining_TurnedPartSize.hxx>
#include <cadex/DFMMachining_TurningAnalyzerParameters.hxx>
#include <cadex/DFMMachining_NarrowRegionInPocketIssue.hxx>
#include <cadex/DFMMachining_LargeDifferenceRegionsSizeInPocketIssue.hxx>
#include <cadex/LicenseManager_Activate.h>
#include <cadex/Machining_Data.hxx>
#include <cadex/Machining_FeatureRecognizer.hxx>
#include <cadex/Machining_FeatureRecognizerParameters.hxx>
#include <cadex/Machining_OperationType.hxx>
#include <cadex/ModelData/Model.hxx>
#include <cadex/ModelData/ModelReader.hxx>
#include <cadex/MTKBase_FeatureList.hxx>
#define _USE_MATH_DEFINES
#include <math.h>
#include <unordered_map>
#include "../../helpers/feature_group.hxx"
#include "../../helpers/shape_processor.hxx"
#include "../../mtk_license.cxx"
using namespace std;
double ToDegrees (double theAngleRad)
{
return theAngleRad * 180. / M_PI;
}
void PrintIssues (const MTKBase_FeatureList& theIssueList)
{
FeatureGroupManager aManager;
for (size_t i = 0; i < theIssueList.Size(); ++i) {
const auto& anIssue = theIssueList[i];
if (anIssue.IsOfType<DFMMachining_SmallDiameterHoleIssue>()) {
aManager.AddFeature ("Small Diameter Hole Issue(s)", "Hole(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_DeepHoleIssue>()) {
aManager.AddFeature ("Deep Hole Issue(s)", "Hole(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_NonStandardDiameterHoleIssue>()) {
aManager.AddFeature ("Non Standard Diameter Hole Issue(s)", "Hole(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_NonStandardDrillPointAngleBlindHoleIssue>()) {
aManager.AddFeature ("Non Standard Drill Point Angle Blind Hole Issue(s)", "Hole(s)", true, anIssue);
}
else if (anIssue.IsOfType<DFMMachining_FlatBottomHoleIssue>()) {
aManager.AddFeature ("Flat Bottom Hole Issue(s)", "", false, anIssue);
} else if (anIssue.IsOfType<DFMMachining_NonPerpendicularHoleIssue>()) {
aManager.AddFeature ("Non Perpendicular Hole Issue(s)", "", false, anIssue);
} else if (anIssue.IsOfType<DFMMachining_IntersectingCavityHoleIssue>()) {
aManager.AddFeature ("Intersecting Cavity Hole Issue(s)", "", false, anIssue);
} else if (anIssue.IsOfType<DFMMachining_PartialHoleIssue>()) {
aManager.AddFeature ("Partial Hole Issue(s)", "Hole(s)", true, anIssue);
}
else if (anIssue.IsOfType<DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue>()) {
aManager.AddFeature ("Non Standard Radius Milled Part Floor Fillet Issue(s)", "Floor Fillet(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_DeepPocketIssue>()) {
aManager.AddFeature ("Deep Pocket Issue(s)", "Pocket(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_HighBossIssue>()) {
aManager.AddFeature ("High Boss Issue(s)", "Boss(es)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_LargeMilledPartIssue>()) {
aManager.AddFeature ("Large Milled Part Issue(s)", "Part(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_SmallRadiusMilledPartInternalCornerIssue>()) {
aManager.AddFeature ("Small Radius Milled Part Internal Corner Issue(s)", "Internal Corner(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_NonPerpendicularMilledPartShapeIssue>()) {
aManager.AddFeature ("Non Perpendicular Milled Part Shape Issue(s)", "Shape(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_MilledPartExternalEdgeFilletIssue>()) {
aManager.AddFeature ("Milled Part External Edge Fillet Issue(s)", "", false, anIssue);
} else if (anIssue.IsOfType<DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue>()) {
aManager.AddFeature ("Inconsistent Radius Milled Part Floor Fillet Issue(s)", "Floor Fillet(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_NarrowRegionInPocketIssue>()) {
aManager.AddFeature ("Narrow Region In Pocket Issue(s)", "Region(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_LargeDifferenceRegionsSizeInPocketIssue>()) {
aManager.AddFeature ("Large Difference Regions Size In Pocket Issue(s)", "Region Size(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_SmallWallThicknessIssue>()) {
aManager.AddFeature ("Small Wall Thickness Issue(s)", "Wall(s)", true, anIssue);
}
else if (anIssue.IsOfType<DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue>()) {
aManager.AddFeature ("Irregular Turned Part Outer Diameter Profile Relief Issue(s)", "Outer Diameter Profile Relief(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_SmallRadiusTurnedPartInternalCornerIssue>()) {
aManager.AddFeature ("Small Radius Turned Part Internal Corner Issue(s)", "Internal Corner(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_LargeTurnedPartIssue>()) {
aManager.AddFeature ("Large Turned Part Issue(s)", "Part(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_LongSlenderTurnedPartIssue>()) {
aManager.AddFeature ("Long Slender Turned Part Issue(s)", "Part(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_SmallDepthBlindBoredHoleReliefIssue>()) {
aManager.AddFeature ("Small Depth Blind Bored Hole Relief Issue(s)", "Blind Bored Hole(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_DeepBoredHoleIssue>()) {
aManager.AddFeature ("Deep Bored Hole Issue(s)", "Bored Hole(s)", true, anIssue);
} else if (anIssue.IsOfType<DFMMachining_SquareEndKeywayIssue>()) {
aManager.AddFeature ("Square End Keyway Issue(s)", "", false, anIssue);
} else if (anIssue.IsOfType<DFMMachining_NonSymmetricalAxialSlotIssue>()) {
aManager.AddFeature ("Non Symmetrical Axial Slot Issue(s)", "", false, anIssue);
}
}
auto PrintFeatureParameters = [] (const MTKBase_Feature& theIssue)
{
if (theIssue.IsOfType<DFMMachining_SmallDiameterHoleIssue>()) {
const auto& aSDHIssue = static_cast<const DFMMachining_SmallDiameterHoleIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected min diameter", aSDHIssue.ExpectedMinDiameter(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual diameter", aSDHIssue.ActualDiameter(), "mm");
} else if (theIssue.IsOfType<DFMMachining_DeepHoleIssue>()) {
const auto& aDHIssue = static_cast<const DFMMachining_DeepHoleIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected max depth", aDHIssue.ExpectedMaxDepth(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual depth", aDHIssue.ActualDepth(), "mm");
} else if (theIssue.IsOfType<DFMMachining_NonStandardDiameterHoleIssue>()) {
const auto& aNSDHIssue = static_cast<const DFMMachining_NonStandardDiameterHoleIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter (
"nearest standard diameter", aNSDHIssue.NearestStandardDiameter(), "mm");
FeatureGroupManager::PrintFeatureParameter (
"actual diameter", aNSDHIssue.ActualDiameter(), "mm");
} else if (theIssue.IsOfType<DFMMachining_NonStandardDrillPointAngleBlindHoleIssue>()) {
const auto& aNSDPABHIssue = static_cast<const DFMMachining_NonStandardDrillPointAngleBlindHoleIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter (
"nearest standard angle", ToDegrees (aNSDPABHIssue.NearestStandardAngle()), "deg");
FeatureGroupManager::PrintFeatureParameter (
"actual angle", ToDegrees (aNSDPABHIssue.ActualAngle()), "deg");
}
else if (theIssue.IsOfType<DFMMachining_FlatBottomHoleIssue>()) {
} else if (theIssue.IsOfType<DFMMachining_NonPerpendicularHoleIssue>()) {
} else if (theIssue.IsOfType<DFMMachining_IntersectingCavityHoleIssue>()) {
} else if (theIssue.IsOfType<DFMMachining_PartialHoleIssue>()) {
const auto& aPHIssue = static_cast<const DFMMachining_PartialHoleIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter (
"expected min material percent", aPHIssue.ExpectedMinMaterialPercent(), "");
FeatureGroupManager::PrintFeatureParameter (
"actual material percent", aPHIssue.ActualMaterialPercent(), "");
}
else if (theIssue.IsOfType<DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue>()) {
const auto& aNSRMPFFIssue =
static_cast<const DFMMachining_NonStandardRadiusMilledPartFloorFilletIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter (
"nearest standard radius", aNSRMPFFIssue.NearestStandardRadius(), "mm");
FeatureGroupManager::PrintFeatureParameter (
"actual radius", aNSRMPFFIssue.ActualRadius(), "mm");
} else if (theIssue.IsOfType<DFMMachining_DeepPocketIssue>()) {
const auto& aDPIssue = static_cast<const DFMMachining_DeepPocketIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected max depth", aDPIssue.ExpectedMaxDepth(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual depth", aDPIssue.ActualDepth(), "mm");
} else if (theIssue.IsOfType<DFMMachining_HighBossIssue>()) {
const auto& aHBIssue = static_cast<const DFMMachining_HighBossIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected max height", aHBIssue.ExpectedMaxHeight(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual height", aHBIssue.ActualHeight(), "mm");
} else if (theIssue.IsOfType<DFMMachining_LargeMilledPartIssue>()) {
const auto& aLMPIssue = static_cast<const DFMMachining_LargeMilledPartIssue&> (theIssue);
const auto& anExpectedSize = aLMPIssue.ExpectedMaxMilledPartSize();
const auto& anActualSize = aLMPIssue.ActualMilledPartSize();
FeatureGroupManager::PrintFeatureParameter (
"expected max size (LxWxH)",
ArrayType ({ anExpectedSize.Length(), anExpectedSize.Width(), anExpectedSize.Height() }),
"mm");
FeatureGroupManager::PrintFeatureParameter (
"actual size (LxWxH)",
ArrayType ({ anActualSize.Length(), anActualSize.Width(), anActualSize.Height() }),
"mm");
} else if (theIssue.IsOfType<DFMMachining_SmallRadiusMilledPartInternalCornerIssue>()) {
const auto& aSRMPICIssue =
static_cast<const DFMMachining_SmallRadiusMilledPartInternalCornerIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected min radius", aSRMPICIssue.ExpectedMinRadius(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual radius", aSRMPICIssue.ActualRadius(), "mm");
} else if (theIssue.IsOfType<DFMMachining_NonPerpendicularMilledPartShapeIssue>()) {
const auto& aNPMPSIssue =
static_cast<const DFMMachining_NonPerpendicularMilledPartShapeIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("actual angle", ToDegrees (aNPMPSIssue.ActualAngle()), "deg");
} else if (theIssue.IsOfType<DFMMachining_MilledPartExternalEdgeFilletIssue>()) {
} else if (theIssue.IsOfType<DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue>()) {
const auto& aIRMPFFIssue =
static_cast<const DFMMachining_InconsistentRadiusMilledPartFloorFilletIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected radius", aIRMPFFIssue.ExpectedRadius(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual radius", aIRMPFFIssue.ActualRadius(), "mm");
} else if (theIssue.IsOfType<DFMMachining_NarrowRegionInPocketIssue>()) {
const auto& aSMNRDIssue =
static_cast<const DFMMachining_NarrowRegionInPocketIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected minimum region size", aSMNRDIssue.ExpectedMinRegionSize(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual region size", aSMNRDIssue.ActualRegionSize(), "mm");
} else if (theIssue.IsOfType<DFMMachining_LargeDifferenceRegionsSizeInPocketIssue>()) {
const auto& aLMNRRIssue =
static_cast<const DFMMachining_LargeDifferenceRegionsSizeInPocketIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected regions maximum to minimum size ratio", aLMNRRIssue.ExpectedMaxRegionsMaxToMinSizeRatio(), "");
FeatureGroupManager::PrintFeatureParameter ("actual regions maximum to minimum size ratio", aLMNRRIssue.ActualMaxRegionsMaxToMinSizeRatio(), "");
} else if (theIssue.IsOfType<DFMMachining_SmallWallThicknessIssue>()) {
const auto& aSWTIssue = static_cast<const DFMMachining_SmallWallThicknessIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected min wall thickness", aSWTIssue.ExpectedMinThickness(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual wall thickness", aSWTIssue.ActualThickness(), "mm");
}
else if (theIssue.IsOfType<DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue>()) {
const auto& anITPODPRIssue =
static_cast<const DFMMachining_IrregularTurnedPartOuterDiameterProfileReliefIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter (
"expected max incline angle", ToDegrees (anITPODPRIssue.ExpectedMaxFaceInclineAngle()), "deg");
FeatureGroupManager::PrintFeatureParameter (
"actual incline angle", ToDegrees (anITPODPRIssue.ActualFaceInclineAngle()), "deg");
} else if (theIssue.IsOfType<DFMMachining_SmallRadiusTurnedPartInternalCornerIssue>()) {
const auto& aSRTPICIssue =
static_cast<const DFMMachining_SmallRadiusTurnedPartInternalCornerIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected min radius", aSRTPICIssue.ExpectedMinRadius(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual radius", aSRTPICIssue.ActualRadius(), "mm");
} else if (theIssue.IsOfType<DFMMachining_LargeTurnedPartIssue>()) {
const auto& aLTPIssue = static_cast<const DFMMachining_LargeTurnedPartIssue&> (theIssue);
const auto& anExpectedSize = aLTPIssue.ExpectedMaxTurnedPartSize();
const auto& anActualSize = aLTPIssue.ActualTurnedPartSize();
FeatureGroupManager::PrintFeatureParameter (
"expected max size (LxR)",
std::make_pair (anExpectedSize.Length(), anExpectedSize.Radius()),
"mm");
FeatureGroupManager::PrintFeatureParameter (
"actual size (LxR)",
std::make_pair (anActualSize.Length(), anActualSize.Radius()),
"mm");
} else if (theIssue.IsOfType<DFMMachining_LongSlenderTurnedPartIssue>()) {
const auto& aLSTPIssue =
static_cast<const DFMMachining_LongSlenderTurnedPartIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected min length", aLSTPIssue.ExpectedMaxLength(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual length", aLSTPIssue.ActualLength(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual min diameter", aLSTPIssue.ActualMinDiameter(), "mm");
} else if (theIssue.IsOfType<DFMMachining_SmallDepthBlindBoredHoleReliefIssue>()) {
const auto& aSDBBHRIssue =
static_cast<const DFMMachining_SmallDepthBlindBoredHoleReliefIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter (
"expected min relief depth", aSDBBHRIssue.ExpectedMinReliefDepth(), "mm");
FeatureGroupManager::PrintFeatureParameter (
"actual relief depth", aSDBBHRIssue.ActualReliefDepth(), "mm");
FeatureGroupManager::PrintFeatureParameter (
"actual diameter", aSDBBHRIssue.ActualDiameter(), "mm");
} else if (theIssue.IsOfType<DFMMachining_DeepBoredHoleIssue>()) {
const auto& aDBHIssue =
static_cast<const DFMMachining_DeepBoredHoleIssue&> (theIssue);
FeatureGroupManager::PrintFeatureParameter ("expected max depth", aDBHIssue.ExpectedMaxDepth(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual depth", aDBHIssue.ActualDepth(), "mm");
FeatureGroupManager::PrintFeatureParameter ("actual diameter", aDBHIssue.ActualDiameter(), "mm");
} else if (theIssue.IsOfType<DFMMachining_SquareEndKeywayIssue>()) {
} else if (theIssue.IsOfType<DFMMachining_NonSymmetricalAxialSlotIssue>()) {
}
};
aManager.Print ("issues", PrintFeatureParameters);
}
class PartProcessor : public SolidProcessor
{
public:
PartProcessor (Machining_OperationType theOperation) : myOperation (theOperation)
{}
void ProcessSolid (const ModelData::Solid& theSolid) override
{
Machining_Data aData;
Machining_FeatureRecognizer aRecognizer;
aRecognizer.Parameters().SetOperation (myOperation);
aRecognizer.Perform (theSolid, aData);
DFMMachining_DrillingAnalyzerParameters aDrillingParameters;
DFMMachining_Analyzer aDrillingAnalyzer (aDrillingParameters);
auto anIssueList = aDrillingAnalyzer.Perform (theSolid, aData);
DFMMachining_MillingAnalyzerParameters aMillingParameters;
DFMMachining_Analyzer aMillingAnalyzer (aMillingParameters);
MTKBase_FeatureList aMillingIssueList = aMillingAnalyzer.Perform (theSolid, aData);
CombineFeatureLists (anIssueList, aMillingIssueList);
MTKBase_FeatureList aTurningIssueList;
if (myOperation == Machining_OT_LatheMilling) {
DFMMachining_TurningAnalyzerParameters aTurninigParameters;
DFMMachining_Analyzer aTurningAnalyzer (aTurninigParameters);
aTurningIssueList = aTurningAnalyzer.Perform (theSolid, aData);
CombineFeatureLists (anIssueList, aTurningIssueList);
}
PrintIssues (anIssueList);
}
private:
void CombineFeatureLists (MTKBase_FeatureList& theFirst, const MTKBase_FeatureList& theSecond)
{
for (size_t i = 0; i < theSecond.Size(); i++) {
const auto& aFeature = theSecond[i];
if (myOperation == Machining_OT_LatheMilling
&& aFeature.IsOfType<DFMMachining_MillingIssue>()
&& !aFeature.IsOfType<DFMMachining_DeepPocketIssue>()) {
continue;
}
theFirst.Append (aFeature);
}
}
Machining_OperationType myOperation = Machining_OT_Undefined;
};
void PrintSupportedOperations()
{
cerr << "Supported operations:" << endl;
cerr << " milling:\t CNC Machining Milling feature recognition" << endl;
cerr << " turning:\t CNC Machining Lathe+Milling feature recognition" << endl;
}
Machining_OperationType OperationType (std::string theOperationStr)
{
static std::unordered_map<std::string, Machining_OperationType> aProcessMap
{
{"milling", Machining_OT_Milling},
{"turning", Machining_OT_LatheMilling}
};
auto aRes = aProcessMap.find (theOperationStr);
if (aRes != aProcessMap.end()) {
return aRes->second;
}
return Machining_OT_Undefined;
}
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 != 3) {
cerr << "Usage: " << argv[0] << " <input_file> <operation>, where:" << endl;
cerr << " <input_file> is a name of the file to be read" << endl;
cerr << " <operation> is a name of desired machining operation" << endl << endl;
PrintSupportedOperations();
return 1;
}
const char* aSource = argv[1];
ModelData::Model aModel;
ModelData::ModelReader aReader;
if (!aReader.Read (aSource, aModel)) {
cerr << "Failed to read the file " << aSource << endl;
return 1;
}
cout << "Model: " << aModel.Name() << "\n" << endl;
const char* anOperationStr = argv[2];
auto anOperation = OperationType (anOperationStr);
if (anOperation == Machining_OT_Undefined) {
cerr << "Unsupported operation - " << anOperationStr << endl;
cerr << "Please use one of the following." << endl;
PrintSupportedOperations();
return 1;
}
PartProcessor aPartProcessor (anOperation);
ModelData::ModelElementUniqueVisitor aVisitor (aPartProcessor);
aModel.Accept (aVisitor);
return 0;
}