2016-11-22 12:04:34 +01:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file dialogpiecepath.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 22 11, 2016
|
|
|
|
**
|
|
|
|
** @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) 2016 Valentina project
|
|
|
|
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
|
|
|
|
**
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
** 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.
|
|
|
|
**
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
** 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/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#ifndef DIALOGPIECEPATH_H
|
|
|
|
#define DIALOGPIECEPATH_H
|
|
|
|
|
|
|
|
#include "dialogtool.h"
|
|
|
|
|
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class DialogPiecePath;
|
|
|
|
}
|
|
|
|
|
|
|
|
class DialogPiecePath : public DialogTool
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit DialogPiecePath(const VContainer *data, quint32 toolId, QWidget *parent = nullptr);
|
|
|
|
virtual ~DialogPiecePath();
|
|
|
|
|
2016-11-28 09:45:57 +01:00
|
|
|
void EnbleShowMode(bool disable);
|
2016-11-22 12:04:34 +01:00
|
|
|
|
2016-11-23 12:57:12 +01:00
|
|
|
VPiecePath GetPiecePath() const;
|
|
|
|
void SetPiecePath(const VPiecePath &path);
|
2016-11-22 12:04:34 +01:00
|
|
|
|
2016-11-23 17:41:01 +01:00
|
|
|
quint32 GetPieceId() const;
|
|
|
|
void SetPieceId(quint32 id);
|
|
|
|
|
2017-01-21 14:24:40 +01:00
|
|
|
QString GetFormulaSAWidth() const;
|
|
|
|
void SetFormulaSAWidth(const QString &formula);
|
2016-11-28 12:58:17 +01:00
|
|
|
|
2016-11-23 17:41:01 +01:00
|
|
|
virtual void SetPiecesList(const QVector<quint32> &list) Q_DECL_OVERRIDE;
|
|
|
|
|
2016-11-22 12:04:34 +01:00
|
|
|
public slots:
|
|
|
|
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE;
|
|
|
|
virtual void ShowDialog(bool click) Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void CheckState() Q_DECL_OVERRIDE;
|
2016-11-29 18:39:40 +01:00
|
|
|
virtual void ShowVisualization() Q_DECL_OVERRIDE;
|
2017-01-31 13:27:13 +01:00
|
|
|
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
2016-11-22 12:04:34 +01:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void ShowContextMenu(const QPoint &pos);
|
|
|
|
void ListChanged();
|
|
|
|
void NameChanged();
|
2016-11-28 12:58:17 +01:00
|
|
|
void NodeChanged(int index);
|
|
|
|
void ReturnDefBefore();
|
|
|
|
void ReturnDefAfter();
|
2017-01-21 14:24:40 +01:00
|
|
|
|
|
|
|
void EvalWidth();
|
|
|
|
void EvalWidthBefore();
|
|
|
|
void EvalWidthAfter();
|
|
|
|
|
|
|
|
void FXWidth();
|
|
|
|
void FXWidthBefore();
|
|
|
|
void FXWidthAfter();
|
|
|
|
|
|
|
|
void WidthChanged();
|
|
|
|
void WidthBeforeChanged();
|
|
|
|
void WidthAfterChanged();
|
|
|
|
|
|
|
|
void DeployWidthFormulaTextEdit();
|
|
|
|
void DeployWidthBeforeFormulaTextEdit();
|
|
|
|
void DeployWidthAfterFormulaTextEdit();
|
2016-11-22 12:04:34 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(DialogPiecePath)
|
|
|
|
Ui::DialogPiecePath *ui;
|
2017-01-21 14:24:40 +01:00
|
|
|
bool m_showMode;
|
|
|
|
qreal m_saWidth;
|
2016-11-22 12:04:34 +01:00
|
|
|
|
2017-01-21 14:24:40 +01:00
|
|
|
QTimer *m_timerWidth;
|
|
|
|
QTimer *m_timerWidthBefore;
|
|
|
|
QTimer *m_timerWidthAfter;
|
|
|
|
|
|
|
|
int m_formulaBaseWidth;
|
|
|
|
int m_formulaBaseWidthBefore;
|
|
|
|
int m_formulaBaseWidthAfter;
|
|
|
|
|
|
|
|
void InitPathTab();
|
|
|
|
void InitSeamAllowanceTab();
|
2016-11-23 13:50:30 +01:00
|
|
|
void InitPathTypes();
|
2016-11-23 17:41:01 +01:00
|
|
|
void InitListPieces();
|
2016-11-28 12:58:17 +01:00
|
|
|
void InitNodesList();
|
|
|
|
void NodeAngleChanged(int index);
|
2016-11-23 13:50:30 +01:00
|
|
|
|
2016-11-23 12:57:12 +01:00
|
|
|
VPiecePath CreatePath() const;
|
2016-11-22 12:04:34 +01:00
|
|
|
|
|
|
|
bool PathIsValid() const;
|
|
|
|
void ValidObjects(bool value);
|
|
|
|
void NewItem(const VPieceNode &node);
|
2016-11-24 20:26:51 +01:00
|
|
|
|
|
|
|
PiecePathType GetType() const;
|
|
|
|
void SetType(PiecePathType type);
|
2016-11-28 12:58:17 +01:00
|
|
|
|
2016-12-03 17:01:39 +01:00
|
|
|
Qt::PenStyle GetPenType() const;
|
|
|
|
void SetPenType(const Qt::PenStyle &type);
|
|
|
|
|
2016-11-28 12:58:17 +01:00
|
|
|
QListWidgetItem *GetItemById(quint32 id);
|
|
|
|
|
2016-12-03 18:18:58 +01:00
|
|
|
quint32 GetLastId() const;
|
|
|
|
|
2017-01-21 14:24:40 +01:00
|
|
|
void SetCurrentSABefore(const QString &formula);
|
|
|
|
void SetCurrentSAAfter(const QString &formula);
|
|
|
|
|
|
|
|
void UpdateNodeSABefore(const QString &formula);
|
|
|
|
void UpdateNodeSAAfter(const QString &formula);
|
|
|
|
|
|
|
|
QString GetFormulaSAWidthBefore() const;
|
|
|
|
QString GetFormulaSAWidthAfter() const;
|
2016-11-22 12:04:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DIALOGPIECEPATH_H
|