Add Nodes interface to FemMesh (for usage e.g. calculating eigen transformation)

This commit is contained in:
jriegel
2013-07-10 23:16:21 +02:00
parent 3212791cf8
commit d71fd39987
2 changed files with 27 additions and 7 deletions

View File

@@ -84,13 +84,19 @@
<UserDocu>Make a copy of this FEM mesh.</UserDocu>
</Documentation>
</Methode>
<Attribute Name="NodeCount" ReadOnly="true">
<Documentation>
<UserDocu>Number of nodes in the Mesh.</UserDocu>
</Documentation>
<Parameter Name="NodeCount" Type="Int"/>
</Attribute>
<Attribute Name="EdgeCount" ReadOnly="true">
<Attribute Name="Nodes" ReadOnly="true">
<Documentation>
<UserDocu>Tuple of node points.</UserDocu>
</Documentation>
<Parameter Name="Nodes" Type="Tuple"/>
</Attribute>
<Attribute Name="NodeCount" ReadOnly="true">
<Documentation>
<UserDocu>Number of nodes in the Mesh.</UserDocu>
</Documentation>
<Parameter Name="NodeCount" Type="Int"/>
</Attribute>
<Attribute Name="EdgeCount" ReadOnly="true">
<Documentation>
<UserDocu>Number of edges in the Mesh.</UserDocu>
</Documentation>

View File

@@ -439,6 +439,20 @@ PyObject* FemMeshPy::setTransform(PyObject *args)
// ===== Atributes ============================================================
Py::Tuple FemMeshPy::getNodes(void) const
{
int count = getFemMeshPtr()->getSMesh()->GetMeshDS()->NbNodes();
Py::Tuple tup(count);
SMDS_NodeIteratorPtr aNodeIter = getFemMeshPtr()->getSMesh()->GetMeshDS()->nodesIterator();
for (int i=0;aNodeIter->more();i++) {
const SMDS_MeshNode* aNode = aNodeIter->next();
tup.setItem(i, Py::asObject(new Base::VectorPy(Base::Vector3d(aNode->X(),aNode->Y(),aNode->Z()))));
}
return tup;
}
Py::Int FemMeshPy::getNodeCount(void) const
{
return Py::Int(getFemMeshPtr()->getSMesh()->NbNodes());