Remove the class fixed element

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5280 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2018-03-25 18:56:16 +00:00
parent 37ef43b97b
commit da186f2efb
5 changed files with 3 additions and 104 deletions

View File

@@ -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<QVector<qreal> *> 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

View File

@@ -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 <QPicture>
@@ -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<QRectF *> circles() const override;
QList<QVector<QPointF> *> polygons() const override;
QList<QVector<qreal> *> arcs() const override;
int terminalsCount() const override;
void paint(QPainter *, const QStyleOptionGraphicsItem *) override;
QString typeId() const override;
ElementsLocation location() const;

View File

@@ -90,12 +90,6 @@ class Element : public QetGraphicsItem
virtual QList<QVector<QPointF> *> polygons() const = 0;
/// @return the list of arcs in this element
virtual QList<QVector<qreal> *> 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 <QPair <Terminal *, Terminal *> > AlignedFreeTerminals () const;

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
#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());
}

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
#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