20 #include "qgraphicsitem.h" 37 m_terminals_list(terminals_list)
49 QList<Conductor *> c_list;
52 if (t == hub_terminal) {
78 QList<Terminal *> t_list;
80 for (QGraphicsItem *item : d->items(polygon))
83 t_list.append(qgraphicsitem_cast<Terminal *>(item));
87 if (t_list.size() <= 1) {
104 if (!potentials.isEmpty())
106 if (potentials.size() >= 2)
108 QList <ConductorProperties> cp_list;
110 cp_list.append(c->properties());
120 else if (potentials.size() == 1)
140 QList<Conductor *> c_list;
141 QList<Terminal *> t_exclude;
145 if (t_exclude.contains(t)) {
149 if (!t->conductors().isEmpty())
151 c_list.append(t->conductors().first());
158 t_exclude.append(c->terminal1);
160 t_exclude.append(c->terminal2);
164 else if (t->parentElement()->linkType() &
Element::AllReport && !t->parentElement()->isFree())
168 c_list.append(linked_report->
conductors().first());
186 if (tt->scenePos().x() < hub_terminal->scenePos().x()) {
188 }
else if (tt->scenePos().x() == hub_terminal->scenePos().x()) {
189 if (tt->scenePos().y() < hub_terminal->scenePos().y()) {
static void newProperties(Diagram *diagram, ConductorProperties &cp, autonum::sequentialNumbers &seq)
ConductorAutoNumerotation::newProperties Create a new properties according to the current autonum rul...
QList< Conductor * > existingPotential()
ConductorCreator::existingPotential Return the list of existing potential of the terminal list...
QList< Element * > linkedElements()
Element::linkedElements.
QSet< Conductor * > relatedPotentialConductors(const bool all_diagram=true, QList< Terminal *> *t_list=nullptr)
Conductor::relatedPotentialConductors Return all conductors at the same potential of this conductor...
static void create(Diagram *d, const QPolygonF &polygon)
ConductorCreator::create Create an electrical potential between the terminals of the diagram d...
ConductorProperties m_properties
The AddItemCommand class This command add an item in a diagram The item to add is template...
QList< Conductor * > conductors() const
Element::conductors.
void setProperties(const ConductorProperties &property)
ConductorCreator(Diagram *d, QList< Terminal *> terminals_list)
ConductorCreator::ConductorCreator Create an electrical potential between all terminals of ...
QList< Terminal * > m_terminals_list
The ConductorCreator class This class create one or several or several conductors in a given context...
void setUpPropertieToUse()
ConductorCreator::propertieToUse.
Terminal * hubTerminal()
ConductorCreator::hubTerminal.
autonum::sequentialNumbers m_sequential_number
static ConductorProperties chosenProperties(QList< ConductorProperties > list, QWidget *parent=nullptr)
void setSequenceNum(const autonum::sequentialNumbers &sn)