FEM: Fix test with new python filter and other small fixes
This commit is contained in:
@@ -59,7 +59,7 @@ template<> PyObject* FemGui::ViewProviderPostFilterPython::getPyObject()
|
||||
}
|
||||
|
||||
// explicit template instantiation
|
||||
template class GuiExport ViewProviderFeaturePythonT<FemGui::ViewProviderFemPostFilterPythonBase>;
|
||||
template class FemGuiExport ViewProviderFeaturePythonT<FemGui::ViewProviderFemPostFilterPythonBase>;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,6 @@ protected:
|
||||
const char* typeName,
|
||||
const char* propName) override;
|
||||
|
||||
virtual void setupTaskDialog(TaskDlgPost* dlg);
|
||||
bool setupPipeline();
|
||||
void updateVtk();
|
||||
void setRangeOfColorBar(float min, float max);
|
||||
|
||||
@@ -652,20 +652,19 @@ def makePostVtkFilterContours(doc, base_vtk_result, name="VtkFilterContours"):
|
||||
base_vtk_result.addObject(obj)
|
||||
return obj
|
||||
|
||||
if "BUILD_FEM_VTK_PYTHON" in FreeCAD.__cmake__:
|
||||
def makePostFilterGlyph(doc, base_vtk_result, name="Glyph"):
|
||||
"""makePostVtkFilterGlyph(document, [name]):
|
||||
creates a FEM post processing filter that visualizes vector fields with glyphs
|
||||
"""
|
||||
obj = doc.addObject("Fem::PostFilterPython", name)
|
||||
from femobjects import post_glyphfilter
|
||||
def makePostFilterGlyph(doc, base_vtk_result, name="Glyph"):
|
||||
"""makePostVtkFilterGlyph(document, [name]):
|
||||
creates a FEM post processing filter that visualizes vector fields with glyphs
|
||||
"""
|
||||
obj = doc.addObject("Fem::PostFilterPython", name)
|
||||
from femobjects import post_glyphfilter
|
||||
|
||||
post_glyphfilter.PostGlyphFilter(obj)
|
||||
base_vtk_result.addObject(obj)
|
||||
if FreeCAD.GuiUp:
|
||||
from femviewprovider import view_post_glyphfilter
|
||||
view_post_glyphfilter.VPPostGlyphFilter(obj.ViewObject)
|
||||
return obj
|
||||
post_glyphfilter.PostGlyphFilter(obj)
|
||||
base_vtk_result.addObject(obj)
|
||||
if FreeCAD.GuiUp:
|
||||
from femviewprovider import view_post_glyphfilter
|
||||
view_post_glyphfilter.VPPostGlyphFilter(obj.ViewObject)
|
||||
return obj
|
||||
|
||||
def makePostVtkResult(doc, result_data, name="VtkResult"):
|
||||
"""makePostVtkResult(document, base_result, [name]):
|
||||
|
||||
@@ -50,6 +50,7 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel):
|
||||
self.widget = FreeCADGui.PySideUic.loadUi(
|
||||
FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/TaskPostGlyph.ui"
|
||||
)
|
||||
self.widget.setWindowIcon(FreeCADGui.getIcon(":/icons/FEM_PostFilterGlyph.svg"))
|
||||
self.__init_widget()
|
||||
|
||||
# form made from param and selection widget
|
||||
|
||||
@@ -87,7 +87,7 @@ def get_defmake_count(fem_vtk_post=True):
|
||||
# we are not able to create VTK post objects
|
||||
new_lines = []
|
||||
for li in lines_defmake:
|
||||
if "PostVtk" not in li:
|
||||
if "Post" not in li:
|
||||
new_lines.append(li)
|
||||
lines_defmake = new_lines
|
||||
return len(lines_defmake)
|
||||
|
||||
@@ -81,9 +81,13 @@ class TestObjectCreate(unittest.TestCase):
|
||||
# result children: mesh result --> 1
|
||||
# post pipeline children: region, scalar, cut, wrap --> 5
|
||||
# analysis itself is not in analysis group --> 1
|
||||
# thus: -20
|
||||
# vtk python post objects: glyph --> 1
|
||||
|
||||
self.assertEqual(len(doc.Analysis.Group), count_defmake - 20)
|
||||
subtraction = 20
|
||||
if "BUILD_FEM_VTK_PYTHON" in FreeCAD.__cmake__:
|
||||
subtraction += 1
|
||||
|
||||
self.assertEqual(len(doc.Analysis.Group), count_defmake - subtraction)
|
||||
self.assertEqual(len(doc.Objects), count_defmake)
|
||||
|
||||
fcc_print(
|
||||
@@ -1154,7 +1158,8 @@ def create_all_fem_objects_doc(doc):
|
||||
ObjectsFem.makePostVtkFilterCutFunction(doc, vres)
|
||||
ObjectsFem.makePostVtkFilterWarp(doc, vres)
|
||||
ObjectsFem.makePostVtkFilterContours(doc, vres)
|
||||
ObjectsFem.makePostVtkFilterGlyph(doc, vres)
|
||||
if "BUILD_FEM_VTK_PYTHON" in FreeCAD.__cmake__:
|
||||
ObjectsFem.makePostFilterGlyph(doc, vres)
|
||||
|
||||
analysis.addObject(ObjectsFem.makeSolverCalculiXCcxTools(doc))
|
||||
analysis.addObject(ObjectsFem.makeSolverCalculiX(doc))
|
||||
|
||||
Reference in New Issue
Block a user