cimforreduceloss/testHasttable/elementreduction.h

32 lines
1.1 KiB
C
Raw Normal View History

#ifndef ELEMENTREDUCTION_H
#define ELEMENTREDUCTION_H
#include <QList>
#include <QHash>
#include <QString>
#include <QVector>
#include <QDomElement>
#include <QDomDocument>
#include <QDomNodeList>
#include <QDomNode>
#include <QStringList>
#include "element/commontype.h"
//把电阻等于0的元件都去掉
class ElementReduction
{
public:
explicit ElementReduction(const QList<BranchStruc*>& branchList);
void doIt(const QString &rootID);
~ElementReduction();
private:
void calibration(const QString &id, QHash<QString, BranchStruc *> &idToBranch, QHash<QString, QVector<BranchStruc *> > &linkage);
void merge(QDomElement &element, QHash<QString,BranchStruc *>& idToBranch);
void buildTreeTo(QDomElement &element, QDomDocument &root, QHash<QString,QVector<BranchStruc *> >& linkage, QHash<QString,BranchStruc *>& idToBranch);
void buildTreeFrom(QDomElement &element, QDomDocument &root, QHash<QString,QVector<BranchStruc *> >& linkage, QHash<QString,BranchStruc *>& idToBranch);
void reduceSection();
const QList<BranchStruc*>& branchList;
QHash<QString,char> visited;
};
#endif // ELEMENTREDUCTION_H