Use static method FindPoint common for tools.
--HG-- branch : develop
This commit is contained in:
parent
54bf459e17
commit
25190e16a9
|
@ -25,30 +25,30 @@
|
||||||
#include "vtoollinepoint.h"
|
#include "vtoollinepoint.h"
|
||||||
#include "dialogs/dialogalongline.h"
|
#include "dialogs/dialogalongline.h"
|
||||||
|
|
||||||
class VToolAlongLine : public VToolLinePoint
|
class VToolAlongLine : public VToolLinePoint{
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VToolAlongLine(VDomDocument *doc, VContainer *data, qint64 id, const QString &formula,
|
VToolAlongLine(VDomDocument *doc, VContainer *data, qint64 id, const QString &formula,
|
||||||
const qint64 &firstPointId, const qint64 &secondPointId, const QString &typeLine,
|
const qint64 &firstPointId, const qint64 &secondPointId,
|
||||||
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
const QString &typeLine, Tool::Sources typeCreation,
|
||||||
virtual void setDialog();
|
QGraphicsItem * parent = 0);
|
||||||
static void Create(QSharedPointer<DialogAlongLine> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
virtual void setDialog();
|
||||||
VContainer *data);
|
static void Create(QSharedPointer<DialogAlongLine> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
||||||
static void Create(const qint64 _id, const QString &pointName, const QString &typeLine,
|
VContainer *data);
|
||||||
const QString &formula, const qint64 &firstPointId, const qint64 &secondPointId,
|
static void Create(const qint64 _id, const QString &pointName, const QString &typeLine,
|
||||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
|
const QString &formula, const qint64 &firstPointId, const qint64 &secondPointId,
|
||||||
VContainer *data, const Document::Documents &parse, Tool::Sources typeCreation);
|
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
|
||||||
|
VContainer *data, const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
virtual void SetFactor(qreal factor);
|
virtual void SetFactor(qreal factor);
|
||||||
protected:
|
protected:
|
||||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||||
virtual void AddToFile();
|
virtual void AddToFile();
|
||||||
virtual void RemoveReferens();
|
virtual void RemoveReferens();
|
||||||
private:
|
private:
|
||||||
qint64 secondPointId;
|
qint64 secondPointId;
|
||||||
QSharedPointer<DialogAlongLine> dialogAlongLine;
|
QSharedPointer<DialogAlongLine> dialogAlongLine;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -27,31 +27,31 @@
|
||||||
|
|
||||||
class VToolBisector : public VToolLinePoint{
|
class VToolBisector : public VToolLinePoint{
|
||||||
public:
|
public:
|
||||||
VToolBisector(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VToolBisector(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const QString &typeLine, const QString &formula, const qint64 &firstPointId,
|
const QString &typeLine, const QString &formula, const qint64 &firstPointId,
|
||||||
const qint64 &secondPointId, const qint64 &thirdPointId, Tool::Sources typeCreation,
|
const qint64 &secondPointId, const qint64 &thirdPointId,
|
||||||
QGraphicsItem * parent = 0);
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint,
|
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint,
|
||||||
const QPointF &thirdPoint, const qreal& length);
|
const QPointF &thirdPoint, const qreal& length);
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static void Create(QSharedPointer<DialogBisector> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
static void Create(QSharedPointer<DialogBisector> &dialog, VMainGraphicsScene *scene,
|
||||||
VContainer *data);
|
VDomDocument *doc, VContainer *data);
|
||||||
static void Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
|
static void Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
|
||||||
const qint64 &secondPointId, const qint64 &thirdPointId, const QString &typeLine,
|
const qint64 &secondPointId, const qint64 &thirdPointId, const QString &typeLine,
|
||||||
const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
const QString &pointName, const qreal &mx, const qreal &my,
|
||||||
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
|
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
|
||||||
Tool::Sources typeCreation);
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
virtual void SetFactor(qreal factor);
|
virtual void SetFactor(qreal factor);
|
||||||
protected:
|
protected:
|
||||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||||
virtual void AddToFile();
|
virtual void AddToFile();
|
||||||
virtual void RemoveReferens();
|
virtual void RemoveReferens();
|
||||||
private:
|
private:
|
||||||
qint64 firstPointId;
|
qint64 firstPointId;
|
||||||
qint64 thirdPointId;
|
qint64 thirdPointId;
|
||||||
QSharedPointer<DialogBisector> dialogBisector;
|
QSharedPointer<DialogBisector> dialogBisector;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -28,23 +28,22 @@
|
||||||
class VToolEndLine : public VToolLinePoint{
|
class VToolEndLine : public VToolLinePoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VToolEndLine(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VToolEndLine(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
|
||||||
const QString &typeLine, const QString &formula, const qreal &angle,
|
const QString &formula, const qreal &angle, const qint64 &basePointId,
|
||||||
const qint64 &basePointId, Tool::Sources typeCreation,
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
QGraphicsItem * parent = 0);
|
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static void Create(QSharedPointer<DialogEndLine> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
static void Create(QSharedPointer<DialogEndLine> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static void Create(const qint64 _id, const QString &pointName, const QString &typeLine,
|
static void Create(const qint64 _id, const QString &pointName, const QString &typeLine,
|
||||||
const QString &formula, const qreal &angle, const qint64 &basePointId, const qreal &mx, const qreal &my,
|
const QString &formula, const qreal &angle, const qint64 &basePointId, const qreal &mx,
|
||||||
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
|
const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
|
||||||
const Document::Documents &parse, Tool::Sources typeCreation);
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
protected:
|
protected:
|
||||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||||
virtual void AddToFile();
|
virtual void AddToFile();
|
||||||
private:
|
private:
|
||||||
QSharedPointer<DialogEndLine> dialogEndLine;
|
QSharedPointer<DialogEndLine> dialogEndLine;
|
||||||
};
|
};
|
||||||
|
|
|
@ -29,31 +29,31 @@
|
||||||
class VToolLine: public VDrawTool, public QGraphicsLineItem{
|
class VToolLine: public VDrawTool, public QGraphicsLineItem{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VToolLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint,
|
VToolLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint,
|
||||||
qint64 secondPoint, Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
qint64 secondPoint, Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static void Create(QSharedPointer<DialogLine> &dialog, VMainGraphicsScene *scene,
|
static void Create(QSharedPointer<DialogLine> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
||||||
VDomDocument *doc, VContainer *data);
|
VContainer *data);
|
||||||
static void Create(const qint64 &_id, const qint64 &firstPoint, const qint64 &secondPoint,
|
static void Create(const qint64 &_id, const qint64 &firstPoint, const qint64 &secondPoint,
|
||||||
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
|
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
|
||||||
const Document::Documents &parse, Tool::Sources typeCreation);
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void ChangedActivDraw(const QString newName);
|
virtual void ChangedActivDraw(const QString newName);
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
|
virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
|
||||||
virtual void SetFactor(qreal factor);
|
virtual void SetFactor(qreal factor);
|
||||||
protected:
|
protected:
|
||||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||||
virtual void AddToFile();
|
virtual void AddToFile();
|
||||||
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
|
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
|
||||||
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
|
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
|
||||||
virtual void RemoveReferens();
|
virtual void RemoveReferens();
|
||||||
private:
|
private:
|
||||||
qint64 firstPoint;
|
qint64 firstPoint;
|
||||||
qint64 secondPoint;
|
qint64 secondPoint;
|
||||||
QSharedPointer<DialogLine> dialogLine;
|
QSharedPointer<DialogLine> dialogLine;
|
||||||
void RefreshGeometry();
|
void RefreshGeometry();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VTOOLLINE_H
|
#endif // VTOOLLINE_H
|
||||||
|
|
|
@ -25,8 +25,7 @@
|
||||||
#include "vtoollinepoint.h"
|
#include "vtoollinepoint.h"
|
||||||
#include "dialogs/dialognormal.h"
|
#include "dialogs/dialognormal.h"
|
||||||
|
|
||||||
class VToolNormal : public VToolLinePoint
|
class VToolNormal : public VToolLinePoint{
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VToolNormal(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
|
VToolNormal(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
|
||||||
|
|
|
@ -25,8 +25,7 @@
|
||||||
#include "vtoolpoint.h"
|
#include "vtoolpoint.h"
|
||||||
#include "dialogs/dialogpointofcontact.h"
|
#include "dialogs/dialogpointofcontact.h"
|
||||||
|
|
||||||
class VToolPointOfContact : public VToolPoint
|
class VToolPointOfContact : public VToolPoint{
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
VToolPointOfContact(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VToolPointOfContact(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const QString &radius, const qint64 ¢er,
|
const QString &radius, const qint64 ¢er,
|
||||||
|
|
|
@ -25,25 +25,24 @@
|
||||||
#include "dialogs/dialogsinglepoint.h"
|
#include "dialogs/dialogsinglepoint.h"
|
||||||
#include "vtoolpoint.h"
|
#include "vtoolpoint.h"
|
||||||
|
|
||||||
class VToolSinglePoint : public VToolPoint
|
class VToolSinglePoint : public VToolPoint{
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VToolSinglePoint (VDomDocument *doc, VContainer *data, qint64 id,
|
VToolSinglePoint (VDomDocument *doc, VContainer *data, qint64 id, Tool::Sources typeCreation,
|
||||||
Tool::Sources typeCreation, QGraphicsItem * parent = 0 );
|
QGraphicsItem * parent = 0 );
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
virtual void ChangedActivDraw(const QString newName);
|
virtual void ChangedActivDraw(const QString newName);
|
||||||
virtual void SetFactor(qreal factor);
|
virtual void SetFactor(qreal factor);
|
||||||
signals:
|
signals:
|
||||||
void FullUpdateTree();
|
void FullUpdateTree();
|
||||||
protected:
|
protected:
|
||||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||||
virtual void AddToFile();
|
virtual void AddToFile();
|
||||||
QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
|
QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
|
||||||
virtual void decrementReferens();
|
virtual void decrementReferens();
|
||||||
private:
|
private:
|
||||||
QSharedPointer<DialogSinglePoint> dialogSinglePoint;
|
QSharedPointer<DialogSinglePoint> dialogSinglePoint;
|
||||||
};
|
};
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include "vmodelingbisector.h"
|
#include "vmodelingbisector.h"
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
#include "../drawTools/vtoolbisector.h"
|
||||||
|
|
||||||
VModelingBisector::VModelingBisector(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VModelingBisector::VModelingBisector(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const QString &typeLine, const QString &formula, const qint64 &firstPointId,
|
const QString &typeLine, const QString &formula, const qint64 &firstPointId,
|
||||||
|
@ -36,19 +37,6 @@ VModelingBisector::VModelingBisector(VDomDocument *doc, VContainer *data, const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF VModelingBisector::FindPoint(const QPointF &firstPoint, const QPointF &secondPoint,
|
|
||||||
const QPointF &thirdPoint, const qreal &length){
|
|
||||||
QLineF line1(secondPoint, firstPoint);
|
|
||||||
QLineF line2(secondPoint, thirdPoint);
|
|
||||||
qreal angle = line1.angleTo(line2);
|
|
||||||
if(angle>180){
|
|
||||||
angle = 360 - angle;
|
|
||||||
}
|
|
||||||
line1.setAngle(line1.angle()-angle/2);
|
|
||||||
line1.setLength(length);
|
|
||||||
return line1.p2();
|
|
||||||
}
|
|
||||||
|
|
||||||
void VModelingBisector::setDialog(){
|
void VModelingBisector::setDialog(){
|
||||||
Q_ASSERT(!dialogBisector.isNull());
|
Q_ASSERT(!dialogBisector.isNull());
|
||||||
if(!dialogBisector.isNull()){
|
if(!dialogBisector.isNull()){
|
||||||
|
@ -89,7 +77,7 @@ VModelingBisector *VModelingBisector::Create(const qint64 _id, const QString &fo
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
qreal result = cal.eval(formula, &errorMsg);
|
qreal result = cal.eval(formula, &errorMsg);
|
||||||
if(errorMsg.isEmpty()){
|
if(errorMsg.isEmpty()){
|
||||||
QPointF fPoint = VModelingBisector::FindPoint(firstPoint.toQPointF(), secondPoint.toQPointF(),
|
QPointF fPoint = VToolBisector::FindPoint(firstPoint.toQPointF(), secondPoint.toQPointF(),
|
||||||
thirdPoint.toQPointF(), result*PrintDPI/25.4);
|
thirdPoint.toQPointF(), result*PrintDPI/25.4);
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if(typeCreation == Tool::FromGui){
|
if(typeCreation == Tool::FromGui){
|
||||||
|
|
|
@ -28,31 +28,29 @@
|
||||||
class VModelingBisector : public VModelingLinePoint{
|
class VModelingBisector : public VModelingLinePoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingBisector(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VModelingBisector(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const QString &typeLine, const QString &formula,
|
const QString &typeLine, const QString &formula,
|
||||||
const qint64 &firstPointId, const qint64 &secondPointId,
|
const qint64 &firstPointId, const qint64 &secondPointId,
|
||||||
const qint64 &thirdPointId, Tool::Sources typeCreation,
|
const qint64 &thirdPointId, Tool::Sources typeCreation,
|
||||||
QGraphicsItem * parent = 0);
|
QGraphicsItem * parent = 0);
|
||||||
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint,
|
virtual void setDialog();
|
||||||
const QPointF &thirdPoint, const qreal& length);
|
static VModelingBisector* Create(QSharedPointer<DialogBisector> &dialog, VDomDocument *doc,
|
||||||
virtual void setDialog();
|
VContainer *data);
|
||||||
static VModelingBisector* Create(QSharedPointer<DialogBisector> &dialog, VDomDocument *doc,
|
static VModelingBisector* Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
|
||||||
VContainer *data);
|
const qint64 &secondPointId, const qint64 &thirdPointId,
|
||||||
static VModelingBisector* Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
|
const QString &typeLine, const QString &pointName, const qreal &mx,
|
||||||
const qint64 &secondPointId, const qint64 &thirdPointId,
|
const qreal &my, VDomDocument *doc, VContainer *data,
|
||||||
const QString &typeLine, const QString &pointName, const qreal &mx,
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
const qreal &my, VDomDocument *doc, VContainer *data,
|
|
||||||
const Document::Documents &parse, Tool::Sources typeCreation);
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
protected:
|
protected:
|
||||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||||
virtual void AddToFile();
|
virtual void AddToFile();
|
||||||
virtual void RemoveReferens();
|
virtual void RemoveReferens();
|
||||||
private:
|
private:
|
||||||
qint64 firstPointId;
|
qint64 firstPointId;
|
||||||
qint64 thirdPointId;
|
qint64 thirdPointId;
|
||||||
QSharedPointer<DialogBisector> dialogBisector;
|
QSharedPointer<DialogBisector> dialogBisector;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "vmodelingheight.h"
|
#include "vmodelingheight.h"
|
||||||
|
#include "../drawTools/vtoolheight.h"
|
||||||
|
|
||||||
VModelingHeight::VModelingHeight(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VModelingHeight::VModelingHeight(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const QString &typeLine, const qint64 &basePointId, const qint64 &p1LineId,
|
const QString &typeLine, const qint64 &basePointId, const qint64 &p1LineId,
|
||||||
|
@ -44,7 +45,8 @@ VModelingHeight *VModelingHeight::Create(const qint64 _id, const QString &pointN
|
||||||
VPointF p1Line = data->GetModelingPoint(p1LineId);
|
VPointF p1Line = data->GetModelingPoint(p1LineId);
|
||||||
VPointF p2Line = data->GetModelingPoint(p2LineId);
|
VPointF p2Line = data->GetModelingPoint(p2LineId);
|
||||||
|
|
||||||
QPointF pHeight = FindPoint(QLineF(p1Line.toQPointF(), p2Line.toQPointF()), basePoint.toQPointF());
|
QPointF pHeight = VToolHeight::FindPoint(QLineF(p1Line.toQPointF(), p2Line.toQPointF()),
|
||||||
|
basePoint.toQPointF());
|
||||||
QLineF line = QLineF(basePoint.toQPointF(), pHeight);
|
QLineF line = QLineF(basePoint.toQPointF(), pHeight);
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if(typeCreation == Tool::FromGui){
|
if(typeCreation == Tool::FromGui){
|
||||||
|
@ -113,18 +115,3 @@ void VModelingHeight::AddToFile(){
|
||||||
|
|
||||||
AddToModeling(domElement);
|
AddToModeling(domElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF VModelingHeight::FindPoint(const QLineF &line, const QPointF &point){
|
|
||||||
qreal a = 0, b = 0, c = 0;
|
|
||||||
LineCoefficients(line, &a, &b, &c);
|
|
||||||
qreal x = point.x() - b;
|
|
||||||
qreal y = -a + point.y();
|
|
||||||
QLineF l (point, QPointF(x, y));
|
|
||||||
QPointF p;
|
|
||||||
QLineF::IntersectType intersect = line.intersect(l, &p);
|
|
||||||
if(intersect == QLineF::UnboundedIntersection || intersect == QLineF::BoundedIntersection){
|
|
||||||
return p;
|
|
||||||
} else {
|
|
||||||
return QPointF();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -11,14 +11,13 @@ public:
|
||||||
const QString &typeLine, const qint64 &basePointId,
|
const QString &typeLine, const qint64 &basePointId,
|
||||||
const qint64 &p1LineId, const qint64 &p2LineId,
|
const qint64 &p1LineId, const qint64 &p2LineId,
|
||||||
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static VModelingHeight* Create(QSharedPointer<DialogHeight> &dialog, VDomDocument *doc,
|
static VModelingHeight* Create(QSharedPointer<DialogHeight> &dialog, VDomDocument *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static VModelingHeight* Create(const qint64 _id, const QString &pointName, const QString &typeLine,
|
static VModelingHeight* Create(const qint64 _id, const QString &pointName, const QString &typeLine,
|
||||||
const qint64 &basePointId, const qint64 &p1LineId, const qint64 &p2LineId,
|
const qint64 &basePointId, const qint64 &p1LineId, const qint64 &p2LineId,
|
||||||
const qreal &mx, const qreal &my, VDomDocument *doc, VContainer *data,
|
const qreal &mx, const qreal &my, VDomDocument *doc, VContainer *data,
|
||||||
const Document::Documents &parse, Tool::Sources typeCreation);
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
static QPointF FindPoint(const QLineF &line, const QPointF &point);
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vmodelingnormal.h"
|
#include "vmodelingnormal.h"
|
||||||
|
#include "../drawTools/vtoolnormal.h"
|
||||||
|
|
||||||
VModelingNormal::VModelingNormal(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VModelingNormal::VModelingNormal(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const QString &typeLine,
|
const QString &typeLine,
|
||||||
|
@ -72,8 +73,8 @@ VModelingNormal *VModelingNormal::Create(const qint64 _id, const QString &formul
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
qreal result = cal.eval(formula, &errorMsg);
|
qreal result = cal.eval(formula, &errorMsg);
|
||||||
if(errorMsg.isEmpty()){
|
if(errorMsg.isEmpty()){
|
||||||
QPointF fPoint = VModelingNormal::FindPoint(firstPoint.toQPointF(), secondPoint.toQPointF(),
|
QPointF fPoint = VToolNormal::FindPoint(firstPoint.toQPointF(), secondPoint.toQPointF(),
|
||||||
result*PrintDPI/25.4, angle);
|
toPixel(result), angle);
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if(typeCreation == Tool::FromGui){
|
if(typeCreation == Tool::FromGui){
|
||||||
id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
|
@ -95,15 +96,6 @@ VModelingNormal *VModelingNormal::Create(const qint64 _id, const QString &formul
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF VModelingNormal::FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const qreal &length,
|
|
||||||
const qreal &angle){
|
|
||||||
QLineF line(firstPoint, secondPoint);
|
|
||||||
QLineF normal = line.normalVector();
|
|
||||||
normal.setAngle(normal.angle()+angle);
|
|
||||||
normal.setLength(length);
|
|
||||||
return normal.p2();
|
|
||||||
}
|
|
||||||
|
|
||||||
void VModelingNormal::FullUpdateFromFile(){
|
void VModelingNormal::FullUpdateFromFile(){
|
||||||
QDomElement domElement = doc->elementById(QString().setNum(id));
|
QDomElement domElement = doc->elementById(QString().setNum(id));
|
||||||
if(domElement.isElement()){
|
if(domElement.isElement()){
|
||||||
|
|
|
@ -28,30 +28,27 @@
|
||||||
class VModelingNormal : public VModelingLinePoint{
|
class VModelingNormal : public VModelingLinePoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingNormal(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VModelingNormal(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const QString &typeLine, const QString &formula,
|
const QString &typeLine, const QString &formula,
|
||||||
const qreal &angle, const qint64 &firstPointId,
|
const qreal &angle, const qint64 &firstPointId,
|
||||||
const qint64 &secondPointId, Tool::Sources typeCreation,
|
const qint64 &secondPointId, Tool::Sources typeCreation,
|
||||||
QGraphicsItem * parent = 0);
|
QGraphicsItem * parent = 0);
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static VModelingNormal* Create(QSharedPointer<DialogNormal> &dialog, VDomDocument *doc,
|
static VModelingNormal* Create(QSharedPointer<DialogNormal> &dialog, VDomDocument *doc, VContainer *data);
|
||||||
VContainer *data);
|
static VModelingNormal* Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
|
||||||
static VModelingNormal* Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
|
const qint64 &secondPointId, const QString typeLine,
|
||||||
const qint64 &secondPointId, const QString typeLine,
|
const QString pointName, const qreal angle, const qreal &mx,
|
||||||
const QString pointName, const qreal angle, const qreal &mx,
|
const qreal &my, VDomDocument *doc, VContainer *data,
|
||||||
const qreal &my, VDomDocument *doc, VContainer *data,
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
const Document::Documents &parse, Tool::Sources typeCreation);
|
|
||||||
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint,
|
|
||||||
const qreal &length, const qreal &angle = 0);
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
protected:
|
protected:
|
||||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||||
virtual void AddToFile();
|
virtual void AddToFile();
|
||||||
virtual void RemoveReferens();
|
virtual void RemoveReferens();
|
||||||
private:
|
private:
|
||||||
qint64 secondPointId;
|
qint64 secondPointId;
|
||||||
QSharedPointer<DialogNormal> dialogNormal;
|
QSharedPointer<DialogNormal> dialogNormal;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vmodelingpointofcontact.h"
|
#include "vmodelingpointofcontact.h"
|
||||||
|
#include "../drawTools/vtoolpointofcontact.h"
|
||||||
|
|
||||||
VModelingPointOfContact::VModelingPointOfContact(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VModelingPointOfContact::VModelingPointOfContact(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const QString &radius, const qint64 ¢er,
|
const QString &radius, const qint64 ¢er,
|
||||||
|
@ -45,28 +46,6 @@ void VModelingPointOfContact::setDialog(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF VModelingPointOfContact::FindPoint(const qreal &radius, const QPointF ¢er, const QPointF &firstPoint,
|
|
||||||
const QPointF &secondPoint){
|
|
||||||
QPointF pArc;
|
|
||||||
qreal s = 0.0, s_x, s_y, step = 0.01, distans;
|
|
||||||
while( s < 1){
|
|
||||||
s_x = secondPoint.x()-(qAbs(secondPoint.x()-firstPoint.x()))*s;
|
|
||||||
s_y = secondPoint.y()-(qAbs(secondPoint.y()-firstPoint.y()))*s;
|
|
||||||
distans = QLineF(center.x(), center.y(), s_x, s_y).length();
|
|
||||||
if(ceil(distans*10) == ceil(radius*10)){
|
|
||||||
pArc.rx() = s_x;
|
|
||||||
pArc.ry() = s_y;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(distans<radius){
|
|
||||||
pArc.rx() = s_x;
|
|
||||||
pArc.ry() = s_y;
|
|
||||||
}
|
|
||||||
s = s + step;
|
|
||||||
}
|
|
||||||
return pArc;
|
|
||||||
}
|
|
||||||
|
|
||||||
VModelingPointOfContact *VModelingPointOfContact::Create(QSharedPointer<DialogPointOfContact> &dialog,
|
VModelingPointOfContact *VModelingPointOfContact::Create(QSharedPointer<DialogPointOfContact> &dialog,
|
||||||
VDomDocument *doc, VContainer *data){
|
VDomDocument *doc, VContainer *data){
|
||||||
QString radius = dialog->getRadius();
|
QString radius = dialog->getRadius();
|
||||||
|
@ -94,8 +73,8 @@ VModelingPointOfContact *VModelingPointOfContact::Create(const qint64 _id, const
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
qreal result = cal.eval(radius, &errorMsg);
|
qreal result = cal.eval(radius, &errorMsg);
|
||||||
if(errorMsg.isEmpty()){
|
if(errorMsg.isEmpty()){
|
||||||
QPointF fPoint = VModelingPointOfContact::FindPoint(result*PrintDPI/25.4, centerP.toQPointF(),
|
QPointF fPoint = VToolPointOfContact::FindPoint(toPixel(result), centerP.toQPointF(),
|
||||||
firstP.toQPointF(), secondP.toQPointF());
|
firstP.toQPointF(), secondP.toQPointF());
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if(typeCreation == Tool::FromGui){
|
if(typeCreation == Tool::FromGui){
|
||||||
id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
|
|
|
@ -28,35 +28,32 @@
|
||||||
class VModelingPointOfContact : public VModelingPoint{
|
class VModelingPointOfContact : public VModelingPoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingPointOfContact(VDomDocument *doc, VContainer *data,
|
VModelingPointOfContact(VDomDocument *doc, VContainer *data,
|
||||||
const qint64 &id, const QString &radius,
|
const qint64 &id, const QString &radius,
|
||||||
const qint64 ¢er,
|
const qint64 ¢er, const qint64 &firstPointId,
|
||||||
const qint64 &firstPointId,
|
const qint64 &secondPointId,
|
||||||
const qint64 &secondPointId,
|
Tool::Sources typeCreation,
|
||||||
Tool::Sources typeCreation,
|
QGraphicsItem * parent = 0);
|
||||||
QGraphicsItem * parent = 0);
|
virtual void setDialog();
|
||||||
virtual void setDialog();
|
static VModelingPointOfContact* Create(QSharedPointer<DialogPointOfContact> &dialog,
|
||||||
static QPointF FindPoint(const qreal &radius, const QPointF ¢er,
|
|
||||||
const QPointF &firstPoint, const QPointF &secondPoint);
|
|
||||||
static VModelingPointOfContact* Create(QSharedPointer<DialogPointOfContact> &dialog,
|
|
||||||
VDomDocument *doc, VContainer *data);
|
VDomDocument *doc, VContainer *data);
|
||||||
static VModelingPointOfContact* Create(const qint64 _id, const QString &radius, const qint64 ¢er,
|
static VModelingPointOfContact* Create(const qint64 _id, const QString &radius, const qint64 ¢er,
|
||||||
const qint64 &firstPointId, const qint64 &secondPointId,
|
const qint64 &firstPointId, const qint64 &secondPointId,
|
||||||
const QString &pointName, const qreal &mx, const qreal &my,
|
const QString &pointName, const qreal &mx, const qreal &my,
|
||||||
VDomDocument *doc, VContainer *data,
|
VDomDocument *doc, VContainer *data,
|
||||||
const Document::Documents &parse, Tool::Sources typeCreation);
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
protected:
|
protected:
|
||||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||||
virtual void AddToFile();
|
virtual void AddToFile();
|
||||||
virtual void RemoveReferens();
|
virtual void RemoveReferens();
|
||||||
private:
|
private:
|
||||||
QString radius;
|
QString radius;
|
||||||
qint64 center;
|
qint64 center;
|
||||||
qint64 firstPointId;
|
qint64 firstPointId;
|
||||||
qint64 secondPointId;
|
qint64 secondPointId;
|
||||||
QSharedPointer<DialogPointOfContact> dialogPointOfContact;
|
QSharedPointer<DialogPointOfContact> dialogPointOfContact;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
#include "vmodelingshoulderpoint.h"
|
#include "vmodelingshoulderpoint.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include "../drawTools/vtoolshoulderpoint.h"
|
||||||
|
|
||||||
VModelingShoulderPoint::VModelingShoulderPoint(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VModelingShoulderPoint::VModelingShoulderPoint(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const QString &typeLine, const QString &formula, const qint64 &p1Line,
|
const QString &typeLine, const QString &formula, const qint64 &p1Line,
|
||||||
|
@ -48,27 +49,6 @@ void VModelingShoulderPoint::setDialog(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF VModelingShoulderPoint::FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder,
|
|
||||||
const qreal &length){
|
|
||||||
QLineF line = QLineF(p1Line, p2Line);
|
|
||||||
qreal dist = line.length();
|
|
||||||
if(dist>length){
|
|
||||||
qDebug()<<"A3П2="<<length/PrintDPI*25.4<<"А30П ="<<dist/PrintDPI*25.4;
|
|
||||||
throw"Не можу знайти точку плеча. Довжина А3П2 < А3П.";
|
|
||||||
}
|
|
||||||
if(dist==length){
|
|
||||||
return line.p2();
|
|
||||||
}
|
|
||||||
qreal step = 0.01;
|
|
||||||
while(1){
|
|
||||||
line.setLength(line.length()+step);
|
|
||||||
QLineF line2 = QLineF(pShoulder, line.p2());
|
|
||||||
if(line2.length()>=length){
|
|
||||||
return line.p2();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VModelingShoulderPoint *VModelingShoulderPoint::Create(QSharedPointer<DialogShoulderPoint> &dialog,
|
VModelingShoulderPoint *VModelingShoulderPoint::Create(QSharedPointer<DialogShoulderPoint> &dialog,
|
||||||
VDomDocument *doc, VContainer *data){
|
VDomDocument *doc, VContainer *data){
|
||||||
QString formula = dialog->getFormula();
|
QString formula = dialog->getFormula();
|
||||||
|
@ -97,8 +77,8 @@ VModelingShoulderPoint *VModelingShoulderPoint::Create(const qint64 _id, const Q
|
||||||
QString errorMsg;
|
QString errorMsg;
|
||||||
qreal result = cal.eval(formula, &errorMsg);
|
qreal result = cal.eval(formula, &errorMsg);
|
||||||
if(errorMsg.isEmpty()){
|
if(errorMsg.isEmpty()){
|
||||||
QPointF fPoint = VModelingShoulderPoint::FindPoint(firstPoint.toQPointF(), secondPoint.toQPointF(),
|
QPointF fPoint = VToolShoulderPoint::FindPoint(firstPoint.toQPointF(), secondPoint.toQPointF(),
|
||||||
shoulderPoint.toQPointF(), result*PrintDPI/25.4);
|
shoulderPoint.toQPointF(), toPixel(result));
|
||||||
qint64 id = _id;
|
qint64 id = _id;
|
||||||
if(typeCreation == Tool::FromGui){
|
if(typeCreation == Tool::FromGui){
|
||||||
id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my));
|
||||||
|
|
|
@ -28,33 +28,30 @@
|
||||||
class VModelingShoulderPoint : public VModelingLinePoint{
|
class VModelingShoulderPoint : public VModelingLinePoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingShoulderPoint(VDomDocument *doc, VContainer *data,
|
VModelingShoulderPoint(VDomDocument *doc, VContainer *data,
|
||||||
const qint64 &id, const QString &typeLine,
|
const qint64 &id, const QString &typeLine,
|
||||||
const QString &formula, const qint64 &p1Line,
|
const QString &formula, const qint64 &p1Line,
|
||||||
const qint64 &p2Line, const qint64 &pShoulder,
|
const qint64 &p2Line, const qint64 &pShoulder,
|
||||||
Tool::Sources typeCreation,
|
Tool::Sources typeCreation,
|
||||||
QGraphicsItem * parent = 0);
|
QGraphicsItem * parent = 0);
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static QPointF FindPoint(const QPointF &p1Line, const QPointF &p2Line,
|
static VModelingShoulderPoint* Create(QSharedPointer<DialogShoulderPoint> &dialog, VDomDocument *doc,
|
||||||
const QPointF &pShoulder, const qreal &length);
|
VContainer *data);
|
||||||
static VModelingShoulderPoint* Create(QSharedPointer<DialogShoulderPoint> &dialog,
|
static VModelingShoulderPoint* Create(const qint64 _id, const QString &formula, const qint64 &p1Line,
|
||||||
VDomDocument *doc, VContainer *data);
|
const qint64 &p2Line, const qint64 &pShoulder,
|
||||||
static VModelingShoulderPoint* Create(const qint64 _id, const QString &formula, const qint64 &p1Line,
|
const QString &typeLine, const QString &pointName, const qreal &mx,
|
||||||
const qint64 &p2Line, const qint64 &pShoulder,
|
const qreal &my, VDomDocument *doc, VContainer *data,
|
||||||
const QString &typeLine, const QString &pointName,
|
const Document::Documents &parse, const Tool::Sources &typeCreation);
|
||||||
const qreal &mx, const qreal &my, VDomDocument *doc,
|
|
||||||
VContainer *data, const Document::Documents &parse,
|
|
||||||
const Tool::Sources &typeCreation);
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
protected:
|
protected:
|
||||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||||
virtual void AddToFile();
|
virtual void AddToFile();
|
||||||
virtual void RemoveReferens();
|
virtual void RemoveReferens();
|
||||||
private:
|
private:
|
||||||
qint64 p2Line;
|
qint64 p2Line;
|
||||||
qint64 pShoulder;
|
qint64 pShoulder;
|
||||||
QSharedPointer<DialogShoulderPoint> dialogShoulderPoint;
|
QSharedPointer<DialogShoulderPoint> dialogShoulderPoint;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -30,40 +30,38 @@
|
||||||
class VModelingSplinePath:public VModelingTool, public QGraphicsPathItem{
|
class VModelingSplinePath:public VModelingTool, public QGraphicsPathItem{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingSplinePath(VDomDocument *doc, VContainer *data, qint64 id,
|
VModelingSplinePath(VDomDocument *doc, VContainer *data, qint64 id,
|
||||||
Tool::Sources typeCreation,
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
QGraphicsItem * parent = 0);
|
virtual void setDialog();
|
||||||
virtual void setDialog();
|
static VModelingSplinePath* Create(QSharedPointer<DialogSplinePath> &dialog, VDomDocument *doc,
|
||||||
static VModelingSplinePath* Create(QSharedPointer<DialogSplinePath> &dialog,
|
VContainer *data);
|
||||||
VDomDocument *doc, VContainer *data);
|
static VModelingSplinePath* Create(const qint64 _id, const VSplinePath &path, VDomDocument *doc,
|
||||||
static VModelingSplinePath* Create(const qint64 _id, const VSplinePath &path, VDomDocument *doc,
|
VContainer *data, const Document::Documents &parse,
|
||||||
VContainer *data, const Document::Documents &parse,
|
Tool::Sources typeCreation);
|
||||||
Tool::Sources typeCreation);
|
|
||||||
signals:
|
signals:
|
||||||
void RefreshLine(const qint32 &indexSpline, SplinePoint::Position pos,
|
void RefreshLine(const qint32 &indexSpline, SplinePoint::Position pos,
|
||||||
const QPointF &controlPoint, const QPointF &splinePoint);
|
const QPointF &controlPoint, const QPointF &splinePoint);
|
||||||
void setEnabledPoint(bool enable);
|
void setEnabledPoint(bool enable);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
void ControlPointChangePosition(const qint32 &indexSpline,
|
void ControlPointChangePosition(const qint32 &indexSpline,
|
||||||
SplinePoint::Position position,
|
SplinePoint::Position position, const QPointF pos);
|
||||||
const QPointF pos);
|
|
||||||
protected:
|
protected:
|
||||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||||
virtual void AddToFile();
|
virtual void AddToFile();
|
||||||
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
|
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
|
||||||
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
|
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
|
||||||
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
|
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
|
||||||
virtual void RemoveReferens();
|
virtual void RemoveReferens();
|
||||||
private:
|
private:
|
||||||
QSharedPointer<DialogSplinePath> dialogSplinePath;
|
QSharedPointer<DialogSplinePath> dialogSplinePath;
|
||||||
QVector<VControlPointSpline *> controlPoints;
|
QVector<VControlPointSpline *> controlPoints;
|
||||||
void RefreshGeometry();
|
void RefreshGeometry();
|
||||||
void AddPathPoint(QDomElement &domElement, const VSplinePoint &splPoint);
|
void AddPathPoint(QDomElement &domElement, const VSplinePoint &splPoint);
|
||||||
void UpdatePathPoint(QDomNode& node, VSplinePath &path);
|
void UpdatePathPoint(QDomNode& node, VSplinePath &path);
|
||||||
void CorectControlPoints(const VSpline &spl, VSplinePath &splPath,
|
void CorectControlPoints(const VSpline &spl, VSplinePath &splPath,
|
||||||
const qint32 &indexSpline);
|
const qint32 &indexSpline);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // VMODELINGSPLINEPATH_H
|
#endif // VMODELINGSPLINEPATH_H
|
||||||
|
|
|
@ -51,6 +51,11 @@ protected:
|
||||||
QAction *actionRemove = 0;
|
QAction *actionRemove = 0;
|
||||||
if(showRemove){
|
if(showRemove){
|
||||||
actionRemove = menu.addAction(tr("Delete"));
|
actionRemove = menu.addAction(tr("Delete"));
|
||||||
|
if(_referens > 1){
|
||||||
|
actionRemove->setEnabled(false);
|
||||||
|
} else {
|
||||||
|
actionRemove->setEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
QAction *selectedAction = menu.exec(event->screenPos());
|
QAction *selectedAction = menu.exec(event->screenPos());
|
||||||
if(selectedAction == actionOption){
|
if(selectedAction == actionOption){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user