Refactoring.
--HG-- branch : develop
This commit is contained in:
parent
61be0a0a93
commit
50cd9a7f20
|
@ -21,16 +21,7 @@
|
||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include <QLabel>
|
|
||||||
#include <QSpinBox>
|
|
||||||
#include <QScrollBar>
|
|
||||||
#include <QShowEvent>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QInputDialog>
|
|
||||||
#include <QFileDialog>
|
|
||||||
#include <QDebug>
|
|
||||||
#include "geometry/vspline.h"
|
#include "geometry/vspline.h"
|
||||||
#include <QMessageBox>
|
|
||||||
#include "exception/vexceptionobjecterror.h"
|
#include "exception/vexceptionobjecterror.h"
|
||||||
#include "exception/vexceptionconversionerror.h"
|
#include "exception/vexceptionconversionerror.h"
|
||||||
#include "exception/vexceptionemptyparameter.h"
|
#include "exception/vexceptionemptyparameter.h"
|
||||||
|
|
|
@ -23,19 +23,14 @@
|
||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QLabel>
|
|
||||||
#include <QtXml>
|
|
||||||
#include <QComboBox>
|
|
||||||
#include <QSharedPointer>
|
|
||||||
#include <QToolButton>
|
|
||||||
#include "widgets/vmaingraphicsscene.h"
|
#include "widgets/vmaingraphicsscene.h"
|
||||||
#include "widgets/vmaingraphicsview.h"
|
#include "widgets/vmaingraphicsview.h"
|
||||||
#include "widgets/vitem.h"
|
#include "widgets/vitem.h"
|
||||||
#include "dialogs/dialogs.h"
|
#include "dialogs/dialogs.h"
|
||||||
|
#include "tools/vtooldetail.h"
|
||||||
#include "tools/drawTools/drawtools.h"
|
#include "tools/drawTools/drawtools.h"
|
||||||
#include "tools/modelingTools/modelingtools.h"
|
#include "tools/modelingTools/modelingtools.h"
|
||||||
#include "xml/vdomdocument.h"
|
#include "xml/vdomdocument.h"
|
||||||
#include "tools/vtooldetail.h"
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
|
|
|
@ -21,12 +21,8 @@
|
||||||
|
|
||||||
#include "tablewindow.h"
|
#include "tablewindow.h"
|
||||||
#include "ui_tablewindow.h"
|
#include "ui_tablewindow.h"
|
||||||
#include <QCloseEvent>
|
|
||||||
#include <QDesktopWidget>
|
|
||||||
#include "widgets/vtablegraphicsview.h"
|
#include "widgets/vtablegraphicsview.h"
|
||||||
#include <QFileDialog>
|
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
#include <QtSvg/QtSvg>
|
|
||||||
|
|
||||||
TableWindow::TableWindow(QWidget *parent) :
|
TableWindow::TableWindow(QWidget *parent) :
|
||||||
QMainWindow(parent), numberDetal(0), colission(0), ui(new Ui::TableWindow),
|
QMainWindow(parent), numberDetal(0), colission(0), ui(new Ui::TableWindow),
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#define TABLEWINDOW_H
|
#define TABLEWINDOW_H
|
||||||
|
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QLabel>
|
|
||||||
#include "widgets/vitem.h"
|
#include "widgets/vitem.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vdrawtool.h"
|
#include "vdrawtool.h"
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
qreal VDrawTool::factor = 1;
|
qreal VDrawTool::factor = 1;
|
||||||
|
|
||||||
|
@ -32,12 +31,6 @@ VDrawTool::VDrawTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *pa
|
||||||
connect(this->doc, &VDomDocument::ShowTool, this, &VDrawTool::ShowTool);
|
connect(this->doc, &VDomDocument::ShowTool, this, &VDrawTool::ShowTool);
|
||||||
}
|
}
|
||||||
|
|
||||||
VDrawTool::~VDrawTool(){
|
|
||||||
}
|
|
||||||
|
|
||||||
void VDrawTool::setDialog(){
|
|
||||||
}
|
|
||||||
|
|
||||||
void VDrawTool::AddRecord(const qint64 id, Tool::Tools toolType, VDomDocument *doc){
|
void VDrawTool::AddRecord(const qint64 id, Tool::Tools toolType, VDomDocument *doc){
|
||||||
qint64 cursor = doc->getCursor();
|
qint64 cursor = doc->getCursor();
|
||||||
QVector<VToolRecord> *history = doc->getHistory();
|
QVector<VToolRecord> *history = doc->getHistory();
|
||||||
|
@ -56,10 +49,6 @@ void VDrawTool::AddRecord(const qint64 id, Tool::Tools toolType, VDomDocument *d
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VDrawTool::ignoreContextMenu(bool enable){
|
|
||||||
ignoreContextMenuEvent = enable;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VDrawTool::ShowTool(qint64 id, Qt::GlobalColor color, bool enable){
|
void VDrawTool::ShowTool(qint64 id, Qt::GlobalColor color, bool enable){
|
||||||
Q_UNUSED(id);
|
Q_UNUSED(id);
|
||||||
Q_UNUSED(color);
|
Q_UNUSED(color);
|
||||||
|
|
|
@ -23,16 +23,15 @@
|
||||||
#define VDRAWTOOL_H
|
#define VDRAWTOOL_H
|
||||||
|
|
||||||
#include "../vabstracttool.h"
|
#include "../vabstracttool.h"
|
||||||
#include <QMenu>
|
|
||||||
|
|
||||||
class VDrawTool : public VAbstractTool{
|
class VDrawTool : public VAbstractTool{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VDrawTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent = 0);
|
VDrawTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent = 0);
|
||||||
virtual ~VDrawTool();
|
virtual ~VDrawTool() {}
|
||||||
virtual void setDialog();
|
virtual void setDialog() {}
|
||||||
static void AddRecord(const qint64 id, Tool::Tools toolType, VDomDocument *doc);
|
static void AddRecord(const qint64 id, Tool::Tools toolType, VDomDocument *doc);
|
||||||
void ignoreContextMenu(bool enable);
|
void ignoreContextMenu(bool enable) {ignoreContextMenuEvent = enable;}
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
|
virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
|
||||||
virtual void ChangedActivDraw(const QString newName);
|
virtual void ChangedActivDraw(const QString newName);
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vtoolalongline.h"
|
#include "vtoolalongline.h"
|
||||||
#include <QDialog>
|
|
||||||
#include <QDebug>
|
|
||||||
#include "container/calculator.h"
|
#include "container/calculator.h"
|
||||||
|
|
||||||
VToolAlongLine::VToolAlongLine(VDomDocument *doc, VContainer *data, qint64 id, const QString &formula,
|
VToolAlongLine::VToolAlongLine(VDomDocument *doc, VContainer *data, qint64 id, const QString &formula,
|
||||||
|
|
|
@ -29,16 +29,15 @@ 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 qint64 &firstPointId, const qint64 &secondPointId, const QString &typeLine,
|
||||||
const QString &typeLine, Tool::Sources typeCreation,
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
QGraphicsItem * parent = 0);
|
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static void Create(QSharedPointer<DialogAlongLine> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
static void Create(QSharedPointer<DialogAlongLine> &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 QString &formula, const qint64 &firstPointId, const qint64 &secondPointId,
|
const qint64 &firstPointId, const qint64 &secondPointId, const qreal &mx, const qreal &my,
|
||||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
|
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
|
||||||
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);
|
||||||
|
|
|
@ -27,20 +27,19 @@
|
||||||
|
|
||||||
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 &typeLine, const QString &formula, const qint64 &firstPointId,
|
const QString &formula, const qint64 &firstPointId, const qint64 &secondPointId,
|
||||||
const qint64 &secondPointId, const qint64 &thirdPointId,
|
const qint64 &thirdPointId, Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint,
|
||||||
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint,
|
const qreal& length);
|
||||||
const QPointF &thirdPoint, const qreal& length);
|
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static void Create(QSharedPointer<DialogBisector> &dialog, VMainGraphicsScene *scene,
|
static void Create(QSharedPointer<DialogBisector> &dialog, VMainGraphicsScene *scene,
|
||||||
VDomDocument *doc, 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,
|
const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||||
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
|
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
|
||||||
const Document::Documents &parse, Tool::Sources typeCreation);
|
Tool::Sources typeCreation);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vtoolendline.h"
|
#include "vtoolendline.h"
|
||||||
#include <QDebug>
|
|
||||||
#include <QMenu>
|
|
||||||
#include "widgets/vmaingraphicsscene.h"
|
#include "widgets/vmaingraphicsscene.h"
|
||||||
#include <container/calculator.h>
|
#include <container/calculator.h>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
|
|
||||||
#include "vtoollinepoint.h"
|
#include "vtoollinepoint.h"
|
||||||
#include "dialogs/dialogheight.h"
|
#include "dialogs/dialogheight.h"
|
||||||
#include <QLineF>
|
|
||||||
|
|
||||||
class VToolHeight: public VToolLinePoint{
|
class VToolHeight: public VToolLinePoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vtoolline.h"
|
#include "vtoolline.h"
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
VToolLine::VToolLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint, qint64 secondPoint,
|
VToolLine::VToolLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint, qint64 secondPoint,
|
||||||
Tool::Sources typeCreation, QGraphicsItem *parent):VDrawTool(doc, data, id),
|
Tool::Sources typeCreation, QGraphicsItem *parent):VDrawTool(doc, data, id),
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vtoollineintersect.h"
|
#include "vtoollineintersect.h"
|
||||||
#include <QMenu>
|
|
||||||
|
|
||||||
VToolLineIntersect::VToolLineIntersect(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VToolLineIntersect::VToolLineIntersect(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const qint64 &p1Line1, const qint64 &p2Line1, const qint64 &p1Line2,
|
const qint64 &p1Line1, const qint64 &p2Line1, const qint64 &p1Line2,
|
||||||
|
|
|
@ -28,17 +28,16 @@
|
||||||
class VToolLineIntersect:public VToolPoint{
|
class VToolLineIntersect:public VToolPoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VToolLineIntersect(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VToolLineIntersect(VDomDocument *doc, VContainer *data, const qint64 &id, const qint64 &p1Line1,
|
||||||
const qint64 &p1Line1, const qint64 &p2Line1, const qint64 &p1Line2,
|
const qint64 &p2Line1, const qint64 &p1Line2, const qint64 &p2Line2,
|
||||||
const qint64 &p2Line2, Tool::Sources typeCreation,
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
QGraphicsItem * parent = 0);
|
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static void Create(QSharedPointer<DialogLineIntersect> &dialog, VMainGraphicsScene *scene,
|
static void Create(QSharedPointer<DialogLineIntersect> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
||||||
VDomDocument *doc, VContainer *data);
|
VContainer *data);
|
||||||
static void Create(const qint64 _id, const qint64 &p1Line1Id, const qint64 &p2Line1Id,
|
static void Create(const qint64 _id, const qint64 &p1Line1Id, const qint64 &p2Line1Id, const qint64 &p1Line2Id,
|
||||||
const qint64 &p1Line2Id, const qint64 &p2Line2Id, const QString &pointName,
|
const qint64 &p2Line2Id, const QString &pointName, const qreal &mx, const qreal &my,
|
||||||
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
|
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
|
||||||
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);
|
||||||
|
|
|
@ -64,10 +64,6 @@ void VToolLinePoint::RefreshGeometry(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolLinePoint::RemoveReferens(){
|
|
||||||
doc->DecrementReferens(basePointId);
|
|
||||||
}
|
|
||||||
|
|
||||||
void VToolLinePoint::SetFactor(qreal factor){
|
void VToolLinePoint::SetFactor(qreal factor){
|
||||||
VDrawTool::SetFactor(factor);
|
VDrawTool::SetFactor(factor);
|
||||||
RefreshGeometry();
|
RefreshGeometry();
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
class VToolLinePoint : public VToolPoint{
|
class VToolLinePoint : public VToolPoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VToolLinePoint(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VToolLinePoint(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
|
||||||
const QString &typeLine, const QString &formula,
|
const QString &formula, const qint64 &basePointId, const qreal &angle,
|
||||||
const qint64 &basePointId, const qreal &angle, QGraphicsItem * parent = 0);
|
QGraphicsItem * parent = 0);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void ChangedActivDraw(const QString newName);
|
virtual void ChangedActivDraw(const QString newName);
|
||||||
virtual void SetFactor(qreal factor);
|
virtual void SetFactor(qreal factor);
|
||||||
|
@ -40,7 +40,7 @@ protected:
|
||||||
qint64 basePointId;
|
qint64 basePointId;
|
||||||
QGraphicsLineItem *mainLine;
|
QGraphicsLineItem *mainLine;
|
||||||
virtual void RefreshGeometry();
|
virtual void RefreshGeometry();
|
||||||
virtual void RemoveReferens();
|
virtual void RemoveReferens() {doc->DecrementReferens(basePointId);}
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VToolLinePoint)
|
Q_DISABLE_COPY(VToolLinePoint)
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,8 +30,7 @@ class VToolNormal : public VToolLinePoint{
|
||||||
public:
|
public:
|
||||||
VToolNormal(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
|
VToolNormal(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
|
||||||
const QString &formula, const qreal &angle, const qint64 &firstPointId,
|
const QString &formula, 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 void Create(QSharedPointer<DialogNormal> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
static void Create(QSharedPointer<DialogNormal> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
|
|
|
@ -20,11 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vtoolpoint.h"
|
#include "vtoolpoint.h"
|
||||||
#include <QPen>
|
|
||||||
#include <QBrush>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QGraphicsItem>
|
|
||||||
|
|
||||||
|
|
||||||
VToolPoint::VToolPoint(VDomDocument *doc, VContainer *data, qint64 id,
|
VToolPoint::VToolPoint(VDomDocument *doc, VContainer *data, qint64 id,
|
||||||
QGraphicsItem *parent):VDrawTool(doc, data, id),
|
QGraphicsItem *parent):VDrawTool(doc, data, id),
|
||||||
|
@ -151,6 +146,3 @@ void VToolPoint::RefreshLine(){
|
||||||
lineName->setVisible(true);
|
lineName->setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VToolPoint::~VToolPoint(){
|
|
||||||
}
|
|
||||||
|
|
|
@ -28,9 +28,8 @@
|
||||||
class VToolPoint: public VDrawTool, public QGraphicsEllipseItem{
|
class VToolPoint: public VDrawTool, public QGraphicsEllipseItem{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VToolPoint(VDomDocument *doc, VContainer *data, qint64 id,
|
VToolPoint(VDomDocument *doc, VContainer *data, qint64 id, QGraphicsItem * parent = 0);
|
||||||
QGraphicsItem * parent = 0);
|
virtual ~VToolPoint(){}
|
||||||
virtual ~VToolPoint();
|
|
||||||
public slots:
|
public slots:
|
||||||
void NameChangePosition(const QPointF pos);
|
void NameChangePosition(const QPointF pos);
|
||||||
virtual void ChangedActivDraw(const QString newName);
|
virtual void ChangedActivDraw(const QString newName);
|
||||||
|
|
|
@ -7,15 +7,16 @@
|
||||||
class VToolPointOfIntersection : public VToolPoint{
|
class VToolPointOfIntersection : public VToolPoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VToolPointOfIntersection(VDomDocument *doc, VContainer *data, const qint64 &id, const qint64 &firstPointId,
|
VToolPointOfIntersection(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const qint64 &secondPointId, Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
const qint64 &firstPointId, const qint64 &secondPointId,
|
||||||
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static void Create(QSharedPointer<DialogPointOfIntersection> &dialog, VMainGraphicsScene *scene,
|
static void Create(QSharedPointer<DialogPointOfIntersection> &dialog, VMainGraphicsScene *scene,
|
||||||
VDomDocument *doc, VContainer *data);
|
VDomDocument *doc, VContainer *data);
|
||||||
static void Create(const qint64 _id, const QString &pointName, const qint64 &firstPointId,
|
static void Create(const qint64 _id, const QString &pointName, const qint64 &firstPointId,
|
||||||
const qint64 &secondPointId, const qreal &mx, const qreal &my,
|
const qint64 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
|
||||||
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
|
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
|
||||||
const Document::Documents &parse, Tool::Sources typeCreation);
|
Tool::Sources typeCreation);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
|
|
|
@ -33,7 +33,6 @@ VToolShoulderPoint::VToolShoulderPoint(VDomDocument *doc, VContainer *data, cons
|
||||||
if(typeCreation == Tool::FromGui){
|
if(typeCreation == Tool::FromGui){
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolShoulderPoint::setDialog(){
|
void VToolShoulderPoint::setDialog(){
|
||||||
|
|
|
@ -27,19 +27,17 @@
|
||||||
|
|
||||||
class VToolShoulderPoint : public VToolLinePoint{
|
class VToolShoulderPoint : public VToolLinePoint{
|
||||||
public:
|
public:
|
||||||
VToolShoulderPoint(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VToolShoulderPoint(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
|
||||||
const QString &typeLine, const QString &formula, const qint64 &p1Line,
|
const QString &formula, const qint64 &p1Line, const qint64 &p2Line,
|
||||||
const qint64 &p2Line, const qint64 &pShoulder,
|
const qint64 &pShoulder, Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static QPointF FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder,
|
static QPointF FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder,
|
||||||
const qreal &length);
|
const qreal &length);
|
||||||
static void Create(QSharedPointer<DialogShoulderPoint> &dialog, VMainGraphicsScene *scene,
|
static void Create(QSharedPointer<DialogShoulderPoint> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
||||||
VDomDocument *doc, VContainer *data);
|
VContainer *data);
|
||||||
static void Create(const qint64 _id, const QString &formula, const qint64 &p1Line,
|
static void Create(const qint64 _id, const QString &formula, const qint64 &p1Line, const qint64 &p2Line,
|
||||||
const qint64 &p2Line, const qint64 &pShoulder, const QString &typeLine,
|
const qint64 &pShoulder, const QString &typeLine, const QString &pointName, const qreal &mx,
|
||||||
const QString &pointName, const qreal &mx, const qreal &my,
|
const qreal &my, 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();
|
||||||
|
|
|
@ -20,11 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vtoolsinglepoint.h"
|
#include "vtoolsinglepoint.h"
|
||||||
#include <QPen>
|
|
||||||
#include <QBrush>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QGraphicsItem>
|
|
||||||
#include <QGraphicsSceneContextMenuEvent>
|
|
||||||
|
|
||||||
VToolSinglePoint::VToolSinglePoint (VDomDocument *doc, VContainer *data, qint64 id, Tool::Sources typeCreation,
|
VToolSinglePoint::VToolSinglePoint (VDomDocument *doc, VContainer *data, qint64 id, Tool::Sources typeCreation,
|
||||||
QGraphicsItem * parent ):VToolPoint(doc, data, id, parent),
|
QGraphicsItem * parent ):VToolPoint(doc, data, id, parent),
|
||||||
|
|
|
@ -41,8 +41,8 @@ public:
|
||||||
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);
|
||||||
signals:
|
signals:
|
||||||
void RefreshLine ( const qint32 &indexSpline, SplinePoint::Position position,
|
void RefreshLine ( const qint32 &indexSpline, SplinePoint::Position position, const QPointF &controlPoint,
|
||||||
const QPointF &controlPoint, const QPointF &splinePoint );
|
const QPointF &splinePoint );
|
||||||
void setEnabledPoint ( bool enable );
|
void setEnabledPoint ( bool enable );
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile ();
|
virtual void FullUpdateFromFile ();
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vtoolsplinepath.h"
|
#include "vtoolsplinepath.h"
|
||||||
#include <QMenu>
|
|
||||||
|
|
||||||
VToolSplinePath::VToolSplinePath(VDomDocument *doc, VContainer *data, qint64 id,
|
VToolSplinePath::VToolSplinePath(VDomDocument *doc, VContainer *data, qint64 id,
|
||||||
Tool::Sources typeCreation,
|
Tool::Sources typeCreation,
|
||||||
|
|
|
@ -13,9 +13,8 @@ public:
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static void Create(QSharedPointer<DialogTriangle> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
static void Create(QSharedPointer<DialogTriangle> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static void Create(const qint64 _id, const QString &pointName,
|
static void Create(const qint64 _id, const QString &pointName, const qint64 &axisP1Id, const qint64 &axisP2Id,
|
||||||
const qint64 &axisP1Id, const qint64 &axisP2Id, const qint64 &firstPointId,
|
const qint64 &firstPointId, const qint64 &secondPointId, const qreal &mx, const qreal &my,
|
||||||
const qint64 &secondPointId, const qreal &mx, const qreal &my,
|
|
||||||
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);
|
||||||
static QPointF FindPoint(const QPointF axisP1, const QPointF axisP2, const QPointF firstPoint,
|
static QPointF FindPoint(const QPointF axisP1, const QPointF axisP2, const QPointF firstPoint,
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vmodelingalongline.h"
|
#include "vmodelingalongline.h"
|
||||||
#include <QDialog>
|
|
||||||
#include <QDebug>
|
|
||||||
#include "container/calculator.h"
|
#include "container/calculator.h"
|
||||||
|
|
||||||
VModelingAlongLine::VModelingAlongLine(VDomDocument *doc, VContainer *data, qint64 id,
|
VModelingAlongLine::VModelingAlongLine(VDomDocument *doc, VContainer *data, qint64 id,
|
||||||
|
|
|
@ -33,12 +33,10 @@ public:
|
||||||
const qint64 &secondPointId, const QString &typeLine,
|
const qint64 &secondPointId, const QString &typeLine,
|
||||||
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static VModelingAlongLine* Create(QSharedPointer<DialogAlongLine> &dialog, VDomDocument *doc,
|
static VModelingAlongLine* Create(QSharedPointer<DialogAlongLine> &dialog, VDomDocument *doc, VContainer *data);
|
||||||
VContainer *data);
|
|
||||||
static VModelingAlongLine* Create(const qint64 _id, const QString &pointName, const QString &typeLine,
|
static VModelingAlongLine* Create(const qint64 _id, const QString &pointName, const QString &typeLine,
|
||||||
const QString &formula, const qint64 &firstPointId,
|
const QString &formula, const qint64 &firstPointId, const qint64 &secondPointId,
|
||||||
const qint64 &secondPointId, const qreal &mx, const qreal &my,
|
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();
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vmodelingarc.h"
|
#include "vmodelingarc.h"
|
||||||
#include <QMenu>
|
|
||||||
#include "container/calculator.h"
|
#include "container/calculator.h"
|
||||||
|
|
||||||
VModelingArc::VModelingArc(VDomDocument *doc, VContainer *data, qint64 id, Tool::Sources typeCreation,
|
VModelingArc::VModelingArc(VDomDocument *doc, VContainer *data, qint64 id, Tool::Sources typeCreation,
|
||||||
|
|
|
@ -30,12 +30,12 @@
|
||||||
class VModelingArc :public VModelingTool, public QGraphicsPathItem{
|
class VModelingArc :public VModelingTool, public QGraphicsPathItem{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingArc(VDomDocument *doc, VContainer *data, qint64 id,
|
VModelingArc(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 VModelingArc* Create(QSharedPointer<DialogArc> &dialog, VDomDocument *doc, VContainer *data);
|
static VModelingArc* Create(QSharedPointer<DialogArc> &dialog, VDomDocument *doc, VContainer *data);
|
||||||
static VModelingArc* Create(const qint64 _id, const qint64 ¢er, const QString &radius,
|
static VModelingArc* Create(const qint64 _id, const qint64 ¢er, const QString &radius, const QString &f1,
|
||||||
const QString &f1, const QString &f2, VDomDocument *doc, VContainer *data,
|
const QString &f2, 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();
|
||||||
|
|
|
@ -34,13 +34,11 @@ public:
|
||||||
const qint64 &thirdPointId, Tool::Sources typeCreation,
|
const qint64 &thirdPointId, Tool::Sources typeCreation,
|
||||||
QGraphicsItem * parent = 0);
|
QGraphicsItem * parent = 0);
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static VModelingBisector* Create(QSharedPointer<DialogBisector> &dialog, VDomDocument *doc,
|
static VModelingBisector* Create(QSharedPointer<DialogBisector> &dialog, VDomDocument *doc, VContainer *data);
|
||||||
VContainer *data);
|
|
||||||
static VModelingBisector* Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
|
static VModelingBisector* Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
|
||||||
const qint64 &secondPointId, const qint64 &thirdPointId,
|
const qint64 &secondPointId, const qint64 &thirdPointId, const QString &typeLine,
|
||||||
const QString &typeLine, const QString &pointName, const qreal &mx,
|
const QString &pointName, const qreal &mx, const qreal &my, VDomDocument *doc,
|
||||||
const qreal &my, VDomDocument *doc, VContainer *data,
|
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);
|
||||||
|
|
|
@ -29,13 +29,11 @@ class VModelingEndLine : public VModelingLinePoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingEndLine(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VModelingEndLine(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const QString &typeLine, const QString &formula,
|
const QString &typeLine, const QString &formula, const qreal &angle,
|
||||||
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 VModelingEndLine* Create(QSharedPointer<DialogEndLine> &dialog, VDomDocument *doc,
|
static VModelingEndLine* Create(QSharedPointer<DialogEndLine> &dialog, VDomDocument *doc, VContainer *data);
|
||||||
VContainer *data);
|
|
||||||
static VModelingEndLine* Create(const qint64 _id, const QString &pointName, const QString &typeLine,
|
static VModelingEndLine* Create(const qint64 _id, const QString &pointName, const QString &typeLine,
|
||||||
const QString &formula, const qreal &angle, const qint64 &basePointId,
|
const QString &formula, const qreal &angle, const qint64 &basePointId,
|
||||||
const qreal &mx, const qreal &my, VDomDocument *doc, VContainer *data,
|
const qreal &mx, const qreal &my, VDomDocument *doc, VContainer *data,
|
||||||
|
|
|
@ -8,12 +8,11 @@ class VModelingHeight : public VModelingLinePoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingHeight(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VModelingHeight(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const QString &typeLine, const qint64 &basePointId,
|
const QString &typeLine, const qint64 &basePointId, const qint64 &p1LineId,
|
||||||
const qint64 &p1LineId, const qint64 &p2LineId,
|
const qint64 &p2LineId, Tool::Sources typeCreation,
|
||||||
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
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,
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vmodelingline.h"
|
#include "vmodelingline.h"
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
VModelingLine::VModelingLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint,
|
VModelingLine::VModelingLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint,
|
||||||
qint64 secondPoint, Tool::Sources typeCreation, QGraphicsItem *parent):
|
qint64 secondPoint, Tool::Sources typeCreation, QGraphicsItem *parent):
|
||||||
|
|
|
@ -30,8 +30,7 @@ class VModelingLine: public VModelingTool, public QGraphicsLineItem{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint,
|
VModelingLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint,
|
||||||
qint64 secondPoint, Tool::Sources typeCreation,
|
qint64 secondPoint, Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
QGraphicsItem * parent = 0);
|
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static VModelingLine* Create(QSharedPointer<DialogLine> &dialog, VDomDocument *doc, VContainer *data);
|
static VModelingLine* Create(QSharedPointer<DialogLine> &dialog, VDomDocument *doc, VContainer *data);
|
||||||
static VModelingLine* Create(const qint64 &_id, const qint64 &firstPoint, const qint64 &secondPoint,
|
static VModelingLine* Create(const qint64 &_id, const qint64 &firstPoint, const qint64 &secondPoint,
|
||||||
|
|
|
@ -28,21 +28,17 @@
|
||||||
class VModelingLineIntersect:public VModelingPoint{
|
class VModelingLineIntersect:public VModelingPoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingLineIntersect(VDomDocument *doc, VContainer *data,
|
VModelingLineIntersect(VDomDocument *doc, VContainer *data, const qint64 &id,
|
||||||
const qint64 &id, const qint64 &p1Line1,
|
const qint64 &p1Line1, const qint64 &p2Line1,
|
||||||
const qint64 &p2Line1, const qint64 &p1Line2,
|
const qint64 &p1Line2, const qint64 &p2Line2,
|
||||||
const qint64 &p2Line2,
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
Tool::Sources typeCreation,
|
|
||||||
QGraphicsItem * parent = 0);
|
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static VModelingLineIntersect* Create(QSharedPointer<DialogLineIntersect> &dialog,
|
static VModelingLineIntersect* Create(QSharedPointer<DialogLineIntersect> &dialog, VDomDocument *doc,
|
||||||
VDomDocument *doc,VContainer *data);
|
VContainer *data);
|
||||||
static VModelingLineIntersect* Create(const qint64 _id, const qint64 &p1Line1Id,
|
static VModelingLineIntersect* Create(const qint64 _id, const qint64 &p1Line1Id, const qint64 &p2Line1Id,
|
||||||
const qint64 &p2Line1Id, const qint64 &p1Line2Id,
|
const qint64 &p1Line2Id, const qint64 &p2Line2Id, const QString &pointName,
|
||||||
const qint64 &p2Line2Id, const QString &pointName,
|
const qreal &mx, const qreal &my, VDomDocument *doc, VContainer *data,
|
||||||
const qreal &mx, const qreal &my, VDomDocument *doc,
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
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);
|
||||||
|
|
|
@ -50,7 +50,3 @@ void VModelingLinePoint::RefreshGeometry(){
|
||||||
mainLine->setVisible(true);
|
mainLine->setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VModelingLinePoint::RemoveReferens(){
|
|
||||||
doc->DecrementReferens(basePointId);
|
|
||||||
}
|
|
||||||
|
|
|
@ -27,9 +27,8 @@
|
||||||
class VModelingLinePoint : public VModelingPoint{
|
class VModelingLinePoint : public VModelingPoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingLinePoint(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VModelingLinePoint(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
|
||||||
const QString &typeLine, const QString &formula,
|
const QString &formula, const qint64 &basePointId, const qreal &angle,
|
||||||
const qint64 &basePointId, const qreal &angle,
|
|
||||||
QGraphicsItem * parent = 0);
|
QGraphicsItem * parent = 0);
|
||||||
protected:
|
protected:
|
||||||
QString typeLine;
|
QString typeLine;
|
||||||
|
@ -38,7 +37,7 @@ protected:
|
||||||
qint64 basePointId;
|
qint64 basePointId;
|
||||||
QGraphicsLineItem *mainLine;
|
QGraphicsLineItem *mainLine;
|
||||||
virtual void RefreshGeometry();
|
virtual void RefreshGeometry();
|
||||||
virtual void RemoveReferens();
|
virtual void RemoveReferens() {doc->DecrementReferens(basePointId);}
|
||||||
private:
|
private:
|
||||||
Q_DISABLE_COPY(VModelingLinePoint)
|
Q_DISABLE_COPY(VModelingLinePoint)
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,7 +33,6 @@ VModelingNormal::VModelingNormal(VDomDocument *doc, VContainer *data, const qint
|
||||||
if(typeCreation == Tool::FromGui){
|
if(typeCreation == Tool::FromGui){
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VModelingNormal::setDialog(){
|
void VModelingNormal::setDialog(){
|
||||||
|
|
|
@ -29,17 +29,15 @@ 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 qreal &angle, 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 VModelingNormal* Create(QSharedPointer<DialogNormal> &dialog, VDomDocument *doc, VContainer *data);
|
static VModelingNormal* Create(QSharedPointer<DialogNormal> &dialog, VDomDocument *doc, 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 QString pointName, const qreal angle, const qreal &mx,
|
const qreal angle, const qreal &mx, const qreal &my, VDomDocument *doc,
|
||||||
const qreal &my, VDomDocument *doc, VContainer *data,
|
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);
|
||||||
|
|
|
@ -20,10 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vmodelingpoint.h"
|
#include "vmodelingpoint.h"
|
||||||
#include <QPen>
|
|
||||||
#include <QBrush>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <QGraphicsItem>
|
|
||||||
#include "container/vpointf.h"
|
#include "container/vpointf.h"
|
||||||
|
|
||||||
VModelingPoint::VModelingPoint(VDomDocument *doc, VContainer *data, qint64 id,
|
VModelingPoint::VModelingPoint(VDomDocument *doc, VContainer *data, qint64 id,
|
||||||
|
@ -102,6 +98,3 @@ void VModelingPoint::RefreshLine(){
|
||||||
lineName->setVisible(true);
|
lineName->setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VModelingPoint::~VModelingPoint(){
|
|
||||||
}
|
|
||||||
|
|
|
@ -28,9 +28,8 @@
|
||||||
class VModelingPoint: public VModelingTool, public QGraphicsEllipseItem{
|
class VModelingPoint: public VModelingTool, public QGraphicsEllipseItem{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingPoint(VDomDocument *doc, VContainer *data, qint64 id,
|
VModelingPoint(VDomDocument *doc, VContainer *data, qint64 id, QGraphicsItem * parent = 0);
|
||||||
QGraphicsItem * parent = 0);
|
virtual ~VModelingPoint() {}
|
||||||
virtual ~VModelingPoint();
|
|
||||||
public slots:
|
public slots:
|
||||||
void NameChangePosition(const QPointF pos);
|
void NameChangePosition(const QPointF pos);
|
||||||
virtual void FullUpdateFromGui(int result) = 0;
|
virtual void FullUpdateFromGui(int result) = 0;
|
||||||
|
|
|
@ -28,15 +28,13 @@
|
||||||
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 qint64 &id, const QString &radius,
|
const QString &radius, const qint64 ¢er,
|
||||||
const qint64 ¢er, const qint64 &firstPointId,
|
const qint64 &firstPointId, const qint64 &secondPointId,
|
||||||
const qint64 &secondPointId,
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
Tool::Sources typeCreation,
|
|
||||||
QGraphicsItem * parent = 0);
|
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static VModelingPointOfContact* Create(QSharedPointer<DialogPointOfContact> &dialog,
|
static VModelingPointOfContact* Create(QSharedPointer<DialogPointOfContact> &dialog, VDomDocument *doc,
|
||||||
VDomDocument *doc, VContainer *data);
|
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,
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vmodelingshoulderpoint.h"
|
#include "vmodelingshoulderpoint.h"
|
||||||
#include <QDebug>
|
|
||||||
#include "../drawTools/vtoolshoulderpoint.h"
|
#include "../drawTools/vtoolshoulderpoint.h"
|
||||||
#include <container/calculator.h>
|
#include <container/calculator.h>
|
||||||
|
|
||||||
|
@ -34,7 +33,6 @@ VModelingShoulderPoint::VModelingShoulderPoint(VDomDocument *doc, VContainer *da
|
||||||
if(typeCreation == Tool::FromGui){
|
if(typeCreation == Tool::FromGui){
|
||||||
AddToFile();
|
AddToFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VModelingShoulderPoint::setDialog(){
|
void VModelingShoulderPoint::setDialog(){
|
||||||
|
|
|
@ -28,20 +28,18 @@
|
||||||
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 qint64 &p2Line,
|
||||||
const QString &formula, const qint64 &p1Line,
|
const qint64 &pShoulder, Tool::Sources typeCreation,
|
||||||
const qint64 &p2Line, const qint64 &pShoulder,
|
|
||||||
Tool::Sources typeCreation,
|
|
||||||
QGraphicsItem * parent = 0);
|
QGraphicsItem * parent = 0);
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static VModelingShoulderPoint* Create(QSharedPointer<DialogShoulderPoint> &dialog, VDomDocument *doc,
|
static VModelingShoulderPoint* Create(QSharedPointer<DialogShoulderPoint> &dialog, VDomDocument *doc,
|
||||||
VContainer *data);
|
VContainer *data);
|
||||||
static VModelingShoulderPoint* Create(const qint64 _id, const QString &formula, const qint64 &p1Line,
|
static VModelingShoulderPoint* Create(const qint64 _id, const QString &formula, const qint64 &p1Line,
|
||||||
const qint64 &p2Line, const qint64 &pShoulder,
|
const qint64 &p2Line, const qint64 &pShoulder, const QString &typeLine,
|
||||||
const QString &typeLine, const QString &pointName, const qreal &mx,
|
const QString &pointName, const qreal &mx, const qreal &my, VDomDocument *doc,
|
||||||
const qreal &my, VDomDocument *doc, VContainer *data,
|
VContainer *data, const Document::Documents &parse,
|
||||||
const Document::Documents &parse, const Tool::Sources &typeCreation);
|
const Tool::Sources &typeCreation);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
|
|
|
@ -20,11 +20,8 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vmodelingspline.h"
|
#include "vmodelingspline.h"
|
||||||
#include <QMenu>
|
|
||||||
#include <QDebug>
|
|
||||||
#include "geometry/vspline.h"
|
#include "geometry/vspline.h"
|
||||||
|
|
||||||
|
|
||||||
VModelingSpline::VModelingSpline(VDomDocument *doc, VContainer *data, qint64 id,
|
VModelingSpline::VModelingSpline(VDomDocument *doc, VContainer *data, qint64 id,
|
||||||
Tool::Sources typeCreation,
|
Tool::Sources typeCreation,
|
||||||
QGraphicsItem *parent):VModelingTool(doc, data, id), QGraphicsPathItem(parent),
|
QGraphicsItem *parent):VModelingTool(doc, data, id), QGraphicsPathItem(parent),
|
||||||
|
|
|
@ -31,15 +31,13 @@
|
||||||
class VModelingSpline:public VModelingTool, public QGraphicsPathItem{
|
class VModelingSpline:public VModelingTool, public QGraphicsPathItem{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingSpline (VDomDocument *doc, VContainer *data, qint64 id,
|
VModelingSpline (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 VModelingSpline* Create(QSharedPointer<DialogSpline> &dialog, VDomDocument *doc,
|
static VModelingSpline* Create(QSharedPointer<DialogSpline> &dialog, VDomDocument *doc, VContainer *data);
|
||||||
VContainer *data);
|
static VModelingSpline* Create(const qint64 _id, const qint64 &p1, const qint64 &p4, const qreal &kAsm1,
|
||||||
static VModelingSpline* Create(const qint64 _id, const qint64 &p1, const qint64 &p4,
|
const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve,
|
||||||
const qreal &kAsm1, const qreal kAsm2, const qreal &angle1,
|
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
|
||||||
const qreal &angle2, const qreal &kCurve, VDomDocument *doc,
|
|
||||||
VContainer *data, const Document::Documents &parse,
|
|
||||||
Tool::Sources typeCreation);
|
Tool::Sources typeCreation);
|
||||||
signals:
|
signals:
|
||||||
void RefreshLine (const qint32 &indexSpline, SplinePoint::Position position,
|
void RefreshLine (const qint32 &indexSpline, SplinePoint::Position position,
|
||||||
|
@ -48,8 +46,7 @@ signals:
|
||||||
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 );
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vmodelingsplinepath.h"
|
#include "vmodelingsplinepath.h"
|
||||||
#include <QMenu>
|
|
||||||
|
|
||||||
VModelingSplinePath::VModelingSplinePath(VDomDocument *doc, VContainer *data, qint64 id,
|
VModelingSplinePath::VModelingSplinePath(VDomDocument *doc, VContainer *data, qint64 id,
|
||||||
Tool::Sources typeCreation,
|
Tool::Sources typeCreation,
|
||||||
|
|
|
@ -30,23 +30,21 @@
|
||||||
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, VDomDocument *doc, VContainer *data);
|
||||||
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 &controlPoint, const QPointF &splinePoint);
|
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();
|
||||||
|
@ -60,8 +58,7 @@ private:
|
||||||
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
|
||||||
|
|
|
@ -27,16 +27,6 @@ VAbstractTool(doc, data, id, parent), ignoreContextMenuEvent(false), ignoreFullU
|
||||||
_referens = 0;
|
_referens = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
VModelingTool::~VModelingTool(){
|
|
||||||
}
|
|
||||||
|
|
||||||
void VModelingTool::setDialog(){
|
|
||||||
}
|
|
||||||
|
|
||||||
void VModelingTool::ignoreContextMenu(bool enable){
|
|
||||||
ignoreContextMenuEvent = enable;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VModelingTool::AddToModeling(const QDomElement &domElement){
|
void VModelingTool::AddToModeling(const QDomElement &domElement){
|
||||||
QDomElement modelingElement;
|
QDomElement modelingElement;
|
||||||
bool ok = doc->GetActivModelingElement(modelingElement);
|
bool ok = doc->GetActivModelingElement(modelingElement);
|
||||||
|
|
|
@ -25,14 +25,13 @@
|
||||||
#include "../vabstracttool.h"
|
#include "../vabstracttool.h"
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
class VModelingTool: public VAbstractTool
|
class VModelingTool: public VAbstractTool{
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent = 0);
|
VModelingTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent = 0);
|
||||||
virtual ~VModelingTool();
|
virtual ~VModelingTool(){}
|
||||||
virtual void setDialog();
|
virtual void setDialog(){}
|
||||||
void ignoreContextMenu(bool enable);
|
inline void ignoreContextMenu(bool enable) {ignoreContextMenuEvent = enable;}
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromGui(int result)=0;
|
virtual void FullUpdateFromGui(int result)=0;
|
||||||
signals:
|
signals:
|
||||||
|
|
|
@ -8,18 +8,15 @@
|
||||||
class VModelingTriangle : public VModelingPoint{
|
class VModelingTriangle : public VModelingPoint{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VModelingTriangle(VDomDocument *doc, VContainer *data, const qint64 &id,
|
VModelingTriangle(VDomDocument *doc, VContainer *data, const qint64 &id, const qint64 &axisP1Id,
|
||||||
const qint64 &axisP1Id, const qint64 &axisP2Id,
|
const qint64 &axisP2Id, const qint64 &firstPointId, const qint64 &secondPointId,
|
||||||
const qint64 &firstPointId, const qint64 &secondPointId,
|
|
||||||
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
virtual void setDialog();
|
virtual void setDialog();
|
||||||
static VModelingTriangle* Create(QSharedPointer<DialogTriangle> &dialog, VDomDocument *doc,
|
static VModelingTriangle* Create(QSharedPointer<DialogTriangle> &dialog, VDomDocument *doc, VContainer *data);
|
||||||
VContainer *data);
|
|
||||||
static VModelingTriangle* Create(const qint64 _id, const QString &pointName, const qint64 &axisP1Id,
|
static VModelingTriangle* Create(const qint64 _id, const QString &pointName, const qint64 &axisP1Id,
|
||||||
const qint64 &axisP2Id, const qint64 &firstPointId,
|
const qint64 &axisP2Id, const qint64 &firstPointId, const qint64 &secondPointId,
|
||||||
const qint64 &secondPointId, const qreal &mx, const qreal &my,
|
const qreal &mx, const qreal &my, VDomDocument *doc, VContainer *data,
|
||||||
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
Tool::Sources typeCreation);
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
virtual void FullUpdateFromGui(int result);
|
virtual void FullUpdateFromGui(int result);
|
||||||
|
|
|
@ -24,8 +24,7 @@
|
||||||
|
|
||||||
#include "../vabstracttool.h"
|
#include "../vabstracttool.h"
|
||||||
|
|
||||||
class VAbstractNode : public VAbstractTool
|
class VAbstractNode : public VAbstractTool{
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VAbstractNode(VDomDocument *doc, VContainer *data, qint64 id, qint64 idNode,
|
VAbstractNode(VDomDocument *doc, VContainer *data, qint64 id, qint64 idNode,
|
||||||
|
|
|
@ -25,8 +25,7 @@
|
||||||
#include "vabstractnode.h"
|
#include "vabstractnode.h"
|
||||||
#include <QGraphicsPathItem>
|
#include <QGraphicsPathItem>
|
||||||
|
|
||||||
class VNodeArc :public VAbstractNode, public QGraphicsPathItem
|
class VNodeArc :public VAbstractNode, public QGraphicsPathItem{
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VNodeArc(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc, Draw::Draws typeobject,
|
VNodeArc(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc, Draw::Draws typeobject,
|
||||||
|
|
|
@ -25,16 +25,13 @@
|
||||||
#include "vabstractnode.h"
|
#include "vabstractnode.h"
|
||||||
#include "widgets/vgraphicssimpletextitem.h"
|
#include "widgets/vgraphicssimpletextitem.h"
|
||||||
|
|
||||||
class VNodePoint: public VAbstractNode, public QGraphicsEllipseItem
|
class VNodePoint: public VAbstractNode, public QGraphicsEllipseItem{
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VNodePoint(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint,
|
VNodePoint(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint, Draw::Draws typeobject,
|
||||||
Draw::Draws typeobject, Tool::Sources typeCreation,
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0 );
|
||||||
QGraphicsItem * parent = 0 );
|
static void Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint, Draw::Draws typeobject,
|
||||||
static void Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint,
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
Draw::Draws typeobject, const Document::Documents &parse,
|
|
||||||
Tool::Sources typeCreation);
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
void NameChangePosition(const QPointF pos);
|
void NameChangePosition(const QPointF pos);
|
||||||
|
|
|
@ -25,14 +25,13 @@
|
||||||
#include "vabstractnode.h"
|
#include "vabstractnode.h"
|
||||||
#include <QGraphicsPathItem>
|
#include <QGraphicsPathItem>
|
||||||
|
|
||||||
class VNodeSpline:public VAbstractNode, public QGraphicsPathItem
|
class VNodeSpline:public VAbstractNode, public QGraphicsPathItem{
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VNodeSpline(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, Draw::Draws typeobject,
|
VNodeSpline(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, Draw::Draws typeobject,
|
||||||
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
static VNodeSpline *Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline,
|
static VNodeSpline *Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, Draw::Draws typeobject,
|
||||||
Draw::Draws typeobject, const Document::Documents &parse, Tool::Sources typeCreation);
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile ();
|
virtual void FullUpdateFromFile ();
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -25,15 +25,13 @@
|
||||||
#include "vabstractnode.h"
|
#include "vabstractnode.h"
|
||||||
#include <QGraphicsPathItem>
|
#include <QGraphicsPathItem>
|
||||||
|
|
||||||
class VNodeSplinePath : public VAbstractNode, public QGraphicsPathItem
|
class VNodeSplinePath : public VAbstractNode, public QGraphicsPathItem{
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VNodeSplinePath(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline,
|
VNodeSplinePath(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline,
|
||||||
Draw::Draws typeobject, Tool::Sources typeCreation,
|
Draw::Draws typeobject, Tool::Sources typeCreation, QGraphicsItem * parent = 0);
|
||||||
QGraphicsItem * parent = 0);
|
static void Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, Draw::Draws typeobject,
|
||||||
static void Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline,
|
const Document::Documents &parse, Tool::Sources typeCreation);
|
||||||
Draw::Draws typeobject, const Document::Documents &parse, Tool::Sources typeCreation);
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile();
|
virtual void FullUpdateFromFile();
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -20,7 +20,6 @@
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "vabstracttool.h"
|
#include "vabstracttool.h"
|
||||||
#include <QDebug>
|
|
||||||
|
|
||||||
VAbstractTool::VAbstractTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent):
|
VAbstractTool::VAbstractTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent):
|
||||||
VDataTool(data, parent), doc(doc), id(id), baseColor(Qt::black), currentColor(Qt::black){
|
VDataTool(data, parent), doc(doc), id(id), baseColor(Qt::black), currentColor(Qt::black){
|
||||||
|
@ -132,10 +131,6 @@ QPointF VAbstractTool::addVector(QPointF p, QPointF p1, QPointF p2, qreal k){
|
||||||
return QPointF (p.x() + (p2.x() - p1.x()) * k, p.y() + (p2.y() - p1.y()) * k);
|
return QPointF (p.x() + (p2.x() - p1.x()) * k, p.y() + (p2.y() - p1.y()) * k);
|
||||||
}
|
}
|
||||||
|
|
||||||
const VContainer *VAbstractTool::getData()const{
|
|
||||||
return &data;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VAbstractTool::RemoveAllChild(QDomElement &domElement){
|
void VAbstractTool::RemoveAllChild(QDomElement &domElement){
|
||||||
if ( domElement.hasChildNodes() ){
|
if ( domElement.hasChildNodes() ){
|
||||||
while ( domElement.childNodes().length() >= 1 ){
|
while ( domElement.childNodes().length() >= 1 ){
|
||||||
|
@ -150,7 +145,3 @@ void VAbstractTool::LineCoefficients(const QLineF &line, qreal *a, qreal *b, qre
|
||||||
*b = line.p1().x() - line.p2().x();
|
*b = line.p1().x() - line.p2().x();
|
||||||
*c = - *a * line.p1().x() - *b * line.p1().y();
|
*c = - *a * line.p1().x() - *b * line.p1().y();
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 VAbstractTool::getId() const{
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
#ifndef VABSTRACTTOOL_H
|
#ifndef VABSTRACTTOOL_H
|
||||||
#define VABSTRACTTOOL_H
|
#define VABSTRACTTOOL_H
|
||||||
|
|
||||||
#include "xml/vdomdocument.h"
|
|
||||||
#include "vdatatool.h"
|
#include "vdatatool.h"
|
||||||
|
#include <xml/vdomdocument.h>
|
||||||
|
|
||||||
class VAbstractTool: public VDataTool{
|
class VAbstractTool: public VDataTool{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -31,11 +31,10 @@ public:
|
||||||
VAbstractTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent = 0);
|
VAbstractTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent = 0);
|
||||||
virtual ~VAbstractTool();
|
virtual ~VAbstractTool();
|
||||||
static QPointF LineIntersectRect(QRectF rec, QLineF line);
|
static QPointF LineIntersectRect(QRectF rec, QLineF line);
|
||||||
static qint32 LineIntersectCircle(QPointF center, qreal radius, QLineF line, QPointF &p1,
|
static qint32 LineIntersectCircle(QPointF center, qreal radius, QLineF line, QPointF &p1, QPointF &p2);
|
||||||
QPointF &p2);
|
|
||||||
static QPointF ClosestPoint(QLineF line, QPointF p);
|
static QPointF ClosestPoint(QLineF line, QPointF p);
|
||||||
static QPointF addVector (QPointF p, QPointF p1, QPointF p2, qreal k);
|
static QPointF addVector (QPointF p, QPointF p1, QPointF p2, qreal k);
|
||||||
qint64 getId() const;
|
inline qint64 getId() const {return id;}
|
||||||
static void LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c);
|
static void LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c);
|
||||||
public slots:
|
public slots:
|
||||||
virtual void FullUpdateFromFile()=0;
|
virtual void FullUpdateFromFile()=0;
|
||||||
|
@ -53,7 +52,7 @@ protected:
|
||||||
void AddAttribute(QDomElement &domElement, const QString &name, const qint32 &value);
|
void AddAttribute(QDomElement &domElement, const QString &name, const qint32 &value);
|
||||||
void AddAttribute(QDomElement &domElement, const QString &name, const qreal &value);
|
void AddAttribute(QDomElement &domElement, const QString &name, const qreal &value);
|
||||||
void AddAttribute(QDomElement &domElement, const QString &name, const QString &value);
|
void AddAttribute(QDomElement &domElement, const QString &name, const QString &value);
|
||||||
const VContainer *getData() const;
|
inline const VContainer *getData() const {return &data;}
|
||||||
virtual void RemoveReferens(){}
|
virtual void RemoveReferens(){}
|
||||||
void RemoveAllChild(QDomElement &domElement);
|
void RemoveAllChild(QDomElement &domElement);
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -27,10 +27,6 @@ VDataTool &VDataTool::operator =(const VDataTool &tool){
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VDataTool::setData(const VContainer *value){
|
|
||||||
data = *value;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VDataTool::decrementReferens(){
|
void VDataTool::decrementReferens(){
|
||||||
if(_referens > 0){
|
if(_referens > 0){
|
||||||
--_referens;
|
--_referens;
|
||||||
|
|
|
@ -22,18 +22,17 @@
|
||||||
#ifndef VDATATOOL_H
|
#ifndef VDATATOOL_H
|
||||||
#define VDATATOOL_H
|
#define VDATATOOL_H
|
||||||
|
|
||||||
#include "container/vcontainer.h"
|
#include <container/vcontainer.h>
|
||||||
|
|
||||||
//We need QObject class because we use qobject_cast.
|
//We need QObject class because we use qobject_cast.
|
||||||
class VDataTool : public QObject{
|
class VDataTool : public QObject{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit VDataTool(VContainer *data, QObject *parent = 0)
|
explicit VDataTool(VContainer *data, QObject *parent = 0): QObject(parent), data(*data), _referens(1){}
|
||||||
: QObject(parent), data(*data), _referens(1){}
|
|
||||||
virtual ~VDataTool(){}
|
virtual ~VDataTool(){}
|
||||||
VDataTool &operator= (const VDataTool &tool);
|
VDataTool &operator= (const VDataTool &tool);
|
||||||
inline VContainer getData() const { return data; }
|
inline VContainer getData() const { return data; }
|
||||||
void setData(const VContainer *value);
|
inline void setData(const VContainer *value) {data = *value;}
|
||||||
virtual inline qint64 referens() const {return _referens;}
|
virtual inline qint64 referens() const {return _referens;}
|
||||||
virtual inline void incrementReferens(){++_referens;}
|
virtual inline void incrementReferens(){++_referens;}
|
||||||
virtual void decrementReferens();
|
virtual void decrementReferens();
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
|
|
||||||
#include "vtooldetail.h"
|
#include "vtooldetail.h"
|
||||||
#include "nodeDetails/nodedetails.h"
|
#include "nodeDetails/nodedetails.h"
|
||||||
#include <QDebug>
|
|
||||||
#include "modelingTools/vmodelingtool.h"
|
#include "modelingTools/vmodelingtool.h"
|
||||||
#include "modelingTools/modelingtools.h"
|
#include "modelingTools/modelingtools.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user