2014-08-26 19:23:08 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vtooloptionspropertybrowser.cpp
|
|
|
|
** @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/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#include "vtooloptionspropertybrowser.h"
|
2015-10-08 20:11:50 +02:00
|
|
|
#include "../vtools/tools/drawTools/drawtools.h"
|
2014-10-17 22:26:30 +02:00
|
|
|
#include "../core/vapplication.h"
|
2015-10-08 20:11:50 +02:00
|
|
|
#include "../vwidgets/vmaingraphicsview.h"
|
|
|
|
#include "../vwidgets/vgraphicssimpletextitem.h"
|
|
|
|
#include "../vwidgets/vcontrolpointspline.h"
|
|
|
|
#include "../vwidgets/vsimplepoint.h"
|
2016-05-25 10:46:57 +02:00
|
|
|
#include "../vwidgets/vsimplecurve.h"
|
2015-10-08 20:11:50 +02:00
|
|
|
#include "../vpropertyexplorer/vproperties.h"
|
2014-08-29 11:19:11 +02:00
|
|
|
#include "vformulaproperty.h"
|
2015-10-08 20:11:50 +02:00
|
|
|
#include "../vpatterndb/vformula.h"
|
2014-08-26 19:23:08 +02:00
|
|
|
|
|
|
|
#include <QDockWidget>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
|
|
|
|
using namespace VPE;
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VToolOptionsPropertyBrowser::VToolOptionsPropertyBrowser(QDockWidget *parent)
|
2014-09-11 16:15:49 +02:00
|
|
|
:QObject(parent), PropertyModel(nullptr), formView(nullptr), currentItem(nullptr),
|
2014-08-26 19:23:08 +02:00
|
|
|
propertyToId(QMap<VProperty *, QString>()),
|
|
|
|
idToProperty(QMap<QString, VProperty *>())
|
|
|
|
{
|
|
|
|
PropertyModel = new VPropertyModel(this);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView = new VPropertyFormView(PropertyModel, parent);
|
|
|
|
formView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
2014-08-26 19:23:08 +02:00
|
|
|
|
2014-08-26 20:31:28 +02:00
|
|
|
QScrollArea *scroll = new QScrollArea(parent);
|
2014-08-26 19:23:08 +02:00
|
|
|
scroll->setWidgetResizable(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
scroll->setWidget(formView);
|
2014-08-26 19:23:08 +02:00
|
|
|
|
2014-08-26 20:31:28 +02:00
|
|
|
parent->setWidget(scroll);
|
2014-08-26 19:23:08 +02:00
|
|
|
|
2014-09-11 16:15:49 +02:00
|
|
|
connect(PropertyModel, &VPropertyModel::onDataChangedByEditor, this, &VToolOptionsPropertyBrowser::userChangedData);
|
2014-08-26 19:23:08 +02:00
|
|
|
}
|
|
|
|
|
2014-10-27 18:19:59 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ClearPropertyBrowser()
|
|
|
|
{
|
|
|
|
PropertyModel->clear();
|
|
|
|
propertyToId.clear();
|
|
|
|
idToProperty.clear();
|
|
|
|
currentItem = nullptr;
|
|
|
|
}
|
|
|
|
|
2014-08-26 19:23:08 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-08-30 12:41:21 +02:00
|
|
|
void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item)
|
2014-08-26 19:23:08 +02:00
|
|
|
{
|
2016-03-18 22:11:14 +01:00
|
|
|
// This check helps to find missed tools in the switch
|
2016-06-23 19:20:21 +02:00
|
|
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 44, "Not all tools was used in switch.");
|
2016-03-18 22:11:14 +01:00
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
switch (item->type())
|
2014-08-26 21:34:27 +02:00
|
|
|
{
|
2015-06-19 14:08:27 +02:00
|
|
|
case VToolBasePoint::Type:
|
2014-09-01 14:53:57 +02:00
|
|
|
ShowOptionsToolSinglePoint(item);
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
|
|
|
case VToolEndLine::Type:
|
2014-09-01 14:53:57 +02:00
|
|
|
ShowOptionsToolEndLine(item);
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
|
|
|
case VToolAlongLine::Type:
|
2014-09-01 14:53:57 +02:00
|
|
|
ShowOptionsToolAlongLine(item);
|
|
|
|
break;
|
|
|
|
case VToolArc::Type:
|
|
|
|
ShowOptionsToolArc(item);
|
|
|
|
break;
|
2015-06-09 20:23:37 +02:00
|
|
|
case VToolArcWithLength::Type:
|
|
|
|
ShowOptionsToolArcWithLength(item);
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolBisector::Type:
|
|
|
|
ShowOptionsToolBisector(item);
|
|
|
|
break;
|
|
|
|
case VToolCutArc::Type:
|
|
|
|
ShowOptionsToolCutArc(item);
|
|
|
|
break;
|
|
|
|
case VToolCutSpline::Type:
|
|
|
|
ShowOptionsToolCutSpline(item);
|
|
|
|
break;
|
|
|
|
case VToolCutSplinePath::Type:
|
|
|
|
ShowOptionsToolCutSplinePath(item);
|
|
|
|
break;
|
|
|
|
case VToolHeight::Type:
|
|
|
|
ShowOptionsToolHeight(item);
|
|
|
|
break;
|
|
|
|
case VToolLine::Type:
|
|
|
|
ShowOptionsToolLine(item);
|
|
|
|
break;
|
|
|
|
case VToolLineIntersect::Type:
|
|
|
|
ShowOptionsToolLineIntersect(item);
|
|
|
|
break;
|
|
|
|
case VToolNormal::Type:
|
|
|
|
ShowOptionsToolNormal(item);
|
|
|
|
break;
|
|
|
|
case VToolPointOfContact::Type:
|
|
|
|
ShowOptionsToolPointOfContact(item);
|
|
|
|
break;
|
|
|
|
case VToolPointOfIntersection::Type:
|
|
|
|
ShowOptionsToolPointOfIntersection(item);
|
|
|
|
break;
|
2015-05-27 18:24:20 +02:00
|
|
|
case VToolPointOfIntersectionArcs::Type:
|
|
|
|
ShowOptionsToolPointOfIntersectionArcs(item);
|
|
|
|
break;
|
2015-05-30 12:02:20 +02:00
|
|
|
case VToolPointOfIntersectionCircles::Type:
|
|
|
|
ShowOptionsToolPointOfIntersectionCircles(item);
|
|
|
|
break;
|
2016-01-24 17:15:08 +01:00
|
|
|
case VToolPointOfIntersectionCurves::Type:
|
|
|
|
ShowOptionsToolPointOfIntersectionCurves(item);
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolShoulderPoint::Type:
|
|
|
|
ShowOptionsToolShoulderPoint(item);
|
|
|
|
break;
|
|
|
|
case VToolSpline::Type:
|
|
|
|
ShowOptionsToolSpline(item);
|
|
|
|
break;
|
2016-03-10 14:55:04 +01:00
|
|
|
case VToolCubicBezier::Type:
|
|
|
|
ShowOptionsToolCubicBezier(item);
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolSplinePath::Type:
|
|
|
|
ShowOptionsToolSplinePath(item);
|
|
|
|
break;
|
2016-03-18 22:11:14 +01:00
|
|
|
case VToolCubicBezierPath::Type:
|
|
|
|
ShowOptionsToolCubicBezierPath(item);
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolTriangle::Type:
|
|
|
|
ShowOptionsToolTriangle(item);
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
|
|
|
case VGraphicsSimpleTextItem::Type:
|
|
|
|
currentItem = item->parentItem();
|
|
|
|
ShowItemOptions(currentItem);
|
|
|
|
break;
|
|
|
|
case VControlPointSpline::Type:
|
|
|
|
currentItem = item->parentItem();
|
|
|
|
ShowItemOptions(currentItem);
|
|
|
|
break;
|
2014-10-20 19:41:02 +02:00
|
|
|
case VToolLineIntersectAxis::Type:
|
|
|
|
ShowOptionsToolLineIntersectAxis(item);
|
|
|
|
break;
|
2014-10-23 10:38:57 +02:00
|
|
|
case VToolCurveIntersectAxis::Type:
|
|
|
|
ShowOptionsToolCurveIntersectAxis(item);
|
|
|
|
break;
|
2015-06-05 15:43:41 +02:00
|
|
|
case VToolPointFromCircleAndTangent::Type:
|
|
|
|
ShowOptionsToolPointFromCircleAndTangent(item);
|
|
|
|
break;
|
2015-06-06 08:33:19 +02:00
|
|
|
case VToolPointFromArcAndTangent::Type:
|
|
|
|
ShowOptionsToolPointFromArcAndTangent(item);
|
|
|
|
break;
|
2015-06-24 16:30:07 +02:00
|
|
|
case VSimplePoint::Type:
|
|
|
|
currentItem = item->parentItem();
|
|
|
|
ShowItemOptions(currentItem);
|
|
|
|
break;
|
2016-05-25 10:46:57 +02:00
|
|
|
case VSimpleCurve::Type:
|
|
|
|
currentItem = item->parentItem();
|
|
|
|
ShowItemOptions(currentItem);
|
|
|
|
break;
|
2015-06-24 16:30:07 +02:00
|
|
|
case VToolTrueDarts::Type:
|
|
|
|
ShowOptionsToolTrueDarts(item);
|
|
|
|
break;
|
2016-05-12 21:11:21 +02:00
|
|
|
case VToolRotation::Type:
|
|
|
|
ShowOptionsToolRotation(item);
|
|
|
|
break;
|
2014-08-30 12:41:21 +02:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptions()
|
|
|
|
{
|
2014-08-26 19:23:08 +02:00
|
|
|
if (currentItem == nullptr)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-03-18 22:11:14 +01:00
|
|
|
// This check helps to find missed tools in the switch
|
2016-06-23 19:20:21 +02:00
|
|
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 44, "Not all tools was used in switch.");
|
2016-03-18 22:11:14 +01:00
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
switch (currentItem->type())
|
|
|
|
{
|
2015-06-19 14:08:27 +02:00
|
|
|
case VToolBasePoint::Type:
|
2014-09-01 14:53:57 +02:00
|
|
|
UpdateOptionsToolSinglePoint();
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
|
|
|
case VToolEndLine::Type:
|
2014-09-01 14:53:57 +02:00
|
|
|
UpdateOptionsToolEndLine();
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
|
|
|
case VToolAlongLine::Type:
|
2014-09-01 14:53:57 +02:00
|
|
|
UpdateOptionsToolAlongLine();
|
|
|
|
break;
|
|
|
|
case VToolArc::Type:
|
|
|
|
UpdateOptionsToolArc();
|
|
|
|
break;
|
2015-06-09 20:23:37 +02:00
|
|
|
case VToolArcWithLength::Type:
|
|
|
|
UpdateOptionsToolArcWithLength();
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolBisector::Type:
|
|
|
|
UpdateOptionsToolBisector();
|
|
|
|
break;
|
|
|
|
case VToolCutArc::Type:
|
|
|
|
UpdateOptionsToolCutArc();
|
|
|
|
break;
|
|
|
|
case VToolCutSpline::Type:
|
|
|
|
UpdateOptionsToolCutSpline();
|
|
|
|
break;
|
|
|
|
case VToolCutSplinePath::Type:
|
|
|
|
UpdateOptionsToolCutSplinePath();
|
|
|
|
break;
|
|
|
|
case VToolHeight::Type:
|
|
|
|
UpdateOptionsToolHeight();
|
|
|
|
break;
|
|
|
|
case VToolLine::Type:
|
|
|
|
UpdateOptionsToolLine();
|
|
|
|
break;
|
|
|
|
case VToolLineIntersect::Type:
|
|
|
|
UpdateOptionsToolLineIntersect();
|
|
|
|
break;
|
|
|
|
case VToolNormal::Type:
|
|
|
|
UpdateOptionsToolNormal();
|
|
|
|
break;
|
|
|
|
case VToolPointOfContact::Type:
|
|
|
|
UpdateOptionsToolPointOfContact();
|
|
|
|
break;
|
|
|
|
case VToolPointOfIntersection::Type:
|
|
|
|
UpdateOptionsToolPointOfIntersection();
|
|
|
|
break;
|
2015-05-27 18:24:20 +02:00
|
|
|
case VToolPointOfIntersectionArcs::Type:
|
|
|
|
UpdateOptionsToolPointOfIntersectionArcs();
|
|
|
|
break;
|
2015-05-30 12:02:20 +02:00
|
|
|
case VToolPointOfIntersectionCircles::Type:
|
|
|
|
UpdateOptionsToolPointOfIntersectionCircles();
|
|
|
|
break;
|
2016-01-24 17:15:08 +01:00
|
|
|
case VToolPointOfIntersectionCurves::Type:
|
|
|
|
UpdateOptionsToolPointOfIntersectionCurves();
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolShoulderPoint::Type:
|
|
|
|
UpdateOptionsToolShoulderPoint();
|
|
|
|
break;
|
|
|
|
case VToolSpline::Type:
|
|
|
|
UpdateOptionsToolSpline();
|
|
|
|
break;
|
2016-03-10 14:55:04 +01:00
|
|
|
case VToolCubicBezier::Type:
|
|
|
|
UpdateOptionsToolCubicBezier();
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolSplinePath::Type:
|
|
|
|
UpdateOptionsToolSplinePath();
|
|
|
|
break;
|
2016-03-18 22:11:14 +01:00
|
|
|
case VToolCubicBezierPath::Type:
|
|
|
|
UpdateOptionsToolCubicBezierPath();
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolTriangle::Type:
|
|
|
|
UpdateOptionsToolTriangle();
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
|
|
|
case VGraphicsSimpleTextItem::Type:
|
|
|
|
ShowItemOptions(currentItem->parentItem());
|
|
|
|
break;
|
|
|
|
case VControlPointSpline::Type:
|
|
|
|
ShowItemOptions(currentItem->parentItem());
|
|
|
|
break;
|
2014-10-20 19:41:02 +02:00
|
|
|
case VToolLineIntersectAxis::Type:
|
|
|
|
UpdateOptionsToolLineIntersectAxis();
|
|
|
|
break;
|
2014-10-23 10:38:57 +02:00
|
|
|
case VToolCurveIntersectAxis::Type:
|
|
|
|
UpdateOptionsToolCurveIntersectAxis();
|
|
|
|
break;
|
2015-06-05 15:43:41 +02:00
|
|
|
case VToolPointFromCircleAndTangent::Type:
|
|
|
|
UpdateOptionsToolPointFromCircleAndTangent();
|
|
|
|
break;
|
2015-06-06 08:33:19 +02:00
|
|
|
case VToolPointFromArcAndTangent::Type:
|
|
|
|
UpdateOptionsToolPointFromArcAndTangent();
|
|
|
|
break;
|
2015-06-24 16:30:07 +02:00
|
|
|
case VToolTrueDarts::Type:
|
|
|
|
UpdateOptionsToolTrueDarts();
|
|
|
|
break;
|
2016-05-12 21:11:21 +02:00
|
|
|
case VToolRotation::Type:
|
|
|
|
UpdateOptionsToolRotation();
|
|
|
|
break;
|
2014-08-30 12:41:21 +02:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2014-08-26 19:23:08 +02:00
|
|
|
}
|
|
|
|
|
2015-02-11 11:33:13 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::RefreshOptions()
|
|
|
|
{
|
|
|
|
QGraphicsItem *item = currentItem;
|
|
|
|
itemClicked(nullptr);//close options
|
|
|
|
itemClicked(item);//reopen options
|
|
|
|
}
|
|
|
|
|
2014-08-26 19:23:08 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::userChangedData(VProperty *property)
|
|
|
|
{
|
2014-08-27 14:39:54 +02:00
|
|
|
VProperty *prop = property;
|
|
|
|
if (!propertyToId.contains(prop))
|
2014-08-26 19:23:08 +02:00
|
|
|
{
|
2014-08-27 14:39:54 +02:00
|
|
|
if (!propertyToId.contains(prop->getParent()))// Maybe we know parent
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
prop = prop->getParent();
|
|
|
|
}
|
2014-08-26 19:23:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!currentItem)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-03-18 22:11:14 +01:00
|
|
|
// This check helps to find missed tools in the switch
|
2016-06-23 19:20:21 +02:00
|
|
|
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 44, "Not all tools was used in switch.");
|
2016-03-18 22:11:14 +01:00
|
|
|
|
2014-08-26 19:23:08 +02:00
|
|
|
switch (currentItem->type())
|
|
|
|
{
|
2015-06-19 14:08:27 +02:00
|
|
|
case VToolBasePoint::Type:
|
2014-08-30 12:41:21 +02:00
|
|
|
ChangeDataToolSinglePoint(prop);
|
2014-08-26 19:23:08 +02:00
|
|
|
break;
|
2014-08-28 13:05:58 +02:00
|
|
|
case VToolEndLine::Type:
|
2014-08-30 12:41:21 +02:00
|
|
|
ChangeDataToolEndLine(prop);
|
|
|
|
break;
|
|
|
|
case VToolAlongLine::Type:
|
|
|
|
ChangeDataToolAlongLine(prop);
|
2014-08-28 13:05:58 +02:00
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolArc::Type:
|
|
|
|
ChangeDataToolArc(prop);
|
|
|
|
break;
|
2015-06-09 20:23:37 +02:00
|
|
|
case VToolArcWithLength::Type:
|
|
|
|
ChangeDataToolArcWithLength(prop);
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolBisector::Type:
|
|
|
|
ChangeDataToolBisector(prop);
|
|
|
|
break;
|
|
|
|
case VToolCutArc::Type:
|
|
|
|
ChangeDataToolCutArc(prop);
|
|
|
|
break;
|
|
|
|
case VToolCutSpline::Type:
|
|
|
|
ChangeDataToolCutSpline(prop);
|
|
|
|
break;
|
|
|
|
case VToolCutSplinePath::Type:
|
|
|
|
ChangeDataToolCutSplinePath(prop);
|
|
|
|
break;
|
|
|
|
case VToolHeight::Type:
|
|
|
|
ChangeDataToolHeight(prop);
|
|
|
|
break;
|
|
|
|
case VToolLine::Type:
|
|
|
|
ChangeDataToolLine(prop);
|
|
|
|
break;
|
|
|
|
case VToolLineIntersect::Type:
|
|
|
|
ChangeDataToolLineIntersect(prop);
|
|
|
|
break;
|
|
|
|
case VToolNormal::Type:
|
|
|
|
ChangeDataToolNormal(prop);
|
|
|
|
break;
|
|
|
|
case VToolPointOfContact::Type:
|
|
|
|
ChangeDataToolPointOfContact(prop);
|
|
|
|
break;
|
|
|
|
case VToolPointOfIntersection::Type:
|
|
|
|
ChangeDataToolPointOfIntersection(prop);
|
|
|
|
break;
|
2015-05-27 18:24:20 +02:00
|
|
|
case VToolPointOfIntersectionArcs::Type:
|
|
|
|
ChangeDataToolPointOfIntersectionArcs(prop);
|
|
|
|
break;
|
2015-05-30 12:02:20 +02:00
|
|
|
case VToolPointOfIntersectionCircles::Type:
|
|
|
|
ChangeDataToolPointOfIntersectionCircles(prop);
|
|
|
|
break;
|
2016-01-24 17:15:08 +01:00
|
|
|
case VToolPointOfIntersectionCurves::Type:
|
|
|
|
ChangeDataToolPointOfIntersectionCurves(prop);
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolShoulderPoint::Type:
|
|
|
|
ChangeDataToolShoulderPoint(prop);
|
|
|
|
break;
|
|
|
|
case VToolSpline::Type:
|
|
|
|
ChangeDataToolSpline(prop);
|
|
|
|
break;
|
2016-03-10 14:55:04 +01:00
|
|
|
case VToolCubicBezier::Type:
|
|
|
|
ChangeDataToolCubicBezier(prop);
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolSplinePath::Type:
|
|
|
|
ChangeDataToolSplinePath(prop);
|
|
|
|
break;
|
2016-03-18 22:11:14 +01:00
|
|
|
case VToolCubicBezierPath::Type:
|
|
|
|
ChangeDataToolCubicBezierPath(prop);
|
|
|
|
break;
|
2014-09-01 14:53:57 +02:00
|
|
|
case VToolTriangle::Type:
|
|
|
|
ChangeDataToolTriangle(prop);
|
|
|
|
break;
|
2014-10-20 19:41:02 +02:00
|
|
|
case VToolLineIntersectAxis::Type:
|
|
|
|
ChangeDataToolLineIntersectAxis(prop);
|
|
|
|
break;
|
2014-10-23 10:38:57 +02:00
|
|
|
case VToolCurveIntersectAxis::Type:
|
|
|
|
ChangeDataToolCurveIntersectAxis(prop);
|
|
|
|
break;
|
2015-06-05 15:43:41 +02:00
|
|
|
case VToolPointFromCircleAndTangent::Type:
|
|
|
|
ChangeDataToolPointFromCircleAndTangent(prop);
|
|
|
|
break;
|
2015-06-06 08:33:19 +02:00
|
|
|
case VToolPointFromArcAndTangent::Type:
|
|
|
|
ChangeDataToolPointFromArcAndTangent(prop);
|
|
|
|
break;
|
2015-06-24 16:30:07 +02:00
|
|
|
case VToolTrueDarts::Type:
|
|
|
|
ChangeDataToolTrueDarts(prop);
|
|
|
|
break;
|
2016-05-12 21:11:21 +02:00
|
|
|
case VToolRotation::Type:
|
|
|
|
ChangeDataToolRotation(prop);
|
|
|
|
break;
|
2014-08-26 19:23:08 +02:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
qApp->getSceneView()->update();
|
|
|
|
}
|
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::itemClicked(QGraphicsItem *item)
|
|
|
|
{
|
2014-10-04 08:37:19 +02:00
|
|
|
if (item != nullptr)
|
2014-10-02 15:34:49 +02:00
|
|
|
{
|
2014-10-04 08:37:19 +02:00
|
|
|
if (item->isEnabled()==false)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2014-10-02 15:34:49 +02:00
|
|
|
}
|
|
|
|
|
2014-10-04 08:37:19 +02:00
|
|
|
if (currentItem == item && item != nullptr)
|
2014-08-30 12:41:21 +02:00
|
|
|
{
|
|
|
|
UpdateOptions();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
PropertyModel->clear();
|
|
|
|
propertyToId.clear();
|
|
|
|
idToProperty.clear();
|
|
|
|
|
2014-10-04 08:37:19 +02:00
|
|
|
|
|
|
|
if (currentItem != nullptr)
|
2014-09-03 15:52:16 +02:00
|
|
|
{
|
2014-10-04 08:37:19 +02:00
|
|
|
VAbstractTool *previousTool = dynamic_cast<VAbstractTool *>(currentItem);
|
|
|
|
if (previousTool != nullptr)
|
|
|
|
{
|
|
|
|
previousTool->ShowVisualization(false); // hide for previous tool
|
|
|
|
}
|
2014-09-03 15:52:16 +02:00
|
|
|
}
|
2014-08-30 12:41:21 +02:00
|
|
|
|
2014-09-03 15:52:16 +02:00
|
|
|
currentItem = item;
|
2014-08-30 12:41:21 +02:00
|
|
|
if (currentItem == nullptr)
|
|
|
|
{
|
2014-09-03 15:52:16 +02:00
|
|
|
formView->setTitle("");
|
2014-08-30 12:41:21 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ShowItemOptions(currentItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::AddPropertyFormula(const QString &propertyName, const VFormula &formula,
|
|
|
|
const QString &attrName)
|
|
|
|
{
|
|
|
|
VFormulaProperty* itemLength = new VFormulaProperty(propertyName);
|
2015-02-03 11:17:04 +01:00
|
|
|
itemLength->SetFormula(formula);
|
2014-08-30 12:41:21 +02:00
|
|
|
AddProperty(itemLength, attrName);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
2016-02-16 14:04:21 +01:00
|
|
|
void VToolOptionsPropertyBrowser::AddPropertyObjectName(Tool *i, const QString &propertyName, bool readOnly)
|
2014-08-30 12:41:21 +02:00
|
|
|
{
|
2016-02-16 14:04:21 +01:00
|
|
|
auto itemName = new VStringProperty(propertyName);
|
2015-12-09 12:13:34 +01:00
|
|
|
itemName->setClearButtonEnable(true);
|
2014-08-30 12:41:21 +02:00
|
|
|
itemName->setValue(i->name());
|
2016-02-16 14:04:21 +01:00
|
|
|
itemName->setReadOnly(readOnly);
|
2015-08-11 15:41:03 +02:00
|
|
|
AddProperty(itemName, AttrName);
|
2014-08-30 12:41:21 +02:00
|
|
|
}
|
|
|
|
|
2015-06-24 16:30:07 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::AddPropertyPointName1(Tool *i, const QString &propertyName)
|
|
|
|
{
|
2015-12-09 12:13:34 +01:00
|
|
|
VStringProperty *itemName = new VStringProperty(propertyName);
|
|
|
|
itemName->setClearButtonEnable(true);
|
2015-06-24 16:30:07 +02:00
|
|
|
itemName->setValue(i->nameP1());
|
2015-08-11 15:41:03 +02:00
|
|
|
AddProperty(itemName, AttrName1);
|
2015-06-24 16:30:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::AddPropertyPointName2(Tool *i, const QString &propertyName)
|
|
|
|
{
|
2015-12-09 12:13:34 +01:00
|
|
|
VStringProperty *itemName = new VStringProperty(propertyName);
|
|
|
|
itemName->setClearButtonEnable(true);
|
2015-06-24 16:30:07 +02:00
|
|
|
itemName->setValue(i->nameP2());
|
2015-08-11 15:41:03 +02:00
|
|
|
AddProperty(itemName, AttrName2);
|
2015-06-24 16:30:07 +02:00
|
|
|
}
|
|
|
|
|
2016-05-18 13:32:51 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::AddPropertyOperationSuffix(Tool *i, const QString &propertyName, bool readOnly)
|
|
|
|
{
|
|
|
|
auto itemSuffix = new VStringProperty(propertyName);
|
|
|
|
itemSuffix->setClearButtonEnable(true);
|
|
|
|
itemSuffix->setValue(i->Suffix());
|
|
|
|
itemSuffix->setReadOnly(readOnly);
|
|
|
|
AddProperty(itemSuffix, AttrSuffix);
|
|
|
|
}
|
|
|
|
|
2015-05-27 18:24:20 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString &propertyName)
|
|
|
|
{
|
|
|
|
VEnumProperty* itemProperty = new VEnumProperty(propertyName);
|
|
|
|
itemProperty->setLiterals(QStringList()<< tr("First point") << tr("Second point"));
|
2016-01-25 15:46:24 +01:00
|
|
|
itemProperty->setValue(static_cast<int>(i->GetCrossCirclesPoint())-1);
|
2015-08-11 15:41:03 +02:00
|
|
|
AddProperty(itemProperty, AttrCrossPoint);
|
2015-05-27 18:24:20 +02:00
|
|
|
}
|
|
|
|
|
2016-01-24 17:15:08 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::AddPropertyVCrossPoint(Tool *i, const QString &propertyName)
|
|
|
|
{
|
|
|
|
auto itemProperty = new VEnumProperty(propertyName);
|
|
|
|
itemProperty->setLiterals(QStringList()<< tr("Highest point") << tr("Lowest point"));
|
2016-01-25 15:46:24 +01:00
|
|
|
itemProperty->setValue(static_cast<int>(i->GetVCrossPoint())-1);
|
2016-01-24 17:15:08 +01:00
|
|
|
AddProperty(itemProperty, AttrVCrossPoint);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::AddPropertyHCrossPoint(Tool *i, const QString &propertyName)
|
|
|
|
{
|
|
|
|
auto itemProperty = new VEnumProperty(propertyName);
|
|
|
|
itemProperty->setLiterals(QStringList()<< tr("Leftmost point") << tr("Rightmost point"));
|
2016-01-25 15:46:24 +01:00
|
|
|
itemProperty->setValue(static_cast<int>(i->GetHCrossPoint())-1);
|
2016-01-24 17:15:08 +01:00
|
|
|
AddProperty(itemProperty, AttrHCrossPoint);
|
|
|
|
}
|
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
2015-01-29 16:47:02 +01:00
|
|
|
void VToolOptionsPropertyBrowser::AddPropertyLineType(Tool *i, const QString &propertyName,
|
|
|
|
const QMap<QString, QIcon> &styles)
|
2014-08-30 12:41:21 +02:00
|
|
|
{
|
2015-01-29 16:47:02 +01:00
|
|
|
VLineTypeProperty *lineTypeProperty = new VLineTypeProperty(propertyName);
|
|
|
|
lineTypeProperty->setStyles(styles);
|
|
|
|
const qint32 index = VLineTypeProperty::IndexOfStyle(styles, i->getLineType());
|
2014-09-03 13:10:51 +02:00
|
|
|
if (index == -1)
|
|
|
|
{
|
|
|
|
qWarning()<<"Can't find line style" << i->getLineType()<<"in list";
|
|
|
|
}
|
2014-08-30 12:41:21 +02:00
|
|
|
lineTypeProperty->setValue(index);
|
2015-08-11 15:41:03 +02:00
|
|
|
AddProperty(lineTypeProperty, AttrTypeLine);
|
2014-08-30 12:41:21 +02:00
|
|
|
}
|
|
|
|
|
2015-02-07 15:42:49 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::AddPropertyLineColor(Tool *i, const QString &propertyName,
|
|
|
|
const QMap<QString, QString> &colors, const QString &id)
|
|
|
|
{
|
|
|
|
VLineColorProperty *lineColorProperty = new VLineColorProperty(propertyName);
|
|
|
|
lineColorProperty->setColors(colors);
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(colors, i->GetLineColor());
|
|
|
|
if (index == -1)
|
|
|
|
{
|
|
|
|
qWarning()<<"Can't find line style" << i->GetLineColor()<<"in list";
|
|
|
|
}
|
|
|
|
lineColorProperty->setValue(index);
|
|
|
|
AddProperty(lineColorProperty, id);
|
|
|
|
}
|
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-08-28 13:05:58 +02:00
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::SetPointName(const QString &name)
|
|
|
|
{
|
|
|
|
if (Tool *i = qgraphicsitem_cast<Tool *>(currentItem))
|
|
|
|
{
|
|
|
|
if (name == i->name())
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-05-11 14:59:53 +02:00
|
|
|
QRegularExpression rx(NameRegExp());
|
|
|
|
if (name.isEmpty() || VContainer::IsUnique(name) == false || rx.match(name).hasMatch() == false)
|
2014-08-28 13:05:58 +02:00
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-08-28 13:05:58 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
i->setName(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
qWarning()<<"Can't cast item";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-24 16:30:07 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::SetPointName1(const QString &name)
|
|
|
|
{
|
|
|
|
if (Tool *i = qgraphicsitem_cast<Tool *>(currentItem))
|
|
|
|
{
|
|
|
|
if (name == i->nameP1())
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QRegularExpression rx(NameRegExp());
|
|
|
|
if (name.isEmpty() || VContainer::IsUnique(name) == false || rx.match(name).hasMatch() == false)
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName1]->setValue(i->nameP1());
|
2015-06-24 16:30:07 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
i->setNameP1(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
qWarning()<<"Can't cast item";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::SetPointName2(const QString &name)
|
|
|
|
{
|
|
|
|
if (Tool *i = qgraphicsitem_cast<Tool *>(currentItem))
|
|
|
|
{
|
|
|
|
if (name == i->nameP2())
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QRegularExpression rx(NameRegExp());
|
|
|
|
if (name.isEmpty() || VContainer::IsUnique(name) == false || rx.match(name).hasMatch() == false)
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName2]->setValue(i->nameP2());
|
2015-06-24 16:30:07 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
i->setNameP2(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
qWarning()<<"Can't cast item";
|
|
|
|
}
|
|
|
|
}
|
2015-05-30 12:02:20 +02:00
|
|
|
|
2016-05-18 13:32:51 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::SetOperationSuffix(const QString &suffix)
|
|
|
|
{
|
|
|
|
if (Tool *item = qgraphicsitem_cast<Tool *>(currentItem))
|
|
|
|
{
|
|
|
|
if (suffix == item->Suffix())
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (suffix.isEmpty())
|
|
|
|
{
|
|
|
|
idToProperty[AttrSuffix]->setValue(item->Suffix());
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QRegularExpression rx(NameRegExp());
|
2016-05-18 15:44:23 +02:00
|
|
|
const QStringList uniqueNames = VContainer::AllUniqueNames();
|
|
|
|
for (int i=0; i < uniqueNames.size(); ++i)
|
2016-05-18 13:32:51 +02:00
|
|
|
{
|
2016-05-18 15:44:23 +02:00
|
|
|
const QString name = uniqueNames.at(i) + suffix;
|
|
|
|
if (not rx.match(name).hasMatch() || not VContainer::IsUnique(name))
|
2016-05-18 13:32:51 +02:00
|
|
|
{
|
|
|
|
idToProperty[AttrSuffix]->setValue(item->Suffix());
|
2016-05-18 15:44:23 +02:00
|
|
|
return;
|
2016-05-18 13:32:51 +02:00
|
|
|
}
|
|
|
|
}
|
2016-05-18 15:44:23 +02:00
|
|
|
|
|
|
|
item->SetSuffix(suffix);
|
2016-05-18 13:32:51 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
qWarning()<<"Can't cast item";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-24 17:15:08 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Type>
|
|
|
|
Type VToolOptionsPropertyBrowser::GetCrossPoint(const QVariant &value)
|
|
|
|
{
|
|
|
|
bool ok = false;
|
|
|
|
const int val = value.toInt(&ok);
|
|
|
|
|
|
|
|
auto cross = static_cast<Type>(1);
|
|
|
|
if (ok)
|
|
|
|
{
|
|
|
|
switch(val)
|
|
|
|
{
|
2016-01-25 15:46:24 +01:00
|
|
|
case 0:
|
2016-01-24 17:15:08 +01:00
|
|
|
case 1:
|
2016-01-25 15:46:24 +01:00
|
|
|
cross = static_cast<Type>(val+1);
|
2016-01-24 17:15:08 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return cross;
|
|
|
|
}
|
|
|
|
|
2015-05-30 12:02:20 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
2015-10-28 15:22:36 +01:00
|
|
|
void VToolOptionsPropertyBrowser::SetCrossCirclesPoint(const QVariant &value)
|
2015-05-30 12:02:20 +02:00
|
|
|
{
|
|
|
|
if (Tool *i = qgraphicsitem_cast<Tool *>(currentItem))
|
|
|
|
{
|
2016-01-24 17:15:08 +01:00
|
|
|
i->SetCrossCirclesPoint(GetCrossPoint<CrossCirclesPoint>(value));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
qWarning()<<"Can't cast item";
|
|
|
|
}
|
|
|
|
}
|
2015-05-30 12:02:20 +02:00
|
|
|
|
2016-01-24 17:15:08 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::SetVCrossCurvesPoint(const QVariant &value)
|
|
|
|
{
|
|
|
|
if (auto i = qgraphicsitem_cast<Tool *>(currentItem))
|
|
|
|
{
|
|
|
|
i->SetVCrossPoint(GetCrossPoint<VCrossCurvesPoint>(value));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
qWarning()<<"Can't cast item";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
template<class Tool>
|
|
|
|
void VToolOptionsPropertyBrowser::SetHCrossCurvesPoint(const QVariant &value)
|
|
|
|
{
|
|
|
|
if (auto i = qgraphicsitem_cast<Tool *>(currentItem))
|
|
|
|
{
|
|
|
|
i->SetHCrossPoint(GetCrossPoint<HCrossCurvesPoint>(value));
|
2015-05-30 12:02:20 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
qWarning()<<"Can't cast item";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-08-26 19:23:08 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-08-30 12:41:21 +02:00
|
|
|
void VToolOptionsPropertyBrowser::AddProperty(VProperty *property, const QString &id)
|
2014-08-26 19:23:08 +02:00
|
|
|
{
|
2014-08-30 12:41:21 +02:00
|
|
|
propertyToId[property] = id;
|
|
|
|
idToProperty[id] = property;
|
|
|
|
PropertyModel->addProperty(property, id);
|
|
|
|
}
|
2014-08-28 13:23:28 +02:00
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolSinglePoint(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
2014-08-29 15:57:12 +02:00
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
2014-08-29 11:19:11 +02:00
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2015-06-19 14:08:27 +02:00
|
|
|
SetPointName<VToolBasePoint>(value.toString());
|
2014-08-28 13:05:58 +02:00
|
|
|
break;
|
2014-08-30 12:41:21 +02:00
|
|
|
case 1: // QLatin1String("position")
|
|
|
|
currentItem->setPos(value.toPointF());
|
2014-08-26 19:23:08 +02:00
|
|
|
break;
|
|
|
|
default:
|
2014-08-30 12:41:21 +02:00
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
2014-08-26 19:23:08 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-08-30 12:41:21 +02:00
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VProperty *property)
|
2014-08-26 19:23:08 +02:00
|
|
|
{
|
2014-08-30 12:41:21 +02:00
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolEndLine *i = qgraphicsitem_cast<VToolEndLine *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-08-30 12:41:21 +02:00
|
|
|
SetPointName<VToolEndLine>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 3: // AttrTypeLine
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetTypeLine(value.toString());
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 26: // AttrTypeLineColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 4: // AttrLength
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormulaLength(value.value<VFormula>());
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 5: // AttrAngle
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormulaAngle(value.value<VFormula>());
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-08-26 19:23:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-08-30 12:41:21 +02:00
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VProperty *property)
|
2014-08-26 19:23:08 +02:00
|
|
|
{
|
2014-08-30 12:41:21 +02:00
|
|
|
SCASSERT(property != nullptr)
|
2014-08-26 19:23:08 +02:00
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
2014-08-28 10:17:36 +02:00
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
VToolAlongLine *i = qgraphicsitem_cast<VToolAlongLine *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolAlongLine>(value.toString());
|
2014-08-26 19:23:08 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 3: // AttrTypeLine
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetTypeLine(value.toString());
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 26: // AttrTypeLineColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
2014-08-30 12:41:21 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 4: // AttrLength
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormulaLength(value.value<VFormula>());
|
2014-08-26 19:23:08 +02:00
|
|
|
break;
|
|
|
|
default:
|
2014-08-30 12:41:21 +02:00
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
2014-08-26 19:23:08 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2014-08-30 12:41:21 +02:00
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolArc(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolArc *i = qgraphicsitem_cast<VToolArc *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 8: // AttrRadius
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormulaRadius(value.value<VFormula>());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 9: // AttrAngle1
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormulaF1(value.value<VFormula>());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 10: // AttrAngle2
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormulaF2(value.value<VFormula>());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 27: // AttrTypeColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2015-06-09 20:23:37 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolArcWithLength *i = qgraphicsitem_cast<VToolArcWithLength *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 8: // AttrRadius
|
2015-06-09 20:23:37 +02:00
|
|
|
i->SetFormulaRadius(value.value<VFormula>());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 9: // AttrAngle1
|
2015-06-09 20:23:37 +02:00
|
|
|
i->SetFormulaF1(value.value<VFormula>());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 4: // AttrLength
|
2015-06-09 20:23:37 +02:00
|
|
|
i->SetFormulaLength(value.value<VFormula>());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 27: // AttrTypeColor
|
2015-06-09 20:23:37 +02:00
|
|
|
i->SetLineColor(value.toString());
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
VToolBisector *i = qgraphicsitem_cast<VToolBisector *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolBisector>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 4: // AttrLength
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormulaLength(value.value<VFormula>());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 3: // AttrTypeLine
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetTypeLine(value.toString());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 26: // AttrTypeLineColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2015-06-24 16:30:07 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 32: // AttrName1
|
2015-06-24 16:30:07 +02:00
|
|
|
SetPointName1<VToolTrueDarts>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 33: // AttrName2
|
2015-06-24 16:30:07 +02:00
|
|
|
SetPointName2<VToolTrueDarts>(value.toString());
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolCutArc *i = qgraphicsitem_cast<VToolCutArc *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolCutArc>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 4: // AttrLength
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormula(value.value<VFormula>());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
VToolCutSpline *i = qgraphicsitem_cast<VToolCutSpline *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolCutSpline>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 4: // AttrLength
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormula(value.value<VFormula>());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
VToolCutSplinePath *i = qgraphicsitem_cast<VToolCutSplinePath *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolCutSplinePath>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 4: // AttrLength
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormula(value.value<VFormula>());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
VToolHeight *i = qgraphicsitem_cast<VToolHeight *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolHeight>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 3: // AttrTypeLine
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetTypeLine(value.toString());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 26: // AttrTypeLineColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolLine(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolLine *i = qgraphicsitem_cast<VToolLine *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 3: // AttrTypeLine
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetTypeLine(value.toString());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 26: // AttrTypeLineColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolLineIntersect>(value.toString());
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolNormal *i = qgraphicsitem_cast<VToolNormal *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 4: // AttrLength
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormulaLength(value.value<VFormula>());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolNormal>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 5: // AttrAngle
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetAngle(value.toDouble());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 3: // AttrTypeLine
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetTypeLine(value.toString());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 26: // AttrTypeLineColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolPointOfContact *i = qgraphicsitem_cast<VToolPointOfContact *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 8: // AttrRadius
|
2014-09-03 13:10:51 +02:00
|
|
|
i->setArcRadius(value.value<VFormula>());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolPointOfContact>(value.toString());
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolPointOfIntersection>(value.toString());
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2015-05-27 18:24:20 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2015-05-27 18:24:20 +02:00
|
|
|
SetPointName<VToolPointOfIntersectionArcs>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 28: // AttrCrossPoint
|
2015-05-27 18:24:20 +02:00
|
|
|
{
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
2015-05-30 12:02:20 +02:00
|
|
|
SetCrossCirclesPoint<VToolPointOfIntersectionArcs>(value);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2015-05-27 18:24:20 +02:00
|
|
|
|
2015-05-30 12:02:20 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolPointOfIntersectionCircles *i = qgraphicsitem_cast<VToolPointOfIntersectionCircles *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2015-05-30 12:02:20 +02:00
|
|
|
SetPointName<VToolPointOfIntersectionCircles>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 28: // AttrCrossPoint
|
2015-05-30 12:02:20 +02:00
|
|
|
{
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
|
|
|
SetCrossCirclesPoint<VToolPointOfIntersectionCircles>(value);
|
2015-05-27 18:24:20 +02:00
|
|
|
break;
|
|
|
|
}
|
2015-08-11 15:41:03 +02:00
|
|
|
case 29: // AttrC1Radius
|
2015-05-30 12:02:20 +02:00
|
|
|
i->SetFirstCircleRadius(value.value<VFormula>());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 30: // AttrC2Radius
|
2015-05-30 12:02:20 +02:00
|
|
|
i->SetSecondCircleRadius(value.value<VFormula>());
|
|
|
|
break;
|
2015-05-27 18:24:20 +02:00
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-24 17:15:08 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
|
|
|
case 0: // AttrName
|
|
|
|
SetPointName<VToolPointOfIntersectionCurves>(value.toString());
|
|
|
|
break;
|
|
|
|
case 34: // AttrVCrossPoint
|
|
|
|
{
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
|
|
|
SetVCrossCurvesPoint<VToolPointOfIntersectionCurves>(value);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 35: // AttrHCrossPoint
|
|
|
|
{
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
|
|
|
SetHCrossCurvesPoint<VToolPointOfIntersectionCurves>(value);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-05 15:43:41 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolPointFromCircleAndTangent *i = qgraphicsitem_cast<VToolPointFromCircleAndTangent *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2015-06-05 15:43:41 +02:00
|
|
|
SetPointName<VToolPointFromCircleAndTangent>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 31: // AttrCRadius
|
2015-06-05 15:43:41 +02:00
|
|
|
i->SetCircleRadius(value.value<VFormula>());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 28: // AttrCrossPoint
|
2015-06-05 15:43:41 +02:00
|
|
|
{
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
|
|
|
SetCrossCirclesPoint<VToolPointFromCircleAndTangent>(value);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-06-06 08:33:19 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2015-06-06 08:33:19 +02:00
|
|
|
SetPointName<VToolPointFromArcAndTangent>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 28: // AttrCrossPoint
|
2015-06-06 08:33:19 +02:00
|
|
|
{
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::EditRole);
|
|
|
|
SetCrossCirclesPoint<VToolPointFromArcAndTangent>(value);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
VToolShoulderPoint *i = qgraphicsitem_cast<VToolShoulderPoint *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 4: // AttrLength
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormulaLength(value.value<VFormula>());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolShoulderPoint>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 3: // AttrTypeLine
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetTypeLine(value.toString());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 26: // AttrTypeLineColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
2014-09-03 13:10:51 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolSpline(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2016-02-27 11:28:15 +01:00
|
|
|
auto i = qgraphicsitem_cast<VToolSpline *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(i != nullptr);
|
2016-02-27 11:28:15 +01:00
|
|
|
|
|
|
|
VSpline spl = i->getSpline();
|
|
|
|
const VFormula f = value.value<VFormula>();
|
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2016-02-16 14:04:21 +01:00
|
|
|
case 0: // AttrName
|
|
|
|
Q_UNREACHABLE();//The attribute is read only
|
|
|
|
break;
|
2016-02-27 11:28:15 +01:00
|
|
|
case 9: // AttrAngle1
|
|
|
|
if (not f.error())
|
|
|
|
{
|
|
|
|
spl.SetStartAngle(f.getDoubleValue(), f.GetFormula(FormulaType::FromUser));
|
|
|
|
i->setSpline(spl);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 10: // AttrAngle2
|
|
|
|
if (not f.error())
|
|
|
|
{
|
|
|
|
spl.SetEndAngle(f.getDoubleValue(), f.GetFormula(FormulaType::FromUser));
|
|
|
|
i->setSpline(spl);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 36: // AttrLength1
|
|
|
|
if (not f.error() && f.getDoubleValue() >= 0)
|
|
|
|
{
|
|
|
|
spl.SetC1Length(qApp->toPixel(f.getDoubleValue()), f.GetFormula(FormulaType::FromUser));
|
|
|
|
i->setSpline(spl);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 37: // AttrLength2
|
|
|
|
if (not f.error() && f.getDoubleValue() >= 0)
|
|
|
|
{
|
|
|
|
spl.SetC2Length(qApp->toPixel(f.getDoubleValue()), f.GetFormula(FormulaType::FromUser));
|
|
|
|
i->setSpline(spl);
|
|
|
|
}
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 27: // AttrTypeColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
|
|
|
break;
|
2014-09-03 13:10:51 +02:00
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2016-03-10 14:55:04 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
const QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
auto i = qgraphicsitem_cast<VToolCubicBezier *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
|
|
|
case 0: // AttrName
|
|
|
|
Q_UNREACHABLE();//The attribute is read only
|
|
|
|
break;
|
|
|
|
case 27: // AttrTypeColor
|
|
|
|
i->SetLineColor(value.toString());
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolSplinePath(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolSplinePath *i = qgraphicsitem_cast<VToolSplinePath *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2016-02-16 14:04:21 +01:00
|
|
|
case 0: // AttrName
|
|
|
|
Q_UNREACHABLE();//The attribute is read only
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 27: // AttrTypeColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
|
|
|
break;
|
2014-09-03 13:10:51 +02:00
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2016-03-18 22:11:14 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezierPath(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolCubicBezierPath *i = qgraphicsitem_cast<VToolCubicBezierPath *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
|
|
|
case 0: // AttrName
|
|
|
|
Q_UNREACHABLE();//The attribute is read only
|
|
|
|
break;
|
|
|
|
case 27: // AttrTypeColor
|
|
|
|
i->SetLineColor(value.toString());
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VProperty *property)
|
|
|
|
{
|
2014-09-03 13:10:51 +02:00
|
|
|
SCASSERT(property != nullptr)
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2014-09-03 13:10:51 +02:00
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-09-03 13:10:51 +02:00
|
|
|
SetPointName<VToolTriangle>(value.toString());
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2014-10-20 19:41:02 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolLineIntersectAxis *i = qgraphicsitem_cast<VToolLineIntersectAxis *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-10-20 19:41:02 +02:00
|
|
|
SetPointName<VToolLineIntersectAxis>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 3: // AttrTypeLine
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetTypeLine(value.toString());
|
2014-10-20 19:41:02 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 26: // AttrTypeLineColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
2014-10-20 19:41:02 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 5: // AttrAngle
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormulaAngle(value.value<VFormula>());
|
2014-10-20 19:41:02 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-10-23 10:38:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolCurveIntersectAxis *i = qgraphicsitem_cast<VToolCurveIntersectAxis *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
case 0: // AttrName
|
2014-10-23 10:38:57 +02:00
|
|
|
SetPointName<VToolCurveIntersectAxis>(value.toString());
|
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 3: // AttrTypeLine
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetTypeLine(value.toString());
|
2014-10-23 10:38:57 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 26: // AttrTypeLineColor
|
2015-02-07 15:42:49 +01:00
|
|
|
i->SetLineColor(value.toString());
|
2014-10-23 10:38:57 +02:00
|
|
|
break;
|
2015-08-11 15:41:03 +02:00
|
|
|
case 5: // AttrAngle
|
2015-02-03 11:17:04 +01:00
|
|
|
i->SetFormulaAngle(value.value<VFormula>());
|
2014-10-23 10:38:57 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-05-12 21:11:21 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VProperty *property)
|
|
|
|
{
|
|
|
|
SCASSERT(property != nullptr)
|
2016-05-18 13:32:51 +02:00
|
|
|
|
|
|
|
QVariant value = property->data(VProperty::DPC_Data, Qt::DisplayRole);
|
|
|
|
const QString id = propertyToId[property];
|
|
|
|
|
|
|
|
VToolRotation *i = qgraphicsitem_cast<VToolRotation *>(currentItem);
|
|
|
|
SCASSERT(i != nullptr);
|
|
|
|
switch (PropertiesList().indexOf(id))
|
|
|
|
{
|
|
|
|
case 38: // AttrSuffix
|
|
|
|
SetOperationSuffix<VToolRotation>(value.toString());
|
|
|
|
break;
|
|
|
|
case 5: // AttrAngle
|
|
|
|
i->SetFormulaAngle(value.value<VFormula>());
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
qWarning()<<"Unknown property type. id = "<<id;
|
|
|
|
break;
|
|
|
|
}
|
2016-05-12 21:11:21 +02:00
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolSinglePoint(QGraphicsItem *item)
|
|
|
|
{
|
2015-06-19 14:08:27 +02:00
|
|
|
VToolBasePoint *i = qgraphicsitem_cast<VToolBasePoint *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Base point"));
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2014-09-01 14:53:57 +02:00
|
|
|
|
|
|
|
VPointFProperty* itemPosition = new VPointFProperty(tr("Position"));
|
|
|
|
itemPosition->setValue(i->pos());
|
|
|
|
AddProperty(itemPosition, QLatin1String("position"));
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolEndLine(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolEndLine *i = qgraphicsitem_cast<VToolEndLine *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Point at distance and angle"));
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-01-29 16:47:02 +01:00
|
|
|
AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics());
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
|
|
|
|
AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength);
|
|
|
|
AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), AttrAngle);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolAlongLine(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolAlongLine *i = qgraphicsitem_cast<VToolAlongLine *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Point at distance along line"));
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-01-29 16:47:02 +01:00
|
|
|
AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics());
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
|
|
|
|
AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolArc(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolArc *i = qgraphicsitem_cast<VToolArc *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Arc"));
|
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyFormula(tr("Radius"), i->GetFormulaRadius(), AttrRadius);
|
|
|
|
AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), AttrAngle1);
|
|
|
|
AddPropertyFormula(tr("Second angle"), i->GetFormulaF2(), AttrAngle2);
|
|
|
|
AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2015-06-09 20:23:37 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolArcWithLength(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolArcWithLength *i = qgraphicsitem_cast<VToolArcWithLength *>(item);
|
|
|
|
i->ShowVisualization(true);
|
|
|
|
formView->setTitle(tr("Arc with given length"));
|
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyFormula(tr("Radius"), i->GetFormulaRadius(), AttrRadius);
|
|
|
|
AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), AttrAngle1);
|
|
|
|
AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength);
|
|
|
|
AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor);
|
2015-06-09 20:23:37 +02:00
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolBisector(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolBisector *i = qgraphicsitem_cast<VToolBisector *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Point along bisector"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-01-29 16:47:02 +01:00
|
|
|
AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics());
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
|
|
|
|
AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2015-06-24 16:30:07 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolTrueDarts(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolTrueDarts *i = qgraphicsitem_cast<VToolTrueDarts *>(item);
|
|
|
|
i->ShowVisualization(true);
|
|
|
|
formView->setTitle(tr("True darts"));
|
|
|
|
|
|
|
|
AddPropertyPointName1(i, tr("Point 1 label"));
|
|
|
|
AddPropertyPointName2(i, tr("Point 2 label"));
|
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolCutArc(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolCutArc *i = qgraphicsitem_cast<VToolCutArc *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Cut arc tool"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyFormula(tr("Length"), i->GetFormula(), AttrLength);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolCutSpline(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolCutSpline *i = qgraphicsitem_cast<VToolCutSpline *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Tool for segmenting a curve"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyFormula(tr("Length"), i->GetFormula(), AttrLength);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolCutSplinePath(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolCutSplinePath *i = qgraphicsitem_cast<VToolCutSplinePath *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Tool segment a pathed curve"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyFormula(tr("Length"), i->GetFormula(), AttrLength);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolHeight(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolHeight *i = qgraphicsitem_cast<VToolHeight *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Perpendicular point along line"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-01-29 16:47:02 +01:00
|
|
|
AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics());
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolLine(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolLine *i = qgraphicsitem_cast<VToolLine *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Line between points"));
|
|
|
|
|
2015-01-29 16:47:02 +01:00
|
|
|
QMap<QString, QIcon> styles = VAbstractTool::LineStylesPics();
|
2015-08-11 15:41:03 +02:00
|
|
|
styles.remove(TypeLineNone);
|
2015-01-29 16:47:02 +01:00
|
|
|
AddPropertyLineType(i, tr("Line type"), styles);
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersect(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolLineIntersect *i = qgraphicsitem_cast<VToolLineIntersect *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Point at line intersection"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolNormal(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolNormal *i = qgraphicsitem_cast<VToolNormal *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Point along perpendicular"));
|
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength);
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-01-29 16:47:02 +01:00
|
|
|
AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics());
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
VDoubleProperty* itemAngle = new VDoubleProperty(tr("Additional angle degrees"));
|
2015-02-03 11:17:04 +01:00
|
|
|
itemAngle->setValue(i->GetAngle());
|
2014-10-24 18:53:13 +02:00
|
|
|
itemAngle->setSetting("Min", -360);
|
2014-09-03 13:10:51 +02:00
|
|
|
itemAngle->setSetting("Max", 360);
|
|
|
|
itemAngle->setSetting("Precision", 3);
|
2015-08-11 15:41:03 +02:00
|
|
|
AddProperty(itemAngle, AttrAngle);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfContact(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolPointOfContact *i = qgraphicsitem_cast<VToolPointOfContact *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Point at intersection of arc and line"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyFormula(tr("Radius"), i->getArcRadius(), AttrRadius);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersection(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolPointOfIntersection *i = qgraphicsitem_cast<VToolPointOfIntersection *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Tool to make point from x & y of two other points"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2015-05-27 18:24:20 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionArcs(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolPointOfIntersectionArcs *i = qgraphicsitem_cast<VToolPointOfIntersectionArcs *>(item);
|
|
|
|
i->ShowVisualization(true);
|
|
|
|
formView->setTitle(tr("Tool to make point from intersection two arcs"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-05-27 18:24:20 +02:00
|
|
|
AddPropertyCrossPoint(i, tr("Take"));
|
|
|
|
}
|
|
|
|
|
2015-05-30 12:02:20 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionCircles(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolPointOfIntersectionCircles *i = qgraphicsitem_cast<VToolPointOfIntersectionCircles *>(item);
|
|
|
|
i->ShowVisualization(true);
|
|
|
|
formView->setTitle(tr("Tool to make point from intersection two circles"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyFormula(tr("First circle radius"), i->GetFirstCircleRadius(), AttrC1Radius);
|
|
|
|
AddPropertyFormula(tr("Second circle radius"), i->GetSecondCircleRadius(), AttrC2Radius);
|
2015-05-30 12:02:20 +02:00
|
|
|
AddPropertyCrossPoint(i, tr("Take"));
|
|
|
|
}
|
|
|
|
|
2016-01-24 17:15:08 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionCurves(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
auto i = qgraphicsitem_cast<VToolPointOfIntersectionCurves *>(item);
|
|
|
|
i->ShowVisualization(true);
|
|
|
|
formView->setTitle(tr("Tool to make point from intersection two curves"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2016-01-24 17:15:08 +01:00
|
|
|
AddPropertyVCrossPoint(i, tr("Vertical correction"));
|
|
|
|
AddPropertyHCrossPoint(i, tr("Horizontal correction"));
|
|
|
|
}
|
|
|
|
|
2015-06-05 15:43:41 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolPointFromCircleAndTangent(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolPointFromCircleAndTangent *i = qgraphicsitem_cast<VToolPointFromCircleAndTangent *>(item);
|
|
|
|
i->ShowVisualization(true);
|
|
|
|
formView->setTitle(tr("Tool to make point from circle and tangent"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyFormula(tr("Circle radius"), i->GetCircleRadius(), AttrCRadius);
|
2015-06-05 15:43:41 +02:00
|
|
|
AddPropertyCrossPoint(i, tr("Take"));
|
|
|
|
}
|
|
|
|
|
2015-06-06 08:33:19 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolPointFromArcAndTangent(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolPointFromArcAndTangent *i = qgraphicsitem_cast<VToolPointFromArcAndTangent *>(item);
|
|
|
|
i->ShowVisualization(true);
|
|
|
|
formView->setTitle(tr("Tool to make point from arc and tangent"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-06-06 08:33:19 +02:00
|
|
|
AddPropertyCrossPoint(i, tr("Take"));
|
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolShoulderPoint(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolShoulderPoint *i = qgraphicsitem_cast<VToolShoulderPoint *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Special point on shoulder"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-01-29 16:47:02 +01:00
|
|
|
AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics());
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
|
|
|
|
AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolSpline(QGraphicsItem *item)
|
|
|
|
{
|
2016-02-27 11:28:15 +01:00
|
|
|
auto i = qgraphicsitem_cast<VToolSpline *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Curve tool"));
|
|
|
|
|
2016-02-27 11:28:15 +01:00
|
|
|
const auto spl = i->getSpline();
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Name"), true);
|
|
|
|
|
2016-02-27 11:28:15 +01:00
|
|
|
VFormula angle1(spl.GetStartAngleFormula(), i->getData());
|
|
|
|
angle1.setCheckZero(false);
|
|
|
|
angle1.setToolId(i->getId());
|
|
|
|
angle1.setPostfix(degreeSymbol);
|
|
|
|
AddPropertyFormula(tr("C1: angle"), angle1, AttrAngle1);
|
|
|
|
|
|
|
|
VFormula length1(spl.GetC1LengthFormula(), i->getData());
|
|
|
|
length1.setCheckZero(false);
|
|
|
|
length1.setToolId(i->getId());
|
|
|
|
length1.setPostfix(VDomDocument::UnitsToStr(qApp->patternUnit()));
|
|
|
|
AddPropertyFormula(tr("C1: length"), length1, AttrLength1);
|
|
|
|
|
|
|
|
VFormula angle2(spl.GetEndAngleFormula(), i->getData());
|
|
|
|
angle2.setCheckZero(false);
|
|
|
|
angle2.setToolId(i->getId());
|
|
|
|
angle2.setPostfix(degreeSymbol);
|
|
|
|
AddPropertyFormula(tr("C2: angle"), angle2, AttrAngle2);
|
|
|
|
|
|
|
|
VFormula length2(spl.GetC2LengthFormula(), i->getData());
|
|
|
|
length2.setCheckZero(false);
|
|
|
|
length2.setToolId(i->getId());
|
|
|
|
length2.setPostfix(VDomDocument::UnitsToStr(qApp->patternUnit()));
|
|
|
|
AddPropertyFormula(tr("C2: length"), length2, AttrLength2);
|
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2016-03-10 14:55:04 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolCubicBezier(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
auto i = qgraphicsitem_cast<VToolCubicBezier *>(item);
|
|
|
|
i->ShowVisualization(true);
|
|
|
|
formView->setTitle(tr("Cubic bezier curve"));
|
|
|
|
|
|
|
|
AddPropertyObjectName(i, tr("Name"), true);
|
|
|
|
AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor);
|
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolSplinePath(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolSplinePath *i = qgraphicsitem_cast<VToolSplinePath *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Tool for path curve"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Name"), true);
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2016-03-18 22:11:14 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolCubicBezierPath(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolCubicBezierPath *i = qgraphicsitem_cast<VToolCubicBezierPath *>(item);
|
|
|
|
i->ShowVisualization(true);
|
|
|
|
formView->setTitle(tr("Tool cubic bezier curve"));
|
|
|
|
|
|
|
|
AddPropertyObjectName(i, tr("Name"), true);
|
|
|
|
AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor);
|
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolTriangle(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolTriangle *i = qgraphicsitem_cast<VToolTriangle *>(item);
|
2014-09-03 15:52:16 +02:00
|
|
|
i->ShowVisualization(true);
|
2014-09-03 13:10:51 +02:00
|
|
|
formView->setTitle(tr("Tool triangle"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2014-10-20 19:41:02 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersectAxis(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolLineIntersectAxis *i = qgraphicsitem_cast<VToolLineIntersectAxis *>(item);
|
|
|
|
i->ShowVisualization(true);
|
|
|
|
formView->setTitle(tr("Point intersection line and axis"));
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-01-29 16:47:02 +01:00
|
|
|
AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics());
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
|
|
|
|
AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), AttrAngle);
|
2014-10-20 19:41:02 +02:00
|
|
|
}
|
|
|
|
|
2014-10-23 10:38:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolCurveIntersectAxis(QGraphicsItem *item)
|
|
|
|
{
|
|
|
|
VToolCurveIntersectAxis *i = qgraphicsitem_cast<VToolCurveIntersectAxis *>(item);
|
|
|
|
i->ShowVisualization(true);
|
2015-02-03 12:21:01 +01:00
|
|
|
formView->setTitle(tr("Point intersection curve and axis"));
|
2014-10-23 10:38:57 +02:00
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
AddPropertyObjectName(i, tr("Point label"));
|
2015-01-29 16:47:02 +01:00
|
|
|
AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics());
|
2015-08-11 15:41:03 +02:00
|
|
|
AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor);
|
|
|
|
AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), AttrAngle);
|
2014-10-23 10:38:57 +02:00
|
|
|
}
|
|
|
|
|
2016-05-12 21:11:21 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::ShowOptionsToolRotation(QGraphicsItem *item)
|
|
|
|
{
|
2016-05-17 12:24:51 +02:00
|
|
|
VToolRotation *i = qgraphicsitem_cast<VToolRotation *>(item);
|
|
|
|
i->ShowVisualization(true);
|
2016-05-18 13:32:51 +02:00
|
|
|
formView->setTitle(tr("Tool rotation"));
|
|
|
|
|
|
|
|
AddPropertyOperationSuffix(i, tr("Suffix"));
|
|
|
|
AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), AttrAngle);
|
2016-05-12 21:11:21 +02:00
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolSinglePoint()
|
|
|
|
{
|
2015-06-19 14:08:27 +02:00
|
|
|
VToolBasePoint *i = qgraphicsitem_cast<VToolBasePoint *>(currentItem);
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-03 13:10:51 +02:00
|
|
|
idToProperty[QLatin1String("position")]->setValue(i->pos());
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine()
|
|
|
|
{
|
|
|
|
VToolEndLine *i = qgraphicsitem_cast<VToolEndLine *>(currentItem);
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2015-02-07 15:42:49 +01:00
|
|
|
{
|
2015-01-29 16:47:02 +01:00
|
|
|
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrTypeLine]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLineColor]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueFormula;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueFormula.setValue(i->GetFormulaLength());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLength]->setValue(valueFormula);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueAngle;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueAngle.setValue(i->GetFormulaAngle());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrAngle]->setValue(valueAngle);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine()
|
|
|
|
{
|
|
|
|
VToolAlongLine *i = qgraphicsitem_cast<VToolAlongLine *>(currentItem);
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-01 14:53:57 +02:00
|
|
|
|
2015-02-07 15:42:49 +01:00
|
|
|
{
|
2015-01-29 16:47:02 +01:00
|
|
|
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrTypeLine]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLineColor]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueFormula;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueFormula.setValue(i->GetFormulaLength());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLength]->setValue(valueFormula);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolArc()
|
|
|
|
{
|
|
|
|
VToolArc *i = qgraphicsitem_cast<VToolArc *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueRadius;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueRadius.setValue(i->GetFormulaRadius());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrRadius]->setValue(valueRadius);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueFirstAngle;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueFirstAngle.setValue(i->GetFormulaF1());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrAngle1]->setValue(valueFirstAngle);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueSecondAngle;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueSecondAngle.setValue(i->GetFormulaF2());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrAngle2]->setValue(valueSecondAngle);
|
2015-02-07 15:42:49 +01:00
|
|
|
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrColor]->setValue(index);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2015-06-09 20:23:37 +02:00
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolArcWithLength()
|
|
|
|
{
|
|
|
|
VToolArcWithLength *i = qgraphicsitem_cast<VToolArcWithLength *>(currentItem);
|
|
|
|
|
|
|
|
QVariant valueRadius;
|
|
|
|
valueRadius.setValue(i->GetFormulaRadius());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrRadius]->setValue(valueRadius);
|
2015-06-09 20:23:37 +02:00
|
|
|
|
|
|
|
QVariant valueFirstAngle;
|
|
|
|
valueFirstAngle.setValue(i->GetFormulaF1());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrAngle1]->setValue(valueFirstAngle);
|
2015-06-09 20:23:37 +02:00
|
|
|
|
|
|
|
QVariant valueLength;
|
|
|
|
valueLength.setValue(i->GetFormulaLength());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLength]->setValue(valueLength);
|
2015-06-09 20:23:37 +02:00
|
|
|
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrColor]->setValue(index);
|
2015-06-09 20:23:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2014-09-01 14:53:57 +02:00
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector()
|
|
|
|
{
|
|
|
|
VToolBisector *i = qgraphicsitem_cast<VToolBisector *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueFormula;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueFormula.setValue(i->GetFormulaLength());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLength]->setValue(valueFormula);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-02-07 15:42:49 +01:00
|
|
|
{
|
2015-01-29 16:47:02 +01:00
|
|
|
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrTypeLine]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLineColor]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2015-06-24 16:30:07 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolTrueDarts()
|
|
|
|
{
|
|
|
|
VToolTrueDarts *i = qgraphicsitem_cast<VToolTrueDarts *>(currentItem);
|
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName1]->setValue(i->nameP1());
|
|
|
|
idToProperty[AttrName2]->setValue(i->nameP2());
|
2015-06-24 16:30:07 +02:00
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolCutArc()
|
|
|
|
{
|
|
|
|
VToolCutArc *i = qgraphicsitem_cast<VToolCutArc *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueFormula;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueFormula.setValue(i->GetFormula());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLength]->setValue(valueFormula);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSpline()
|
|
|
|
{
|
|
|
|
VToolCutSpline *i = qgraphicsitem_cast<VToolCutSpline *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueFormula;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueFormula.setValue(i->GetFormula());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLength]->setValue(valueFormula);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSplinePath()
|
|
|
|
{
|
|
|
|
VToolCutSplinePath *i = qgraphicsitem_cast<VToolCutSplinePath *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueFormula;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueFormula.setValue(i->GetFormula());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLength]->setValue(valueFormula);
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolHeight()
|
|
|
|
{
|
|
|
|
VToolHeight *i = qgraphicsitem_cast<VToolHeight *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-02-07 15:42:49 +01:00
|
|
|
{
|
2015-01-29 16:47:02 +01:00
|
|
|
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrTypeLine]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLineColor]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolLine()
|
|
|
|
{
|
|
|
|
VToolLine *i = qgraphicsitem_cast<VToolLine *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-02-07 15:42:49 +01:00
|
|
|
{
|
2015-01-29 16:47:02 +01:00
|
|
|
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrTypeLine]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLineColor]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersect()
|
|
|
|
{
|
|
|
|
VToolLineIntersect *i = qgraphicsitem_cast<VToolLineIntersect *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal()
|
|
|
|
{
|
|
|
|
VToolNormal *i = qgraphicsitem_cast<VToolNormal *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueFormula;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueFormula.setValue(i->GetFormulaLength());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLength]->setValue(valueFormula);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrAngle]->setValue( i->GetAngle());
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-02-07 15:42:49 +01:00
|
|
|
{
|
2015-01-29 16:47:02 +01:00
|
|
|
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrTypeLine]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLineColor]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfContact()
|
|
|
|
{
|
|
|
|
VToolPointOfContact *i = qgraphicsitem_cast<VToolPointOfContact *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueFormula;
|
|
|
|
valueFormula.setValue(i->getArcRadius());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrRadius]->setValue(valueFormula);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersection()
|
|
|
|
{
|
|
|
|
VToolPointOfIntersection *i = qgraphicsitem_cast<VToolPointOfIntersection *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2015-05-27 18:24:20 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionArcs()
|
|
|
|
{
|
|
|
|
VToolPointOfIntersectionArcs *i = qgraphicsitem_cast<VToolPointOfIntersectionArcs *>(currentItem);
|
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2016-01-25 15:46:24 +01:00
|
|
|
idToProperty[AttrCrossPoint]->setValue(static_cast<int>(i->GetCrossCirclesPoint())-1);
|
2015-05-30 12:02:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionCircles()
|
|
|
|
{
|
|
|
|
VToolPointOfIntersectionCircles *i = qgraphicsitem_cast<VToolPointOfIntersectionCircles *>(currentItem);
|
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2016-01-25 15:46:24 +01:00
|
|
|
idToProperty[AttrCrossPoint]->setValue(static_cast<int>(i->GetCrossCirclesPoint())-1);
|
2015-05-30 12:02:20 +02:00
|
|
|
|
|
|
|
QVariant c1Radius;
|
|
|
|
c1Radius.setValue(i->GetFirstCircleRadius());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrC1Radius]->setValue(c1Radius);
|
2015-05-30 12:02:20 +02:00
|
|
|
|
|
|
|
QVariant c2Radius;
|
|
|
|
c2Radius.setValue(i->GetSecondCircleRadius());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrC2Radius]->setValue(c2Radius);
|
2015-05-27 18:24:20 +02:00
|
|
|
}
|
|
|
|
|
2016-01-24 17:15:08 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionCurves()
|
|
|
|
{
|
|
|
|
auto i = qgraphicsitem_cast<VToolPointOfIntersectionCurves *>(currentItem);
|
|
|
|
|
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2016-01-25 15:46:24 +01:00
|
|
|
idToProperty[AttrVCrossPoint]->setValue(static_cast<int>(i->GetVCrossPoint())-1);
|
|
|
|
idToProperty[AttrHCrossPoint]->setValue(static_cast<int>(i->GetHCrossPoint())-1);
|
2016-01-24 17:15:08 +01:00
|
|
|
}
|
|
|
|
|
2015-06-05 15:43:41 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolPointFromCircleAndTangent()
|
|
|
|
{
|
|
|
|
VToolPointFromCircleAndTangent *i = qgraphicsitem_cast<VToolPointFromCircleAndTangent *>(currentItem);
|
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2016-01-25 15:46:24 +01:00
|
|
|
idToProperty[AttrCrossPoint]->setValue(static_cast<int>(i->GetCrossCirclesPoint())-1);
|
2015-06-05 15:43:41 +02:00
|
|
|
|
|
|
|
QVariant cRadius;
|
|
|
|
cRadius.setValue(i->GetCircleRadius());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrCRadius]->setValue(cRadius);
|
2015-06-05 15:43:41 +02:00
|
|
|
}
|
|
|
|
|
2015-06-06 08:33:19 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolPointFromArcAndTangent()
|
|
|
|
{
|
|
|
|
VToolPointFromArcAndTangent *i = qgraphicsitem_cast<VToolPointFromArcAndTangent *>(currentItem);
|
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2016-01-25 15:46:24 +01:00
|
|
|
idToProperty[AttrCrossPoint]->setValue(static_cast<int>(i->GetCrossCirclesPoint())-1);
|
2015-06-06 08:33:19 +02:00
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint()
|
|
|
|
{
|
|
|
|
VToolShoulderPoint *i = qgraphicsitem_cast<VToolShoulderPoint *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
|
|
|
QVariant valueFormula;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueFormula.setValue(i->GetFormulaLength());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLength]->setValue(valueFormula);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-02-07 15:42:49 +01:00
|
|
|
{
|
2015-01-29 16:47:02 +01:00
|
|
|
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrTypeLine]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLineColor]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolSpline()
|
|
|
|
{
|
2016-02-16 14:04:21 +01:00
|
|
|
auto i = qgraphicsitem_cast<VToolSpline *>(currentItem);
|
2016-02-27 11:28:15 +01:00
|
|
|
const VSpline spl = i->getSpline();
|
2015-02-07 15:42:49 +01:00
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2016-02-27 11:28:15 +01:00
|
|
|
|
|
|
|
VFormula angle1F(spl.GetStartAngleFormula(), i->getData());
|
|
|
|
angle1F.setCheckZero(false);
|
|
|
|
angle1F.setToolId(i->getId());
|
|
|
|
angle1F.setPostfix(degreeSymbol);
|
|
|
|
QVariant angle1;
|
|
|
|
angle1.setValue(angle1F);
|
|
|
|
idToProperty[AttrAngle1]->setValue(angle1);
|
|
|
|
|
|
|
|
VFormula length1F(spl.GetC1LengthFormula(), i->getData());
|
|
|
|
length1F.setCheckZero(false);
|
|
|
|
length1F.setToolId(i->getId());
|
|
|
|
length1F.setPostfix(VDomDocument::UnitsToStr(qApp->patternUnit()));
|
|
|
|
QVariant length1;
|
|
|
|
length1.setValue(length1F);
|
|
|
|
idToProperty[AttrLength1]->setValue(length1);
|
|
|
|
|
|
|
|
VFormula angle2F(spl.GetEndAngleFormula(), i->getData());
|
|
|
|
angle2F.setCheckZero(false);
|
|
|
|
angle2F.setToolId(i->getId());
|
|
|
|
angle2F.setPostfix(degreeSymbol);
|
|
|
|
QVariant angle2;
|
|
|
|
angle2.setValue(angle2F);
|
|
|
|
idToProperty[AttrAngle2]->setValue(angle2);
|
|
|
|
|
|
|
|
VFormula length2F(spl.GetC2LengthFormula(), i->getData());
|
|
|
|
length2F.setCheckZero(false);
|
|
|
|
length2F.setToolId(i->getId());
|
|
|
|
length2F.setPostfix(VDomDocument::UnitsToStr(qApp->patternUnit()));
|
|
|
|
QVariant length2;
|
|
|
|
length2.setValue(length2F);
|
|
|
|
idToProperty[AttrLength2]->setValue(length2);
|
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2016-03-10 14:55:04 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezier()
|
|
|
|
{
|
|
|
|
auto i = qgraphicsitem_cast<VToolCubicBezier *>(currentItem);
|
|
|
|
|
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
|
|
|
idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
|
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolSplinePath()
|
|
|
|
{
|
2016-02-16 14:04:21 +01:00
|
|
|
auto i = qgraphicsitem_cast<VToolSplinePath *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2016-02-16 14:04:21 +01:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
|
|
|
idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2016-03-18 22:11:14 +01:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezierPath()
|
|
|
|
{
|
|
|
|
auto i = qgraphicsitem_cast<VToolCubicBezierPath *>(currentItem);
|
|
|
|
|
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
|
|
|
idToProperty[AttrColor]->setValue(VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()));
|
|
|
|
}
|
|
|
|
|
2014-09-01 14:53:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolTriangle()
|
|
|
|
{
|
|
|
|
VToolTriangle *i = qgraphicsitem_cast<VToolTriangle *>(currentItem);
|
2014-09-03 13:10:51 +02:00
|
|
|
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-09-01 14:53:57 +02:00
|
|
|
}
|
|
|
|
|
2014-10-20 19:41:02 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis()
|
|
|
|
{
|
|
|
|
VToolLineIntersectAxis *i = qgraphicsitem_cast<VToolLineIntersectAxis *>(currentItem);
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-10-20 19:41:02 +02:00
|
|
|
|
2015-02-07 15:42:49 +01:00
|
|
|
{
|
2015-01-29 16:47:02 +01:00
|
|
|
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrTypeLine]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLineColor]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
2014-10-20 19:41:02 +02:00
|
|
|
|
|
|
|
QVariant valueAngle;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueAngle.setValue(i->GetFormulaAngle());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrAngle]->setValue(valueAngle);
|
2014-10-20 19:41:02 +02:00
|
|
|
}
|
|
|
|
|
2014-10-23 10:38:57 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis()
|
|
|
|
{
|
|
|
|
VToolCurveIntersectAxis *i = qgraphicsitem_cast<VToolCurveIntersectAxis *>(currentItem);
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrName]->setValue(i->name());
|
2014-10-23 10:38:57 +02:00
|
|
|
|
2015-02-07 15:42:49 +01:00
|
|
|
{
|
2015-01-29 16:47:02 +01:00
|
|
|
const qint32 index = VLineTypeProperty::IndexOfStyle(VAbstractTool::LineStylesPics(), i->getLineType());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrTypeLine]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const qint32 index = VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrLineColor]->setValue(index);
|
2015-02-07 15:42:49 +01:00
|
|
|
}
|
2014-10-23 10:38:57 +02:00
|
|
|
|
|
|
|
QVariant valueAngle;
|
2015-02-03 11:17:04 +01:00
|
|
|
valueAngle.setValue(i->GetFormulaAngle());
|
2015-08-11 15:41:03 +02:00
|
|
|
idToProperty[AttrAngle]->setValue(valueAngle);
|
2014-10-23 10:38:57 +02:00
|
|
|
}
|
|
|
|
|
2016-05-12 21:11:21 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VToolOptionsPropertyBrowser::UpdateOptionsToolRotation()
|
|
|
|
{
|
2016-05-18 13:32:51 +02:00
|
|
|
VToolRotation *i = qgraphicsitem_cast<VToolRotation *>(currentItem);
|
|
|
|
idToProperty[AttrSuffix]->setValue(i->Suffix());
|
2016-05-12 21:11:21 +02:00
|
|
|
|
2016-05-18 13:32:51 +02:00
|
|
|
QVariant valueAngle;
|
|
|
|
valueAngle.setValue(i->GetFormulaAngle());
|
|
|
|
idToProperty[AttrAngle]->setValue(valueAngle);
|
2016-05-12 21:11:21 +02:00
|
|
|
}
|
|
|
|
|
2014-08-30 12:41:21 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
QStringList VToolOptionsPropertyBrowser::PropertiesList() const
|
|
|
|
{
|
2015-08-11 15:41:03 +02:00
|
|
|
QStringList attr = QStringList() << AttrName /* 0 */
|
2014-10-17 22:26:30 +02:00
|
|
|
<< QLatin1String("position") /* 1 */
|
2015-08-11 15:41:03 +02:00
|
|
|
<< AttrBasePoint /* 2 */
|
|
|
|
<< AttrTypeLine /* 3 */
|
|
|
|
<< AttrLength /* 4 */
|
|
|
|
<< AttrAngle /* 5 */
|
|
|
|
<< AttrFirstPoint /* 6 */
|
|
|
|
<< AttrSecondPoint /* 7 */
|
|
|
|
<< AttrRadius /* 8 */
|
|
|
|
<< AttrAngle1 /* 9 */
|
|
|
|
<< AttrAngle2 /* 10 */
|
|
|
|
<< AttrCenter /* 11 */
|
|
|
|
<< AttrThirdPoint /* 12 */
|
|
|
|
<< AttrArc /* 13 */
|
2014-10-17 22:26:30 +02:00
|
|
|
<< VToolCutSpline::AttrSpline /* 14 */
|
|
|
|
<< VToolCutSplinePath::AttrSplinePath /* 15 */
|
2015-08-11 15:41:03 +02:00
|
|
|
<< AttrP1Line /* 16 */
|
|
|
|
<< AttrP2Line /* 17 */
|
|
|
|
<< AttrP1Line1 /* 18 */
|
|
|
|
<< AttrP2Line1 /* 19 */
|
|
|
|
<< AttrP1Line2 /* 20 */
|
|
|
|
<< AttrP2Line2 /* 21 */
|
|
|
|
<< AttrPShoulder /* 22 */
|
|
|
|
<< AttrAxisP1 /* 23 */
|
|
|
|
<< AttrAxisP2 /* 24 */
|
2016-02-27 15:49:10 +01:00
|
|
|
<< AttrKCurve /*Not used*/ /* 25 */
|
2015-08-11 15:41:03 +02:00
|
|
|
<< AttrLineColor /* 26 */
|
|
|
|
<< AttrColor /* 27 */
|
|
|
|
<< AttrCrossPoint /* 28 */
|
|
|
|
<< AttrC1Radius /* 29 */
|
|
|
|
<< AttrC2Radius /* 30 */
|
|
|
|
<< AttrCRadius /* 31 */
|
|
|
|
<< AttrName1 /* 32 */
|
2016-01-24 17:15:08 +01:00
|
|
|
<< AttrName2 /* 33 */
|
|
|
|
<< AttrVCrossPoint /* 34 */
|
2016-02-27 11:28:15 +01:00
|
|
|
<< AttrHCrossPoint /* 35 */
|
|
|
|
<< AttrLength1 /* 36 */
|
2016-05-18 13:32:51 +02:00
|
|
|
<< AttrLength2 /* 37 */
|
|
|
|
<< AttrSuffix; /* 38 */
|
2014-08-30 12:41:21 +02:00
|
|
|
return attr;
|
|
|
|
}
|