Add Attribute to FemMeshViewProvider python class to get all visible FemMesh faces.

This commit is contained in:
jriegel 2013-11-17 13:08:45 +01:00
parent 8f01d64d6a
commit 7336a31e44
3 changed files with 26 additions and 2 deletions

View File

@ -109,6 +109,8 @@ public:
void resetColorByNodeId(void);
//@}
const std::vector<unsigned long> &getVisibleElementFaces(void)const{return vFaceElementIdx;}
PyObject *getPyObject();

View File

@ -22,15 +22,21 @@
</Methode>
<Attribute Name="NodeColor" ReadOnly="false">
<Documentation>
<UserDocu>Pose of Axis 1 in degrees</UserDocu>
<UserDocu>Postprocessing color of the the nodes. The faces between the nodes gets interpolated. </UserDocu>
</Documentation>
<Parameter Name="NodeColor" Type="Dict"/>
</Attribute>
<Attribute Name="HighlightedNodes" ReadOnly="false">
<Documentation>
<UserDocu>Pose of Axis 1 in degrees</UserDocu>
<UserDocu>List of nodes which gets highlighted</UserDocu>
</Documentation>
<Parameter Name="HighlightedNodes" Type="List"/>
</Attribute>
<Attribute Name="VisibleElementFaces" ReadOnly="true">
<Documentation>
<UserDocu>A List of elements and faces which are actually shown. This are all surface faces of the mesh</UserDocu>
</Documentation>
<Parameter Name="VisibleElementFaces" Type="List"/>
</Attribute>
</PythonExport>
</GenerateModel>

View File

@ -66,6 +66,22 @@ void ViewProviderFemMeshPy::setHighlightedNodes(Py::List arg)
}
Py::List ViewProviderFemMeshPy::getVisibleElementFaces(void) const
{
const std::vector<unsigned long> & visElmFc = this->getViewProviderFemMeshPtr()->getVisibleElementFaces();
Py::List result( visElmFc.size() );
int i = 0;
for (std::vector<unsigned long>::const_iterator it = visElmFc.begin();it!=visElmFc.end();++it,i++){
Py::Tuple tup(2);
tup.setItem( 0,Py::Int((long)*it>>3) );
tup.setItem( 1,Py::Int((long)(*it&7)+1) );
result.setItem(i,tup);
}
return result;
}
PyObject *ViewProviderFemMeshPy::getCustomAttributes(const char* /*attr*/) const