2013-06-20 16:09:50 +02:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
2013-08-13 18:48:36 +02:00
|
|
|
#pragma GCC diagnostic ignored "-Weffc++"
|
2013-06-20 16:09:50 +02:00
|
|
|
#include <QMainWindow>
|
2013-07-03 14:29:26 +02:00
|
|
|
#include <QLabel>
|
2013-07-13 12:51:31 +02:00
|
|
|
#include <QtXml>
|
|
|
|
#include <QComboBox>
|
2013-07-28 00:18:06 +02:00
|
|
|
#include <QSharedPointer>
|
2013-08-13 18:48:36 +02:00
|
|
|
#include <QToolButton>
|
|
|
|
#include <QSharedPointer>
|
2013-07-03 14:29:26 +02:00
|
|
|
|
|
|
|
#include "widgets/vmaingraphicsscene.h"
|
2013-08-13 18:48:36 +02:00
|
|
|
#include "widgets/vmaingraphicsview.h"
|
2013-07-03 14:29:26 +02:00
|
|
|
#include "dialogs/dialogsinglepoint.h"
|
2013-07-17 13:38:11 +02:00
|
|
|
#include "dialogs/dialogincrements.h"
|
2013-07-25 20:39:51 +02:00
|
|
|
#include "dialogs/dialogline.h"
|
2013-07-28 00:18:06 +02:00
|
|
|
#include "dialogs/dialogalongline.h"
|
2013-07-29 14:55:40 +02:00
|
|
|
#include "dialogs/dialogshoulderpoint.h"
|
|
|
|
#include "dialogs/dialogendline.h"
|
2013-07-30 15:09:34 +02:00
|
|
|
#include "dialogs/dialognormal.h"
|
2013-07-30 20:46:40 +02:00
|
|
|
#include "dialogs/dialogbisector.h"
|
2013-07-31 13:34:39 +02:00
|
|
|
#include "dialogs/dialoglineintersect.h"
|
2013-08-05 10:37:56 +02:00
|
|
|
#include "dialogs/dialogspline.h"
|
2013-08-06 09:56:09 +02:00
|
|
|
#include "dialogs/dialogarc.h"
|
2013-08-09 08:49:34 +02:00
|
|
|
#include "dialogs/dialogsplinepath.h"
|
2013-08-05 10:37:56 +02:00
|
|
|
#include "tools/vtoolsinglepoint.h"
|
2013-07-13 12:51:31 +02:00
|
|
|
#include "xml/vdomdocument.h"
|
2013-08-13 18:48:36 +02:00
|
|
|
#pragma GCC diagnostic warning "-Weffc++"
|
2013-07-13 12:51:31 +02:00
|
|
|
#include "container/vcontainer.h"
|
2013-06-20 16:09:50 +02:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class MainWindow;
|
|
|
|
}
|
|
|
|
|
2013-07-03 14:29:26 +02:00
|
|
|
namespace Tools{
|
|
|
|
enum Enum
|
|
|
|
{
|
|
|
|
ArrowTool,
|
2013-07-25 14:00:51 +02:00
|
|
|
SinglePointTool,
|
2013-07-25 20:39:51 +02:00
|
|
|
EndLineTool,
|
2013-07-28 00:18:06 +02:00
|
|
|
LineTool,
|
2013-07-29 14:55:40 +02:00
|
|
|
AlongLineTool,
|
2013-07-30 15:09:34 +02:00
|
|
|
ShoulderPointTool,
|
2013-07-30 20:46:40 +02:00
|
|
|
NormalTool,
|
2013-07-31 13:34:39 +02:00
|
|
|
BisectorTool,
|
2013-08-05 10:37:56 +02:00
|
|
|
LineIntersectTool,
|
2013-08-06 09:56:09 +02:00
|
|
|
SplineTool,
|
2013-08-09 08:49:34 +02:00
|
|
|
ArcTool,
|
|
|
|
SplinePathTool
|
2013-07-03 14:29:26 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2013-06-20 16:09:50 +02:00
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
2013-07-03 14:29:26 +02:00
|
|
|
Q_OBJECT
|
2013-06-20 16:09:50 +02:00
|
|
|
public:
|
2013-07-03 14:29:26 +02:00
|
|
|
explicit MainWindow(QWidget *parent = 0);
|
|
|
|
~MainWindow();
|
|
|
|
public slots:
|
|
|
|
void mouseMove(QPointF scenePos);
|
2013-07-25 14:00:51 +02:00
|
|
|
void ToolSinglePoint(bool checked);
|
|
|
|
void ActionAroowTool();
|
|
|
|
void ActionDraw(bool checked);
|
|
|
|
void ActionDetails(bool checked);
|
2013-07-28 00:18:06 +02:00
|
|
|
void ClosedDialogSinglePoint(int result);
|
2013-07-25 14:00:51 +02:00
|
|
|
void ActionNewDraw();
|
2013-07-13 12:51:31 +02:00
|
|
|
void currentDrawChanged( int index );
|
2013-07-25 14:00:51 +02:00
|
|
|
void OptionDraw();
|
|
|
|
void ActionSaveAs();
|
|
|
|
void ActionSave();
|
|
|
|
void ActionOpen();
|
|
|
|
void ActionNew();
|
2013-07-13 12:51:31 +02:00
|
|
|
void haveChange();
|
2013-07-17 13:38:11 +02:00
|
|
|
void ChangedSize(const QString &text);
|
|
|
|
void ChangedGrowth(const QString & text);
|
2013-07-25 14:00:51 +02:00
|
|
|
void ActionTable(bool checked);
|
|
|
|
void ClosedActionTable();
|
|
|
|
void ToolEndLine(bool checked);
|
|
|
|
void ClosedDialogEndLine(int result);
|
2013-07-25 20:39:51 +02:00
|
|
|
void ToolLine(bool checked);
|
|
|
|
void ClosedDialogLine(int result);
|
2013-07-28 00:18:06 +02:00
|
|
|
void ToolAlongLine(bool checked);
|
|
|
|
void ClosedDialogAlongLine(int result);
|
2013-07-29 14:55:40 +02:00
|
|
|
void ToolShoulderPoint(bool checked);
|
|
|
|
void ClosedDialogShoulderPoint(int result);
|
2013-07-30 15:09:34 +02:00
|
|
|
void ToolNormal(bool checked);
|
|
|
|
void ClosedDialogNormal(int result);
|
2013-07-30 20:46:40 +02:00
|
|
|
void ToolBisector(bool checked);
|
|
|
|
void ClosedDialogBisector(int result);
|
2013-07-31 13:34:39 +02:00
|
|
|
void ToolLineIntersect(bool checked);
|
|
|
|
void ClosedDialogLineIntersect(int result);
|
2013-08-05 10:37:56 +02:00
|
|
|
void ToolSpline(bool checked);
|
|
|
|
void ClosedDialogSpline(int result);
|
2013-08-06 09:56:09 +02:00
|
|
|
void ToolArc(bool checked);
|
|
|
|
void ClosedDialogArc(int result);
|
2013-08-09 08:49:34 +02:00
|
|
|
void ToolSplinePath(bool checked);
|
|
|
|
void ClosedDialogSplinePath(int result);
|
2013-07-13 12:51:31 +02:00
|
|
|
protected:
|
|
|
|
virtual void keyPressEvent ( QKeyEvent * event );
|
|
|
|
virtual void showEvent( QShowEvent *event );
|
2013-06-20 16:09:50 +02:00
|
|
|
private:
|
2013-07-03 14:29:26 +02:00
|
|
|
Ui::MainWindow *ui;
|
2013-07-13 12:51:31 +02:00
|
|
|
Tools::Enum tool;
|
2013-07-03 14:29:26 +02:00
|
|
|
VMainGraphicsScene *scene;
|
|
|
|
QLabel *mouseCoordinate;
|
|
|
|
QLabel *helpLabel;
|
2013-08-13 18:48:36 +02:00
|
|
|
VMainGraphicsView *view;
|
2013-07-03 14:29:26 +02:00
|
|
|
bool isInitialized;
|
|
|
|
DialogSinglePoint *dialogSinglePoint;
|
2013-07-17 13:38:11 +02:00
|
|
|
DialogIncrements *dialogTable;
|
2013-08-13 18:48:36 +02:00
|
|
|
QSharedPointer<DialogEndLine> dialogEndLine;
|
|
|
|
QSharedPointer<DialogLine> dialogLine;
|
|
|
|
QSharedPointer<DialogAlongLine> dialogAlongLine;
|
|
|
|
QSharedPointer<DialogShoulderPoint> dialogShoulderPoint;
|
|
|
|
QSharedPointer<DialogNormal> dialogNormal;
|
|
|
|
QSharedPointer<DialogBisector> dialogBisector;
|
|
|
|
QSharedPointer<DialogLineIntersect> dialogLineIntersect;
|
|
|
|
QSharedPointer<DialogSpline> dialogSpline;
|
|
|
|
QSharedPointer<DialogArc> dialogArc;
|
|
|
|
QSharedPointer<DialogSplinePath> dialogSplinePath;
|
2013-07-13 12:51:31 +02:00
|
|
|
VDomDocument *doc;
|
|
|
|
VContainer *data;
|
|
|
|
QComboBox *comboBoxDraws;
|
|
|
|
QString fileName;
|
|
|
|
bool changeInFile;
|
2013-07-03 14:29:26 +02:00
|
|
|
void ToolBarOption();
|
|
|
|
void ToolBarDraws();
|
|
|
|
void CanselTool();
|
|
|
|
void ArrowTool();
|
2013-07-17 13:38:11 +02:00
|
|
|
void SetEnableWidgets(bool enable);
|
2013-07-25 14:00:51 +02:00
|
|
|
void SetEnableTool(bool enable);
|
2013-08-13 18:48:36 +02:00
|
|
|
template <typename Dialog, typename Func>
|
|
|
|
void SetToolButton(bool checked, Tools::Enum t, const QString &cursor, QSharedPointer<Dialog> &dialog,
|
|
|
|
Func closeDialogSlot);
|
2013-06-20 16:09:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|