Skip to content

Commit 19d5b4f

Browse files
committed
test4
1 parent 6292875 commit 19d5b4f

File tree

1 file changed

+24
-18
lines changed

1 file changed

+24
-18
lines changed

src/Mod/Fem/App/FemPostFilter.cpp

+24-18
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ FemPostContoursFilter::FemPostContoursFilter()
776776
m_contours->ComputeScalarsOn();
777777
smoothExtension.getFilter()->SetInputConnection(m_contours->GetOutputPort());
778778
contours.source = m_contours;
779-
contours.target = m_contours; // smoothExtension.getFilter();
779+
contours.target = smoothExtension.getFilter();
780780
addFilterPipeline(contours, "contours");
781781
setActiveFilterPipeline("contours");
782782

@@ -794,20 +794,20 @@ DocumentObjectExecReturn* FemPostContoursFilter::execute()
794794
}
795795

796796
// recalculate the filter
797-
auto returnObject = Fem::FemPostFilter::execute();
798-
799-
// delete contour field
800-
vtkDataSet* dset = getInputData();
801-
if (!dset) {
802-
return returnObject;
803-
}
804-
dset->GetPointData()->RemoveArray(contourFieldName.c_str());
805-
// refresh fields to reflect the deletion
806-
if (!m_blockPropertyChanges) {
807-
refreshFields();
808-
}
809-
810-
return returnObject;
797+
// auto returnObject = Fem::FemPostFilter::execute();
798+
799+
// // delete contour field
800+
// vtkDataSet* dset = getInputData();
801+
// if (!dset) {
802+
// return StdReturn;
803+
// }
804+
// dset->GetPointData()->RemoveArray(contourFieldName.c_str());
805+
// // refresh fields to reflect the deletion
806+
// if (!m_blockPropertyChanges) {
807+
// refreshFields();
808+
// }
809+
810+
return Fem::FemPostFilter::execute(); // returnObject;
811811
}
812812

813813
void FemPostContoursFilter::onChanged(const Property* prop)
@@ -968,8 +968,10 @@ void FemPostContoursFilter::refreshFields()
968968
else {
969969
m_blockPropertyChanges = false;
970970
// select the first field
971-
Field.setValue(long(0));
972-
fieldName = Field.getValueAsString();
971+
if (Field.isValid()) {
972+
Field.setValue(long(0));
973+
fieldName = Field.getValueAsString();
974+
}
973975
}
974976

975977
m_blockPropertyChanges = false;
@@ -985,7 +987,11 @@ void FemPostContoursFilter::refreshVectors()
985987
m_blockPropertyChanges = false;
986988
return;
987989
}
988-
vtkDataArray* fieldArray = dset->GetPointData()->GetArray(Field.getValueAsString());
990+
vtkDataArray* fieldArray = nullptr;
991+
992+
if (Field.isValid()) {
993+
fieldArray = dset->GetPointData()->GetArray(Field.getValueAsString());
994+
}
989995
if (!fieldArray) {
990996
m_blockPropertyChanges = false;
991997
return;

0 commit comments

Comments
 (0)