2013-11-15 13:41:26 +01:00
|
|
|
|
/************************************************************************
|
2013-09-18 21:16:19 +02:00
|
|
|
|
**
|
2013-11-15 13:50:05 +01:00
|
|
|
|
** @file mainwindow.h
|
2013-11-15 13:41:26 +01:00
|
|
|
|
** @author Roman Telezhinsky <dismine@gmail.com>
|
2013-11-15 13:50:05 +01:00
|
|
|
|
** @date November 15, 2013
|
2013-09-18 21:16:19 +02:00
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
** @brief
|
|
|
|
|
** @copyright
|
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
|
** Copyright (C) 2013 Valentina project
|
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
2013-09-18 21:16:19 +02:00
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
2013-09-18 21:16:19 +02:00
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
** (at your option) any later version.
|
|
|
|
|
**
|
2013-10-27 13:36:29 +01:00
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
2013-09-18 21:16:19 +02:00
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
|
**
|
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
**
|
2013-11-15 13:41:26 +01:00
|
|
|
|
*************************************************************************/
|
2013-09-18 21:16:19 +02:00
|
|
|
|
|
2013-06-20 16:09:50 +02:00
|
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
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-09-10 14:29:06 +02:00
|
|
|
|
#include "widgets/vitem.h"
|
|
|
|
|
#include "dialogs/dialogs.h"
|
2013-10-27 12:56:05 +01:00
|
|
|
|
#include "tools/vtooldetail.h"
|
2013-09-10 14:29:06 +02:00
|
|
|
|
#include "tools/drawTools/drawtools.h"
|
|
|
|
|
#include "tools/modelingTools/modelingtools.h"
|
2013-07-13 12:51:31 +02:00
|
|
|
|
#include "xml/vdomdocument.h"
|
2013-06-20 16:09:50 +02:00
|
|
|
|
|
2013-11-04 21:35:15 +01:00
|
|
|
|
namespace Ui
|
|
|
|
|
{
|
|
|
|
|
class MainWindow;
|
2013-06-20 16:09:50 +02:00
|
|
|
|
}
|
|
|
|
|
|
2013-11-04 21:35:15 +01:00
|
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2013-06-20 16:09:50 +02:00
|
|
|
|
public:
|
2013-11-04 21:35:15 +01:00
|
|
|
|
explicit MainWindow(QWidget *parent = 0);
|
2013-09-10 14:29:06 +02:00
|
|
|
|
~MainWindow();
|
2013-09-23 15:17:15 +02:00
|
|
|
|
void OpenPattern(const QString &fileName);
|
2013-07-03 14:29:26 +02:00
|
|
|
|
public slots:
|
2013-11-06 22:11:12 +01:00
|
|
|
|
void mouseMove(const QPointF &scenePos);
|
2013-09-10 14:29:06 +02:00
|
|
|
|
void ActionAroowTool();
|
|
|
|
|
void ActionDraw(bool checked);
|
|
|
|
|
void ActionDetails(bool checked);
|
|
|
|
|
void ActionNewDraw();
|
|
|
|
|
void ActionSaveAs();
|
|
|
|
|
void ActionSave();
|
|
|
|
|
void ActionOpen();
|
|
|
|
|
void ActionNew();
|
|
|
|
|
void ActionTable(bool checked);
|
|
|
|
|
void ActionHistory(bool checked);
|
|
|
|
|
void ActionLayout(bool checked);
|
|
|
|
|
void currentDrawChanged( int index );
|
|
|
|
|
void OptionDraw();
|
|
|
|
|
void haveChange();
|
|
|
|
|
void ChangedSize(const QString &text);
|
|
|
|
|
void ChangedGrowth(const QString & text);
|
|
|
|
|
void ClosedActionTable();
|
|
|
|
|
void ClosedActionHistory();
|
|
|
|
|
void ToolEndLine(bool checked);
|
|
|
|
|
void ToolLine(bool checked);
|
|
|
|
|
void ToolAlongLine(bool checked);
|
|
|
|
|
void ToolShoulderPoint(bool checked);
|
|
|
|
|
void ToolNormal(bool checked);
|
|
|
|
|
void ToolBisector(bool checked);
|
|
|
|
|
void ToolLineIntersect(bool checked);
|
|
|
|
|
void ToolSpline(bool checked);
|
|
|
|
|
void ToolArc(bool checked);
|
|
|
|
|
void ToolSplinePath(bool checked);
|
|
|
|
|
void ToolPointOfContact(bool checked);
|
|
|
|
|
void ToolDetail(bool checked);
|
2013-10-18 12:03:01 +02:00
|
|
|
|
void ToolHeight(bool checked);
|
2013-10-18 20:20:54 +02:00
|
|
|
|
void ToolTriangle(bool checked);
|
2013-10-21 16:09:05 +02:00
|
|
|
|
void ToolPointOfIntersection(bool checked);
|
2013-09-10 14:29:06 +02:00
|
|
|
|
void ClosedDialogEndLine(int result);
|
|
|
|
|
void ClosedDialogLine(int result);
|
|
|
|
|
void ClosedDialogAlongLine(int result);
|
|
|
|
|
void ClosedDialogShoulderPoint(int result);
|
|
|
|
|
void ClosedDialogNormal(int result);
|
|
|
|
|
void ClosedDialogBisector(int result);
|
|
|
|
|
void ClosedDialogLineIntersect(int result);
|
|
|
|
|
void ClosedDialogSpline(int result);
|
|
|
|
|
void ClosedDialogArc(int result);
|
|
|
|
|
void ClosedDialogSplinePath(int result);
|
|
|
|
|
void ClosedDialogPointOfContact(int result);
|
|
|
|
|
void ClosedDialogDetail(int result);
|
2013-10-18 12:03:01 +02:00
|
|
|
|
void ClosedDialogHeight(int result);
|
2013-10-18 20:20:54 +02:00
|
|
|
|
void ClosedDialogTriangle(int result);
|
2013-10-21 16:09:05 +02:00
|
|
|
|
void ClosedDialogPointOfIntersection(int result);
|
2013-10-05 14:07:04 +02:00
|
|
|
|
void About();
|
|
|
|
|
void AboutQt();
|
2013-10-07 13:11:56 +02:00
|
|
|
|
void ShowToolTip(const QString &toolTip);
|
2013-08-29 12:31:50 +02:00
|
|
|
|
/**
|
|
|
|
|
* @brief tableClosed Слот, що виконується при отриманні сигналу закриття вікна укладання
|
|
|
|
|
*деталей моделі.
|
|
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
|
void tableClosed();
|
2013-08-29 12:31:50 +02:00
|
|
|
|
signals:
|
|
|
|
|
/**
|
|
|
|
|
* @brief ModelChosen Сигнал, що висилається після розрахунку всіх деталей моделі.
|
|
|
|
|
* @param listDetails Список детайле моделі.
|
|
|
|
|
*/
|
2013-09-10 14:29:06 +02:00
|
|
|
|
void ModelChosen(QVector<VItem*> listDetails);
|
2013-07-13 12:51:31 +02:00
|
|
|
|
protected:
|
2013-09-10 14:29:06 +02:00
|
|
|
|
virtual void keyPressEvent ( QKeyEvent * event );
|
|
|
|
|
virtual void showEvent( QShowEvent *event );
|
2013-09-26 15:47:46 +02:00
|
|
|
|
virtual void closeEvent( QCloseEvent * event );
|
2013-09-23 15:17:15 +02:00
|
|
|
|
void Clear();
|
2013-06-20 16:09:50 +02:00
|
|
|
|
private:
|
2013-09-26 20:50:52 +02:00
|
|
|
|
Q_DISABLE_COPY(MainWindow)
|
2013-09-10 14:29:06 +02:00
|
|
|
|
Ui::MainWindow *ui;
|
2013-09-27 11:17:00 +02:00
|
|
|
|
Tool::Tools tool;
|
2013-09-10 14:29:06 +02:00
|
|
|
|
VMainGraphicsScene *currentScene;
|
|
|
|
|
VMainGraphicsScene *sceneDraw;
|
|
|
|
|
VMainGraphicsScene *sceneDetails;
|
|
|
|
|
QLabel *mouseCoordinate;
|
|
|
|
|
QLabel *helpLabel;
|
|
|
|
|
VMainGraphicsView *view;
|
|
|
|
|
bool isInitialized;
|
|
|
|
|
DialogIncrements *dialogTable;
|
2013-10-21 16:09:05 +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;
|
|
|
|
|
QSharedPointer<DialogPointOfContact> dialogPointOfContact;
|
|
|
|
|
QSharedPointer<DialogDetail> dialogDetail;
|
|
|
|
|
QSharedPointer<DialogHeight> dialogHeight;
|
|
|
|
|
QSharedPointer<DialogTriangle> dialogTriangle;
|
|
|
|
|
QSharedPointer<DialogPointOfIntersection> dialogPointOfIntersection;
|
2013-09-10 14:29:06 +02:00
|
|
|
|
DialogHistory *dialogHistory;
|
|
|
|
|
VDomDocument *doc;
|
|
|
|
|
VContainer *data;
|
|
|
|
|
QComboBox *comboBoxDraws;
|
|
|
|
|
QString fileName;
|
|
|
|
|
bool changeInFile;
|
2013-10-21 16:09:05 +02:00
|
|
|
|
Draw::Draws mode;
|
2013-09-10 14:29:06 +02:00
|
|
|
|
void ToolBarOption();
|
|
|
|
|
void ToolBarDraws();
|
|
|
|
|
void CanselTool();
|
|
|
|
|
void ArrowTool();
|
|
|
|
|
void SetEnableWidgets(bool enable);
|
|
|
|
|
void SetEnableTool(bool enable);
|
2013-08-13 18:48:36 +02:00
|
|
|
|
template <typename Dialog, typename Func>
|
2013-11-04 21:35:15 +01:00
|
|
|
|
void SetToolButton(bool checked, Tool::Tools t, const QString &cursor, const QString &toolTip,
|
|
|
|
|
QSharedPointer<Dialog> &dialog, Func closeDialogSlot);
|
2013-09-10 14:29:06 +02:00
|
|
|
|
void MinimumScrollBar();
|
2013-09-27 11:17:00 +02:00
|
|
|
|
template <typename T>
|
|
|
|
|
void AddToolToDetail(T *tool, const qint64 &id, Tool::Tools typeTool,
|
2013-09-10 14:29:06 +02:00
|
|
|
|
const qint64 &idDetail);
|
2013-10-29 16:17:47 +01:00
|
|
|
|
template <typename DrawTool, typename ModelingTool, typename Dialog>
|
|
|
|
|
void ClosedDialog(QSharedPointer<Dialog> &dialog, int result);
|
2013-10-04 15:22:37 +02:00
|
|
|
|
bool SafeSaveing(const QString &fileName)const;
|
2013-10-04 16:00:19 +02:00
|
|
|
|
void AutoSavePattern();
|
2013-06-20 16:09:50 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|