Starting Displacement post-processing to the FemMesh ViewProvider
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include <Base/VectorPy.h>
|
||||
#include <Base/GeometryPyCXX.h>
|
||||
|
||||
#include "Mod/Fem/Gui/ViewProviderFemMesh.h"
|
||||
|
||||
// inclusion of the generated files (generated out of ViewProviderFemMeshPy.xml)
|
||||
@@ -49,6 +52,32 @@ void ViewProviderFemMeshPy::setNodeColor(Py::Dict arg)
|
||||
}
|
||||
}
|
||||
|
||||
Py::Dict ViewProviderFemMeshPy::getNodeDisplacement(void) const
|
||||
{
|
||||
//return Py::Dict();
|
||||
throw Py::AttributeError("Not yet implemented");
|
||||
}
|
||||
|
||||
void ViewProviderFemMeshPy::setNodeDisplacement(Py::Dict arg)
|
||||
{
|
||||
if(arg.size() == 0)
|
||||
this->getViewProviderFemMeshPtr()->resetColorByNodeId();
|
||||
else {
|
||||
std::map<long,Base::Vector3d> NodeDispMap;
|
||||
union PyType_Object pyType = {&(Base::VectorPy::Type)};
|
||||
Py::Type vType(pyType.o);
|
||||
|
||||
for( Py::Dict::iterator it = arg.begin(); it!= arg.end();++it){
|
||||
Py::Int id((*it).first);
|
||||
if ((*it).second.isType(vType)) {
|
||||
Py::Vector p((*it).second);
|
||||
NodeDispMap[id] = p.toVector();
|
||||
}
|
||||
}
|
||||
this->getViewProviderFemMeshPtr()->setDisplacementByNodeId(NodeDispMap);
|
||||
}
|
||||
}
|
||||
|
||||
Py::List ViewProviderFemMeshPy::getHighlightedNodes(void) const
|
||||
{
|
||||
//return Py::List();
|
||||
|
||||
Reference in New Issue
Block a user