2014-08-26 19:23:08 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vtooloptionspropertybrowser.h
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 22 8, 2014
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
|
|
|
** This source code is part of the Valentine project, a pattern making
|
|
|
|
** 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>
|
|
|
|
|
2014-10-17 22:26:30 +02:00
|
|
|
#include "../../libs/vpropertyexplorer/vproperty.h"
|
|
|
|
#include "../../libs/vpropertyexplorer/vpropertymodel.h"
|
|
|
|
#include "../../libs/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:
|
|
|
|
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);
|
2014-09-10 19:57:08 +02:00
|
|
|
void userChangedData(VPE::VProperty* property);
|
2014-08-26 19:23:08 +02:00
|
|
|
void UpdateOptions();
|
2015-02-11 11:33:13 +01:00
|
|
|
void RefreshOptions();
|
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-05-30 12:02:20 +02:00
|
|
|
template<class Tool>
|
|
|
|
void SetCrossCirclesPoint(const QVariant value);
|
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
template<class Tool>
|
|
|
|
void AddPropertyPointName(Tool *i, const QString &propertyName);
|
|
|
|
|
2015-05-27 18:24:20 +02:00
|
|
|
template<class Tool>
|
|
|
|
void AddPropertyCrossPoint(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>
|
|
|
|
void AddPropertyLineColor(Tool *i, const QString &propertyName, const QMap<QString, QString> &colors,
|
|
|
|
const QString &id);
|
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
void AddPropertyFormula(const QString &propertyName, const VFormula &formula, const QString &attrName);
|
|
|
|
|
|
|
|
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);
|
|
|
|
void ChangeDataToolBisector(VPE::VProperty *property);
|
|
|
|
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);
|
2014-09-10 19:57:08 +02:00
|
|
|
void ChangeDataToolShoulderPoint(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolSpline(VPE::VProperty *property);
|
|
|
|
void ChangeDataToolSplinePath(VPE::VProperty *property);
|
|
|
|
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);
|
2014-09-01 14:53:57 +02:00
|
|
|
|
|
|
|
void ShowOptionsToolSinglePoint(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolEndLine(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolAlongLine(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolArc(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolBisector(QGraphicsItem *item);
|
|
|
|
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);
|
2014-09-01 14:53:57 +02:00
|
|
|
void ShowOptionsToolShoulderPoint(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolSpline(QGraphicsItem *item);
|
|
|
|
void ShowOptionsToolSplinePath(QGraphicsItem *item);
|
|
|
|
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);
|
2014-09-01 14:53:57 +02:00
|
|
|
|
|
|
|
void UpdateOptionsToolSinglePoint();
|
|
|
|
void UpdateOptionsToolEndLine();
|
|
|
|
void UpdateOptionsToolAlongLine();
|
|
|
|
void UpdateOptionsToolArc();
|
|
|
|
void UpdateOptionsToolBisector();
|
|
|
|
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();
|
2014-09-01 14:53:57 +02:00
|
|
|
void UpdateOptionsToolShoulderPoint();
|
|
|
|
void UpdateOptionsToolSpline();
|
|
|
|
void UpdateOptionsToolSplinePath();
|
|
|
|
void UpdateOptionsToolTriangle();
|
2014-10-20 19:41:02 +02:00
|
|
|
void UpdateOptionsToolLineIntersectAxis();
|
2014-10-23 10:38:57 +02:00
|
|
|
void UpdateOptionsToolCurveIntersectAxis();
|
2014-08-26 19:23:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VTOOLOPTIONSPROPERTYBROWSER_H
|