diff --git a/sources/qetgraphicsitem/customelement.cpp b/sources/qetgraphicsitem/customelement.cpp index 99376fb56..d78c070ca 100644 --- a/sources/qetgraphicsitem/customelement.cpp +++ b/sources/qetgraphicsitem/customelement.cpp @@ -47,7 +47,7 @@ - 8 : Aucune partie du dessin n'a pu etre chargee */ CustomElement::CustomElement(const ElementsLocation &location, QGraphicsItem *qgi, int *state) : - FixedElement(qgi), + Element(qgi), location_(location), forbid_antialiasing(false) { @@ -281,13 +281,6 @@ QList *> CustomElement::arcs() const { return(m_arcs); } -/** - @return Le nombre de bornes que l'element possede -*/ -int CustomElement::terminalsCount() const { - return(m_terminals.size()); -} - /** Dessine le composant sur le Diagram @param qp Le QPainter a utiliser pour dessiner l'element diff --git a/sources/qetgraphicsitem/customelement.h b/sources/qetgraphicsitem/customelement.h index 67e8001ea..7bff33437 100644 --- a/sources/qetgraphicsitem/customelement.h +++ b/sources/qetgraphicsitem/customelement.h @@ -17,7 +17,7 @@ */ #ifndef CUSTOM_ELEMENT_H #define CUSTOM_ELEMENT_H -#include "fixedelement.h" +#include "element.h" #include "nameslist.h" #include "elementslocation.h" #include @@ -29,7 +29,7 @@ class Terminal; element, the difference being that the CustomElement reads its description (names, drawing, behavior) from an XML document. */ -class CustomElement : public FixedElement +class CustomElement : public Element { Q_OBJECT @@ -68,7 +68,6 @@ class CustomElement : public FixedElement QList circles() const override; QList *> polygons() const override; QList *> arcs() const override; - int terminalsCount() const override; void paint(QPainter *, const QStyleOptionGraphicsItem *) override; QString typeId() const override; ElementsLocation location() const; diff --git a/sources/qetgraphicsitem/element.h b/sources/qetgraphicsitem/element.h index be03304d3..49fb87104 100644 --- a/sources/qetgraphicsitem/element.h +++ b/sources/qetgraphicsitem/element.h @@ -90,12 +90,6 @@ class Element : public QetGraphicsItem virtual QList *> polygons() const = 0; /// @return the list of arcs in this element virtual QList *> arcs() const = 0; - /// @return the current number of terminals of this element - virtual int terminalsCount() const = 0; - /// @return the minimum number of terminals for this element - virtual int minTerminalsCount() const = 0; - /// @return the maximum number of terminals for this element - virtual int maxTerminalsCount() const = 0; QList > AlignedFreeTerminals () const; diff --git a/sources/qetgraphicsitem/fixedelement.cpp b/sources/qetgraphicsitem/fixedelement.cpp deleted file mode 100644 index e9de87968..000000000 --- a/sources/qetgraphicsitem/fixedelement.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright 2006-2017 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 . -*/ -#include "fixedelement.h" -/** - Constructeur -*/ -FixedElement::FixedElement(QGraphicsItem *parent) : Element(parent) { -} - -/** - Destructeur -*/ -FixedElement::~FixedElement() { -} - -/** - @return Le nombre minimal de bornes que l'element peut avoir -*/ -int FixedElement::minTerminalsCount() const { - return(terminalsCount()); -} - -/** - @return Le nombre maximal de bornes que l'element peut avoir -*/ -int FixedElement::maxTerminalsCount() const { - return(terminalsCount()); -} diff --git a/sources/qetgraphicsitem/fixedelement.h b/sources/qetgraphicsitem/fixedelement.h deleted file mode 100644 index c508ee71a..000000000 --- a/sources/qetgraphicsitem/fixedelement.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Copyright 2006-2017 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 . -*/ -#ifndef ELEMENTFIXE_H -#define ELEMENTFIXE_H - -#include "element.h" - -/** - This class represents an element having a fixed number of terminals. -*/ -class FixedElement : public Element { - - Q_OBJECT - - // constructors, destructor - public: - FixedElement(QGraphicsItem * = nullptr); - ~FixedElement() override; - - // methods - public: - int minTerminalsCount() const override; - int maxTerminalsCount() const override; - int terminalsCount() const override = 0; - void paint(QPainter *, const QStyleOptionGraphicsItem *) override = 0; - QString typeId() const override = 0; - QString name() const override = 0; -}; -#endif