FEM Post: FreeCADify the vtk post processing

- Data property for saving/loading vtk data
- Use FreeCAD recompute system instead of vtk pipeline
This commit is contained in:
Stefan Tröger
2016-01-01 14:12:23 +01:00
committed by wmayer
parent 427ded23d5
commit c2df92cd76
15 changed files with 265 additions and 356 deletions

View File

@@ -289,13 +289,13 @@ void TaskPostClip::collectImplicitFunctions() {
pipelines = App::GetApplication().getActiveDocument()->getObjectsOfType<Fem::FemPostPipeline>();
if (!pipelines.empty()) {
Fem::FemPostPipeline *pipeline = pipelines.front();
if(pipeline->Function.getValue() &&
pipeline->Function.getValue()->getTypeId() == Fem::FemPostFunctionProvider::getClassTypeId()) {
if(pipeline->Functions.getValue() &&
pipeline->Functions.getValue()->getTypeId() == Fem::FemPostFunctionProvider::getClassTypeId()) {
ui->FunctionBox->clear();
QStringList items;
const std::vector<App::DocumentObject*>& funcs = static_cast<Fem::FemPostFunctionProvider*>(
pipeline->Function.getValue())->Functions.getValues();
pipeline->Functions.getValue())->Functions.getValues();
for(std::size_t i=0; i<funcs.size(); ++i)
items.push_back(QString::fromAscii(funcs[i]->getNameInDocument()));
@@ -317,11 +317,11 @@ void TaskPostClip::on_FunctionBox_currentIndexChanged(int idx) {
pipelines = App::GetApplication().getActiveDocument()->getObjectsOfType<Fem::FemPostPipeline>();
if (!pipelines.empty()) {
Fem::FemPostPipeline *pipeline = pipelines.front();
if(pipeline->Function.getValue() &&
pipeline->Function.getValue()->getTypeId() == Fem::FemPostFunctionProvider::getClassTypeId()) {
if(pipeline->Functions.getValue() &&
pipeline->Functions.getValue()->getTypeId() == Fem::FemPostFunctionProvider::getClassTypeId()) {
const std::vector<App::DocumentObject*>& funcs = static_cast<Fem::FemPostFunctionProvider*>(
pipeline->Function.getValue())->Functions.getValues();
pipeline->Functions.getValue())->Functions.getValues();
if(idx>=0)
static_cast<Fem::FemPostClipFilter*>(getObject())->Function.setValue(funcs[idx]);
else
@@ -581,13 +581,13 @@ void TaskPostCut::collectImplicitFunctions() {
pipelines = App::GetApplication().getActiveDocument()->getObjectsOfType<Fem::FemPostPipeline>();
if (!pipelines.empty()) {
Fem::FemPostPipeline *pipeline = pipelines.front();
if(pipeline->Function.getValue() &&
pipeline->Function.getValue()->getTypeId() == Fem::FemPostFunctionProvider::getClassTypeId()) {
if(pipeline->Functions.getValue() &&
pipeline->Functions.getValue()->getTypeId() == Fem::FemPostFunctionProvider::getClassTypeId()) {
ui->FunctionBox->clear();
QStringList items;
const std::vector<App::DocumentObject*>& funcs = static_cast<Fem::FemPostFunctionProvider*>(
pipeline->Function.getValue())->Functions.getValues();
pipeline->Functions.getValue())->Functions.getValues();
for(std::size_t i=0; i<funcs.size(); ++i)
items.push_back(QString::fromAscii(funcs[i]->getNameInDocument()));
@@ -609,11 +609,11 @@ void TaskPostCut::on_FunctionBox_currentIndexChanged(int idx) {
pipelines = App::GetApplication().getActiveDocument()->getObjectsOfType<Fem::FemPostPipeline>();
if (!pipelines.empty()) {
Fem::FemPostPipeline *pipeline = pipelines.front();
if(pipeline->Function.getValue() &&
pipeline->Function.getValue()->getTypeId() == Fem::FemPostFunctionProvider::getClassTypeId()) {
if(pipeline->Functions.getValue() &&
pipeline->Functions.getValue()->getTypeId() == Fem::FemPostFunctionProvider::getClassTypeId()) {
const std::vector<App::DocumentObject*>& funcs = static_cast<Fem::FemPostFunctionProvider*>(
pipeline->Function.getValue())->Functions.getValues();
pipeline->Functions.getValue())->Functions.getValues();
if(idx>=0)
static_cast<Fem::FemPostCutFilter*>(getObject())->Function.setValue(funcs[idx]);
else