Files
qelectrotech-source-mirror/sources/utils/conductorcreator.h
T
DaTweety a0e2193971 Joining potentials: agreeing ones leave nothing to choose
ConductorCreator asked which potential's properties to keep whenever a
new wire joined two potentials, even when they agreed in every
property; headless (scripting, qet MCP) such a wire was refused. Only
distinct properties are offered now, and with one left the wire takes it.

A potential's properties seen through one of a cable's cores carried
the core with them -- cable, cable uuid, core slot, and the core label
CableManager writes as text -- so a new wire claimed to be that core.
They are cleared; the text is left to the formula.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 11:21:09 +02:00

59 lines
1.8 KiB
C++

/*
Copyright 2006-2026 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONDUCTORCREATOR_H
#define CONDUCTORCREATOR_H
class Diagram;
class QPolygonF;
class Terminal;
class Conductor;
#include "../autoNum/assignvariables.h"
#include "../conductorproperties.h"
#include <QList>
/**
@brief The ConductorCreator class
This class create one or several or several conductors
in a given context
*/
class ConductorCreator
{
public:
ConductorCreator(Diagram *d, QList<Terminal *> terminals_list);
static void create(Diagram *d, const QPolygonF &polygon);
static bool needsPotentialChoice(const QList<Terminal *> &terminals_list);
private:
static QList<Conductor *> existingPotential(const QList<Terminal *> &terminals_list);
static ConductorProperties inheritedProperties(const Conductor *conductor);
static QList<ConductorProperties> distinctProperties(const QList<Conductor *> &potentials);
bool setUpPropertieToUse();
Terminal *hubTerminal();
QList<QPair<Terminal *, Terminal *>> terminalPairs(bool chain);
QList<Terminal *> m_terminals_list;
ConductorProperties m_properties;
autonum::sequentialNumbers m_sequential_number;
};
#endif // CONDUCTORCREATOR_H