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

File diff suppressed because it is too large Load Diff

View File

@ -125,6 +125,8 @@ private:
const QString &id); const QString &id);
void AddPropertyFormula(const QString &propertyName, const VFormula &formula, const QString &attrName); 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; 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/vstringproperty.h"
#include "plugins/vwidgetproperty.h" #include "plugins/vwidgetproperty.h"
#include "plugins/vlinecolorproperty.h" #include "plugins/vlinecolorproperty.h"
#include "plugins/vlabelproperty.h"
#endif // VPROPERTIES_H #endif // VPROPERTIES_H

View File

@ -29,7 +29,8 @@ SOURCES += \
$$PWD/plugins/vobjectproperty.cpp \ $$PWD/plugins/vobjectproperty.cpp \
$$PWD/plugins/vlinetypeproperty.cpp \ $$PWD/plugins/vlinetypeproperty.cpp \
$$PWD/plugins/vlinecolorproperty.cpp \ $$PWD/plugins/vlinecolorproperty.cpp \
$$PWD/checkablemessagebox.cpp $$PWD/checkablemessagebox.cpp \
$$PWD/plugins/vlabelproperty.cpp
win32-msvc*:SOURCES += $$PWD/stable.cpp win32-msvc*:SOURCES += $$PWD/stable.cpp
@ -74,4 +75,5 @@ HEADERS +=\
$$PWD/stable.h \ $$PWD/stable.h \
$$PWD/plugins/vlinetypeproperty.h \ $$PWD/plugins/vlinetypeproperty.h \
$$PWD/plugins/vlinecolorproperty.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); SaveOption(obj);
} }
//---------------------------------------------------------------------------------------------------------------------
QString VToolFlippingByAxis::OriginPointName() const
{
return VAbstractTool::data.GetGObject(m_originPointId)->name();
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VToolFlippingByAxis::ShowVisualization(bool show) void VToolFlippingByAxis::ShowVisualization(bool show)
{ {

View File

@ -55,6 +55,8 @@ public:
AxisType GetAxisType() const; AxisType GetAxisType() const;
void SetAxisType(AxisType value); void SetAxisType(AxisType value);
QString OriginPointName() const;
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE; virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE;
protected: protected:
virtual void SetVisualization() Q_DECL_OVERRIDE; virtual void SetVisualization() Q_DECL_OVERRIDE;

View File

@ -140,6 +140,18 @@ VToolFlippingByLine *VToolFlippingByLine::Create(const quint32 _id, quint32 firs
return nullptr; 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) void VToolFlippingByLine::ShowVisualization(bool show)
{ {

View File

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

View File

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

View File

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

View File

@ -187,6 +187,12 @@ QString VToolArc::getTagName() const
return VAbstractPattern::TagArc; return VAbstractPattern::TagArc;
} }
//---------------------------------------------------------------------------------------------------------------------
QString VToolArc::CenterPointName() const
{
return VAbstractTool::data.GetGObject(getCenter())->name();
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
quint32 VToolArc::getCenter() const quint32 VToolArc::getCenter() const
{ {

View File

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

View File

@ -157,6 +157,12 @@ QString VToolArcWithLength::getTagName() const
return VAbstractPattern::TagArc; return VAbstractPattern::TagArc;
} }
//---------------------------------------------------------------------------------------------------------------------
QString VToolArcWithLength::CenterPointName() const
{
return VAbstractTool::data.GetGObject(getCenter())->name();
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
quint32 VToolArcWithLength::getCenter() const quint32 VToolArcWithLength::getCenter() const
{ {

View File

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

View File

@ -142,6 +142,34 @@ VToolCubicBezier *VToolCubicBezier::Create(const quint32 _id, VCubicBezier *spli
return nullptr; 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 VCubicBezier VToolCubicBezier::getSpline() const
{ {

View File

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

View File

@ -201,6 +201,11 @@ QString VToolEllipticalArc::getTagName() const
return VAbstractPattern::TagElArc; return VAbstractPattern::TagElArc;
} }
//---------------------------------------------------------------------------------------------------------------------
QString VToolEllipticalArc::CenterPointName() const
{
return VAbstractTool::data.GetGObject(getCenter())->name();
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
quint32 VToolEllipticalArc::getCenter() const quint32 VToolEllipticalArc::getCenter() const

View File

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

View File

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

View File

@ -70,6 +70,12 @@ public:
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE; 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; quint32 GetBaseLineP1Id() const;
void SetBaseLineP1Id(const quint32 &value); 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. * @brief RefreshGeometry refresh item on scene.

View File

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

View File

@ -314,3 +314,9 @@ VToolAlongLine* VToolAlongLine::Create(const quint32 _id, const QString &pointNa
data->RemoveVariable(currentLength); data->RemoveVariable(currentLength);
return point; 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;} virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Tool::AlongLine)}; enum { Type = UserType + static_cast<int>(Tool::AlongLine)};
QString SecondPointName() const;
quint32 GetSecondPointId() const; quint32 GetSecondPointId() const;
void SetSecondPointId(const quint32 &value); void SetSecondPointId(const quint32 &value);
virtual void ShowVisualization(bool show) Q_DECL_OVERRIDE; 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; 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. * @brief SetFactor set current scale factor of scene.

View File

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

View File

@ -70,6 +70,8 @@ public:
VFormula GetFormulaAngle() const; VFormula GetFormulaAngle() const;
void SetFormulaAngle(const VFormula &value); void SetFormulaAngle(const VFormula &value);
QString CurveName() const;
quint32 getCurveId() const; quint32 getCurveId() const;
void setCurveId(const quint32 &value); 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); 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. * @brief contextMenuEvent handle context menu events.

View File

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

View File

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

View File

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

View File

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

View File

@ -209,6 +209,12 @@ QPointF VToolNormal::FindPoint(const QPointF &firstPoint, const QPointF &secondP
return normal.p2(); return normal.p2();
} }
//---------------------------------------------------------------------------------------------------------------------
QString VToolNormal::SecondPointName() const
{
return VAbstractTool::data.GetGObject(secondPointId)->name();
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
* @brief SetFactor set current scale factor of scene. * @brief SetFactor set current scale factor of scene.

View File

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

View File

@ -238,6 +238,18 @@ VToolShoulderPoint* VToolShoulderPoint::Create(const quint32 _id, QString &formu
return nullptr; 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. * @brief SetFactor set current scale factor of scene.

View File

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

View File

@ -199,6 +199,30 @@ VToolLineIntersect* VToolLineIntersect::Create(const quint32 _id, const quint32
return nullptr; 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. * @brief SetFactor set current scale factor of scene.

View File

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

View File

@ -214,6 +214,18 @@ QPointF VToolPointFromArcAndTangent::FindPoint(const QPointF &p, const VArc *arc
return QPointF(); 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 quint32 VToolPointFromArcAndTangent::GetTangentPointId() const
{ {

View File

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

View File

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

View File

@ -250,6 +250,24 @@ VToolPointOfContact* VToolPointOfContact::Create(const quint32 _id, QString &rad
return nullptr; 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. * @brief SetFactor set current scale factor of scene.

View File

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

View File

@ -171,6 +171,18 @@ VToolPointOfIntersection *VToolPointOfIntersection::Create(const quint32 _id, co
return nullptr; 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. * @brief RemoveReferens decrement value of reference.

View File

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

View File

@ -221,6 +221,18 @@ QPointF VToolPointOfIntersectionArcs::FindPoint(const VArc *arc1, const VArc *ar
return QPointF(); 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 quint32 VToolPointOfIntersectionArcs::GetFirstArcId() const
{ {

View File

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

View File

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

View File

@ -269,6 +269,18 @@ QPointF VToolPointOfIntersectionCurves::FindPoint(const QVector<QPointF> &curve1
return crossPoint; 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 quint32 VToolPointOfIntersectionCurves::GetFirstCurveId() const
{ {

View File

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

View File

@ -231,6 +231,30 @@ QPointF VToolTriangle::FindPoint(const QPointF &axisP1, const QPointF &axisP2, c
return QPointF(); 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. * @brief RemoveReferens decrement value of reference.

View File

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

View File

@ -192,6 +192,18 @@ QString VToolLine::getTagName() const
return VAbstractPattern::TagLine; 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. * @brief FullUpdateFromFile update tool data form file.

View File

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