FEM Post: Clean up work
This commit is contained in:
@@ -67,7 +67,6 @@ void FemPostFilter::setActiveFilterPipeline(std::string name) {
|
||||
|
||||
DocumentObjectExecReturn* FemPostFilter::execute(void) {
|
||||
|
||||
Base::Console().Message("Recalculate filter\n");
|
||||
if(!m_pipelines.empty() && !m_activePipeline.empty()) {
|
||||
|
||||
FemPostFilter::FilterPipeline& pipe = m_pipelines[m_activePipeline];
|
||||
@@ -76,7 +75,6 @@ DocumentObjectExecReturn* FemPostFilter::execute(void) {
|
||||
|
||||
Data.setValue(pipe.target->GetOutputDataObject(0));
|
||||
}
|
||||
Base::Console().Message("Done Recalculate filter\n");
|
||||
return StdReturn;
|
||||
}
|
||||
|
||||
@@ -165,6 +163,13 @@ short int FemPostClipFilter::mustExecute(void) const {
|
||||
else return App::DocumentObject::mustExecute();
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostClipFilter::execute(void) {
|
||||
|
||||
if(!m_extractor->GetImplicitFunction())
|
||||
return StdReturn;
|
||||
|
||||
return Fem::FemPostFilter::execute();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ public:
|
||||
return "FemGui::ViewProviderFemPostClip";
|
||||
}
|
||||
virtual short int mustExecute(void) const;
|
||||
virtual App::DocumentObjectExecReturn* execute(void);
|
||||
|
||||
protected:
|
||||
virtual void onChanged(const App::Property* prop);
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <vtkQuad.h>
|
||||
#include <vtkImageData.h>
|
||||
#include <vtkRectilinearGrid.h>
|
||||
#include <vtkAppendFilter.h>
|
||||
#include <vtkXMLUnstructuredGridReader.h>
|
||||
#include <vtkXMLPolyDataReader.h>
|
||||
#include <vtkXMLStructuredGridReader.h>
|
||||
@@ -76,15 +77,42 @@ FemPostPipeline::~FemPostPipeline()
|
||||
|
||||
short FemPostPipeline::mustExecute(void) const
|
||||
{
|
||||
return 1;
|
||||
if(Mode.isTouched())
|
||||
return 1;
|
||||
|
||||
return FemPostFilter::mustExecute();
|
||||
}
|
||||
|
||||
DocumentObjectExecReturn* FemPostPipeline::execute(void) {
|
||||
|
||||
|
||||
//if we are the toplevel pipeline our data object is not created by filters, we are the main source!
|
||||
if(!Input.getValue())
|
||||
return StdReturn;
|
||||
|
||||
//now if we are a filter than our data object is created by the filter we hold
|
||||
|
||||
//if we are in serial mode we just copy over the data of the last filter,
|
||||
//but if we are in parallel we need to combine all filter results
|
||||
if(Mode.getValue() == 0) {
|
||||
|
||||
//serial
|
||||
Data.setValue(getLastPostObject()->Data.getValue());
|
||||
}
|
||||
else {
|
||||
|
||||
//parallel. go through all filters and append the result
|
||||
const std::vector<App::DocumentObject*>& filters = Filter.getValues();
|
||||
std::vector<App::DocumentObject*>::const_iterator it = filters.begin();
|
||||
|
||||
vtkSmartPointer<vtkAppendFilter> append = vtkSmartPointer<vtkAppendFilter>::New();
|
||||
for(;it != filters.end(); ++it) {
|
||||
|
||||
append->AddInputDataObject(static_cast<FemPostObject*>(*it)->Data.getValue());
|
||||
}
|
||||
|
||||
append->Update();
|
||||
Data.setValue(append->GetOutputDataObject(0));
|
||||
}
|
||||
|
||||
|
||||
return Fem::FemPostObject::execute();
|
||||
|
||||
Reference in New Issue
Block a user