2007-01-29 00:41:12 +00:00
|
|
|
#ifndef DIAGRAMVIEW_H
|
2007-04-12 03:13:13 +00:00
|
|
|
#define DIAGRAMVIEW_H
|
|
|
|
#include <QtGui>
|
|
|
|
class Diagram;
|
|
|
|
/**
|
|
|
|
Classe representant graphiquement un schema electrique
|
|
|
|
*/
|
|
|
|
class DiagramView : public QGraphicsView {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
// constructeurs, destructeur
|
|
|
|
public:
|
|
|
|
DiagramView(QWidget * = 0);
|
|
|
|
virtual ~DiagramView();
|
|
|
|
|
|
|
|
private:
|
|
|
|
DiagramView(const DiagramView &);
|
|
|
|
|
|
|
|
// attributs
|
2007-09-29 12:54:01 +00:00
|
|
|
public:
|
|
|
|
QString file_name;
|
|
|
|
|
2007-04-12 03:13:13 +00:00
|
|
|
private:
|
|
|
|
Diagram *scene;
|
|
|
|
|
|
|
|
// methodes
|
|
|
|
public:
|
2007-09-29 12:54:01 +00:00
|
|
|
bool open(QString, int * = NULL);
|
2007-04-12 03:13:13 +00:00
|
|
|
void closeEvent(QCloseEvent *);
|
2007-09-29 12:54:01 +00:00
|
|
|
bool save();
|
|
|
|
bool saveAs();
|
2007-04-12 03:13:13 +00:00
|
|
|
void dialogExport();
|
|
|
|
void dialogEditInfos();
|
|
|
|
void dialogPrint();
|
|
|
|
void addColumn();
|
|
|
|
void removeColumn();
|
|
|
|
void expand();
|
|
|
|
void shrink();
|
|
|
|
Diagram *diagram() { return(scene); }
|
|
|
|
bool hasSelectedItems();
|
|
|
|
|
2007-10-04 14:30:52 +00:00
|
|
|
protected:
|
|
|
|
virtual void wheelEvent(QWheelEvent *);
|
2007-10-12 10:58:57 +00:00
|
|
|
virtual bool event(QEvent *);
|
2007-10-04 14:30:52 +00:00
|
|
|
|
2007-04-12 03:13:13 +00:00
|
|
|
private:
|
2007-09-29 12:54:01 +00:00
|
|
|
bool saveDiagramToFile(QString &);
|
2007-04-12 03:13:13 +00:00
|
|
|
void mousePressEvent(QMouseEvent *);
|
|
|
|
void dragEnterEvent(QDragEnterEvent *);
|
|
|
|
void dragLeaveEvent(QDragLeaveEvent *);
|
|
|
|
void dragMoveEvent(QDragMoveEvent *);
|
|
|
|
void dropEvent(QDropEvent *);
|
2007-09-04 18:15:41 +00:00
|
|
|
QRectF viewedSceneRect() const;
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void selectionChanged();
|
|
|
|
void antialiasingChanged();
|
|
|
|
void modeChanged();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void selectNothing();
|
|
|
|
void selectAll();
|
|
|
|
void selectInvert();
|
2007-09-29 12:54:01 +00:00
|
|
|
void deleteSelection();
|
|
|
|
void rotateSelection();
|
2007-04-12 03:13:13 +00:00
|
|
|
void setVisualisationMode();
|
|
|
|
void setSelectionMode();
|
2007-09-29 12:54:01 +00:00
|
|
|
void zoomIn();
|
|
|
|
void zoomOut();
|
2007-04-12 03:13:13 +00:00
|
|
|
void zoomFit();
|
|
|
|
void zoomReset();
|
2007-09-29 12:54:01 +00:00
|
|
|
void cut();
|
|
|
|
void copy();
|
|
|
|
void paste();
|
2007-09-28 21:02:53 +00:00
|
|
|
void adjustSceneRect();
|
2007-09-29 09:52:35 +00:00
|
|
|
void updateWindowTitle();
|
2007-10-03 17:02:39 +00:00
|
|
|
void editConductor();
|
2007-10-06 18:37:21 +00:00
|
|
|
void resetConductors();
|
2007-10-14 15:16:37 +00:00
|
|
|
void editDefaultConductorProperties();
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void slot_selectionChanged();
|
2007-09-04 18:15:41 +00:00
|
|
|
void adjustGridToZoom();
|
2007-04-12 03:13:13 +00:00
|
|
|
};
|
2006-10-27 15:47:22 +00:00
|
|
|
#endif
|