FEM Post: Move post processing to fem objects
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user