Added ShowOptionsToolEllipticalArc method.

--HG--
branch : feature
This commit is contained in:
Valentina Zhuravska 2016-12-17 03:57:01 +02:00
parent a8a3487996
commit 947f4eb97c
3 changed files with 34 additions and 5 deletions

View file

@ -77,7 +77,7 @@ void VToolOptionsPropertyBrowser::ClearPropertyBrowser()
void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item)
{
// This check helps to find missed tools in the switch
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 48, "Not all tools was used in switch.");
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was used in switch.");
switch (item->type())
{
@ -196,6 +196,9 @@ void VToolOptionsPropertyBrowser::ShowItemOptions(QGraphicsItem *item)
case VToolMove::Type:
ShowOptionsToolMove(item);
break;
case VToolEllipticalArc::Type:
ShowOptionsToolEllipticalArc(item);
break;
default:
break;
}
@ -210,7 +213,7 @@ void VToolOptionsPropertyBrowser::UpdateOptions()
}
// This check helps to find missed tools in the switch
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 48, "Not all tools was used in switch.");
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was used in switch.");
switch (currentItem->type())
{
@ -354,7 +357,7 @@ void VToolOptionsPropertyBrowser::userChangedData(VProperty *property)
}
// This check helps to find missed tools in the switch
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 48, "Not all tools was used in switch.");
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was used in switch.");
switch (currentItem->type())
{
@ -2148,6 +2151,21 @@ void VToolOptionsPropertyBrowser::ShowOptionsToolFlippingByAxis(QGraphicsItem *i
AddPropertyOperationSuffix(i, tr("Suffix"));
}
//---------------------------------------------------------------------------------------------------------------------
void VToolOptionsPropertyBrowser::ShowOptionsToolEllipticalArc(QGraphicsItem *item)
{
VToolEllipticalArc *i = qgraphicsitem_cast<VToolEllipticalArc *>(item);
i->ShowVisualization(true);
formView->setTitle(tr("Elliptical arc"));
AddPropertyFormula(tr("Radius"), i->GetFormulaRadius1(), AttrRadius1);
AddPropertyFormula(tr("Radius"), i->GetFormulaRadius2(), AttrRadius2);
AddPropertyFormula(tr("First angle"), i->GetFormulaF1(), AttrAngle1);
AddPropertyFormula(tr("Second angle"), i->GetFormulaF2(), AttrAngle2);
AddPropertyFormula(tr("Rotation angle"), i->GetFormulaRotationAngle(), AttrRotationAngle);
AddPropertyLineColor(i, tr("Color"), VAbstractTool::ColorsList(), AttrColor);
}
//---------------------------------------------------------------------------------------------------------------------
void VToolOptionsPropertyBrowser::UpdateOptionsToolSinglePoint()
{
@ -2680,6 +2698,9 @@ QStringList VToolOptionsPropertyBrowser::PropertiesList() const
<< AttrLength1 /* 36 */
<< AttrLength2 /* 37 */
<< AttrSuffix /* 38 */
<< AttrAxisType; /* 39 */
<< AttrAxisType /* 39 */
<< AttrRadius1 /* 40 */
<< AttrRadius2 /* 41 */
<< AttrRotationAngle; /* 42 */
return attr;
}

View file

@ -195,6 +195,7 @@ private:
void ShowOptionsToolMove(QGraphicsItem *item);
void ShowOptionsToolFlippingByLine(QGraphicsItem *item);
void ShowOptionsToolFlippingByAxis(QGraphicsItem *item);
void ShowOptionsToolEllipticalArc(QGraphicsItem *item);
void UpdateOptionsToolSinglePoint();
void UpdateOptionsToolEndLine();

View file

@ -29,6 +29,7 @@
#include "dialoghistory.h"
#include "ui_dialoghistory.h"
#include "../vgeometry/varc.h"
#include "../vgeometry/vellipticalarc.h"
#include "../vgeometry/vcubicbezier.h"
#include "../vgeometry/vsplinepath.h"
#include "../vgeometry/vcubicbezierpath.h"
@ -208,7 +209,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default")
QString DialogHistory::Record(const VToolRecord &tool)
{
// This check helps to find missed tools in the switch
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 48, "Not all tools was used in history.");
Q_STATIC_ASSERT_X(static_cast<int>(Tool::LAST_ONE_DO_NOT_USE) == 49, "Not all tools was used in history.");
const QDomElement domElem = doc->elementById(tool.getId());
if (domElem.isElement() == false)
@ -378,6 +379,12 @@ QString DialogHistory::Record(const VToolRecord &tool)
.arg(PointName(AttrUInt(domElem, AttrDartP1)))
.arg(PointName(AttrUInt(domElem, AttrDartP2)))
.arg(PointName(AttrUInt(domElem, AttrDartP2)));
case Tool::EllipticalArc:
{
const QSharedPointer<VEllipticalArc> elArc = data->GeometricObject<VEllipticalArc>(tool.getId());
SCASSERT(elArc != nullptr);
return elArc->NameForHistory(tr("Elliptical arc"));
}
//Because "history" not only show history of pattern, but help restore current data for each pattern's
//piece, we need add record about details and nodes, but don't show them.
case Tool::Detail: