From ea5010d8f7c29bd9e8172aa102dc4fd4e2d4679c Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sun, 19 Mar 2017 17:13:02 +0200 Subject: [PATCH] Resolved request "Tool Options should show information about parent objects". --HG-- branch : develop --- .../core/vtooloptionspropertybrowser.cpp | 518 ++++++++++++++++-- .../core/vtooloptionspropertybrowser.h | 2 + .../plugins/vlabelproperty.cpp | 132 +++++ .../plugins/vlabelproperty.h | 103 ++++ src/libs/vpropertyexplorer/vproperties.h | 1 + .../vpropertyexplorer/vpropertyexplorer.pri | 156 +++--- .../flipping/vtoolflippingbyaxis.cpp | 6 + .../operation/flipping/vtoolflippingbyaxis.h | 2 + .../flipping/vtoolflippingbyline.cpp | 12 + .../operation/flipping/vtoolflippingbyline.h | 3 + .../drawTools/operation/vtoolrotation.cpp | 6 + .../tools/drawTools/operation/vtoolrotation.h | 2 + .../tools/drawTools/toolcurve/vtoolarc.cpp | 6 + .../tools/drawTools/toolcurve/vtoolarc.h | 2 + .../toolcurve/vtoolarcwithlength.cpp | 6 + .../drawTools/toolcurve/vtoolarcwithlength.h | 2 + .../drawTools/toolcurve/vtoolcubicbezier.cpp | 28 + .../drawTools/toolcurve/vtoolcubicbezier.h | 5 + .../toolcurve/vtoolellipticalarc.cpp | 5 + .../drawTools/toolcurve/vtoolellipticalarc.h | 2 + .../tooldoublepoint/vtooltruedarts.cpp | 30 + .../tooldoublepoint/vtooltruedarts.h | 6 + .../toolsinglepoint/toolcut/vtoolcut.cpp | 6 + .../toolsinglepoint/toolcut/vtoolcut.h | 2 + .../toollinepoint/vtoolalongline.cpp | 6 + .../toollinepoint/vtoolalongline.h | 2 + .../toollinepoint/vtoolbisector.cpp | 12 + .../toollinepoint/vtoolbisector.h | 3 + .../toollinepoint/vtoolcurveintersectaxis.cpp | 6 + .../toollinepoint/vtoolcurveintersectaxis.h | 2 + .../toollinepoint/vtoolheight.cpp | 12 + .../toollinepoint/vtoolheight.h | 3 + .../toollinepoint/vtoollineintersectaxis.cpp | 12 + .../toollinepoint/vtoollineintersectaxis.h | 3 + .../toollinepoint/vtoollinepoint.cpp | 6 + .../toollinepoint/vtoollinepoint.h | 2 + .../toollinepoint/vtoolnormal.cpp | 6 + .../toollinepoint/vtoolnormal.h | 2 + .../toollinepoint/vtoolshoulderpoint.cpp | 12 + .../toollinepoint/vtoolshoulderpoint.h | 3 + .../toolsinglepoint/vtoollineintersect.cpp | 24 + .../toolsinglepoint/vtoollineintersect.h | 5 + .../vtoolpointfromarcandtangent.cpp | 12 + .../vtoolpointfromarcandtangent.h | 3 + .../vtoolpointfromcircleandtangent.cpp | 12 + .../vtoolpointfromcircleandtangent.h | 3 + .../toolsinglepoint/vtoolpointofcontact.cpp | 18 + .../toolsinglepoint/vtoolpointofcontact.h | 4 + .../vtoolpointofintersection.cpp | 12 + .../vtoolpointofintersection.h | 3 + .../vtoolpointofintersectionarcs.cpp | 12 + .../vtoolpointofintersectionarcs.h | 3 + .../vtoolpointofintersectioncircles.cpp | 12 + .../vtoolpointofintersectioncircles.h | 3 + .../vtoolpointofintersectioncurves.cpp | 12 + .../vtoolpointofintersectioncurves.h | 3 + .../toolsinglepoint/vtooltriangle.cpp | 24 + .../toolpoint/toolsinglepoint/vtooltriangle.h | 5 + src/libs/vtools/tools/drawTools/vtoolline.cpp | 12 + src/libs/vtools/tools/drawTools/vtoolline.h | 4 + 60 files changed, 1201 insertions(+), 120 deletions(-) create mode 100644 src/libs/vpropertyexplorer/plugins/vlabelproperty.cpp create mode 100644 src/libs/vpropertyexplorer/plugins/vlabelproperty.h diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.cpp b/src/app/valentina/core/vtooloptionspropertybrowser.cpp index 8e0e356bd..74c81248b 100644 --- a/src/app/valentina/core/vtooloptionspropertybrowser.cpp +++ b/src/app/valentina/core/vtooloptionspropertybrowser.cpp @@ -552,6 +552,15 @@ void VToolOptionsPropertyBrowser::AddPropertyOperationSuffix(Tool *i, const QStr AddProperty(itemSuffix, AttrSuffix); } +//--------------------------------------------------------------------------------------------------------------------- +void VToolOptionsPropertyBrowser::AddPropertyParentPointName(const QString &pointName, const QString &propertyName, + const QString &propertyAttribure) +{ + auto itemParentPoint = new VPE::VLabelProperty(propertyName); + itemParentPoint->setValue(pointName); + AddProperty(itemParentPoint, propertyAttribure); +} + //--------------------------------------------------------------------------------------------------------------------- template void VToolOptionsPropertyBrowser::AddPropertyCrossPoint(Tool *i, const QString &propertyName) @@ -879,6 +888,8 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEndLine(VPE::VProperty *property case 5: // AttrAngle i->SetFormulaAngle(value.value()); break; + case 2: // AttrBasePoint (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetFormulaLength(value.value()); break; + case 2: // AttrBasePoint (read only) + case 7: // AttrSecondPoint (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetLineColor(value.toString()); break; + case 11: // AttrCenter (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetLineColor(value.toString()); break; + case 11: // AttrCenter (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetLineColor(value.toString()); break; + case 6: // AttrFirstPoint (read only) + case 2: // AttrBasePoint (read only) + case 12: // AttrThirdPoint (read only) + break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; + case 6: // AttrFirstPoint (read only) + case 7: // AttrSecondPoint (read only) + case 43: // AttrDartP1 (read only) + case 44: // AttrDartP2 (read only) + case 45: // AttrDartP3 (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetFormula(value.value()); break; + case 13: // AttrArc (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetFormula(value.value()); break; + case 46: // AttrCurve (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetFormula(value.value()); break; + case 46: // AttrCurve (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetLineColor(value.toString()); break; + case 2: // AttrBasePoint (read only) + case 16: // AttrP1Line (read only) + case 17: // AttrP2Line (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetLineColor(value.toString()); break; + case 6: // AttrFirstPoint (read only) + case 7: // AttrSecondPoint (read only) + break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; + case 18: // AttrP1Line1 (read only) + case 19: // AttrP2Line1 (read only) + case 20: // AttrP1Line2 (read only) + case 21: // AttrP2Line2 (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetLineColor(value.toString()); break; + case 2: // AttrBasePoint (read only) + case 7: // AttrSecondPoint (read only) + break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; + case 11: // AttrCenter (read only) + case 6: // AttrFirstPoint (read only) + case 7: // AttrSecondPoint (read only) + break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; + case 6: // AttrFirstPoint (read only) + case 7: // AttrSecondPoint (read only) + break; default: qWarning()<<"Unknown property type. id = "<(value); break; } + case 47: // AttrFirstArc (read only) + case 48: // AttrSecondArc (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetSecondCircleRadius(value.value()); break; + case 49: // AttrC1Center (read only) + case 50: // AttrC2Center (read only) + break; default: qWarning()<<"Unknown property type. id = "<(value); break; } + case 51: // AttrCurve1 (read only) + case 52: // AttrCurve2 (read only) + break; default: qWarning()<<"Unknown property type. id = "<(value); break; } + case 53: // AttrCCenter (read only) + case 54: // AttrTangent (read only) + break; default: qWarning()<<"Unknown property type. id = "<(value); break; } + case 54: // AttrTangent (read only) + case 13: // AttrArc (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetLineColor(value.toString()); break; + case 6: // AttrFirstPoint (read only) + case 2: // AttrBasePoint (read only) + case 12: // AttrThirdPoint (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetLineColor(value.toString()); break; + case 55: // AttrPoint1 (read only) + case 56: // AttrPoint2 (read only) + case 57: // AttrPoint3 (read only) + case 58: // AttrPoint4 (read only) + break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; + case 23: // AttrAxisP1 (read only) + case 24: // AttrAxisP2 (read only) + case 6: // AttrFirstPoint (read only) + case 7: // AttrSecondPoint (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetFormulaAngle(value.value()); break; + case 2: // AttrBasePoint (read only) + case 6: // AttrFirstPoint (read only) + case 7: // AttrSecondPoint (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetFormulaAngle(value.value()); break; + case 2: // AttrBasePoint (read only) + case 46: // AttrCurve (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetFormulaAngle(value.value()); break; + case 11: // AttrCenter (read only) + break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; + case 6: // AttrFirstPoint + case 7: // AttrSecondPoint + break; default: qWarning()<<"Unknown property type. id = "<(value.toString()); break; + case 11: // AttrCenter (read only) + break; default: qWarning()<<"Unknown property type. id = "<SetLineColor(value.toString()); break; + case 11: // AttrCenter (read only) + break; default: qWarning()<<"Unknown property type. id = "<setTitle(tr("Point at distance and angle")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->BasePointName(), tr("Base point"), AttrBasePoint); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength); @@ -1794,6 +1896,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolAlongLine(QGraphicsItem *item) formView->setTitle(tr("Point at distance along line")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->BasePointName(), tr("First point"), AttrBasePoint); + AddPropertyParentPointName(i->SecondPointName(), tr("Second point"), AttrSecondPoint); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength); @@ -1806,6 +1910,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolArc(QGraphicsItem *item) i->ShowVisualization(true); formView->setTitle(tr("Arc")); + AddPropertyParentPointName(i->CenterPointName(), tr("Center point"), AttrCenter); AddPropertyFormula(tr("Radius"), i->GetFormulaRadius(), AttrRadius); AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), AttrAngle1); AddPropertyFormula(tr("Second angle"), i->GetFormulaF2(), AttrAngle2); @@ -1819,6 +1924,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolArcWithLength(QGraphicsItem *it i->ShowVisualization(true); formView->setTitle(tr("Arc with given length")); + AddPropertyParentPointName(i->CenterPointName(), tr("Center point"), AttrCenter); AddPropertyFormula(tr("Radius"), i->GetFormulaRadius(), AttrRadius); AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), AttrAngle1); AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength); @@ -1833,6 +1939,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolBisector(QGraphicsItem *item) formView->setTitle(tr("Point along bisector")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->FirstPointName(), tr("First point"), AttrFirstPoint); + AddPropertyParentPointName(i->BasePointName(), tr("Second point"), AttrBasePoint); + AddPropertyParentPointName(i->ThirdPointName(), tr("Third point"), AttrThirdPoint); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength); @@ -1847,6 +1956,11 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolTrueDarts(QGraphicsItem *item) AddPropertyPointName1(i, tr("Point 1 label")); AddPropertyPointName2(i, tr("Point 2 label")); + AddPropertyParentPointName(i->BaseLineP1Name(), tr("First base point"), AttrFirstPoint); + AddPropertyParentPointName(i->BaseLineP2Name(), tr("Second base point"), AttrSecondPoint); + AddPropertyParentPointName(i->DartP1Name(), tr("First dart point"), AttrDartP1); + AddPropertyParentPointName(i->DartP2Name(), tr("First dart point"), AttrDartP2); + AddPropertyParentPointName(i->DartP3Name(), tr("First dart point"), AttrDartP3); } //--------------------------------------------------------------------------------------------------------------------- @@ -1857,6 +1971,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutArc(QGraphicsItem *item) formView->setTitle(tr("Cut arc tool")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->CurveName(), tr("Arc"), AttrArc); AddPropertyFormula(tr("Length"), i->GetFormula(), AttrLength); } @@ -1868,6 +1983,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutSpline(QGraphicsItem *item) formView->setTitle(tr("Tool for segmenting a curve")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->CurveName(), tr("Curve"), AttrCurve); AddPropertyFormula(tr("Length"), i->GetFormula(), AttrLength); } @@ -1879,6 +1995,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCutSplinePath(QGraphicsItem *it formView->setTitle(tr("Tool segment a pathed curve")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->CurveName(), tr("Curve"), AttrCurve); AddPropertyFormula(tr("Length"), i->GetFormula(), AttrLength); } @@ -1890,6 +2007,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolHeight(QGraphicsItem *item) formView->setTitle(tr("Perpendicular point along line")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->BasePointName(), tr("Base point"), AttrBasePoint); + AddPropertyParentPointName(i->FirstLinePointName(), tr("First line point"), AttrP1Line); + AddPropertyParentPointName(i->SecondLinePointName(), tr("Second line point"), AttrP2Line); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); } @@ -1901,6 +2021,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLine(QGraphicsItem *item) i->ShowVisualization(true); formView->setTitle(tr("Line between points")); + AddPropertyParentPointName(i->FirstPointName(), tr("First point"), AttrFirstPoint); + AddPropertyParentPointName(i->SecondPointName(), tr("Second point"), AttrSecondPoint); QMap styles = VAbstractTool::LineStylesPics(); styles.remove(TypeLineNone); AddPropertyLineType(i, tr("Line type"), styles); @@ -1915,6 +2037,10 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersect(QGraphicsItem *it formView->setTitle(tr("Point at line intersection")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->Line1P1Name(), tr("First line (first point)"), AttrP1Line1); + AddPropertyParentPointName(i->Line1P2Name(), tr("First line (second point)"), AttrP2Line1); + AddPropertyParentPointName(i->Line2P1Name(), tr("Second line (first point)"), AttrP1Line2); + AddPropertyParentPointName(i->Line2P2Name(), tr("Second line (second point)"), AttrP2Line2); } //--------------------------------------------------------------------------------------------------------------------- @@ -1926,6 +2052,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolNormal(QGraphicsItem *item) AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->BasePointName(), tr("First point"), AttrBasePoint); + AddPropertyParentPointName(i->SecondPointName(), tr("Second point"), AttrSecondPoint); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); @@ -1945,6 +2073,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfContact(QGraphicsItem *i formView->setTitle(tr("Point at intersection of arc and line")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->ArcCenterPointName(), tr("Center of arc"), AttrCenter); + AddPropertyParentPointName(i->FirstPointName(), tr("Top of the line"), AttrFirstPoint); + AddPropertyParentPointName(i->SecondPointName(), tr("End of the line"), AttrSecondPoint); AddPropertyFormula(tr("Radius"), i->getArcRadius(), AttrRadius); } @@ -1956,6 +2087,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersection(QGraphicsIt formView->setTitle(tr("Tool to make point from x & y of two other points")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->FirstPointName(), tr("X: vertical point:"), AttrFirstPoint); + AddPropertyParentPointName(i->SecondPointName(), tr("Y: horizontal point:"), AttrSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -1966,6 +2099,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionArcs(QGraphi formView->setTitle(tr("Tool to make point from intersection two arcs")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->FirstArcName(), tr("First arc"), AttrFirstArc); + AddPropertyParentPointName(i->SecondArcName(), tr("Second arc"), AttrSecondArc); AddPropertyCrossPoint(i, tr("Take")); } @@ -1977,6 +2112,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionCircles(QGra formView->setTitle(tr("Tool to make point from intersection two circles")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->FirstCircleCenterPointName(), tr("Center of the first circle:"), AttrC1Center); + AddPropertyParentPointName(i->SecondCircleCenterPointName(), tr("Center of the second circle:"), AttrC2Center); AddPropertyFormula(tr("First circle radius"), i->GetFirstCircleRadius(), AttrC1Radius); AddPropertyFormula(tr("Second circle radius"), i->GetSecondCircleRadius(), AttrC2Radius); AddPropertyCrossPoint(i, tr("Take")); @@ -1990,6 +2127,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointOfIntersectionCurves(QGrap formView->setTitle(tr("Tool to make point from intersection two curves")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->FirstCurveName(), tr("First curve"), AttrCurve1); + AddPropertyParentPointName(i->SecondCurveName(), tr("Second curve"), AttrCurve2); AddPropertyVCrossPoint(i, tr("Vertical correction")); AddPropertyHCrossPoint(i, tr("Horizontal correction")); } @@ -2002,6 +2141,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointFromCircleAndTangent(QGrap formView->setTitle(tr("Tool to make point from circle and tangent")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->CircleCenterPointName(), tr("Center of the circle:"), AttrCCenter); + AddPropertyParentPointName(i->TangentPointName(), tr("Tangent point:"), AttrTangent); AddPropertyFormula(tr("Circle radius"), i->GetCircleRadius(), AttrCRadius); AddPropertyCrossPoint(i, tr("Take")); } @@ -2014,6 +2155,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolPointFromArcAndTangent(QGraphic formView->setTitle(tr("Tool to make point from arc and tangent")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->TangentPointName(), tr("Tangent point:"), AttrTangent); + AddPropertyParentPointName(i->ArcName(), tr("Arc"), AttrArc); AddPropertyCrossPoint(i, tr("Take")); } @@ -2025,6 +2168,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolShoulderPoint(QGraphicsItem *it formView->setTitle(tr("Special point on shoulder")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->BasePointName(), tr("First point"), AttrBasePoint); + AddPropertyParentPointName(i->SecondPointName(), tr("Second point"), AttrSecondPoint); + AddPropertyParentPointName(i->ShoulderPointName(), tr("Third point"), AttrThirdPoint); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Length"), i->GetFormulaLength(), AttrLength); @@ -2076,6 +2222,10 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCubicBezier(QGraphicsItem *item formView->setTitle(tr("Cubic bezier curve")); AddPropertyObjectName(i, tr("Name"), true); + AddPropertyParentPointName(i->FirstPointName(), tr("First point"), AttrPoint1); + AddPropertyParentPointName(i->SecondPointName(), tr("Second point"), AttrPoint2); + AddPropertyParentPointName(i->ThirdPointName(), tr("Third point"), AttrPoint3); + AddPropertyParentPointName(i->ForthPointName(), tr("Third point"), AttrPoint4); AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor); } @@ -2109,6 +2259,10 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolTriangle(QGraphicsItem *item) formView->setTitle(tr("Tool triangle")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->AxisP1Name(), tr("First point of axis"), AttrAxisP1); + AddPropertyParentPointName(i->AxisP2Name(), tr("Second point of axis"), AttrAxisP2); + AddPropertyParentPointName(i->FirstPointName(), tr("First point"), AttrFirstPoint); + AddPropertyParentPointName(i->SecondPointName(), tr("Second point"), AttrSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2119,6 +2273,9 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolLineIntersectAxis(QGraphicsItem formView->setTitle(tr("Point intersection line and axis")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->BasePointName(), tr("Axis point"), AttrBasePoint); + AddPropertyParentPointName(i->FirstLinePoint(), tr("First line point"), AttrFirstPoint); + AddPropertyParentPointName(i->SecondLinePoint(), tr("Second line point"), AttrSecondPoint); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), AttrAngle); @@ -2132,6 +2289,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolCurveIntersectAxis(QGraphicsIte formView->setTitle(tr("Point intersection curve and axis")); AddPropertyObjectName(i, tr("Point label")); + AddPropertyParentPointName(i->BasePointName(), tr("Axis point"), AttrBasePoint); + AddPropertyParentPointName(i->CurveName(), tr("Curve"), AttrCurve); AddPropertyLineType(i, tr("Line type"), VAbstractTool::LineStylesPics()); AddPropertyLineColor(i, tr("Line color"), VAbstractTool::ColorsList(), AttrLineColor); AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), AttrAngle); @@ -2145,6 +2304,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolRotation(QGraphicsItem *item) formView->setTitle(tr("Tool rotation")); AddPropertyOperationSuffix(i, tr("Suffix")); + AddPropertyParentPointName(i->OriginPointName(), tr("Origin point"), AttrCenter); AddPropertyFormula(tr("Angle"), i->GetFormulaAngle(), AttrAngle); } @@ -2168,6 +2328,8 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolFlippingByLine(QGraphicsItem *i formView->setTitle(tr("Tool flipping by line")); AddPropertyOperationSuffix(i, tr("Suffix")); + AddPropertyParentPointName(i->FirstLinePointName(), tr("First line point"), AttrFirstPoint); + AddPropertyParentPointName(i->SecondLinePointName(), tr("Second line point"), AttrSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2179,6 +2341,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolFlippingByAxis(QGraphicsItem *i AddPropertyAxisType(i, tr("Axis type")); AddPropertyOperationSuffix(i, tr("Suffix")); + AddPropertyParentPointName(i->OriginPointName(), tr("Origin point"), AttrCenter); } //--------------------------------------------------------------------------------------------------------------------- @@ -2188,6 +2351,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolEllipticalArc(QGraphicsItem *it i->ShowVisualization(true); formView->setTitle(tr("Elliptical arc")); + AddPropertyParentPointName(i->CenterPointName(), tr("Center point"), AttrCenter); AddPropertyFormula(tr("Radius"), i->GetFormulaRadius1(), AttrRadius1); AddPropertyFormula(tr("Radius"), i->GetFormulaRadius2(), AttrRadius2); AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), AttrAngle1); @@ -2227,6 +2391,10 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEndLine() QVariant valueAngle; valueAngle.setValue(i->GetFormulaAngle()); idToProperty[AttrAngle]->setValue(valueAngle); + + QVariant valueBasePoint; + valueBasePoint.setValue(i->BasePointName()); + idToProperty[AttrBasePoint]->setValue(valueBasePoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2248,6 +2416,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolAlongLine() QVariant valueFormula; valueFormula.setValue(i->GetFormulaLength()); idToProperty[AttrLength]->setValue(valueFormula); + + QVariant valueBasePoint; + valueBasePoint.setValue(i->BasePointName()); + idToProperty[AttrBasePoint]->setValue(valueBasePoint); + + QVariant valueSecondPoint; + valueSecondPoint.setValue(i->SecondPointName()); + idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2269,6 +2445,10 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArc() const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrColor]->setValue(index); + + QVariant valueCenterPoint; + valueCenterPoint.setValue(i->CenterPointName()); + idToProperty[AttrCenter]->setValue(valueCenterPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2290,6 +2470,10 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolArcWithLength() const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrColor]->setValue(index); + + QVariant valueCenterPoint; + valueCenterPoint.setValue(i->CenterPointName()); + idToProperty[AttrCenter]->setValue(valueCenterPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2312,6 +2496,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolBisector() const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } + + QVariant valueFirstPoint; + valueFirstPoint.setValue(i->FirstPointName()); + idToProperty[AttrFirstPoint]->setValue(valueFirstPoint); + + QVariant valueBasePoint; + valueBasePoint.setValue(i->BasePointName()); + idToProperty[AttrBasePoint]->setValue(valueBasePoint); + + QVariant valueThirdPoint; + valueThirdPoint.setValue(i->ThirdPointName()); + idToProperty[AttrThirdPoint]->setValue(valueThirdPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2321,6 +2517,26 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolTrueDarts() idToProperty[AttrName1]->setValue(i->nameP1()); idToProperty[AttrName2]->setValue(i->nameP2()); + + QVariant valueFirstPoint; + valueFirstPoint.setValue(i->BaseLineP1Name()); + idToProperty[AttrFirstPoint]->setValue(valueFirstPoint); + + QVariant valueSecondPoint; + valueSecondPoint.setValue(i->BaseLineP2Name()); + idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); + + QVariant valueDrartFirstPoint; + valueDrartFirstPoint.setValue(i->DartP1Name()); + idToProperty[AttrDartP1]->setValue(valueDrartFirstPoint); + + QVariant valueDartSecondPoint; + valueDartSecondPoint.setValue(i->DartP2Name()); + idToProperty[AttrDartP2]->setValue(valueDartSecondPoint); + + QVariant valueDartThirdPoint; + valueDartThirdPoint.setValue(i->DartP3Name()); + idToProperty[AttrDartP3]->setValue(valueDartThirdPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2333,6 +2549,10 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutArc() QVariant valueFormula; valueFormula.setValue(i->GetFormula()); idToProperty[AttrLength]->setValue(valueFormula); + + QVariant valueArc; + valueArc.setValue(i->CurveName()); + idToProperty[AttrArc]->setValue(valueArc); } //--------------------------------------------------------------------------------------------------------------------- @@ -2345,6 +2565,10 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSpline() QVariant valueFormula; valueFormula.setValue(i->GetFormula()); idToProperty[AttrLength]->setValue(valueFormula); + + QVariant valueCurve; + valueCurve.setValue(i->CurveName()); + idToProperty[AttrCurve]->setValue(valueCurve); } //--------------------------------------------------------------------------------------------------------------------- @@ -2357,6 +2581,10 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCutSplinePath() QVariant valueFormula; valueFormula.setValue(i->GetFormula()); idToProperty[AttrLength]->setValue(valueFormula); + + QVariant valueCurve; + valueCurve.setValue(i->CurveName()); + idToProperty[AttrCurve]->setValue(valueCurve); } //--------------------------------------------------------------------------------------------------------------------- @@ -2375,6 +2603,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolHeight() const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } + + QVariant valueBasePoint; + valueBasePoint.setValue(i->BasePointName()); + idToProperty[AttrBasePoint]->setValue(valueBasePoint); + + QVariant valueFirstLinePoint; + valueFirstLinePoint.setValue(i->FirstLinePointName()); + idToProperty[AttrP1Line]->setValue(valueFirstLinePoint); + + QVariant valueSecondLinePoint; + valueSecondLinePoint.setValue(i->SecondLinePointName()); + idToProperty[AttrP2Line]->setValue(valueSecondLinePoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2391,6 +2631,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLine() const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } + + QVariant valueFirstPoint; + valueFirstPoint.setValue(i->FirstPointName()); + idToProperty[AttrFirstPoint]->setValue(valueFirstPoint); + + QVariant valueSecondPoint; + valueSecondPoint.setValue(i->SecondPointName()); + idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2399,6 +2647,22 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersect() VToolLineIntersect *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); + + QVariant valueLine1P1; + valueLine1P1.setValue(i->Line1P1Name()); + idToProperty[AttrP1Line1]->setValue(valueLine1P1); + + QVariant valueLine1P2; + valueLine1P2.setValue(i->Line1P2Name()); + idToProperty[AttrP2Line1]->setValue(valueLine1P2); + + QVariant valueLine2P1; + valueLine2P1.setValue(i->Line2P1Name()); + idToProperty[AttrP1Line2]->setValue(valueLine2P1); + + QVariant valueLine2P2; + valueLine2P2.setValue(i->Line2P2Name()); + idToProperty[AttrP2Line2]->setValue(valueLine2P2); } //--------------------------------------------------------------------------------------------------------------------- @@ -2423,6 +2687,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolNormal() const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } + + QVariant valueBasePoint; + valueBasePoint.setValue(i->BasePointName()); + idToProperty[AttrBasePoint]->setValue(valueBasePoint); + + QVariant valueSecondPoint; + valueSecondPoint.setValue(i->SecondPointName()); + idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2435,6 +2707,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfContact() idToProperty[AttrRadius]->setValue(valueFormula); idToProperty[AttrName]->setValue(i->name()); + + QVariant valueCenterPoint; + valueCenterPoint.setValue(i->ArcCenterPointName()); + idToProperty[AttrCenter]->setValue(valueCenterPoint); + + QVariant valueFirstPoint; + valueFirstPoint.setValue(i->FirstPointName()); + idToProperty[AttrFirstPoint]->setValue(valueFirstPoint); + + QVariant valueSecondPoint; + valueSecondPoint.setValue(i->SecondPointName()); + idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2443,6 +2727,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersection() VToolPointOfIntersection *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); + + QVariant valueFirstPoint; + valueFirstPoint.setValue(i->FirstPointName()); + idToProperty[AttrFirstPoint]->setValue(valueFirstPoint); + + QVariant valueSecondPoint; + valueSecondPoint.setValue(i->SecondPointName()); + idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2452,6 +2744,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionArcs() idToProperty[AttrName]->setValue(i->name()); idToProperty[AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); + + QVariant valueFirstArc; + valueFirstArc.setValue(i->FirstArcName()); + idToProperty[AttrFirstArc]->setValue(valueFirstArc); + + QVariant valueSecondArc; + valueSecondArc.setValue(i->SecondArcName()); + idToProperty[AttrSecondArc]->setValue(valueSecondArc); } //--------------------------------------------------------------------------------------------------------------------- @@ -2469,6 +2769,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionCircles() QVariant c2Radius; c2Radius.setValue(i->GetSecondCircleRadius()); idToProperty[AttrC2Radius]->setValue(c2Radius); + + QVariant valueC1Center; + valueC1Center.setValue(i->FirstCircleCenterPointName()); + idToProperty[AttrC1Center]->setValue(valueC1Center); + + QVariant valueC2Center; + valueC2Center.setValue(i->SecondCircleCenterPointName()); + idToProperty[AttrC2Center]->setValue(valueC2Center); } //--------------------------------------------------------------------------------------------------------------------- @@ -2479,6 +2787,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointOfIntersectionCurves() idToProperty[AttrName]->setValue(i->name()); idToProperty[AttrVCrossPoint]->setValue(static_cast(i->GetVCrossPoint())-1); idToProperty[AttrHCrossPoint]->setValue(static_cast(i->GetHCrossPoint())-1); + + QVariant valueCurve1; + valueCurve1.setValue(i->FirstCurveName()); + idToProperty[AttrCurve1]->setValue(valueCurve1); + + QVariant valueCurve2; + valueCurve2.setValue(i->SecondCurveName()); + idToProperty[AttrCurve2]->setValue(valueCurve2); } //--------------------------------------------------------------------------------------------------------------------- @@ -2492,6 +2808,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointFromCircleAndTangent() QVariant cRadius; cRadius.setValue(i->GetCircleRadius()); idToProperty[AttrCRadius]->setValue(cRadius); + + QVariant valueCenterPoint; + valueCenterPoint.setValue(i->CircleCenterPointName()); + idToProperty[AttrCCenter]->setValue(valueCenterPoint); + + QVariant valueTangentPoint; + valueTangentPoint.setValue(i->TangentPointName()); + idToProperty[AttrTangent]->setValue(valueTangentPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2501,6 +2825,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolPointFromArcAndTangent() idToProperty[AttrName]->setValue(i->name()); idToProperty[AttrCrossPoint]->setValue(static_cast(i->GetCrossCirclesPoint())-1); + + QVariant valueTangentPoint; + valueTangentPoint.setValue(i->TangentPointName()); + idToProperty[AttrTangent]->setValue(valueTangentPoint); + + QVariant valueArc; + valueArc.setValue(i->ArcName()); + idToProperty[AttrArc]->setValue(valueArc); } //--------------------------------------------------------------------------------------------------------------------- @@ -2523,6 +2855,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolShoulderPoint() const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrLineColor]->setValue(index); } + + QVariant valueBasePoint; + valueBasePoint.setValue(i->BasePointName()); + idToProperty[AttrBasePoint]->setValue(valueBasePoint); + + QVariant valueSecondPoint; + valueSecondPoint.setValue(i->SecondPointName()); + idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); + + QVariant valueThirdPoint; + valueThirdPoint.setValue(i->ShoulderPointName()); + idToProperty[AttrThirdPoint]->setValue(valueThirdPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2577,6 +2921,22 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCubicBezier() idToProperty[AttrName]->setValue(i->name()); idToProperty[AttrColor]->setValue(VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor())); + + QVariant valueFirstPoint; + valueFirstPoint.setValue(i->FirstPointName()); + idToProperty[AttrPoint1]->setValue(valueFirstPoint); + + QVariant valueSecondPoint; + valueSecondPoint.setValue(i->SecondPointName()); + idToProperty[AttrPoint2]->setValue(valueSecondPoint); + + QVariant valueThirdPoint; + valueThirdPoint.setValue(i->ThirdPointName()); + idToProperty[AttrPoint3]->setValue(valueThirdPoint); + + QVariant valueForthPoint; + valueForthPoint.setValue(i->ForthPointName()); + idToProperty[AttrPoint4]->setValue(valueForthPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2605,6 +2965,22 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolTriangle() VToolTriangle *i = qgraphicsitem_cast(currentItem); idToProperty[AttrName]->setValue(i->name()); + + QVariant valueAxisP1; + valueAxisP1.setValue(i->AxisP1Name()); + idToProperty[AttrAxisP1]->setValue(valueAxisP1); + + QVariant valueAxisP2; + valueAxisP2.setValue(i->AxisP2Name()); + idToProperty[AttrAxisP2]->setValue(valueAxisP2); + + QVariant valueFirstPoint; + valueFirstPoint.setValue(i->FirstPointName()); + idToProperty[AttrFirstPoint]->setValue(valueFirstPoint); + + QVariant valueSecondPoint; + valueSecondPoint.setValue(i->SecondPointName()); + idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2626,6 +3002,18 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolLineIntersectAxis() QVariant valueAngle; valueAngle.setValue(i->GetFormulaAngle()); idToProperty[AttrAngle]->setValue(valueAngle); + + QVariant valueBasePoint; + valueBasePoint.setValue(i->BasePointName()); + idToProperty[AttrBasePoint]->setValue(valueBasePoint); + + QVariant valueFirstPoint; + valueFirstPoint.setValue(i->FirstLinePoint()); + idToProperty[AttrFirstPoint]->setValue(valueFirstPoint); + + QVariant valueSecondPoint; + valueSecondPoint.setValue(i->SecondLinePoint()); + idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2647,6 +3035,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolCurveIntersectAxis() QVariant valueAngle; valueAngle.setValue(i->GetFormulaAngle()); idToProperty[AttrAngle]->setValue(valueAngle); + + QVariant valueBasePoint; + valueBasePoint.setValue(i->BasePointName()); + idToProperty[AttrBasePoint]->setValue(valueBasePoint); + + QVariant valueCurve; + valueCurve.setValue(i->CurveName()); + idToProperty[AttrCurve]->setValue(valueCurve); } //--------------------------------------------------------------------------------------------------------------------- @@ -2658,6 +3054,10 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolRotation() QVariant valueAngle; valueAngle.setValue(i->GetFormulaAngle()); idToProperty[AttrAngle]->setValue(valueAngle); + + QVariant valueOriginPoint; + valueOriginPoint.setValue(i->OriginPointName()); + idToProperty[AttrCenter]->setValue(valueOriginPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2680,6 +3080,14 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolFlippingByLine() { VToolFlippingByLine *i = qgraphicsitem_cast(currentItem); idToProperty[AttrSuffix]->setValue(i->Suffix()); + + QVariant valueFirstPoint; + valueFirstPoint.setValue(i->FirstLinePointName()); + idToProperty[AttrFirstPoint]->setValue(valueFirstPoint); + + QVariant valueSecondPoint; + valueSecondPoint.setValue(i->SecondLinePointName()); + idToProperty[AttrSecondPoint]->setValue(valueSecondPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2688,6 +3096,10 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolFlippingByAxis() VToolFlippingByAxis *i = qgraphicsitem_cast(currentItem); idToProperty[AttrAxisType]->setValue(static_cast(i->GetAxisType())-1); idToProperty[AttrSuffix]->setValue(i->Suffix()); + + QVariant valueOriginPoint; + valueOriginPoint.setValue(i->OriginPointName()); + idToProperty[AttrCenter]->setValue(valueOriginPoint); } //--------------------------------------------------------------------------------------------------------------------- @@ -2717,53 +3129,73 @@ void VToolOptionsPropertyBrowser::UpdateOptionsToolEllipticalArc() const qint32 index = VPE::VLineColorProperty::IndexOfColor(VAbstractTool::ColorsList(), i->GetLineColor()); idToProperty[AttrColor]->setValue(index); + + QVariant valueCenterPoint; + valueCenterPoint.setValue(i->CenterPointName()); + idToProperty[AttrCenter]->setValue(valueCenterPoint); } //--------------------------------------------------------------------------------------------------------------------- QStringList VToolOptionsPropertyBrowser::PropertiesList() const { - QStringList attr = QStringList() << AttrName /* 0 */ - << QLatin1String("position") /* 1 */ - << AttrBasePoint /* 2 */ - << AttrTypeLine /* 3 */ - << AttrLength /* 4 */ - << AttrAngle /* 5 */ - << AttrFirstPoint /* 6 */ - << AttrSecondPoint /* 7 */ - << AttrRadius /* 8 */ - << AttrAngle1 /* 9 */ - << AttrAngle2 /* 10 */ - << AttrCenter /* 11 */ - << AttrThirdPoint /* 12 */ - << AttrArc /* 13 */ - << VToolCutSpline::AttrSpline /* 14 */ - << VToolCutSplinePath::AttrSplinePath /* 15 */ - << AttrP1Line /* 16 */ - << AttrP2Line /* 17 */ - << AttrP1Line1 /* 18 */ - << AttrP2Line1 /* 19 */ - << AttrP1Line2 /* 20 */ - << AttrP2Line2 /* 21 */ - << AttrPShoulder /* 22 */ - << AttrAxisP1 /* 23 */ - << AttrAxisP2 /* 24 */ - << AttrKCurve /*Not used*/ /* 25 */ - << AttrLineColor /* 26 */ - << AttrColor /* 27 */ - << AttrCrossPoint /* 28 */ - << AttrC1Radius /* 29 */ - << AttrC2Radius /* 30 */ - << AttrCRadius /* 31 */ - << AttrName1 /* 32 */ - << AttrName2 /* 33 */ - << AttrVCrossPoint /* 34 */ - << AttrHCrossPoint /* 35 */ - << AttrLength1 /* 36 */ - << AttrLength2 /* 37 */ - << AttrSuffix /* 38 */ - << AttrAxisType /* 39 */ - << AttrRadius1 /* 40 */ - << AttrRadius2 /* 41 */ - << AttrRotationAngle; /* 42 */ + static QStringList attr = QStringList() << AttrName /* 0 */ + << QLatin1String("position") /* 1 */ + << AttrBasePoint /* 2 */ + << AttrTypeLine /* 3 */ + << AttrLength /* 4 */ + << AttrAngle /* 5 */ + << AttrFirstPoint /* 6 */ + << AttrSecondPoint /* 7 */ + << AttrRadius /* 8 */ + << AttrAngle1 /* 9 */ + << AttrAngle2 /* 10 */ + << AttrCenter /* 11 */ + << AttrThirdPoint /* 12 */ + << AttrArc /* 13 */ + << VToolCutSpline::AttrSpline /* 14 */ + << VToolCutSplinePath::AttrSplinePath /* 15 */ + << AttrP1Line /* 16 */ + << AttrP2Line /* 17 */ + << AttrP1Line1 /* 18 */ + << AttrP2Line1 /* 19 */ + << AttrP1Line2 /* 20 */ + << AttrP2Line2 /* 21 */ + << AttrPShoulder /* 22 */ + << AttrAxisP1 /* 23 */ + << AttrAxisP2 /* 24 */ + << AttrKCurve /*Not used*/ /* 25 */ + << AttrLineColor /* 26 */ + << AttrColor /* 27 */ + << AttrCrossPoint /* 28 */ + << AttrC1Radius /* 29 */ + << AttrC2Radius /* 30 */ + << AttrCRadius /* 31 */ + << AttrName1 /* 32 */ + << AttrName2 /* 33 */ + << AttrVCrossPoint /* 34 */ + << AttrHCrossPoint /* 35 */ + << AttrLength1 /* 36 */ + << AttrLength2 /* 37 */ + << AttrSuffix /* 38 */ + << AttrAxisType /* 39 */ + << AttrRadius1 /* 40 */ + << AttrRadius2 /* 41 */ + << AttrRotationAngle /* 42 */ + << AttrDartP1 /* 43 */ + << AttrDartP2 /* 44 */ + << AttrDartP3 /* 45 */ + << AttrCurve /* 46 */ + << AttrFirstArc /* 47 */ + << AttrSecondArc /* 48 */ + << AttrC1Center /* 49 */ + << AttrC2Center /* 50 */ + << AttrCurve1 /* 51 */ + << AttrCurve2 /* 52 */ + << AttrCCenter /* 53 */ + << AttrTangent /* 54 */ + << AttrPoint1 /* 55 */ + << AttrPoint2 /* 56 */ + << AttrPoint3 /* 57 */ + << AttrPoint4; /* 58 */ return attr; } diff --git a/src/app/valentina/core/vtooloptionspropertybrowser.h b/src/app/valentina/core/vtooloptionspropertybrowser.h index 117fd3618..5a7ec8fae 100644 --- a/src/app/valentina/core/vtooloptionspropertybrowser.h +++ b/src/app/valentina/core/vtooloptionspropertybrowser.h @@ -125,6 +125,8 @@ private: const QString &id); void AddPropertyFormula(const QString &propertyName, const VFormula &formula, const QString &attrName); + void AddPropertyParentPointName(const QString &pointName, const QString &propertyName, + const QString &propertyAttribure); QStringList PropertiesList() const; diff --git a/src/libs/vpropertyexplorer/plugins/vlabelproperty.cpp b/src/libs/vpropertyexplorer/plugins/vlabelproperty.cpp new file mode 100644 index 000000000..dce132149 --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vlabelproperty.cpp @@ -0,0 +1,132 @@ +/************************************************************************ + ** + ** @file vlabelproperty.cpp + ** @author Roman Telezhynskyi + ** @date 18 3, 2017 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2017 Valentina project + ** 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 . + ** + *************************************************************************/ + +#include "vlabelproperty.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "../vproperty_p.h" + +VPE::VLabelProperty::VLabelProperty(const QString &name, const QMap &settings) + : VProperty(name, QVariant::String), + typeForParent(0) +{ + VProperty::setSettings(settings); + d_ptr->VariantValue.setValue(QString()); + d_ptr->VariantValue.convert(QVariant::String); +} + +VPE::VLabelProperty::VLabelProperty(const QString &name) + : VProperty(name), + typeForParent(0) +{ + d_ptr->VariantValue.setValue(QString()); + d_ptr->VariantValue.convert(QVariant::String); +} + +QWidget *VPE::VLabelProperty::createEditor(QWidget *parent, const QStyleOptionViewItem &options, + const QAbstractItemDelegate *delegate) +{ + Q_UNUSED(options) + Q_UNUSED(delegate) + + QLabel* tmpEditor = new QLabel(parent); + tmpEditor->setLocale(parent->locale()); + tmpEditor->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + tmpEditor->setText(d_ptr->VariantValue.toString()); + + d_ptr->editor = tmpEditor; + return d_ptr->editor; +} + +QVariant VPE::VLabelProperty::getEditorData(const QWidget *editor) const +{ + const QLabel* tmpEditor = qobject_cast(editor); + if (tmpEditor) + { + return tmpEditor->text(); + } + + return QVariant(QString()); +} + +void VPE::VLabelProperty::setSetting(const QString &key, const QVariant &value) +{ + if (key == QLatin1String("TypeForParent")) + { + setTypeForParent(value.toInt()); + } +} + +QVariant VPE::VLabelProperty::getSetting(const QString &key) const +{ + if (key == QLatin1String("TypeForParent")) + { + return typeForParent; + } + else + return VProperty::getSetting(key); +} + +QStringList VPE::VLabelProperty::getSettingKeys() const +{ + QStringList settings; + settings << QStringLiteral("TypeForParent"); + return settings; +} + +QString VPE::VLabelProperty::type() const +{ + return QStringLiteral("label"); +} + +VPE::VProperty *VPE::VLabelProperty::clone(bool include_children, VPE::VProperty *container) const +{ + return VProperty::clone(include_children, container ? container : new VLabelProperty(getName(), getSettings())); +} + +void VPE::VLabelProperty::UpdateParent(const QVariant &value) +{ + emit childChanged(value, typeForParent); +} + +int VPE::VLabelProperty::getTypeForParent() const +{ + return typeForParent; +} + +void VPE::VLabelProperty::setTypeForParent(int value) +{ + typeForParent = value; +} diff --git a/src/libs/vpropertyexplorer/plugins/vlabelproperty.h b/src/libs/vpropertyexplorer/plugins/vlabelproperty.h new file mode 100644 index 000000000..ed093f433 --- /dev/null +++ b/src/libs/vpropertyexplorer/plugins/vlabelproperty.h @@ -0,0 +1,103 @@ +/************************************************************************ + ** + ** @file vlabelproperty.h + ** @author Roman Telezhynskyi + ** @date 18 3, 2017 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2017 Valentina project + ** 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 . + ** + *************************************************************************/ + +#ifndef VLABELPROPERTY_H +#define VLABELPROPERTY_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../vproperty.h" +#include "../vpropertyexplorer_global.h" + +namespace VPE +{ + + +//! Class for holding a string property +class VPROPERTYEXPLORERSHARED_EXPORT VLabelProperty : public VProperty +{ + Q_OBJECT +public: + VLabelProperty(const QString& name, const QMap& settings); + + explicit VLabelProperty(const QString& name); + + //! Returns an editor widget, or NULL if it doesn't supply one + //! \param parent The widget to which the editor will be added as a child + //! \options Render options + //! \delegate A pointer to the QAbstractItemDelegate requesting the editor. This can be used to connect signals and + //! slots. + virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& options, + const QAbstractItemDelegate* delegate) Q_DECL_OVERRIDE; + + //! Gets the data from the widget + virtual QVariant getEditorData(const QWidget* editor) const Q_DECL_OVERRIDE; + + //! Sets the settings. + virtual void setSetting(const QString& key, const QVariant& value) Q_DECL_OVERRIDE; + + //! Get the settings. This function has to be implemented in a subclass in order to have an effect + virtual QVariant getSetting(const QString& key) const Q_DECL_OVERRIDE; + + //! Returns the list of keys of the property's settings + virtual QStringList getSettingKeys() const Q_DECL_OVERRIDE; + + //! Returns a string containing the type of the property + virtual QString type() const Q_DECL_OVERRIDE; + + //! Clones this property + //! \param include_children Indicates whether to also clone the children + //! \param container If a property is being passed here, no new VProperty is being created but instead it is tried + //! to fill all the data into container. This can also be used when subclassing this function. + //! \return Returns the newly created property (or container, if it was not NULL) + virtual VProperty* clone(bool include_children = true, + VProperty* container = nullptr) const Q_DECL_OVERRIDE Q_REQUIRED_RESULT; + + virtual void UpdateParent(const QVariant &value) Q_DECL_OVERRIDE; + + int getTypeForParent() const; + void setTypeForParent(int value); + +protected: + int typeForParent; + +private: + Q_DISABLE_COPY(VLabelProperty) +}; + +} + +#endif // VLABELPROPERTY_H diff --git a/src/libs/vpropertyexplorer/vproperties.h b/src/libs/vpropertyexplorer/vproperties.h index a86299421..8b2634b33 100644 --- a/src/libs/vpropertyexplorer/vproperties.h +++ b/src/libs/vpropertyexplorer/vproperties.h @@ -36,5 +36,6 @@ #include "plugins/vstringproperty.h" #include "plugins/vwidgetproperty.h" #include "plugins/vlinecolorproperty.h" +#include "plugins/vlabelproperty.h" #endif // VPROPERTIES_H diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer.pri b/src/libs/vpropertyexplorer/vpropertyexplorer.pri index e1b509643..a2ed82098 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer.pri +++ b/src/libs/vpropertyexplorer/vpropertyexplorer.pri @@ -1,77 +1,79 @@ -# ADD TO EACH PATH $$PWD VARIABLE!!!!!! -# This need for corect working file translations.pro - -SOURCES += \ - $$PWD/vproperty.cpp \ - $$PWD/vpropertydelegate.cpp \ - $$PWD/vpropertyfactorymanager.cpp \ - $$PWD/vpropertyformview.cpp \ - $$PWD/vpropertyformwidget.cpp \ - $$PWD/vpropertymodel.cpp \ - $$PWD/vpropertyset.cpp \ - $$PWD/vpropertytreeview.cpp \ - $$PWD/vserializedproperty.cpp \ - $$PWD/plugins/vwidgetproperty.cpp \ - $$PWD/plugins/vemptyproperty.cpp \ - $$PWD/plugins/vboolproperty.cpp \ - $$PWD/plugins/vshortcutproperty.cpp \ - $$PWD/plugins/vcolorproperty.cpp \ - $$PWD/plugins/vshortcutpropertyeditor.cpp \ - $$PWD/plugins/venumproperty.cpp \ - $$PWD/plugins/vfileproperty.cpp \ - $$PWD/plugins/vcolorpropertyeditor.cpp \ - $$PWD/plugins/vfilepropertyeditor.cpp \ - $$PWD/plugins/vnumberproperty.cpp \ - $$PWD/plugins/Vector3d/vvector3dproperty.cpp \ - $$PWD/vstandardpropertyfactory.cpp \ - $$PWD/plugins/vstringproperty.cpp \ - $$PWD/plugins/vpointfproperty.cpp \ - $$PWD/plugins/vobjectproperty.cpp \ - $$PWD/plugins/vlinetypeproperty.cpp \ - $$PWD/plugins/vlinecolorproperty.cpp \ - $$PWD/checkablemessagebox.cpp - -win32-msvc*:SOURCES += $$PWD/stable.cpp - -HEADERS +=\ - $$PWD/vpropertyexplorer_global.h \ - $$PWD/vpropertyfactorymanager_p.h \ - $$PWD/vpropertytreeview_p.h \ - $$PWD/vpropertyset_p.h \ - $$PWD/vabstractpropertyfactory.h \ - $$PWD/vfileproperty_p.h \ - $$PWD/vwidgetproperty_p.h \ - $$PWD/vpropertymodel_p.h \ - $$PWD/vstandardpropertyfactory.h \ - $$PWD/vpropertyformview_p.h \ - $$PWD/vpropertytreeview.h \ - $$PWD/vpropertyformwidget_p.h \ - $$PWD/vpropertydelegate.h \ - $$PWD/vproperty_p.h \ - $$PWD/vpropertyformwidget.h \ - $$PWD/vpropertyformview.h \ - $$PWD/vpropertyset.h \ - $$PWD/vpropertymodel.h \ - $$PWD/vproperty.h \ - $$PWD/plugins/vwidgetproperty.h \ - $$PWD/plugins/vcolorproperty.h \ - $$PWD/plugins/vboolproperty.h \ - $$PWD/plugins/vcolorpropertyeditor.h \ - $$PWD/plugins/vshortcutpropertyeditor.h \ - $$PWD/plugins/vemptyproperty.h \ - $$PWD/plugins/vshortcutproperty.h \ - $$PWD/plugins/venumproperty.h \ - $$PWD/plugins/vfilepropertyeditor.h \ - $$PWD/plugins/vfileproperty.h \ - $$PWD/plugins/vnumberproperty.h \ - $$PWD/plugins/Vector3d/vvector3dproperty.h \ - $$PWD/vpropertyfactorymanager.h \ - $$PWD/vserializedproperty.h \ - $$PWD/plugins/vstringproperty.h \ - $$PWD/plugins/vpointfproperty.h \ - $$PWD/plugins/vobjectproperty.h \ - $$PWD/vproperties.h \ - $$PWD/stable.h \ - $$PWD/plugins/vlinetypeproperty.h \ - $$PWD/plugins/vlinecolorproperty.h \ - $$PWD/checkablemessagebox.h +# ADD TO EACH PATH $$PWD VARIABLE!!!!!! +# This need for corect working file translations.pro + +SOURCES += \ + $$PWD/vproperty.cpp \ + $$PWD/vpropertydelegate.cpp \ + $$PWD/vpropertyfactorymanager.cpp \ + $$PWD/vpropertyformview.cpp \ + $$PWD/vpropertyformwidget.cpp \ + $$PWD/vpropertymodel.cpp \ + $$PWD/vpropertyset.cpp \ + $$PWD/vpropertytreeview.cpp \ + $$PWD/vserializedproperty.cpp \ + $$PWD/plugins/vwidgetproperty.cpp \ + $$PWD/plugins/vemptyproperty.cpp \ + $$PWD/plugins/vboolproperty.cpp \ + $$PWD/plugins/vshortcutproperty.cpp \ + $$PWD/plugins/vcolorproperty.cpp \ + $$PWD/plugins/vshortcutpropertyeditor.cpp \ + $$PWD/plugins/venumproperty.cpp \ + $$PWD/plugins/vfileproperty.cpp \ + $$PWD/plugins/vcolorpropertyeditor.cpp \ + $$PWD/plugins/vfilepropertyeditor.cpp \ + $$PWD/plugins/vnumberproperty.cpp \ + $$PWD/plugins/Vector3d/vvector3dproperty.cpp \ + $$PWD/vstandardpropertyfactory.cpp \ + $$PWD/plugins/vstringproperty.cpp \ + $$PWD/plugins/vpointfproperty.cpp \ + $$PWD/plugins/vobjectproperty.cpp \ + $$PWD/plugins/vlinetypeproperty.cpp \ + $$PWD/plugins/vlinecolorproperty.cpp \ + $$PWD/checkablemessagebox.cpp \ + $$PWD/plugins/vlabelproperty.cpp + +win32-msvc*:SOURCES += $$PWD/stable.cpp + +HEADERS +=\ + $$PWD/vpropertyexplorer_global.h \ + $$PWD/vpropertyfactorymanager_p.h \ + $$PWD/vpropertytreeview_p.h \ + $$PWD/vpropertyset_p.h \ + $$PWD/vabstractpropertyfactory.h \ + $$PWD/vfileproperty_p.h \ + $$PWD/vwidgetproperty_p.h \ + $$PWD/vpropertymodel_p.h \ + $$PWD/vstandardpropertyfactory.h \ + $$PWD/vpropertyformview_p.h \ + $$PWD/vpropertytreeview.h \ + $$PWD/vpropertyformwidget_p.h \ + $$PWD/vpropertydelegate.h \ + $$PWD/vproperty_p.h \ + $$PWD/vpropertyformwidget.h \ + $$PWD/vpropertyformview.h \ + $$PWD/vpropertyset.h \ + $$PWD/vpropertymodel.h \ + $$PWD/vproperty.h \ + $$PWD/plugins/vwidgetproperty.h \ + $$PWD/plugins/vcolorproperty.h \ + $$PWD/plugins/vboolproperty.h \ + $$PWD/plugins/vcolorpropertyeditor.h \ + $$PWD/plugins/vshortcutpropertyeditor.h \ + $$PWD/plugins/vemptyproperty.h \ + $$PWD/plugins/vshortcutproperty.h \ + $$PWD/plugins/venumproperty.h \ + $$PWD/plugins/vfilepropertyeditor.h \ + $$PWD/plugins/vfileproperty.h \ + $$PWD/plugins/vnumberproperty.h \ + $$PWD/plugins/Vector3d/vvector3dproperty.h \ + $$PWD/vpropertyfactorymanager.h \ + $$PWD/vserializedproperty.h \ + $$PWD/plugins/vstringproperty.h \ + $$PWD/plugins/vpointfproperty.h \ + $$PWD/plugins/vobjectproperty.h \ + $$PWD/vproperties.h \ + $$PWD/stable.h \ + $$PWD/plugins/vlinetypeproperty.h \ + $$PWD/plugins/vlinecolorproperty.h \ + $$PWD/checkablemessagebox.h \ + $$PWD/plugins/vlabelproperty.h diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp index 4f3f24524..177c2907b 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp @@ -160,6 +160,12 @@ void VToolFlippingByAxis::SetAxisType(AxisType value) SaveOption(obj); } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolFlippingByAxis::OriginPointName() const +{ + return VAbstractTool::data.GetGObject(m_originPointId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- void VToolFlippingByAxis::ShowVisualization(bool show) { diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.h b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.h index 5159446e1..bc911d234 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.h +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.h @@ -55,6 +55,8 @@ public: AxisType GetAxisType() const; void SetAxisType(AxisType value); + QString OriginPointName() const; + virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE; protected: virtual void SetVisualization() Q_DECL_OVERRIDE; diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp index b1a1417e9..ed10af982 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp @@ -140,6 +140,18 @@ VToolFlippingByLine *VToolFlippingByLine::Create(const quint32 _id, quint32 firs return nullptr; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolFlippingByLine::FirstLinePointName() const +{ + return VAbstractTool::data.GetGObject(m_firstLinePointId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolFlippingByLine::SecondLinePointName() const +{ + return VAbstractTool::data.GetGObject(m_secondLinePointId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- void VToolFlippingByLine::ShowVisualization(bool show) { diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.h b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.h index 6d11c77c5..d355b1666 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.h +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.h @@ -52,6 +52,9 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::FlippingByLine)}; + QString FirstLinePointName() const; + QString SecondLinePointName() const; + virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE; protected: virtual void SetVisualization() Q_DECL_OVERRIDE; diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index 17ad34e4e..6dc19e515 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -255,6 +255,12 @@ QT_WARNING_POP return nullptr; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolRotation::OriginPointName() const +{ + return VAbstractTool::data.GetGObject(origPointId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- VFormula VToolRotation::GetFormulaAngle() const { diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.h b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.h index fe64c9bb1..8438d8660 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.h +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.h @@ -63,6 +63,8 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::Rotation)}; + QString OriginPointName() const; + VFormula GetFormulaAngle() const; void SetFormulaAngle(const VFormula &value); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp index 6214d3b4a..8b341a426 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp @@ -187,6 +187,12 @@ QString VToolArc::getTagName() const return VAbstractPattern::TagArc; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolArc::CenterPointName() const +{ + return VAbstractTool::data.GetGObject(getCenter())->name(); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolArc::getCenter() const { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h index ba774e9b7..48967761a 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h @@ -61,6 +61,8 @@ public: enum { Type = UserType + static_cast(Tool::Arc)}; virtual QString getTagName() const Q_DECL_OVERRIDE; + QString CenterPointName() const; + quint32 getCenter() const; void setCenter(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp index 142b3adde..7b6b46bf3 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp @@ -157,6 +157,12 @@ QString VToolArcWithLength::getTagName() const return VAbstractPattern::TagArc; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolArcWithLength::CenterPointName() const +{ + return VAbstractTool::data.GetGObject(getCenter())->name(); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolArcWithLength::getCenter() const { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h index 9d42098a0..b64ff94f4 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h @@ -60,6 +60,8 @@ public: enum { Type = UserType + static_cast(Tool::ArcWithLength)}; virtual QString getTagName() const Q_DECL_OVERRIDE; + QString CenterPointName() const; + quint32 getCenter() const; void setCenter(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp index ec00153cc..130aa9766 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp @@ -142,6 +142,34 @@ VToolCubicBezier *VToolCubicBezier::Create(const quint32 _id, VCubicBezier *spli return nullptr; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolCubicBezier::FirstPointName() const +{ + auto spline = VAbstractTool::data.GeometricObject(id); + return spline->GetP1().name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolCubicBezier::SecondPointName() const +{ + auto spline = VAbstractTool::data.GeometricObject(id); + return spline->GetP2().name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolCubicBezier::ThirdPointName() const +{ + auto spline = VAbstractTool::data.GeometricObject(id); + return spline->GetP3().name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolCubicBezier::ForthPointName() const +{ + auto spline = VAbstractTool::data.GeometricObject(id); + return spline->GetP4().name(); +} + //--------------------------------------------------------------------------------------------------------------------- VCubicBezier VToolCubicBezier::getSpline() const { diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h index d34a621f9..480363b81 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h @@ -58,6 +58,11 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::CubicBezier)}; + QString FirstPointName() const; + QString SecondPointName() const; + QString ThirdPointName() const; + QString ForthPointName() const; + VCubicBezier getSpline()const; void setSpline(const VCubicBezier &spl); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp index 1352c5de3..cf6b5f8c1 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp @@ -201,6 +201,11 @@ QString VToolEllipticalArc::getTagName() const return VAbstractPattern::TagElArc; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolEllipticalArc::CenterPointName() const +{ + return VAbstractTool::data.GetGObject(getCenter())->name(); +} //--------------------------------------------------------------------------------------------------------------------- quint32 VToolEllipticalArc::getCenter() const diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h index 4aeca75b1..fdec22083 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h @@ -62,6 +62,8 @@ public: enum { Type = UserType + static_cast(Tool::EllipticalArc)}; virtual QString getTagName() const Q_DECL_OVERRIDE; + QString CenterPointName() const; + quint32 getCenter() const; void setCenter(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp index b530786e1..2d34feb3a 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp @@ -211,6 +211,36 @@ void VToolTrueDarts::ShowVisualization(bool show) ShowToolVisualization(show); } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolTrueDarts::BaseLineP1Name() const +{ + return VAbstractTool::data.GetGObject(baseLineP1Id)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolTrueDarts::BaseLineP2Name() const +{ + return VAbstractTool::data.GetGObject(baseLineP2Id)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolTrueDarts::DartP1Name() const +{ + return VAbstractTool::data.GetGObject(dartP1Id)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolTrueDarts::DartP2Name() const +{ + return VAbstractTool::data.GetGObject(dartP2Id)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolTrueDarts::DartP3Name() const +{ + return VAbstractTool::data.GetGObject(dartP3Id)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolTrueDarts::GetBaseLineP1Id() const { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h index feb7f6c45..2301e0354 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h @@ -70,6 +70,12 @@ public: virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE; + QString BaseLineP1Name() const; + QString BaseLineP2Name() const; + QString DartP1Name() const; + QString DartP2Name() const; + QString DartP3Name() const; + quint32 GetBaseLineP1Id() const; void SetBaseLineP1Id(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp index 2c74ffb5e..de4638d12 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.cpp @@ -115,6 +115,12 @@ void VToolCut::SetFormula(const VFormula &value) } } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolCut::CurveName() const +{ + return VAbstractTool::data.GetGObject(curveCutId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief RefreshGeometry refresh item on scene. diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h index 684a2ca9d..e93383222 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcut.h @@ -57,6 +57,8 @@ public: VFormula GetFormula() const; void SetFormula(const VFormula &value); + QString CurveName() const; + quint32 getCurveCutId() const; void setCurveCutId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp index 2f2735fe4..2b3f1ce43 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp @@ -314,3 +314,9 @@ VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointNa data->RemoveVariable(currentLength); return point; } + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolAlongLine::SecondPointName() const +{ + return VAbstractTool::data.GetGObject(secondPointId)->name(); +} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.h index 4bb5bb7ba..c3a285aa5 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.h @@ -63,6 +63,8 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::AlongLine)}; + QString SecondPointName() const; + quint32 GetSecondPointId() const; void SetSecondPointId(const quint32 &value); virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp index 6432e2256..8c0fe719a 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp @@ -228,6 +228,18 @@ VToolBisector* VToolBisector::Create(const quint32 _id, QString &formula, const return nullptr; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolBisector::FirstPointName() const +{ + return VAbstractTool::data.GetGObject(firstPointId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolBisector::ThirdPointName() const +{ + return VAbstractTool::data.GetGObject(thirdPointId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetFactor set current scale factor of scene. diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h index a02a1f77f..950115093 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h @@ -67,6 +67,9 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::Bisector)}; + QString FirstPointName() const; + QString ThirdPointName() const; + quint32 GetFirstPointId() const; void SetFirstPointId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp index 5d4af8e18..f032c03ee 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp @@ -236,6 +236,12 @@ void VToolCurveIntersectAxis::SetFormulaAngle(const VFormula &value) } } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolCurveIntersectAxis::CurveName() const +{ + return VAbstractTool::data.GetGObject(curveId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolCurveIntersectAxis::getCurveId() const { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h index a3a36908c..60c1dd9b0 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h @@ -70,6 +70,8 @@ public: VFormula GetFormulaAngle() const; void SetFormulaAngle(const VFormula &value); + QString CurveName() const; + quint32 getCurveId() const; void setCurveId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp index c5a9d17b7..87f892aa6 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp @@ -199,6 +199,18 @@ QPointF VToolHeight::FindPoint(const QLineF &line, const QPointF &point) return VGObject::ClosestPoint(line, point); } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolHeight::FirstLinePointName() const +{ + return VAbstractTool::data.GetGObject(p1LineId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolHeight::SecondLinePointName() const +{ + return VAbstractTool::data.GetGObject(p2LineId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief contextMenuEvent handle context menu events. diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h index b217e8acd..301516524 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h @@ -64,6 +64,9 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::Height)}; + QString FirstLinePointName() const; + QString SecondLinePointName() const; + quint32 GetP1LineId() const; void SetP1LineId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp index 90fde2922..19b955c87 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp @@ -192,6 +192,18 @@ QPointF VToolLineIntersectAxis::FindPoint(const QLineF &axis, const QLineF &line } } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolLineIntersectAxis::FirstLinePoint() const +{ + return VAbstractTool::data.GetGObject(firstPointId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolLineIntersectAxis::SecondLinePoint() const +{ + return VAbstractTool::data.GetGObject(secondPointId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- VFormula VToolLineIntersectAxis::GetFormulaAngle() const { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h index ca84af02d..20d3a56be 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h @@ -68,6 +68,9 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::LineIntersectAxis)}; + QString FirstLinePoint() const; + QString SecondLinePoint() const; + VFormula GetFormulaAngle() const; void SetFormulaAngle(const VFormula &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp index 9bf80f800..d974dfc82 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.cpp @@ -222,3 +222,9 @@ void VToolLinePoint::SetFormulaLength(const VFormula &value) SaveOption(obj); } } + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolLinePoint::BasePointName() const +{ + return VAbstractTool::data.GetGObject(basePointId)->name(); +} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h index dd6e86f8d..424cfad6e 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollinepoint.h @@ -59,6 +59,8 @@ public: VFormula GetFormulaLength() const; void SetFormulaLength(const VFormula &value); + QString BasePointName() const; + quint32 GetBasePointId() const; void SetBasePointId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp index 094b4fbab..2a4d21c98 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp @@ -209,6 +209,12 @@ QPointF VToolNormal::FindPoint(const QPointF &firstPoint, const QPointF &secondP return normal.p2(); } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolNormal::SecondPointName() const +{ + return VAbstractTool::data.GetGObject(secondPointId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetFactor set current scale factor of scene. diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h index 72619fa8f..f9dc09316 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h @@ -65,6 +65,8 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::Normal)}; + QString SecondPointName() const; + quint32 GetSecondPointId() const; void SetSecondPointId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp index 67ab701a5..839da734a 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp @@ -238,6 +238,18 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu return nullptr; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolShoulderPoint::SecondPointName() const +{ + return VAbstractTool::data.GetGObject(p2Line)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolShoulderPoint::ShoulderPointName() const +{ + return VAbstractTool::data.GetGObject(pShoulder)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetFactor set current scale factor of scene. diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h index c409d6d0b..bd6d44044 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h @@ -67,6 +67,9 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::ShoulderPoint) }; + QString SecondPointName() const; + QString ShoulderPointName() const; + quint32 GetP2Line() const; void SetP2Line(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp index 08965e7b1..03430b391 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp @@ -199,6 +199,30 @@ VToolLineIntersect* VToolLineIntersect::Create(const quint32 _id, const quint32 return nullptr; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolLineIntersect::Line1P1Name() const +{ + return VAbstractTool::data.GetGObject(p1Line1)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolLineIntersect::Line1P2Name() const +{ + return VAbstractTool::data.GetGObject(p2Line1)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolLineIntersect::Line2P1Name() const +{ + return VAbstractTool::data.GetGObject(p1Line2)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolLineIntersect::Line2P2Name() const +{ + return VAbstractTool::data.GetGObject(p2Line2)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetFactor set current scale factor of scene. diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h index c97ec9624..e4fcfc60d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h @@ -62,6 +62,11 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::LineIntersect)}; + QString Line1P1Name() const; + QString Line1P2Name() const; + QString Line2P1Name() const; + QString Line2P2Name() const; + quint32 GetP1Line1() const; void SetP1Line1(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp index d88f37a2c..b66652e2b 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp @@ -214,6 +214,18 @@ QPointF VToolPointFromArcAndTangent::FindPoint(const QPointF &p, const VArc *arc return QPointF(); } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointFromArcAndTangent::TangentPointName() const +{ + return VAbstractTool::data.GetGObject(tangentPointId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointFromArcAndTangent::ArcName() const +{ + return VAbstractTool::data.GetGObject(arcId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolPointFromArcAndTangent::GetTangentPointId() const { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h index 0fa94ff4e..138dd110a 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h @@ -60,6 +60,9 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::PointFromArcAndTangent) }; + QString TangentPointName() const; + QString ArcName() const; + quint32 GetTangentPointId() const; void SetTangentPointId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp index 03d39374c..876e84a0c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp @@ -175,6 +175,18 @@ QPointF VToolPointFromCircleAndTangent::FindPoint(const QPointF &p, const QPoint } } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointFromCircleAndTangent::TangentPointName() const +{ + return VAbstractTool::data.GetGObject(tangentPointId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointFromCircleAndTangent::CircleCenterPointName() const +{ + return VAbstractTool::data.GetGObject(circleCenterId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolPointFromCircleAndTangent::GetTangentPointId() const { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h index 1617151df..7dd0ba7fd 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h @@ -62,6 +62,9 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::PointFromCircleAndTangent) }; + QString TangentPointName() const; + QString CircleCenterPointName() const; + quint32 GetTangentPointId() const; void SetTangentPointId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp index 92b483d6b..d291f999d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp @@ -250,6 +250,24 @@ VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &rad return nullptr; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointOfContact::ArcCenterPointName() const +{ + return VAbstractTool::data.GetGObject(center)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointOfContact::FirstPointName() const +{ + return VAbstractTool::data.GetGObject(firstPointId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointOfContact::SecondPointName() const +{ + return VAbstractTool::data.GetGObject(secondPointId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief SetFactor set current scale factor of scene. diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h index 45c0fb7d4..aeedcf7d4 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h @@ -67,6 +67,10 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::PointOfContact) }; + QString ArcCenterPointName() const; + QString FirstPointName() const; + QString SecondPointName() const; + VFormula getArcRadius() const; void setArcRadius(const VFormula &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp index 6a2189960..34c31d403 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp @@ -171,6 +171,18 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(const quint32 _id, co return nullptr; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointOfIntersection::FirstPointName() const +{ + return VAbstractTool::data.GetGObject(firstPointId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointOfIntersection::SecondPointName() const +{ + return VAbstractTool::data.GetGObject(secondPointId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief RemoveReferens decrement value of reference. diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h index 749091be6..0bc6c4cd2 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h @@ -61,6 +61,9 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::PointOfIntersection) }; + QString FirstPointName() const; + QString SecondPointName() const; + quint32 GetFirstPointId() const; void SetFirstPointId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp index a93da2a1f..1a578728e 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp @@ -221,6 +221,18 @@ QPointF VToolPointOfIntersectionArcs::FindPoint(const VArc *arc1, const VArc *ar return QPointF(); } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointOfIntersectionArcs::FirstArcName() const +{ + return VAbstractTool::data.GetGObject(firstArcId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointOfIntersectionArcs::SecondArcName() const +{ + return VAbstractTool::data.GetGObject(secondArcId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolPointOfIntersectionArcs::GetFirstArcId() const { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h index abbaa6879..9fd0a4ea3 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h @@ -62,6 +62,9 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::PointOfIntersectionArcs) }; + QString FirstArcName() const; + QString SecondArcName() const; + quint32 GetFirstArcId() const; void SetFirstArcId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp index 71eda82cf..7daad360a 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp @@ -187,6 +187,18 @@ QPointF VToolPointOfIntersectionCircles::FindPoint(const QPointF &c1Point, const } } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointOfIntersectionCircles::FirstCircleCenterPointName() const +{ + return VAbstractTool::data.GetGObject(firstCircleCenterId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointOfIntersectionCircles::SecondCircleCenterPointName() const +{ + return VAbstractTool::data.GetGObject(secondCircleCenterId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolPointOfIntersectionCircles::GetFirstCircleCenterId() const { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h index bfe8f524d..b019e87b6 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h @@ -66,6 +66,9 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::PointOfIntersectionCircles) }; + QString FirstCircleCenterPointName() const; + QString SecondCircleCenterPointName() const; + quint32 GetFirstCircleCenterId() const; void SetFirstCircleCenterId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp index 47758dc00..a29dad3f9 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp @@ -269,6 +269,18 @@ QPointF VToolPointOfIntersectionCurves::FindPoint(const QVector &curve1 return crossPoint; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointOfIntersectionCurves::FirstCurveName() const +{ + return VAbstractTool::data.GetGObject(firstCurveId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolPointOfIntersectionCurves::SecondCurveName() const +{ + return VAbstractTool::data.GetGObject(secondCurveId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- quint32 VToolPointOfIntersectionCurves::GetFirstCurveId() const { diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h index 9b5b986f1..aa110cd16 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h @@ -64,6 +64,9 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::PointOfIntersectionCurves) }; + QString FirstCurveName() const; + QString SecondCurveName() const; + quint32 GetFirstCurveId() const; void SetFirstCurveId(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp index 062ebda38..a756755da 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp @@ -231,6 +231,30 @@ QPointF VToolTriangle::FindPoint(const QPointF &axisP1, const QPointF &axisP2, c return QPointF(); } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolTriangle::AxisP1Name() const +{ + return VAbstractTool::data.GetGObject(axisP1Id)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolTriangle::AxisP2Name() const +{ + return VAbstractTool::data.GetGObject(axisP2Id)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolTriangle::FirstPointName() const +{ + return VAbstractTool::data.GetGObject(firstPointId)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolTriangle::SecondPointName() const +{ + return VAbstractTool::data.GetGObject(secondPointId)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief RemoveReferens decrement value of reference. diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h index a9dbcf7a0..ba5fa81c2 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h @@ -65,6 +65,11 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::Triangle)}; + QString AxisP1Name() const; + QString AxisP2Name() const; + QString FirstPointName() const; + QString SecondPointName() const; + quint32 GetAxisP1Id() const; void SetAxisP1Id(const quint32 &value); diff --git a/src/libs/vtools/tools/drawTools/vtoolline.cpp b/src/libs/vtools/tools/drawTools/vtoolline.cpp index 568952692..b19c0e293 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolline.cpp @@ -192,6 +192,18 @@ QString VToolLine::getTagName() const return VAbstractPattern::TagLine; } +//--------------------------------------------------------------------------------------------------------------------- +QString VToolLine::FirstPointName() const +{ + return VAbstractTool::data.GetGObject(firstPoint)->name(); +} + +//--------------------------------------------------------------------------------------------------------------------- +QString VToolLine::SecondPointName() const +{ + return VAbstractTool::data.GetGObject(secondPoint)->name(); +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief FullUpdateFromFile update tool data form file. diff --git a/src/libs/vtools/tools/drawTools/vtoolline.h b/src/libs/vtools/tools/drawTools/vtoolline.h index 24bd8529a..a28c9c9b9 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.h +++ b/src/libs/vtools/tools/drawTools/vtoolline.h @@ -62,6 +62,10 @@ public: virtual int type() const Q_DECL_OVERRIDE {return Type;} enum { Type = UserType + static_cast(Tool::Line)}; virtual QString getTagName() const Q_DECL_OVERRIDE; + + QString FirstPointName() const; + QString SecondPointName() const; + quint32 GetFirstPoint() const; void SetFirstPoint(const quint32 &value);