2006-10-27 15:47:22 +00:00
|
|
|
#ifndef SCHEMAVUE_H
|
|
|
|
#define SCHEMAVUE_H
|
|
|
|
#include <QtGui>
|
|
|
|
class Schema;
|
|
|
|
#include "element.h"
|
|
|
|
#include "conducteur.h"
|
|
|
|
#define TAILLE_GRILLE 10
|
|
|
|
/**
|
2006-11-11 13:56:40 +00:00
|
|
|
Classe representant graphiquement un schema electrique
|
2006-10-27 15:47:22 +00:00
|
|
|
*/
|
|
|
|
class SchemaVue : public QGraphicsView {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
// constructeurs
|
|
|
|
SchemaVue();
|
|
|
|
SchemaVue(QWidget * = 0);
|
|
|
|
|
|
|
|
// nouveaux attributs
|
|
|
|
Schema *scene;
|
|
|
|
|
|
|
|
// methodes publiques
|
|
|
|
bool antialiased() const;
|
|
|
|
void setAntialiasing(bool);
|
|
|
|
bool ouvrir(QString, int * = NULL);
|
|
|
|
void closeEvent(QCloseEvent *);
|
|
|
|
QString nom_fichier;
|
|
|
|
bool enregistrer();
|
|
|
|
bool enregistrer_sous();
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool private_enregistrer(QString &);
|
|
|
|
void initialise();
|
|
|
|
bool antialiasing; // booleen indiquant s'il faut effectuer un antialiasing sur le rendu graphique du SchemaVue
|
|
|
|
QList<QGraphicsItem *> garbage;
|
|
|
|
|
|
|
|
void throwToGarbage(QGraphicsItem *);
|
|
|
|
void mousePressEvent(QMouseEvent *);
|
|
|
|
void dragEnterEvent(QDragEnterEvent *);
|
|
|
|
void dragLeaveEvent(QDragLeaveEvent *);
|
|
|
|
void dragMoveEvent(QDragMoveEvent *);
|
|
|
|
void dropEvent(QDropEvent *);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void selectionChanged();
|
|
|
|
void antialiasingChanged();
|
|
|
|
void modeChanged();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void selectNothing();
|
|
|
|
void selectAll();
|
|
|
|
void selectInvert();
|
|
|
|
void supprimer();
|
|
|
|
void pivoter();
|
|
|
|
void setVisualisationMode();
|
|
|
|
void setSelectionMode();
|
|
|
|
void zoomPlus();
|
|
|
|
void zoomMoins();
|
|
|
|
void zoomFit();
|
|
|
|
void zoomReset();
|
|
|
|
void couper();
|
|
|
|
void copier();
|
|
|
|
void coller();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void flushGarbage();
|
|
|
|
void slot_selectionChanged();
|
|
|
|
};
|
|
|
|
#endif
|