From c139640c8f2c00d9bc4bde92963e7530c03366cd Mon Sep 17 00:00:00 2001
From: FEA-eng <59876896+FEA-eng@users.noreply.github.com>
Date: Mon, 19 May 2025 17:52:25 +0200
Subject: [PATCH] FEM: Add more glyph types for the Glyph filter (#21397)
* FEM: Update post_glyphfilter.py
* FEM: Update TaskPostGlyph.ui
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
src/Mod/Fem/Gui/Resources/ui/TaskPostGlyph.ui | 20 +++++++++++++++++++
src/Mod/Fem/femobjects/post_glyphfilter.py | 13 +++++++++---
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/src/Mod/Fem/Gui/Resources/ui/TaskPostGlyph.ui b/src/Mod/Fem/Gui/Resources/ui/TaskPostGlyph.ui
index ad91ac7ffa..84fde6626e 100644
--- a/src/Mod/Fem/Gui/Resources/ui/TaskPostGlyph.ui
+++ b/src/Mod/Fem/Gui/Resources/ui/TaskPostGlyph.ui
@@ -42,11 +42,31 @@
Arrow
+ -
+
+ Cone
+
+
-
Cube
+ -
+
+ Cylinder
+
+
+ -
+
+ Line
+
+
+ -
+
+ Sphere
+
+
-
diff --git a/src/Mod/Fem/femobjects/post_glyphfilter.py b/src/Mod/Fem/femobjects/post_glyphfilter.py
index 608ee94f12..a783835656 100644
--- a/src/Mod/Fem/femobjects/post_glyphfilter.py
+++ b/src/Mod/Fem/femobjects/post_glyphfilter.py
@@ -71,7 +71,7 @@ class PostGlyphFilter(base_fempythonobject.BaseFemPythonObject):
name="Glyph",
group="Glyph",
doc="The form of the glyph",
- value=["Arrow", "Cube"],
+ value=["Arrow", "Cone", "Cube", "Cylinder", "Line", "Sphere"],
),
_PropHelper(
type="App::PropertyEnumeration",
@@ -91,7 +91,7 @@ class PostGlyphFilter(base_fempythonobject.BaseFemPythonObject):
type="App::PropertyEnumeration",
name="VectorScaleMode",
group="Scale",
- doc="If the scale data is a vector this property decides if the glyph is scaled by vector magnitude or by the individual components",
+ doc="If the scale data is a vector, this property decides if the glyph is scaled by vector magnitude or by the individual components",
value=["Not a vector"],
),
_PropHelper(
@@ -186,7 +186,14 @@ class PostGlyphFilter(base_fempythonobject.BaseFemPythonObject):
self._algorithms = {}
# create all vtkalgorithm combinations and set them as filter pipeline
- sources = {"Arrow": vtkSources.vtkArrowSource, "Cube": vtkSources.vtkCubeSource}
+ sources = {
+ "Arrow": vtkSources.vtkArrowSource,
+ "Cone": vtkSources.vtkConeSource,
+ "Cube": vtkSources.vtkCubeSource,
+ "Cylinder": vtkSources.vtkCylinderSource,
+ "Line": vtkSources.vtkLineSource,
+ "Sphere": vtkSources.vtkSphereSource,
+ }
for source_name in sources: