Resolved request "Tool Options should show information about parent objects".

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-03-19 17:13:02 +02:00
parent 3a630b1ce3
commit ea5010d8f7
60 changed files with 1201 additions and 120 deletions

View File

@ -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<class Tool>
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<VFormula>());
break;
case 2: // AttrBasePoint (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -909,6 +920,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolAlongLine(VPE::VProperty *proper
case 4: // AttrLength
i->SetFormulaLength(value.value<VFormula>());
break;
case 2: // AttrBasePoint (read only)
case 7: // AttrSecondPoint (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -939,6 +953,8 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArc(VPE::VProperty *property)
case 27: // AttrTypeColor
i->SetLineColor(value.toString());
break;
case 11: // AttrCenter (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -969,6 +985,8 @@ void VToolOptionsPropertyBrowser::ChangeDataToolArcWithLength(VPE::VProperty *pr
case 27: // AttrTypeColor
i->SetLineColor(value.toString());
break;
case 11: // AttrCenter (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -999,6 +1017,10 @@ void VToolOptionsPropertyBrowser::ChangeDataToolBisector(VPE::VProperty *propert
case 26: // AttrTypeLineColor
i->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 = "<<id;
break;
@ -1021,6 +1043,12 @@ void VToolOptionsPropertyBrowser::ChangeDataToolTrueDarts(VPE::VProperty *proper
case 33: // AttrName2
SetPointName2<VToolTrueDarts>(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 = "<<id;
break;
@ -1045,6 +1073,8 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutArc(VPE::VProperty *property)
case 4: // AttrLength
i->SetFormula(value.value<VFormula>());
break;
case 13: // AttrArc (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1069,6 +1099,8 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSpline(VPE::VProperty *proper
case 4: // AttrLength
i->SetFormula(value.value<VFormula>());
break;
case 46: // AttrCurve (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1093,6 +1125,8 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCutSplinePath(VPE::VProperty *pr
case 4: // AttrLength
i->SetFormula(value.value<VFormula>());
break;
case 46: // AttrCurve (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1120,6 +1154,10 @@ void VToolOptionsPropertyBrowser::ChangeDataToolHeight(VPE::VProperty *property)
case 26: // AttrTypeLineColor
i->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 = "<<id;
break;
@ -1144,6 +1182,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLine(VPE::VProperty *property)
case 26: // AttrTypeLineColor
i->SetLineColor(value.toString());
break;
case 6: // AttrFirstPoint (read only)
case 7: // AttrSecondPoint (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1163,6 +1204,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersect(VPE::VProperty *pr
case 0: // AttrName
SetPointName<VToolLineIntersect>(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 = "<<id;
break;
@ -1196,6 +1242,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolNormal(VPE::VProperty *property)
case 26: // AttrTypeLineColor
i->SetLineColor(value.toString());
break;
case 2: // AttrBasePoint (read only)
case 7: // AttrSecondPoint (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1220,6 +1269,10 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfContact(VPE::VProperty *p
case 0: // AttrName
SetPointName<VToolPointOfContact>(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 = "<<id;
break;
@ -1239,6 +1292,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersection(VPE::VProper
case 0: // AttrName
SetPointName<VToolPointOfIntersection>(value.toString());
break;
case 6: // AttrFirstPoint (read only)
case 7: // AttrSecondPoint (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1264,6 +1320,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionArcs(VPE::VPr
SetCrossCirclesPoint<VToolPointOfIntersectionArcs>(value);
break;
}
case 47: // AttrFirstArc (read only)
case 48: // AttrSecondArc (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1297,6 +1356,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCircles(VPE::
case 30: // AttrC2Radius
i->SetSecondCircleRadius(value.value<VFormula>());
break;
case 49: // AttrC1Center (read only)
case 50: // AttrC2Center (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1328,6 +1390,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointOfIntersectionCurves(VPE::V
SetHCrossCurvesPoint<VToolPointOfIntersectionCurves>(value);
break;
}
case 51: // AttrCurve1 (read only)
case 52: // AttrCurve2 (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1358,6 +1423,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromCircleAndTangent(VPE::V
SetCrossCirclesPoint<VToolPointFromCircleAndTangent>(value);
break;
}
case 53: // AttrCCenter (read only)
case 54: // AttrTangent (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1383,6 +1451,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolPointFromArcAndTangent(VPE::VPro
SetCrossCirclesPoint<VToolPointFromArcAndTangent>(value);
break;
}
case 54: // AttrTangent (read only)
case 13: // AttrArc (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1413,6 +1484,10 @@ void VToolOptionsPropertyBrowser::ChangeDataToolShoulderPoint(VPE::VProperty *pr
case 26: // AttrTypeLineColor
i->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 = "<<id;
break;
@ -1494,6 +1569,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCubicBezier(VPE::VProperty *prop
case 27: // AttrTypeColor
i->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 = "<<id;
break;
@ -1561,6 +1641,11 @@ void VToolOptionsPropertyBrowser::ChangeDataToolTriangle(VPE::VProperty *propert
case 0: // AttrName
SetPointName<VToolTriangle>(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 = "<<id;
break;
@ -1591,6 +1676,10 @@ void VToolOptionsPropertyBrowser::ChangeDataToolLineIntersectAxis(VPE::VProperty
case 5: // AttrAngle
i->SetFormulaAngle(value.value<VFormula>());
break;
case 2: // AttrBasePoint (read only)
case 6: // AttrFirstPoint (read only)
case 7: // AttrSecondPoint (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1621,6 +1710,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolCurveIntersectAxis(VPE::VPropert
case 5: // AttrAngle
i->SetFormulaAngle(value.value<VFormula>());
break;
case 2: // AttrBasePoint (read only)
case 46: // AttrCurve (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1645,6 +1737,8 @@ void VToolOptionsPropertyBrowser::ChangeDataToolRotation(VPE::VProperty *propert
case 5: // AttrAngle
i->SetFormulaAngle(value.value<VFormula>());
break;
case 11: // AttrCenter (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1691,6 +1785,9 @@ void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByLine(VPE::VProperty *p
case 38: // AttrSuffix
SetOperationSuffix<VToolFlippingByLine>(value.toString());
break;
case 6: // AttrFirstPoint
case 7: // AttrSecondPoint
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1716,6 +1813,8 @@ void VToolOptionsPropertyBrowser::ChangeDataToolFlippingByAxis(VPE::VProperty *p
case 38: // AttrSuffix
SetOperationSuffix<VToolFlippingByAxis>(value.toString());
break;
case 11: // AttrCenter (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1752,6 +1851,8 @@ void VToolOptionsPropertyBrowser::ChangeDataToolEllipticalArc(VPE::VProperty *pr
case 27://AttrColor
i->SetLineColor(value.toString());
break;
case 11: // AttrCenter (read only)
break;
default:
qWarning()<<"Unknown property type. id = "<<id;
break;
@ -1780,6 +1881,7 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolEndLine(QGraphicsItem *item)
formView->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<QString, QIcon> 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<VToolLineIntersect *>(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<VToolPointOfIntersection *>(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<int>(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<int>(i->GetVCrossPoint())-1);
idToProperty[AttrHCrossPoint]->setValue(static_cast<int>(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<int>(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<VToolTriangle *>(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<VToolFlippingByLine *>(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<VToolFlippingByAxis *>(currentItem);
idToProperty[AttrAxisType]->setValue(static_cast<int>(i->GetAxisType())-1);
idToProperty[AttrSuffix]->setValue(i->Suffix());
QVariant valueOriginPoint;
valueOriginPoint.setValue(i->OriginPointName());
idToProperty[AttrCenter]->setValue(valueOriginPoint);
}
//---------------------------------------------------------------------------------------------------------------------
@ -2717,12 +3129,16 @@ 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 */
static QStringList attr = QStringList() << AttrName /* 0 */
<< QLatin1String("position") /* 1 */
<< AttrBasePoint /* 2 */
<< AttrTypeLine /* 3 */
@ -2764,6 +3180,22 @@ QStringList VToolOptionsPropertyBrowser::PropertiesList() const
<< AttrAxisType /* 39 */
<< AttrRadius1 /* 40 */
<< AttrRadius2 /* 41 */
<< AttrRotationAngle; /* 42 */
<< 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;
}

View File

@ -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;

View File

@ -0,0 +1,132 @@
/************************************************************************
**
** @file vlabelproperty.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @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
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#include "vlabelproperty.h"
#include <QKeyEvent>
#include <QLatin1String>
#include <QLabel>
#include <QSizePolicy>
#include <QStaticStringData>
#include <QStringData>
#include <QStringDataPtr>
#include "../vproperty_p.h"
VPE::VLabelProperty::VLabelProperty(const QString &name, const QMap<QString, QVariant> &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<const QLabel*>(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;
}

View File

@ -0,0 +1,103 @@
/************************************************************************
**
** @file vlabelproperty.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @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
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/
#ifndef VLABELPROPERTY_H
#define VLABELPROPERTY_H
#include <qcompilerdetection.h>
#include <QMap>
#include <QMetaObject>
#include <QObject>
#include <QString>
#include <QStringList>
#include <QStyleOptionViewItem>
#include <QVariant>
#include <QtGlobal>
#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<QString, QVariant>& 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

View File

@ -36,5 +36,6 @@
#include "plugins/vstringproperty.h"
#include "plugins/vwidgetproperty.h"
#include "plugins/vlinecolorproperty.h"
#include "plugins/vlabelproperty.h"
#endif // VPROPERTIES_H

View File

@ -29,7 +29,8 @@ SOURCES += \
$$PWD/plugins/vobjectproperty.cpp \
$$PWD/plugins/vlinetypeproperty.cpp \
$$PWD/plugins/vlinecolorproperty.cpp \
$$PWD/checkablemessagebox.cpp
$$PWD/checkablemessagebox.cpp \
$$PWD/plugins/vlabelproperty.cpp
win32-msvc*:SOURCES += $$PWD/stable.cpp
@ -74,4 +75,5 @@ HEADERS +=\
$$PWD/stable.h \
$$PWD/plugins/vlinetypeproperty.h \
$$PWD/plugins/vlinecolorproperty.h \
$$PWD/checkablemessagebox.h
$$PWD/checkablemessagebox.h \
$$PWD/plugins/vlabelproperty.h

View File

@ -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)
{

View File

@ -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;

View File

@ -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)
{

View File

@ -52,6 +52,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::FlippingByLine)};
QString FirstLinePointName() const;
QString SecondLinePointName() const;
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
protected:
virtual void SetVisualization() Q_DECL_OVERRIDE;

View File

@ -255,6 +255,12 @@ QT_WARNING_POP
return nullptr;
}
//---------------------------------------------------------------------------------------------------------------------
QString VToolRotation::OriginPointName() const
{
return VAbstractTool::data.GetGObject(origPointId)->name();
}
//---------------------------------------------------------------------------------------------------------------------
VFormula VToolRotation::GetFormulaAngle() const
{

View File

@ -63,6 +63,8 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::Rotation)};
QString OriginPointName() const;
VFormula GetFormulaAngle() const;
void SetFormulaAngle(const VFormula &value);

View File

@ -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
{

View File

@ -61,6 +61,8 @@ public:
enum { Type = UserType + static_cast<int>(Tool::Arc)};
virtual QString getTagName() const Q_DECL_OVERRIDE;
QString CenterPointName() const;
quint32 getCenter() const;
void setCenter(const quint32 &value);

View File

@ -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
{

View File

@ -60,6 +60,8 @@ public:
enum { Type = UserType + static_cast<int>(Tool::ArcWithLength)};
virtual QString getTagName() const Q_DECL_OVERRIDE;
QString CenterPointName() const;
quint32 getCenter() const;
void setCenter(const quint32 &value);

View File

@ -142,6 +142,34 @@ VToolCubicBezier *VToolCubicBezier::Create(const quint32 _id, VCubicBezier *spli
return nullptr;
}
//---------------------------------------------------------------------------------------------------------------------
QString VToolCubicBezier::FirstPointName() const
{
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
return spline->GetP1().name();
}
//---------------------------------------------------------------------------------------------------------------------
QString VToolCubicBezier::SecondPointName() const
{
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
return spline->GetP2().name();
}
//---------------------------------------------------------------------------------------------------------------------
QString VToolCubicBezier::ThirdPointName() const
{
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
return spline->GetP3().name();
}
//---------------------------------------------------------------------------------------------------------------------
QString VToolCubicBezier::ForthPointName() const
{
auto spline = VAbstractTool::data.GeometricObject<VCubicBezier>(id);
return spline->GetP4().name();
}
//---------------------------------------------------------------------------------------------------------------------
VCubicBezier VToolCubicBezier::getSpline() const
{

View File

@ -58,6 +58,11 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::CubicBezier)};
QString FirstPointName() const;
QString SecondPointName() const;
QString ThirdPointName() const;
QString ForthPointName() const;
VCubicBezier getSpline()const;
void setSpline(const VCubicBezier &spl);

View File

@ -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

View File

@ -62,6 +62,8 @@ public:
enum { Type = UserType + static_cast<int>(Tool::EllipticalArc)};
virtual QString getTagName() const Q_DECL_OVERRIDE;
QString CenterPointName() const;
quint32 getCenter() const;
void setCenter(const quint32 &value);

View File

@ -211,6 +211,36 @@ void VToolTrueDarts::ShowVisualization(bool show)
ShowToolVisualization<VisToolTrueDarts>(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
{

View File

@ -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);

View File

@ -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.

View File

@ -57,6 +57,8 @@ public:
VFormula GetFormula() const;
void SetFormula(const VFormula &value);
QString CurveName() const;
quint32 getCurveCutId() const;
void setCurveCutId(const quint32 &value);

View File

@ -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();
}

View File

@ -63,6 +63,8 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::AlongLine)};
QString SecondPointName() const;
quint32 GetSecondPointId() const;
void SetSecondPointId(const quint32 &value);
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;

View File

@ -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.

View File

@ -67,6 +67,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::Bisector)};
QString FirstPointName() const;
QString ThirdPointName() const;
quint32 GetFirstPointId() const;
void SetFirstPointId(const quint32 &value);

View File

@ -236,6 +236,12 @@ void VToolCurveIntersectAxis::SetFormulaAngle(const VFormula &value)
}
}
//---------------------------------------------------------------------------------------------------------------------
QString VToolCurveIntersectAxis::CurveName() const
{
return VAbstractTool::data.GetGObject(curveId)->name();
}
//---------------------------------------------------------------------------------------------------------------------
quint32 VToolCurveIntersectAxis::getCurveId() const
{

View File

@ -70,6 +70,8 @@ public:
VFormula GetFormulaAngle() const;
void SetFormulaAngle(const VFormula &value);
QString CurveName() const;
quint32 getCurveId() const;
void setCurveId(const quint32 &value);

View File

@ -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.

View File

@ -64,6 +64,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::Height)};
QString FirstLinePointName() const;
QString SecondLinePointName() const;
quint32 GetP1LineId() const;
void SetP1LineId(const quint32 &value);

View File

@ -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
{

View File

@ -68,6 +68,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::LineIntersectAxis)};
QString FirstLinePoint() const;
QString SecondLinePoint() const;
VFormula GetFormulaAngle() const;
void SetFormulaAngle(const VFormula &value);

View File

@ -222,3 +222,9 @@ void VToolLinePoint::SetFormulaLength(const VFormula &value)
SaveOption(obj);
}
}
//---------------------------------------------------------------------------------------------------------------------
QString VToolLinePoint::BasePointName() const
{
return VAbstractTool::data.GetGObject(basePointId)->name();
}

View File

@ -59,6 +59,8 @@ public:
VFormula GetFormulaLength() const;
void SetFormulaLength(const VFormula &value);
QString BasePointName() const;
quint32 GetBasePointId() const;
void SetBasePointId(const quint32 &value);

View File

@ -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.

View File

@ -65,6 +65,8 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::Normal)};
QString SecondPointName() const;
quint32 GetSecondPointId() const;
void SetSecondPointId(const quint32 &value);

View File

@ -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.

View File

@ -67,6 +67,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::ShoulderPoint) };
QString SecondPointName() const;
QString ShoulderPointName() const;
quint32 GetP2Line() const;
void SetP2Line(const quint32 &value);

View File

@ -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.

View File

@ -62,6 +62,11 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::LineIntersect)};
QString Line1P1Name() const;
QString Line1P2Name() const;
QString Line2P1Name() const;
QString Line2P2Name() const;
quint32 GetP1Line1() const;
void SetP1Line1(const quint32 &value);

View File

@ -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
{

View File

@ -60,6 +60,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::PointFromArcAndTangent) };
QString TangentPointName() const;
QString ArcName() const;
quint32 GetTangentPointId() const;
void SetTangentPointId(const quint32 &value);

View File

@ -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
{

View File

@ -62,6 +62,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::PointFromCircleAndTangent) };
QString TangentPointName() const;
QString CircleCenterPointName() const;
quint32 GetTangentPointId() const;
void SetTangentPointId(const quint32 &value);

View File

@ -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.

View File

@ -67,6 +67,10 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::PointOfContact) };
QString ArcCenterPointName() const;
QString FirstPointName() const;
QString SecondPointName() const;
VFormula getArcRadius() const;
void setArcRadius(const VFormula &value);

View File

@ -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.

View File

@ -61,6 +61,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::PointOfIntersection) };
QString FirstPointName() const;
QString SecondPointName() const;
quint32 GetFirstPointId() const;
void SetFirstPointId(const quint32 &value);

View File

@ -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
{

View File

@ -62,6 +62,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::PointOfIntersectionArcs) };
QString FirstArcName() const;
QString SecondArcName() const;
quint32 GetFirstArcId() const;
void SetFirstArcId(const quint32 &value);

View File

@ -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
{

View File

@ -66,6 +66,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::PointOfIntersectionCircles) };
QString FirstCircleCenterPointName() const;
QString SecondCircleCenterPointName() const;
quint32 GetFirstCircleCenterId() const;
void SetFirstCircleCenterId(const quint32 &value);

View File

@ -269,6 +269,18 @@ QPointF VToolPointOfIntersectionCurves::FindPoint(const QVector<QPointF> &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
{

View File

@ -64,6 +64,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::PointOfIntersectionCurves) };
QString FirstCurveName() const;
QString SecondCurveName() const;
quint32 GetFirstCurveId() const;
void SetFirstCurveId(const quint32 &value);

View File

@ -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.

View File

@ -65,6 +65,11 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::Triangle)};
QString AxisP1Name() const;
QString AxisP2Name() const;
QString FirstPointName() const;
QString SecondPointName() const;
quint32 GetAxisP1Id() const;
void SetAxisP1Id(const quint32 &value);

View File

@ -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.

View File

@ -62,6 +62,10 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::Line)};
virtual QString getTagName() const Q_DECL_OVERRIDE;
QString FirstPointName() const;
QString SecondPointName() const;
quint32 GetFirstPoint() const;
void SetFirstPoint(const quint32 &value);