mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
add method for get each potentials in a diagram and revamp method for reset all conductors text in a diagram
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2121 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -272,6 +272,26 @@ bool Diagram::isEmpty() const {
|
||||
return(!items().count());
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Diagram::potential
|
||||
* @return all potential in the diagram
|
||||
*each potential are in the QList and each conductors of one potential are in the QSet
|
||||
*/
|
||||
QList < QSet <Conductor *> > Diagram::potentials() {
|
||||
QList < QSet <Conductor *> > potential_List;
|
||||
if (content().conductors().size() == 0) return (potential_List); //return an empty potential
|
||||
QList <Conductor *> conductors_list = content().conductors();
|
||||
|
||||
do {
|
||||
QSet <Conductor *> one_potential = conductors_list.first() -> relatedPotentialConductors();
|
||||
one_potential << conductors_list.takeFirst();
|
||||
foreach (Conductor *c, one_potential) conductors_list.removeOne(c);
|
||||
potential_List << one_potential;
|
||||
} while (!conductors_list.empty());
|
||||
|
||||
return (potential_List);
|
||||
}
|
||||
|
||||
/**
|
||||
Exporte tout ou partie du schema
|
||||
@param whole_content Booleen (a vrai par defaut) indiquant si le XML genere doit
|
||||
|
||||
Reference in New Issue
Block a user