FEM: allow to Suppress the constraints (#12359)
* FEM: Introduce suppressible constraints * fix public inheritance
This commit is contained in:
committed by
GitHub
parent
ee39814f0c
commit
17af20aa20
@@ -109,6 +109,8 @@ Constraint::Constraint()
|
||||
Normals.setValues(std::vector<Base::Vector3d>());
|
||||
|
||||
References.setScope(App::LinkScope::Global);
|
||||
|
||||
App::SuppressibleExtension::initExtension(this);
|
||||
}
|
||||
|
||||
Constraint::~Constraint() = default;
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <App/PropertyUnits.h>
|
||||
#include <Base/Vector3D.h>
|
||||
#include <Mod/Fem/FemGlobal.h>
|
||||
#include <App/SuppressibleExtension.h>
|
||||
|
||||
|
||||
namespace Fem
|
||||
@@ -57,7 +58,7 @@ namespace Fem
|
||||
* and @ref Scale and the protected method @ref getPoints(points&, normals&,
|
||||
* scale&).
|
||||
*/
|
||||
class FemExport Constraint: public App::DocumentObject
|
||||
class FemExport Constraint: public App::DocumentObject, public App::SuppressibleExtension
|
||||
{
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(Fem::Constraint);
|
||||
|
||||
|
||||
@@ -84,6 +84,8 @@ ViewProviderFemConstraint::ViewProviderFemConstraint()
|
||||
wizardWidget = nullptr;
|
||||
wizardSubLayout = nullptr;
|
||||
constraintDialog = nullptr;
|
||||
|
||||
Gui::ViewProviderSuppressibleExtension::initExtension(this);
|
||||
}
|
||||
|
||||
ViewProviderFemConstraint::~ViewProviderFemConstraint()
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <Gui/ViewProviderPythonFeature.h>
|
||||
#include <Mod/Fem/FemGlobal.h>
|
||||
|
||||
#include <Gui/ViewProviderSuppressibleExtension.h>
|
||||
|
||||
|
||||
class SoFontStyle;
|
||||
class SoText2;
|
||||
@@ -44,7 +46,8 @@ namespace FemGui
|
||||
|
||||
class TaskFemConstraint;
|
||||
|
||||
class FemGuiExport ViewProviderFemConstraint: public Gui::ViewProviderGeometryObject
|
||||
class FemGuiExport ViewProviderFemConstraint: public Gui::ViewProviderGeometryObject,
|
||||
public Gui::ViewProviderSuppressibleExtension
|
||||
{
|
||||
PROPERTY_HEADER_WITH_OVERRIDE(FemGui::ViewProviderFemConstraint);
|
||||
|
||||
|
||||
@@ -59,7 +59,10 @@ def get_member(analysis, t):
|
||||
for m in analysis.Group:
|
||||
# since is _derived_from is used the father could be used
|
||||
# to test too (ex. "Fem::FemMeshObject")
|
||||
if femutils.is_derived_from(m, t):
|
||||
if (femutils.is_derived_from(m, t)
|
||||
and not (m.hasExtension("App::SuppressibleExtension")
|
||||
and m.Suppressed)
|
||||
):
|
||||
matching.append(m)
|
||||
return matching
|
||||
|
||||
|
||||
Reference in New Issue
Block a user