@@ -776,7 +776,7 @@ FemPostContoursFilter::FemPostContoursFilter()
776
776
m_contours->ComputeScalarsOn ();
777
777
smoothExtension.getFilter ()->SetInputConnection (m_contours->GetOutputPort ());
778
778
contours.source = m_contours;
779
- contours.target = m_contours; // smoothExtension.getFilter();
779
+ contours.target = smoothExtension.getFilter ();
780
780
addFilterPipeline (contours, " contours" );
781
781
setActiveFilterPipeline (" contours" );
782
782
@@ -794,20 +794,20 @@ DocumentObjectExecReturn* FemPostContoursFilter::execute()
794
794
}
795
795
796
796
// 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;
811
811
}
812
812
813
813
void FemPostContoursFilter::onChanged (const Property* prop)
@@ -968,8 +968,10 @@ void FemPostContoursFilter::refreshFields()
968
968
else {
969
969
m_blockPropertyChanges = false ;
970
970
// 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
+ }
973
975
}
974
976
975
977
m_blockPropertyChanges = false ;
@@ -985,7 +987,11 @@ void FemPostContoursFilter::refreshVectors()
985
987
m_blockPropertyChanges = false ;
986
988
return ;
987
989
}
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
+ }
989
995
if (!fieldArray) {
990
996
m_blockPropertyChanges = false ;
991
997
return ;
0 commit comments