Setter and getter for options VToolBisector.
--HG-- branch : feature
This commit is contained in:
parent
3d3282ae61
commit
162794c70b
|
@ -37,9 +37,11 @@
|
|||
|
||||
class QString;
|
||||
|
||||
static const quint32 null_id = 0;
|
||||
|
||||
#define SceneSize 50000
|
||||
#define DefPointRadius 2.0//mm
|
||||
#define NULL_ID 0//use this value for initialization variables that keeps id values. 0 mean uknown id value.
|
||||
#define NULL_ID null_id//use this value for initialization variables that keeps id values. 0 mean uknown id value.
|
||||
|
||||
enum class SceneObject : char { Point, Line, Spline, Arc, SplinePath, Detail, Unknown };
|
||||
enum class Tool : unsigned char
|
||||
|
|
|
@ -166,10 +166,13 @@ quint32 VToolAlongLine::getSecondPointId() const
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolAlongLine::setSecondPointId(const quint32 &value)
|
||||
{
|
||||
secondPointId = value;
|
||||
if (value != NULL_ID)
|
||||
{
|
||||
secondPointId = value;
|
||||
|
||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||
SaveOption(obj);
|
||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||
SaveOption(obj);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -184,12 +184,15 @@ quint32 VToolArc::getCenter() const
|
|||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolArc::setCenter(const quint32 &value)
|
||||
{
|
||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
|
||||
if (value != NULL_ID)
|
||||
{
|
||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||
QSharedPointer<VArc> arc = qSharedPointerDynamicCast<VArc>(obj);
|
||||
|
||||
QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(value);
|
||||
arc->SetCenter(*point.data());
|
||||
SaveOption(obj);
|
||||
QSharedPointer<VPointF> point = VAbstractTool::data.GeometricObject<VPointF>(value);
|
||||
arc->SetCenter(*point.data());
|
||||
SaveOption(obj);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -309,3 +309,40 @@ void VToolBisector::SaveOptions(QDomElement &tag, QSharedPointer<VGObject> &obj)
|
|||
doc->SetAttribute(tag, AttrSecondPoint, basePointId);
|
||||
doc->SetAttribute(tag, AttrThirdPoint, thirdPointId);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VToolBisector::getThirdPointId() const
|
||||
{
|
||||
return thirdPointId;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::setThirdPointId(const quint32 &value)
|
||||
{
|
||||
if (value != NULL_ID)
|
||||
{
|
||||
thirdPointId = value;
|
||||
|
||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||
SaveOption(obj);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
quint32 VToolBisector::getFirstPointId() const
|
||||
{
|
||||
return firstPointId;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VToolBisector::setFirstPointId(const quint32 &value)
|
||||
{
|
||||
if (value != NULL_ID)
|
||||
{
|
||||
firstPointId = value;
|
||||
|
||||
QSharedPointer<VGObject> obj = VAbstractTool::data.GetGObject(id);
|
||||
SaveOption(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,6 +55,13 @@ public:
|
|||
static const QString ToolType;
|
||||
virtual int type() const {return Type;}
|
||||
enum { Type = UserType + static_cast<int>(Tool::Bisector)};
|
||||
|
||||
quint32 getFirstPointId() const;
|
||||
void setFirstPointId(const quint32 &value);
|
||||
|
||||
quint32 getThirdPointId() const;
|
||||
void setThirdPointId(const quint32 &value);
|
||||
|
||||
public slots:
|
||||
virtual void FullUpdateFromFile();
|
||||
virtual void SetFactor(qreal factor);
|
||||
|
|
Loading…
Reference in New Issue
Block a user