Merge pull request #15262 from Rexbas/fix-alignment-direction

Move getGlobalPlacement() and fix alignment direction for transformed objects
This commit is contained in:
Chris Hennes
2024-09-13 13:09:23 -06:00
committed by GitHub
11 changed files with 143 additions and 140 deletions

View File

@@ -372,3 +372,24 @@ std::string Base::Tools::currentDateTimeString()
.toString(Qt::ISODate)
.toStdString();
}
std::vector<std::string> Base::Tools::splitSubName(const std::string& subname)
{
// Turns 'Part.Part001.Body.Pad.Edge1'
// Into ['Part', 'Part001', 'Body', 'Pad', 'Edge1']
std::vector<std::string> subNames;
std::string subName;
std::istringstream subNameStream(subname);
while (std::getline(subNameStream, subName, '.')) {
subNames.push_back(subName);
}
// Check if the last character of the input string is the delimiter.
// If so, add an empty string to the subNames vector.
// Because the last subname is the element name and can be empty.
if (!subname.empty() && subname.back() == '.') {
subNames.push_back(""); // Append empty string for trailing dot.
}
return subNames;
}

View File

@@ -325,6 +325,8 @@ struct BaseExport Tools
static std::string joinList(const std::vector<std::string>& vec, const std::string& sep = ", ");
static std::string currentDateTimeString();
static std::vector<std::string> splitSubName(const std::string& subname);
};