FEM: Switch post groups to extension based system

This commit is contained in:
Stefan Tröger
2024-12-21 20:02:07 +01:00
committed by Benjamin Nauck
parent 1cff507a7f
commit a65a7feb87
19 changed files with 350 additions and 268 deletions

View File

@@ -23,6 +23,7 @@
#include "PreCompiled.h"
#include "FemPostFunction.h"
#include <App/Document.h>
using namespace Fem;
@@ -31,19 +32,26 @@ using namespace App;
PROPERTY_SOURCE(Fem::FemPostFunctionProvider, App::DocumentObject)
FemPostFunctionProvider::FemPostFunctionProvider()
: DocumentObject()
: DocumentObjectGroup()
{
ADD_PROPERTY(Functions, (nullptr));
}
FemPostFunctionProvider::~FemPostFunctionProvider() = default;
void FemPostFunctionProvider::onChanged(const Property* prop)
bool FemPostFunctionProvider::allowObject(App::DocumentObject* obj)
{
App::DocumentObject::onChanged(prop);
return obj->isDerivedFrom(FemPostFunction::getClassTypeId());
}
void FemPostFunctionProvider::unsetupObject()
{
// remove all children!
auto document = getExtendedObject()->getDocument();
for (const auto& obj : Group.getValues()) {
document->removeObject(obj->getNameInDocument());
}
}
PROPERTY_SOURCE(Fem::FemPostFunction, App::DocumentObject)