Merge pull request #13317 from Ondsel-Development/add-prop-varset

Core: Add properties to variable sets
This commit is contained in:
Chris Hennes
2024-06-03 10:34:57 -05:00
committed by GitHub
10 changed files with 732 additions and 7 deletions

View File

@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#include <App/Document.h>
#include <App/VarSet.h>
#include <App/Origin.h>
#include <Base/Placement.h>
@@ -227,10 +228,12 @@ bool Body::isAllowed(const App::DocumentObject *obj)
// TODO Shouldn't we replace it with Sketcher::SketchObject? (2015-08-13, Fat-Zer)
obj->isDerivedFrom<Part::Part2DObject>() ||
obj->isDerivedFrom<PartDesign::ShapeBinder>() ||
obj->isDerivedFrom<PartDesign::SubShapeBinder>()
obj->isDerivedFrom<PartDesign::SubShapeBinder>() ||
// TODO Why this lines was here? why should we allow anything of those? (2015-08-13, Fat-Zer)
//obj->isDerivedFrom<Part::FeaturePython>() // trouble with this line on Windows!? Linker fails to find getClassTypeId() of the Part::FeaturePython...
//obj->isDerivedFrom<Part::Feature>()
// allow VarSets for parameterization
obj->isDerivedFrom<App::VarSet>()
);
}

View File

@@ -33,6 +33,7 @@
#include <App/Document.h>
#include <App/Origin.h>
#include <App/Part.h>
#include <App/VarSet.h>
#include <Base/Console.h>
#include <Gui/ActionFunction.h>
#include <Gui/Application.h>
@@ -494,6 +495,9 @@ bool ViewProviderBody::canDropObjects() const
bool ViewProviderBody::canDropObject(App::DocumentObject* obj) const
{
if (obj->isDerivedFrom<App::VarSet>()) {
return true;
}
if (!obj->isDerivedFrom(Part::Feature::getClassTypeId())) {
return false;
}