QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
autobreakconductor.cpp File Reference
#include "autobreakconductor.h"
#include "diagram.h"
#include "qetproject.h"
#include "conductorautonumerotation.h"
#include "qetgraphicsitem/element.h"
#include "qetgraphicsitem/terminal.h"
#include "qetgraphicsitem/conductor.h"
#include "undocommand/addgraphicsobjectcommand.h"
#include "undocommand/deleteqgraphicsitemcommand.h"
#include <QPainterPath>
#include <QMap>
#include <limits>
Include dependency graph for autobreakconductor.cpp:

Namespaces

namespace  anonymous_namespace{autobreakconductor.cpp}

Functions

qreal anonymous_namespace{autobreakconductor.cpp}::distanceToSegment (const QPointF &point, const QLineF &segment)
 distanceToSegment
QSet< Terminal * > autoBreakConductors (Diagram *diagram, Element *element, QUndoCommand *parent, QList< Conductor * > &conductors_handled, QSet< Terminal * > &used_terminals)
 autoBreakConductors For each terminal of element, check if its dock point lies on an existing conductor. If so, break the conductor and reconnect through the element's terminal. Broken conductors from the same circuit (sharing the same far-end endpoint) are broken together; independent crossing conductors are left untouched.

Function Documentation

◆ autoBreakConductors()

QSet< Terminal * > autoBreakConductors ( Diagram * diagram,
Element * element,
QUndoCommand * parent,
QList< Conductor * > & conductors_handled,
QSet< Terminal * > & used_terminals )

autoBreakConductors For each terminal of element, check if its dock point lies on an existing conductor. If so, break the conductor and reconnect through the element's terminal. Broken conductors from the same circuit (sharing the same far-end endpoint) are broken together; independent crossing conductors are left untouched.

Parameters
diagramthe diagram containing the conductors
elementthe element whose terminals trigger breaks
parentundo command under which break/reconnect sub-commands are created
conductors_handledshared list of conductors already claimed by a previous call in the same batch (prevents double-processing when multiple elements are broken in one pass)
used_terminalsshared set of terminals already used as connect_to or other_terminal in the same batch
Returns
set of terminals that were connected to a broken conductor's far-end (useful for preventing duplicate auto-connect)
Here is the call graph for this function:
Here is the caller graph for this function: