[FEM] fix point filter initialization issue

- on opening the task dialog of existing point filter, the point value must be displayed
This commit is contained in:
Uwe
2022-06-27 01:07:36 +02:00
parent 5ca796a162
commit 5f5ae2fe4a
2 changed files with 8 additions and 4 deletions

View File

@@ -341,7 +341,7 @@ FemPostDataAtPointFilter::FemPostDataAtPointFilter(void) : FemPostFilter() {
ADD_PROPERTY_TYPE(Center, (Base::Vector3d(0.0, 0.0, 0.0)), "DataAtPoint", App::Prop_None, "Center of the point");
ADD_PROPERTY_TYPE(Radius, (0), "DataAtPoint", App::Prop_None, "Radius around the point (unused)");
ADD_PROPERTY_TYPE(PointData, (0), "DataAtPoint", App::Prop_None, "Point data values used for plotting");
ADD_PROPERTY_TYPE(PointData, (0), "DataAtPoint", App::Prop_None, "Point data values");
ADD_PROPERTY_TYPE(FieldName, (""), "DataAtPoint", App::Prop_None, "Field used for plotting");
ADD_PROPERTY_TYPE(Unit, (""), "DataAtPoint", App::Prop_None, "Unit used for the field");

View File

@@ -932,13 +932,17 @@ TaskPostDataAtPoint::TaskPostDataAtPoint(ViewProviderDocumentObject* view, QWidg
ui->centerY->setValue(vec.y);
ui->centerZ->setValue(vec.z);
// update all fields
updateEnumerationList(getTypedView<ViewProviderFemPostObject>()->Field, ui->Field);
// read in point value
auto pointValue = static_cast<Fem::FemPostDataAtPointFilter *>(getObject())->PointData[0];
showValue(pointValue, static_cast<Fem::FemPostDataAtPointFilter *>(getObject())->Unit.getValue());
connect(ui->centerX, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double)));
connect(ui->centerY, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double)));
connect(ui->centerZ, SIGNAL(valueChanged(double)), this, SLOT(centerChanged(double)));
// update all fields
updateEnumerationList(getTypedView<ViewProviderFemPostObject>()->Field, ui->Field);
// the point filter object needs to be recomputed
// to fill all fields with data at the current point
getObject()->recomputeFeature();