mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +02:00
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1 bfdf4180-ca20-0410-9c96-a3a8aa849046
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#ifndef CONDUCTEUR_H
|
|
#define CONDUCTEUR_H
|
|
#include <QtGui>
|
|
#include "borne.h"
|
|
class Element;
|
|
/**
|
|
Cette classe represente un conducteur. Un conducteur relie deux bornes d'element.
|
|
*/
|
|
class Conducteur : public QGraphicsPathItem {
|
|
public:
|
|
enum { Type = UserType + 1001 };
|
|
virtual int type() const { return Type; }
|
|
Conducteur(Borne *, Borne *, Element * = 0, QGraphicsScene * = 0);
|
|
//virtual ~Conducteur();
|
|
|
|
void destroy();
|
|
bool isDestroyed() const { return(destroyed); }
|
|
void update(const QRectF & rect);
|
|
void update(qreal x, qreal y, qreal width, qreal height);
|
|
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *);
|
|
static bool valideXml(QDomElement &);
|
|
|
|
///Premiere borne a laquelle le fil est rattache
|
|
Borne *borne1;
|
|
///Deuxieme borne a laquelle le fil est rattache
|
|
Borne *borne2;
|
|
private:
|
|
/// booleen indiquant si le fil est encore valide
|
|
bool destroyed;
|
|
|
|
void calculeConducteur();
|
|
bool surLeMemeAxe(Borne::Orientation, Borne::Orientation);
|
|
bool estHorizontale(Borne::Orientation a);
|
|
bool estVerticale(Borne::Orientation a);
|
|
};
|
|
#endif
|