2014-08-26 19:23:08 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vtooloptionspropertybrowser.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 22 8, 2014
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2014-08-26 19:23:08 +02:00
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
2015-02-27 11:27:48 +01:00
|
|
|
** Copyright (C) 2013-2015 Valentina project
|
2014-08-26 19:23:08 +02:00
|
|
|
** <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 VTOOLOPTIONSPROPERTYBROWSER_H
|
|
|
|
#define VTOOLOPTIONSPROPERTYBROWSER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QMap>
|
|
|
|
|
2015-10-08 20:11:50 +02:00
|
|
|
#include "../vpropertyexplorer/vproperty.h"
|
|
|
|
#include "../vpropertyexplorer/vpropertymodel.h"
|
|
|
|
#include "../vpropertyexplorer/vpropertyformview.h"
|
2014-08-26 19:23:08 +02:00
|
|
|
|
|
|
|
class QDockWidget;
|
|
|
|
class QGraphicsItem;
|
|
|
|
class QScrollArea;
|
2014-08-30 12:41:21 +02:00
|
|
|
class VFormula;
|
2014-08-26 19:23:08 +02:00
|
|
|
|
|
|
|
class VToolOptionsPropertyBrowser : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2015-10-12 13:52:48 +02:00
|
|
|
explicit VToolOptionsPropertyBrowser(QDockWidget *parent);
|
2014-10-27 18:19:59 +01:00
|
|
|
void ClearPropertyBrowser();
|
2014-08-26 19:23:08 +02:00
|
|
|
public slots:
|
|
|
|
void itemClicked(QGraphicsItem *item);
|
|
|
|
void UpdateOptions();
|
2015-02-11 11:33:13 +01:00
|
|
|
void RefreshOptions();
|
2016-07-18 17:09:15 +02:00
|
|
|
private slots:
|
|
|
|
void userChangedData(VPE::VProperty* property);
|
2014-08-26 19:23:08 +02:00
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(VToolOptionsPropertyBrowser)
|
|
|
|
|
2014-09-10 19:57:08 +02:00
|
|
|
VPE::VPropertyModel* PropertyModel;
|
|
|
|
VPE::VPropertyFormView* formView;
|
2014-08-26 19:23:08 +02:00
|
|
|
|
|
|
|
QGraphicsItem *currentItem;
|
2014-09-10 19:57:08 +02:00
|
|
|
QMap<VPE::VProperty *, QString> propertyToId;
|
|
|
|
QMap<QString, VPE::VProperty *> idToProperty;
|
2014-08-26 19:23:08 +02:00
|
|
|
|
2014-09-10 19:57:08 +02:00
|
|
|
void AddProperty(VPE::VProperty *property, const QString &id);
|
2014-08-26 19:23:08 +02:00
|
|
|
void ShowItemOptions(QGraphicsItem *item);
|
2014-08-28 13:05:58 +02:00
|
|
|
|
|
|
|
template<class Tool>
|
|
|
|
void SetPointName(const QString &name);
|
2014-08-30 12:41:21 +02:00
|
|
|
|
2015-06-24 16:30:07 +02:00
|
|
|
template<class Tool>
|
|
|
|
void SetPointName1(const QString &name);
|
|
|
|
|
|
|
|
template<class Tool>
|
|
|
|
void SetPointName2(const QString &name);
|
|
|
|
|
2016-05-18 13:32:51 +02:00
|
|
|
template<class Tool>
|
|
|
|
void SetOperationSuffix(const QString &suffix);
|
|
|
|
|
2016-01-24 17:15:08 +01:00
|
|
|
template<class Type>
|
|
|
|
Type GetCrossPoint(const QVariant &value);
|
|
|
|
|
2015-05-30 12:02:20 +02:00
|
|
|
template<class Tool>
|
2015-10-28 15:22:36 +01:00
|
|
|
void SetCrossCirclesPoint(const QVariant &value);
|
2015-05-30 12:02:20 +02:00
|
|
|
|
2016-01-24 17:15:08 +01:00
|
|
|
template<class Tool>
|
|
|
|
void SetVCrossCurvesPoint(const QVariant &value);
|
|
|
|
|
|
|
|
template<class Tool>
|
|
|
|
void SetHCrossCurvesPoint(const QVariant &value);
|
|
|
|
|
2016-09-17 11:10:03 +02:00
|
|
|
template<class Tool>
|
|
|
|
void SetAxisType(const QVariant &value);
|
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
template<class Tool>
|
2016-02-16 14:04:21 +01:00
|
|
|
void AddPropertyObjectName(Tool *i, const QString &propertyName, bool readOnly = false);
|
2014-08-30 12:41:21 +02:00
|
|
|
|
2015-06-24 16:30:07 +02:00
|
|
|
template<class Tool>
|
|
|
|
void AddPropertyPointName1(Tool *i, const QString &propertyName);
|
|
|
|
|
|
|
|
template<class Tool>
|
|
|
|
void AddPropertyPointName2(Tool *i, const QString &propertyName);
|
|
|
|
|
2016-05-18 13:32:51 +02:00
|
|
|
template<class Tool>
|
|
|
|
void AddPropertyOperationSuffix(Tool *i, const QString &propertyName, bool readOnly = false);
|
|
|
|
|
2015-05-27 18:24:20 +02:00
|
|
|
template<class Tool>
|
|
|
|
void AddPropertyCrossPoint(Tool *i, const QString &propertyName);
|
|
|
|
|
2016-01-24 17:15:08 +01:00
|
|
|
template<class Tool>
|
|
|
|
void AddPropertyVCrossPoint(Tool *i, const QString &propertyName);
|
|
|
|
|
|
|
|
template<class Tool>
|
|
|
|
void AddPropertyHCrossPoint(Tool *i, const QString &propertyName);
|
|
|
|
|
2016-09-17 11:10:03 +02:00
|
|
|
template<class Tool>
|
|
|
|
void AddPropertyAxisType(Tool *i, const QString &propertyName);
|
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
template<class Tool>
|
2015-01-29 16:47:02 +01:00
|
|
|
void AddPropertyLineType(Tool *i, const QString &propertyName, const QMap<QString, QIcon> &styles);
|
2014-08-30 12:41:21 +02:00
|
|
|
|
2015-02-07 15:42:49 +01:00
|
|
|
template<class Tool>
|
2017-05-16 12:07:53 +02:00
|
|
|
void AddPropertyCurvePenStyle(Tool *i, const QString &propertyName, const QMap<QString, QIcon> &styles);
|
|
|
|
|
|
|
|
template<class Tool>
|
2015-02-07 15:42:49 +01:00
|
|
|
void AddPropertyLineColor(Tool *i, const QString &propertyName, const QMap<QString, QString> &colors,
|
|
|
|
const QString &id);
|
|
|
|
|
2017-10-11 12:51:06 +02:00
|
|
|
void AddPropertyApproximationScale(const QString &propertyName, qreal aScale);
|
2014-08-30 12:41:21 +02:00
|
|
|
void AddPropertyFormula(const QString &propertyName, const VFormula &formula, const QString &attrName);
|
2017-03-19 16:13:02 +01:00
|
|
|
void AddPropertyParentPointName(const QString &pointName, const QString &propertyName,
|
|
|
|
const QString &propertyAttribure);
|
2014-08-30 12:41:21 +02:00
|
|
|
|
|
|
|
QStringList PropertiesList() const;
|
|
|
|
|
2014-09-10 19:57:08 +02:00
|
|
|
void ChangeDataToolSinglePoint(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolEndLine(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolAlongLine(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolArc(VPE::VProperty *property);
|
2015-06-09 20:23:37 +02:00
|
|
|
void ChangeDataToolArcWithLength(VPE::VProperty *property);
|
2014-09-10 19:57:08 +02:00
|
|
|
void ChangeDataToolBisector(VPE::VProperty *property);
|
2015-06-24 16:30:07 +02:00
|
|
|
void ChangeDataToolTrueDarts(VPE::VProperty *property);
|
2014-09-10 19:57:08 +02:00
|
|
|
void ChangeDataToolCutArc(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolCutSpline(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolCutSplinePath(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolHeight(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolLine(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolLineIntersect(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolNormal(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolPointOfContact(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolPointOfIntersection(VPE::VProperty *property);
|
2015-05-27 18:24:20 +02:00
|
|
|
void ChangeDataToolPointOfIntersectionArcs(VPE::VProperty *property);
|
2015-05-30 12:02:20 +02:00
|
|
|
void ChangeDataToolPointOfIntersectionCircles(VPE::VProperty *property);
|
2016-01-24 17:15:08 +01:00
|
|
|
void ChangeDataToolPointOfIntersectionCurves(VPE::VProperty *property);
|
2015-06-05 15:43:41 +02:00
|
|
|
void ChangeDataToolPointFromCircleAndTangent(VPE::VProperty *property);
|
2015-06-06 08:33:19 +02:00
|
|
|
void ChangeDataToolPointFromArcAndTangent(VPE::VProperty *property);
|
2014-09-10 19:57:08 +02:00
|
|
|
void ChangeDataToolShoulderPoint(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolSpline(VPE::VProperty *property);
|
2016-03-10 14:55:04 +01:00
|
|
|
void ChangeDataToolCubicBezier(VPE::VProperty *property);
|
2014-09-10 19:57:08 +02:00
|
|
|
void ChangeDataToolSplinePath(VPE::VProperty *property);
|
2016-03-18 22:11:14 +01:00
|
|
|
void ChangeDataToolCubicBezierPath(VPE::VProperty *property);
|
2014-09-10 19:57:08 +02:00
|
|
|
void ChangeDataToolTriangle(VPE::VProperty *property);
|
2014-10-20 19:41:02 +02:00
|
|
|
void ChangeDataToolLineIntersectAxis(VPE::VProperty *property);
|
2014-10-23 10:38:57 +02:00
|
|
|
void ChangeDataToolCurveIntersectAxis(VPE::VProperty *property);
|
2016-05-12 21:11:21 +02:00
|
|
|
void ChangeDataToolRotation(VPE::VProperty *property);
|
2016-10-04 16:34:37 +02:00
|
|
|
void ChangeDataToolMove(VPE::VProperty *property);
|
2016-09-13 10:27:44 +02:00
|
|
|
void ChangeDataToolFlippingByLine(VPE::VProperty *property);
|
2016-09-17 11:10:03 +02:00
|
|
|
void ChangeDataToolFlippingByAxis(VPE::VProperty *property);
|
2016-12-19 13:18:32 +01:00
|
|
|
void ChangeDataToolEllipticalArc(VPE::VProperty *property);
|
2014-09-01 14:53:57 +02:00
|
|
|
|
|
|
|
void ShowOptionsToolSinglePoint(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolEndLine(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolAlongLine(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolArc(QGraphicsItem *item);
|
2015-06-09 20:23:37 +02:00
|
|
|
void ShowOptionsToolArcWithLength(QGraphicsItem *item);
|
2014-09-01 14:53:57 +02:00
|
|
|
void ShowOptionsToolBisector(QGraphicsItem *item);
|
2015-06-24 16:30:07 +02:00
|
|
|
void ShowOptionsToolTrueDarts(QGraphicsItem *item);
|
2014-09-01 14:53:57 +02:00
|
|
|
void ShowOptionsToolCutArc(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolCutSpline(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolCutSplinePath(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolHeight(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolLine(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolLineIntersect(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolNormal(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolPointOfContact(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolPointOfIntersection(QGraphicsItem *item);
|
2015-05-27 18:24:20 +02:00
|
|
|
void ShowOptionsToolPointOfIntersectionArcs(QGraphicsItem *item);
|
2015-05-30 12:02:20 +02:00
|
|
|
void ShowOptionsToolPointOfIntersectionCircles(QGraphicsItem *item);
|
2016-01-24 17:15:08 +01:00
|
|
|
void ShowOptionsToolPointOfIntersectionCurves(QGraphicsItem *item);
|
2015-06-05 15:43:41 +02:00
|
|
|
void ShowOptionsToolPointFromCircleAndTangent(QGraphicsItem *item);
|
2015-06-06 08:33:19 +02:00
|
|
|
void ShowOptionsToolPointFromArcAndTangent(QGraphicsItem *item);
|
2014-09-01 14:53:57 +02:00
|
|
|
void ShowOptionsToolShoulderPoint(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolSpline(QGraphicsItem *item);
|
2016-03-10 14:55:04 +01:00
|
|
|
void ShowOptionsToolCubicBezier(QGraphicsItem *item);
|
2014-09-01 14:53:57 +02:00
|
|
|
void ShowOptionsToolSplinePath(QGraphicsItem *item);
|
2016-03-18 22:11:14 +01:00
|
|
|
void ShowOptionsToolCubicBezierPath(QGraphicsItem *item);
|
2014-09-01 14:53:57 +02:00
|
|
|
void ShowOptionsToolTriangle(QGraphicsItem *item);
|
2014-10-20 19:41:02 +02:00
|
|
|
void ShowOptionsToolLineIntersectAxis(QGraphicsItem *item);
|
2014-10-23 10:38:57 +02:00
|
|
|
void ShowOptionsToolCurveIntersectAxis(QGraphicsItem *item);
|
2016-05-12 21:11:21 +02:00
|
|
|
void ShowOptionsToolRotation(QGraphicsItem *item);
|
2016-10-04 16:34:37 +02:00
|
|
|
void ShowOptionsToolMove(QGraphicsItem *item);
|
2016-09-13 10:27:44 +02:00
|
|
|
void ShowOptionsToolFlippingByLine(QGraphicsItem *item);
|
2016-09-17 11:10:03 +02:00
|
|
|
void ShowOptionsToolFlippingByAxis(QGraphicsItem *item);
|
2016-12-17 02:57:01 +01:00
|
|
|
void ShowOptionsToolEllipticalArc(QGraphicsItem *item);
|
2014-09-01 14:53:57 +02:00
|
|
|
|
|
|
|
void UpdateOptionsToolSinglePoint();
|
|
|
|
void UpdateOptionsToolEndLine();
|
|
|
|
void UpdateOptionsToolAlongLine();
|
|
|
|
void UpdateOptionsToolArc();
|
2015-06-09 20:23:37 +02:00
|
|
|
void UpdateOptionsToolArcWithLength();
|
2014-09-01 14:53:57 +02:00
|
|
|
void UpdateOptionsToolBisector();
|
2015-06-24 16:30:07 +02:00
|
|
|
void UpdateOptionsToolTrueDarts();
|
2014-09-01 14:53:57 +02:00
|
|
|
void UpdateOptionsToolCutArc();
|
|
|
|
void UpdateOptionsToolCutSpline();
|
|
|
|
void UpdateOptionsToolCutSplinePath();
|
|
|
|
void UpdateOptionsToolHeight();
|
|
|
|
void UpdateOptionsToolLine();
|
|
|
|
void UpdateOptionsToolLineIntersect();
|
|
|
|
void UpdateOptionsToolNormal();
|
|
|
|
void UpdateOptionsToolPointOfContact();
|
|
|
|
void UpdateOptionsToolPointOfIntersection();
|
2015-05-27 18:24:20 +02:00
|
|
|
void UpdateOptionsToolPointOfIntersectionArcs();
|
2015-05-30 12:02:20 +02:00
|
|
|
void UpdateOptionsToolPointOfIntersectionCircles();
|
2016-01-24 17:15:08 +01:00
|
|
|
void UpdateOptionsToolPointOfIntersectionCurves();
|
2015-06-05 15:43:41 +02:00
|
|
|
void UpdateOptionsToolPointFromCircleAndTangent();
|
2015-06-06 08:33:19 +02:00
|
|
|
void UpdateOptionsToolPointFromArcAndTangent();
|
2014-09-01 14:53:57 +02:00
|
|
|
void UpdateOptionsToolShoulderPoint();
|
|
|
|
void UpdateOptionsToolSpline();
|
2016-03-10 14:55:04 +01:00
|
|
|
void UpdateOptionsToolCubicBezier();
|
2014-09-01 14:53:57 +02:00
|
|
|
void UpdateOptionsToolSplinePath();
|
2016-03-18 22:11:14 +01:00
|
|
|
void UpdateOptionsToolCubicBezierPath();
|
2014-09-01 14:53:57 +02:00
|
|
|
void UpdateOptionsToolTriangle();
|
2014-10-20 19:41:02 +02:00
|
|
|
void UpdateOptionsToolLineIntersectAxis();
|
2014-10-23 10:38:57 +02:00
|
|
|
void UpdateOptionsToolCurveIntersectAxis();
|
2016-05-12 21:11:21 +02:00
|
|
|
void UpdateOptionsToolRotation();
|
2016-10-04 16:34:37 +02:00
|
|
|
void UpdateOptionsToolMove();
|
2016-09-13 10:27:44 +02:00
|
|
|
void UpdateOptionsToolFlippingByLine();
|
2016-09-17 11:10:03 +02:00
|
|
|
void UpdateOptionsToolFlippingByAxis();
|
2016-12-19 13:18:32 +01:00
|
|
|
void UpdateOptionsToolEllipticalArc();
|
2014-08-26 19:23:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VTOOLOPTIONSPROPERTYBROWSER_H
|