Skip to content

Commit

Permalink
Implemented Profile Modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
netfabb committed Oct 26, 2024
1 parent c74debb commit 051c8b7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Include/Common/NMR_ErrorConst.h
Original file line number Diff line number Diff line change
Expand Up @@ -1696,4 +1696,7 @@ Toolpath errors (0xBXXX)
// Invalid profile modifier namespace
#define NMR_ERROR_INVALIDPROFILEMODIFIERNAMESPACE 0xB02A

// Toolpath profile not created
#define NMR_ERROR_TOOLPATHPROFILENOTCREATED 0xB02B

#endif // __NMR_ERRORCONST
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace NMR {
private:
CModel * m_pModel;
CModelToolpath* m_pToolpath;
PModelToolpathProfile m_pProfile;
PModelWarnings m_pWarnings;

nfBool m_bHasUUID;
Expand Down
1 change: 1 addition & 0 deletions Source/Common/NMR_Exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ namespace NMR {
case NMR_ERROR_MISSINGMODIFIERPROFILEDELTA: return "Missing modifier profile delta";
case NMR_ERROR_EMPTYMODIFIERPROFILEATTRIBUTE: return "Empty modifier profile attribute";
case NMR_ERROR_INVALIDPROFILEMODIFIERNAMESPACE: return "Invalid profile modifier namespace";
case NMR_ERROR_TOOLPATHPROFILENOTCREATED: return "Toolpath profile not created";

default:
return "unknown error";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ namespace NMR {
m_pModel, m_pWarnings);
pXMLNode->parseXML(pXMLReader);

if (m_pProfile.get() == nullptr)
throw CNMRException(NMR_ERROR_TOOLPATHPROFILENOTCREATED);

pXMLNode->addToProfile(m_pProfile.get(), pXMLReader);

}
else
m_pWarnings->addException(CNMRException(NMR_ERROR_NAMESPACE_INVALID_ELEMENT), mrwInvalidOptionalValue);
Expand All @@ -134,10 +139,10 @@ namespace NMR {
if (!m_bHasName)
throw CNMRException(NMR_ERROR_MISSINGNAME);

auto pProfile = pToolpath->addExistingProfile(m_sUUID, m_sName);
m_pProfile = pToolpath->addExistingProfile(m_sUUID, m_sName);

for (auto iter : m_Parameters) {
pProfile->addValue(iter.first.first, iter.first.second, iter.second, true);
m_pProfile->addValue(iter.first.first, iter.first.second, iter.second, true);
}

}
Expand Down

0 comments on commit 051c8b7

Please sign in to comment.