FEM: add GroupID to python mesh API
This commit is contained in:
parent
80be790af9
commit
084e163137
|
@ -237,6 +237,12 @@
|
|||
</Documentation>
|
||||
<Parameter Name="GroupCount" Type="Int"/>
|
||||
</Attribute>
|
||||
<Attribute Name="Groups" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Tuple of Group IDs.</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Groups" Type="Tuple"/>
|
||||
</Attribute>
|
||||
<Attribute Name="Volume" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Volume of the mesh.</UserDocu>
|
||||
|
|
|
@ -1048,6 +1048,19 @@ Py::Int FemMeshPy::getGroupCount(void) const
|
|||
return Py::Int(getFemMeshPtr()->getSMesh()->NbGroup());
|
||||
}
|
||||
|
||||
Py::Tuple FemMeshPy::getGroups(void) const
|
||||
{
|
||||
std::list<int> groupIDs = getFemMeshPtr()->getSMesh()->GetGroupIds();
|
||||
|
||||
Py::Tuple tuple(groupIDs.size());
|
||||
int index = 0;
|
||||
for (std::list<int>::iterator it = groupIDs.begin(); it != groupIDs.end(); ++it) {
|
||||
tuple.setItem(index++, Py::Int(*it));
|
||||
}
|
||||
|
||||
return tuple;
|
||||
}
|
||||
|
||||
Py::Object FemMeshPy::getVolume(void) const
|
||||
{
|
||||
return Py::Object(new Base::QuantityPy(new Base::Quantity(getFemMeshPtr()->getVolume())));
|
||||
|
|
Loading…
Reference in New Issue
Block a user