mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 13:30:34 +01:00
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:
@@ -47,7 +47,7 @@
|
|||||||
- 8 : Aucune partie du dessin n'a pu etre chargee
|
- 8 : Aucune partie du dessin n'a pu etre chargee
|
||||||
*/
|
*/
|
||||||
CustomElement::CustomElement(const ElementsLocation &location, QGraphicsItem *qgi, int *state) :
|
CustomElement::CustomElement(const ElementsLocation &location, QGraphicsItem *qgi, int *state) :
|
||||||
FixedElement(qgi),
|
Element(qgi),
|
||||||
location_(location),
|
location_(location),
|
||||||
forbid_antialiasing(false)
|
forbid_antialiasing(false)
|
||||||
{
|
{
|
||||||
@@ -281,13 +281,6 @@ QList<QVector<qreal> *> CustomElement::arcs() const {
|
|||||||
return(m_arcs);
|
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
|
Dessine le composant sur le Diagram
|
||||||
@param qp Le QPainter a utiliser pour dessiner l'element
|
@param qp Le QPainter a utiliser pour dessiner l'element
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef CUSTOM_ELEMENT_H
|
#ifndef CUSTOM_ELEMENT_H
|
||||||
#define CUSTOM_ELEMENT_H
|
#define CUSTOM_ELEMENT_H
|
||||||
#include "fixedelement.h"
|
#include "element.h"
|
||||||
#include "nameslist.h"
|
#include "nameslist.h"
|
||||||
#include "elementslocation.h"
|
#include "elementslocation.h"
|
||||||
#include <QPicture>
|
#include <QPicture>
|
||||||
@@ -29,7 +29,7 @@ class Terminal;
|
|||||||
element, the difference being that the CustomElement reads its description
|
element, the difference being that the CustomElement reads its description
|
||||||
(names, drawing, behavior) from an XML document.
|
(names, drawing, behavior) from an XML document.
|
||||||
*/
|
*/
|
||||||
class CustomElement : public FixedElement
|
class CustomElement : public Element
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -68,7 +68,6 @@ class CustomElement : public FixedElement
|
|||||||
QList<QRectF *> circles() const override;
|
QList<QRectF *> circles() const override;
|
||||||
QList<QVector<QPointF> *> polygons() const override;
|
QList<QVector<QPointF> *> polygons() const override;
|
||||||
QList<QVector<qreal> *> arcs() const override;
|
QList<QVector<qreal> *> arcs() const override;
|
||||||
int terminalsCount() const override;
|
|
||||||
void paint(QPainter *, const QStyleOptionGraphicsItem *) override;
|
void paint(QPainter *, const QStyleOptionGraphicsItem *) override;
|
||||||
QString typeId() const override;
|
QString typeId() const override;
|
||||||
ElementsLocation location() const;
|
ElementsLocation location() const;
|
||||||
|
|||||||
@@ -90,12 +90,6 @@ class Element : public QetGraphicsItem
|
|||||||
virtual QList<QVector<QPointF> *> polygons() const = 0;
|
virtual QList<QVector<QPointF> *> polygons() const = 0;
|
||||||
/// @return the list of arcs in this element
|
/// @return the list of arcs in this element
|
||||||
virtual QList<QVector<qreal> *> arcs() const = 0;
|
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;
|
QList <QPair <Terminal *, Terminal *> > AlignedFreeTerminals () const;
|
||||||
|
|
||||||
|
|||||||
@@ -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());
|
|
||||||
}
|
|
||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user