QVariant PropertyFemMeshItem::value(const App::Property*) const
{
    int ctN = 0;
    int ctE = 0;
    int ctF = 0;
    int ctP = 0;
    int ctV = 0;
    int ctH = 0;
    int ctG = 0;

    const std::vector<App::Property*>& props = getPropertyData();
    for (std::vector<App::Property*>::const_iterator pt = props.begin(); pt != props.end(); ++pt) {
        Fem::PropertyFemMesh* prop = static_cast<Fem::PropertyFemMesh*>(*pt);
        SMESH_Mesh* mesh = const_cast<SMESH_Mesh*>(prop->getValue().getSMesh());
        ctN += mesh->NbNodes();
        ctE += mesh->NbEdges();
        ctF += mesh->NbFaces();
        ctP += mesh->NbPolygons();
        ctV += mesh->NbVolumes();
        ctH += mesh->NbPolyhedrons();
        ctG += mesh->NbGroup();
    }

    QString  str = QObject::tr("[Nodes: %1, Edges: %2, Faces: %3, Polygons: %4, Volumes: %5, Polyhedrons: %6, Groups: %7]")
        .arg(ctN).arg(ctE).arg(ctF).arg(ctP).arg(ctV).arg(ctH).arg(ctG);
    return QVariant(str);
}
int PropertyFemMeshItem::countGroups() const
{
    int ctG = 0;
    const std::vector<App::Property*>& props = getPropertyData();
    for (std::vector<App::Property*>::const_iterator pt = props.begin(); pt != props.end(); ++pt) {
        Fem::PropertyFemMesh* prop = static_cast<Fem::PropertyFemMesh*>(*pt);
        SMESH_Mesh* mesh = const_cast<SMESH_Mesh*>(prop->getValue().getSMesh());
        ctG += mesh->NbGroup();
    }

    return ctG;
}