Assembly: Exploded view refactoring

This commit is contained in:
PaddleStroke
2024-03-20 16:14:11 +01:00
committed by Yorik van Havre
parent 971355e1dc
commit 8fd15eaf28
4 changed files with 216 additions and 138 deletions

View File

@@ -75,6 +75,7 @@
#include "AssemblyObject.h"
#include "AssemblyObjectPy.h"
#include "JointGroup.h"
#include "ViewGroup.h"
namespace PartApp = Part;
@@ -398,6 +399,22 @@ JointGroup* AssemblyObject::getJointGroup()
return nullptr;
}
ViewGroup* AssemblyObject::getExplodedViewGroup()
{
App::Document* doc = getDocument();
std::vector<DocumentObject*> viewGroups = doc->getObjectsOfType(ViewGroup::getClassTypeId());
if (viewGroups.empty()) {
return nullptr;
}
for (auto viewGroup : viewGroups) {
if (hasObject(viewGroup)) {
return dynamic_cast<ViewGroup*>(viewGroup);
}
}
return nullptr;
}
std::vector<App::DocumentObject*> AssemblyObject::getJoints(bool updateJCS, bool delBadJoints)
{
std::vector<App::DocumentObject*> joints = {};