FEM Post: Move post processing to fem objects

This commit is contained in:
Stefan Tröger
2015-10-25 21:00:07 +01:00
committed by wmayer
parent 379a51a12d
commit 02095a49af
26 changed files with 2732 additions and 457 deletions

View File

@@ -64,6 +64,7 @@
#include "FemMesh.h"
#include "FemMeshObject.h"
#include "FemPostPipeline.h"
#include "FemMeshPy.h"
#include <cstdlib>
@@ -163,16 +164,36 @@ private:
pcDoc = App::GetApplication().newDocument(DocName);
}
std::auto_ptr<FemMesh> mesh(new FemMesh);
mesh->read(EncodedName.c_str());
Base::FileInfo file(EncodedName.c_str());
FemMeshObject *pcFeature = static_cast<FemMeshObject *>
(pcDoc->addObject("Fem::FemMeshObject", file.fileNamePure().c_str()));
pcFeature->Label.setValue(file.fileNamePure().c_str());
pcFeature->FemMesh.setValuePtr(mesh.get());
(void)mesh.release();
pcFeature->purgeTouched();
try {
std::auto_ptr<FemMesh> mesh(new FemMesh);
mesh->read(EncodedName.c_str());
FemMeshObject *pcFeature = static_cast<FemMeshObject *>
(pcDoc->addObject("Fem::FemMeshObject", file.fileNamePure().c_str()));
pcFeature->Label.setValue(file.fileNamePure().c_str());
pcFeature->FemMesh.setValuePtr(mesh.get());
(void)mesh.release();
pcFeature->purgeTouched();
}
catch(Base::Exception& e) {
#ifdef FC_USE_VTK
if( FemPostPipeline::canRead(file) ) {
FemPostPipeline *pcFeature = static_cast<FemPostPipeline *>
(pcDoc->addObject("Fem::FemPostPipeline", file.fileNamePure().c_str()));
pcFeature->Label.setValue(file.fileNamePure().c_str());
pcFeature->read(file);
pcFeature->touch();
}
else
throw e;
#else
throw e;
#endif
}
return Py::None();
}