Base: Add ComplexGeoData::centerOfGravity helper
This adds a simple quality of life helper returning center of gravity as std::optional instead of C style method accepting reference and returning bool to indicate method success.
This commit is contained in:
@@ -184,6 +184,17 @@ bool ComplexGeoData::getCenterOfGravity(Base::Vector3d& unused) const
|
||||
return false;
|
||||
}
|
||||
|
||||
std::optional<Base::Vector3d> ComplexGeoData::centerOfGravity() const
|
||||
{
|
||||
Base::Vector3d centerOfGravity;
|
||||
|
||||
if (getCenterOfGravity(centerOfGravity)) {
|
||||
return centerOfGravity;
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
const std::string& ComplexGeoData::elementMapPrefix()
|
||||
{
|
||||
static std::string prefix(ELEMENT_MAP_PREFIX);
|
||||
|
||||
Reference in New Issue
Block a user