2013-06-20 16:09:50 +02:00
|
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
2013-08-20 12:26:02 +02:00
|
|
|
|
#pragma GCC diagnostic push
|
2013-08-13 18:48:36 +02:00
|
|
|
|
#pragma GCC diagnostic ignored "-Weffc++"
|
2013-08-20 12:26:02 +02:00
|
|
|
|
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wconversion"
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
|
|
|
|
#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
|
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-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-15 22:39:00 +02:00
|
|
|
|
#include "dialogs/dialoghistory.h"
|
2013-08-21 10:03:53 +02:00
|
|
|
|
#include "dialogs/dialogpointofcontact.h"
|
2013-08-28 10:55:11 +02:00
|
|
|
|
#include "dialogs/dialogdetail.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-20 12:26:02 +02:00
|
|
|
|
#pragma GCC diagnostic pop
|
2013-07-13 12:51:31 +02:00
|
|
|
|
#include "container/vcontainer.h"
|
2013-08-15 22:39:00 +02:00
|
|
|
|
#include "options.h"
|
2013-08-29 12:31:50 +02:00
|
|
|
|
#include "widgets/vitem.h"
|
2013-06-20 16:09:50 +02:00
|
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
class MainWindow;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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 ActionAroowTool();
|
|
|
|
|
void ActionDraw(bool checked);
|
|
|
|
|
void ActionDetails(bool checked);
|
|
|
|
|
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();
|
2013-08-15 22:39:00 +02:00
|
|
|
|
void ActionHistory(bool checked);
|
2013-08-29 12:31:50 +02:00
|
|
|
|
void ActionLayout(bool checked);
|
2013-08-15 22:39:00 +02:00
|
|
|
|
void ClosedActionHistory();
|
2013-07-25 14:00:51 +02:00
|
|
|
|
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-08-21 10:03:53 +02:00
|
|
|
|
void ToolPointOfContact(bool checked);
|
|
|
|
|
void ClosedDialogPointOfContact(int result);
|
2013-08-28 10:55:11 +02:00
|
|
|
|
void ToolDetail(bool checked);
|
|
|
|
|
void ClosedDialogDetail(int result);
|
2013-08-29 12:31:50 +02:00
|
|
|
|
/**
|
|
|
|
|
* @brief tableClosed Слот, що виконується при отриманні сигналу закриття вікна укладання
|
|
|
|
|
*деталей моделі.
|
|
|
|
|
*/
|
|
|
|
|
void tableClosed();
|
|
|
|
|
signals:
|
|
|
|
|
/**
|
|
|
|
|
* @brief ModelChosen Сигнал, що висилається після розрахунку всіх деталей моделі.
|
|
|
|
|
* @param listDetails Список детайле моделі.
|
|
|
|
|
*/
|
|
|
|
|
void ModelChosen(QVector<VItem*> listDetails);
|
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-08-28 10:55:11 +02:00
|
|
|
|
VMainGraphicsScene *currentScene;
|
|
|
|
|
VMainGraphicsScene *sceneDraw;
|
|
|
|
|
VMainGraphicsScene *sceneDetails;
|
2013-07-03 14:29:26 +02:00
|
|
|
|
QLabel *mouseCoordinate;
|
|
|
|
|
QLabel *helpLabel;
|
2013-08-13 18:48:36 +02:00
|
|
|
|
VMainGraphicsView *view;
|
2013-07-03 14:29:26 +02:00
|
|
|
|
bool isInitialized;
|
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-08-21 10:03:53 +02:00
|
|
|
|
QSharedPointer<DialogPointOfContact> dialogPointOfContact;
|
2013-08-28 10:55:11 +02:00
|
|
|
|
QSharedPointer<DialogDetail> dialogDetail;
|
2013-08-15 22:39:00 +02:00
|
|
|
|
DialogHistory *dialogHistory;
|
2013-07-13 12:51:31 +02:00
|
|
|
|
VDomDocument *doc;
|
|
|
|
|
VContainer *data;
|
|
|
|
|
QComboBox *comboBoxDraws;
|
|
|
|
|
QString fileName;
|
|
|
|
|
bool changeInFile;
|
2013-08-28 10:55:11 +02:00
|
|
|
|
Draw::Mode mode;
|
2013-08-20 12:26:02 +02:00
|
|
|
|
MainWindow(const MainWindow &window);
|
|
|
|
|
const MainWindow &operator=(const MainWindow &window);
|
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,
|
2013-08-29 12:31:50 +02:00
|
|
|
|
Func closeDialogSlot);
|
|
|
|
|
void MinimumScrollBar();
|
2013-06-20 16:09:50 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|