Used QFlags for enums.

--HG--
branch : feature
This commit is contained in:
dismine 2013-09-27 12:17:00 +03:00
parent 1488823b34
commit b541610f51
108 changed files with 427 additions and 445 deletions

View File

@ -165,7 +165,7 @@ void VContainer::UpdateId(qint64 newId){
} }
} }
void VContainer::IncrementReferens(qint64 id, Scene::Type obj, Draw::Mode mode){ void VContainer::IncrementReferens(qint64 id, Scene::Scenes obj, Draw::Draws mode){
switch( obj ){ switch( obj ){
case(Scene::Line): case(Scene::Line):
break; break;
@ -240,12 +240,12 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const{
QVector<QPointF> points; QVector<QPointF> points;
for(qint32 i = 0; i< detail.CountNode(); ++i){ for(qint32 i = 0; i< detail.CountNode(); ++i){
switch(detail[i].getTypeTool()){ switch(detail[i].getTypeTool()){
case(Tools::NodePoint):{ case(Tool::NodePoint):{
VPointF point = GetModelingPoint(detail[i].getId()); VPointF point = GetModelingPoint(detail[i].getId());
points.append(point.toQPointF()); points.append(point.toQPointF());
} }
break; break;
case(Tools::NodeArc):{ case(Tool::NodeArc):{
VArc arc = GetModelingArc(detail[i].getId()); VArc arc = GetModelingArc(detail[i].getId());
qreal len1 = GetLengthContour(points, arc.GetPoints()); qreal len1 = GetLengthContour(points, arc.GetPoints());
qreal lenReverse = GetLengthContour(points, GetReversePoint(arc.GetPoints())); qreal lenReverse = GetLengthContour(points, GetReversePoint(arc.GetPoints()));
@ -256,7 +256,7 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const{
} }
} }
break; break;
case(Tools::NodeSpline):{ case(Tool::NodeSpline):{
VSpline spline = GetModelingSpline(detail[i].getId()); VSpline spline = GetModelingSpline(detail[i].getId());
qreal len1 = GetLengthContour(points, spline.GetPoints()); qreal len1 = GetLengthContour(points, spline.GetPoints());
qreal lenReverse = GetLengthContour(points, GetReversePoint(spline.GetPoints())); qreal lenReverse = GetLengthContour(points, GetReversePoint(spline.GetPoints()));
@ -267,7 +267,7 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const{
} }
} }
break; break;
case(Tools::NodeSplinePath):{ case(Tool::NodeSplinePath):{
VSplinePath splinePath = GetModelingSplinePath(detail[i].getId()); VSplinePath splinePath = GetModelingSplinePath(detail[i].getId());
qreal len1 = GetLengthContour(points, splinePath.GetPathPoints()); qreal len1 = GetLengthContour(points, splinePath.GetPathPoints());
qreal lenReverse = GetLengthContour(points, GetReversePoint(splinePath.GetPathPoints())); qreal lenReverse = GetLengthContour(points, GetReversePoint(splinePath.GetPathPoints()));
@ -701,7 +701,7 @@ const QMap<qint64, VDetail> *VContainer::DataDetails() const{
return &details; return &details;
} }
void VContainer::AddLine(const qint64 &firstPointId, const qint64 &secondPointId, Draw::Mode mode){ void VContainer::AddLine(const qint64 &firstPointId, const qint64 &secondPointId, Draw::Draws mode){
QString nameLine = GetNameLine(firstPointId, secondPointId, mode); QString nameLine = GetNameLine(firstPointId, secondPointId, mode);
VPointF first; VPointF first;
VPointF second; VPointF second;
@ -760,7 +760,7 @@ qint64 VContainer::AddModelingArc(const VArc &arc){
return AddObject(modelingArcs, arc); return AddObject(modelingArcs, arc);
} }
QString VContainer::GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint, Draw::Mode mode) const{ QString VContainer::GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint, Draw::Draws mode) const{
VPointF first; VPointF first;
VPointF second; VPointF second;
if(mode == Draw::Calculation){ if(mode == Draw::Calculation){
@ -774,7 +774,7 @@ QString VContainer::GetNameLine(const qint64 &firstPoint, const qint64 &secondPo
} }
QString VContainer::GetNameLineAngle(const qint64 &firstPoint, const qint64 &secondPoint, QString VContainer::GetNameLineAngle(const qint64 &firstPoint, const qint64 &secondPoint,
Draw::Mode mode) const{ Draw::Draws mode) const{
VPointF first; VPointF first;
VPointF second; VPointF second;
if(mode == Draw::Calculation){ if(mode == Draw::Calculation){
@ -788,7 +788,7 @@ QString VContainer::GetNameLineAngle(const qint64 &firstPoint, const qint64 &sec
} }
QString VContainer::GetNameSpline(const qint64 &firstPoint, const qint64 &secondPoint, QString VContainer::GetNameSpline(const qint64 &firstPoint, const qint64 &secondPoint,
Draw::Mode mode) const{ Draw::Draws mode) const{
VPointF first; VPointF first;
VPointF second; VPointF second;
if(mode == Draw::Calculation){ if(mode == Draw::Calculation){
@ -801,7 +801,7 @@ QString VContainer::GetNameSpline(const qint64 &firstPoint, const qint64 &second
return QString("Spl_%1_%2").arg(first.name(), second.name()); return QString("Spl_%1_%2").arg(first.name(), second.name());
} }
QString VContainer::GetNameSplinePath(const VSplinePath &path, Draw::Mode mode) const{ QString VContainer::GetNameSplinePath(const VSplinePath &path, Draw::Draws mode) const{
if(path.Count() == 0){ if(path.Count() == 0){
return QString(); return QString();
} }
@ -823,7 +823,7 @@ QString VContainer::GetNameSplinePath(const VSplinePath &path, Draw::Mode mode)
return name; return name;
} }
QString VContainer::GetNameArc(const qint64 &center, const qint64 &id, Draw::Mode mode) const{ QString VContainer::GetNameArc(const qint64 &center, const qint64 &id, Draw::Draws mode) const{
VPointF centerPoint; VPointF centerPoint;
if(mode == Draw::Calculation){ if(mode == Draw::Calculation){
centerPoint = GetPoint(center); centerPoint = GetPoint(center);
@ -838,7 +838,7 @@ void VContainer::AddLengthLine(const QString &name, const qreal &value){
lengthLines[name] = value; lengthLines[name] = value;
} }
void VContainer::AddLengthSpline(const qint64 &firstPointId, const qint64 &secondPointId, Draw::Mode mode){ void VContainer::AddLengthSpline(const qint64 &firstPointId, const qint64 &secondPointId, Draw::Draws mode){
QString nameLine = GetNameSpline(firstPointId, secondPointId, mode); QString nameLine = GetNameSpline(firstPointId, secondPointId, mode);
VPointF first; VPointF first;
VPointF second; VPointF second;

View File

@ -75,13 +75,13 @@ public:
void AddIncrementTableRow(const QString& name, const VIncrementTableRow &cell); void AddIncrementTableRow(const QString& name, const VIncrementTableRow &cell);
void AddLengthLine(const QString &name, const qreal &value); void AddLengthLine(const QString &name, const qreal &value);
void AddLengthSpline(const qint64 &firstPointId, const qint64 &secondPointId, void AddLengthSpline(const qint64 &firstPointId, const qint64 &secondPointId,
Draw::Mode mode = Draw::Calculation); Draw::Draws mode = Draw::Calculation);
void AddLengthSpline(const QString &name, const qreal &value); void AddLengthSpline(const QString &name, const qreal &value);
void AddLengthArc(const qint64 &center, const qint64 &id); void AddLengthArc(const qint64 &center, const qint64 &id);
void AddLengthArc(const QString &name, const qreal &value); void AddLengthArc(const QString &name, const qreal &value);
void AddLineAngle(const QString &name, const qreal &value); void AddLineAngle(const QString &name, const qreal &value);
void AddLine(const qint64 &firstPointId, const qint64 &secondPointId, void AddLine(const qint64 &firstPointId, const qint64 &secondPointId,
Draw::Mode mode = Draw::Calculation); Draw::Draws mode = Draw::Calculation);
qint64 AddSpline(const VSpline& spl); qint64 AddSpline(const VSpline& spl);
qint64 AddModelingSpline(const VSpline& spl); qint64 AddModelingSpline(const VSpline& spl);
qint64 AddSplinePath(const VSplinePath& splPath); qint64 AddSplinePath(const VSplinePath& splPath);
@ -89,15 +89,15 @@ public:
qint64 AddArc(const VArc& arc); qint64 AddArc(const VArc& arc);
qint64 AddModelingArc(const VArc& arc); qint64 AddModelingArc(const VArc& arc);
QString GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint, QString GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint,
Draw::Mode mode = Draw::Calculation) const; Draw::Draws mode = Draw::Calculation) const;
QString GetNameLineAngle(const qint64 &firstPoint, const qint64 &secondPoint, QString GetNameLineAngle(const qint64 &firstPoint, const qint64 &secondPoint,
Draw::Mode mode = Draw::Calculation) const; Draw::Draws mode = Draw::Calculation) const;
QString GetNameSpline(const qint64 &firstPoint, const qint64 &secondPoint, QString GetNameSpline(const qint64 &firstPoint, const qint64 &secondPoint,
Draw::Mode mode = Draw::Calculation) const; Draw::Draws mode = Draw::Calculation) const;
QString GetNameSplinePath(const VSplinePath &path, QString GetNameSplinePath(const VSplinePath &path,
Draw::Mode mode = Draw::Calculation) const; Draw::Draws mode = Draw::Calculation) const;
QString GetNameArc(const qint64 &center, const qint64 &id, QString GetNameArc(const qint64 &center, const qint64 &id,
Draw::Mode mode = Draw::Calculation) const; Draw::Draws mode = Draw::Calculation) const;
void UpdatePoint(qint64 id, const VPointF& point); void UpdatePoint(qint64 id, const VPointF& point);
void UpdateModelingPoint(qint64 id, const VPointF& point); void UpdateModelingPoint(qint64 id, const VPointF& point);
void UpdateDetail(qint64 id, const VDetail& detail); void UpdateDetail(qint64 id, const VDetail& detail);
@ -143,7 +143,7 @@ public:
const QMap<qint64, VSplinePath> *DataModelingSplinePaths() const; const QMap<qint64, VSplinePath> *DataModelingSplinePaths() const;
const QMap<qint64, VDetail> *DataDetails() const; const QMap<qint64, VDetail> *DataDetails() const;
static void UpdateId(qint64 newId); static void UpdateId(qint64 newId);
void IncrementReferens(qint64 id, Scene::Type obj, Draw::Mode mode = Draw::Calculation); void IncrementReferens(qint64 id, Scene::Scenes obj, Draw::Draws mode = Draw::Calculation);
QPainterPath ContourPath(qint64 idDetail) const; QPainterPath ContourPath(qint64 idDetail) const;
QPainterPath Equidistant(QVector<QPointF> points, const Detail::Equidistant &eqv, QPainterPath Equidistant(QVector<QPointF> points, const Detail::Equidistant &eqv,
const qreal &width)const; const qreal &width)const;

View File

@ -29,7 +29,7 @@ VPointF::VPointF ( const VPointF & point ):_name(point.name()), _mx(point.mx()),
_x(point.x()), _y(point.y()), _referens(0), mode(point.getMode()), idObject(point.getIdObject()){ _x(point.x()), _y(point.y()), _referens(0), mode(point.getMode()), idObject(point.getIdObject()){
} }
VPointF::VPointF (qreal x, qreal y , QString name, qreal mx, qreal my, Draw::Mode mode, qint64 idObject):_name(name), _mx(mx), VPointF::VPointF (qreal x, qreal y , QString name, qreal mx, qreal my, Draw::Draws mode, qint64 idObject):_name(name), _mx(mx),
_my(my), _x(x), _y(y), _referens(0), mode(mode), idObject(idObject){ _my(my), _x(x), _y(y), _referens(0), mode(mode), idObject(idObject){
} }
@ -94,12 +94,12 @@ void VPointF::decrementReferens(){
} }
} }
Draw::Mode VPointF::getMode() const Draw::Draws VPointF::getMode() const
{ {
return mode; return mode;
} }
void VPointF::setMode(const Draw::Mode &value) void VPointF::setMode(const Draw::Draws &value)
{ {
mode = value; mode = value;
} }

View File

@ -31,7 +31,7 @@ class VPointF
public: public:
VPointF(); VPointF();
VPointF (const VPointF &point ); VPointF (const VPointF &point );
VPointF ( qreal x, qreal y, QString name, qreal mx, qreal my, Draw::Mode mode = Draw::Calculation, VPointF ( qreal x, qreal y, QString name, qreal mx, qreal my, Draw::Draws mode = Draw::Calculation,
qint64 idObject = 0); qint64 idObject = 0);
~VPointF(); ~VPointF();
QString name() const; QString name() const;
@ -48,8 +48,8 @@ public:
qint32 referens() const; qint32 referens() const;
void incrementReferens(); void incrementReferens();
void decrementReferens(); void decrementReferens();
Draw::Mode getMode() const; Draw::Draws getMode() const;
void setMode(const Draw::Mode &value); void setMode(const Draw::Draws &value);
qint64 getIdObject() const; qint64 getIdObject() const;
void setIdObject(const qint64 &value); void setIdObject(const qint64 &value);
@ -61,7 +61,7 @@ private:
qreal _x; qreal _x;
qreal _y; qreal _y;
qint32 _referens; qint32 _referens;
Draw::Mode mode; Draw::Draws mode;
qint64 idObject; qint64 idObject;
}; };

View File

@ -22,7 +22,7 @@
#include "dialogalongline.h" #include "dialogalongline.h"
#include "ui_dialogalongline.h" #include "ui_dialogalongline.h"
DialogAlongLine::DialogAlongLine(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogAlongLine::DialogAlongLine(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(new Ui::DialogAlongLine), number(0), pointName(QString()), DialogTool(data, mode, parent), ui(new Ui::DialogAlongLine), number(0), pointName(QString()),
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0){ typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0){
ui->setupUi(this); ui->setupUi(this);
@ -64,7 +64,7 @@ DialogAlongLine::~DialogAlongLine()
delete ui; delete ui;
} }
void DialogAlongLine::ChoosedObject(qint64 id, Scene::Type type){ void DialogAlongLine::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;

View File

@ -35,7 +35,7 @@ class DialogAlongLine : public DialogTool
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DialogAlongLine(const VContainer *data, Draw::Mode mode = Draw::Calculation, explicit DialogAlongLine(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0); QWidget *parent = 0);
~DialogAlongLine(); ~DialogAlongLine();
QString getPointName() const; QString getPointName() const;
@ -49,7 +49,7 @@ public:
qint64 getSecondPointId() const; qint64 getSecondPointId() const;
void setSecondPointId(const qint64 &value, const qint64 &id); void setSecondPointId(const qint64 &value, const qint64 &id);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
private: private:
Q_DISABLE_COPY(DialogAlongLine) Q_DISABLE_COPY(DialogAlongLine)

View File

@ -23,7 +23,7 @@
#include "ui_dialogarc.h" #include "ui_dialogarc.h"
#include "../container/calculator.h" #include "../container/calculator.h"
DialogArc::DialogArc(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogArc::DialogArc(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false), DialogTool(data, mode, parent), ui(new Ui::DialogArc), flagRadius(false), flagF1(false), flagF2(false),
timerRadius(0), timerF1(0), timerF2(0), center(0), radius(QString()), f1(QString()), f2(QString()){ timerRadius(0), timerF1(0), timerF2(0), center(0), radius(QString()), f1(QString()), f2(QString()){
ui->setupUi(this); ui->setupUi(this);
@ -114,7 +114,7 @@ DialogArc::~DialogArc(){
delete ui; delete ui;
} }
void DialogArc::ChoosedObject(qint64 id, Scene::Type type){ void DialogArc::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;

View File

@ -33,7 +33,7 @@ class DialogArc : public DialogTool
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DialogArc(const VContainer *data, Draw::Mode mode = Draw::Calculation, QWidget *parent = 0); explicit DialogArc(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0);
~DialogArc(); ~DialogArc();
qint64 GetCenter() const; qint64 GetCenter() const;
void SetCenter(const qint64 &value); void SetCenter(const qint64 &value);
@ -48,7 +48,7 @@ public:
void SetF2(const QString &value); void SetF2(const QString &value);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
virtual void ValChenged(int row); virtual void ValChenged(int row);
void PutRadius(); void PutRadius();

View File

@ -22,7 +22,7 @@
#include "dialogbisector.h" #include "dialogbisector.h"
#include "ui_dialogbisector.h" #include "ui_dialogbisector.h"
DialogBisector::DialogBisector(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogBisector::DialogBisector(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(new Ui::DialogBisector), number(0), pointName(QString()), DialogTool(data, mode, parent), ui(new Ui::DialogBisector), number(0), pointName(QString()),
typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0){ typeLine(QString()), formula(QString()), firstPointId(0), secondPointId(0), thirdPointId(0){
ui->setupUi(this); ui->setupUi(this);
@ -64,7 +64,7 @@ DialogBisector::~DialogBisector(){
delete ui; delete ui;
} }
void DialogBisector::ChoosedObject(qint64 id, Scene::Type type){ void DialogBisector::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;

View File

@ -39,7 +39,7 @@ class DialogBisector : public DialogTool
Q_OBJECT Q_OBJECT
public: public:
explicit DialogBisector(const VContainer *data, Draw::Mode mode = Draw::Calculation, explicit DialogBisector(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0); QWidget *parent = 0);
~DialogBisector(); ~DialogBisector();
QString getPointName() const; QString getPointName() const;
@ -55,7 +55,7 @@ public:
qint64 getThirdPointId() const; qint64 getThirdPointId() const;
void setThirdPointId(const qint64 &value, const qint64 &id); void setThirdPointId(const qint64 &value, const qint64 &id);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
private: private:
Q_DISABLE_COPY(DialogBisector) Q_DISABLE_COPY(DialogBisector)

View File

@ -22,7 +22,7 @@
#include "dialogdetail.h" #include "dialogdetail.h"
#include <QDebug> #include <QDebug>
DialogDetail::DialogDetail(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogDetail::DialogDetail(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(), details(VDetail()){ DialogTool(data, mode, parent), ui(), details(VDetail()){
ui.setupUi(this); ui.setupUi(this);
bOk = ui.buttonBox->button(QDialogButtonBox::Ok); bOk = ui.buttonBox->button(QDialogButtonBox::Ok);
@ -32,7 +32,7 @@ DialogDetail::DialogDetail(const VContainer *data, Draw::Mode mode, QWidget *par
connect(bCansel, &QPushButton::clicked, this, &DialogDetail::DialogRejected); connect(bCansel, &QPushButton::clicked, this, &DialogDetail::DialogRejected);
} }
void DialogDetail::ChoosedObject(qint64 id, Scene::Type type){ void DialogDetail::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;
@ -47,16 +47,16 @@ void DialogDetail::ChoosedObject(qint64 id, Scene::Type type){
if(type != Scene::Line && type != Scene::Detail){ if(type != Scene::Line && type != Scene::Detail){
switch(type){ switch(type){
case(Scene::Arc): case(Scene::Arc):
NewItem(id, Tools::NodeArc, mode, NodeDetail::Contour); NewItem(id, Tool::NodeArc, mode, NodeDetail::Contour);
break; break;
case(Scene::Point): case(Scene::Point):
NewItem(id, Tools::NodePoint, mode, NodeDetail::Contour); NewItem(id, Tool::NodePoint, mode, NodeDetail::Contour);
break; break;
case(Scene::Spline): case(Scene::Spline):
NewItem(id, Tools::NodeSpline, mode, NodeDetail::Contour); NewItem(id, Tool::NodeSpline, mode, NodeDetail::Contour);
break; break;
case(Scene::SplinePath): case(Scene::SplinePath):
NewItem(id, Tools::NodeSplinePath, mode, NodeDetail::Contour); NewItem(id, Tool::NodeSplinePath, mode, NodeDetail::Contour);
break; break;
default: default:
qWarning()<<"Get wrong scene object. Ignore."; qWarning()<<"Get wrong scene object. Ignore.";
@ -76,10 +76,10 @@ void DialogDetail::DialogAccepted(){
emit DialogClosed(QDialog::Accepted); emit DialogClosed(QDialog::Accepted);
} }
void DialogDetail::NewItem(qint64 id, Tools::Enum typeTool, Draw::Mode mode, NodeDetail::Type typeNode){ void DialogDetail::NewItem(qint64 id, Tool::Tools typeTool, Draw::Draws mode, NodeDetail::NodeDetails typeNode){
QString name; QString name;
switch(typeTool){ switch(typeTool){
case(Tools::NodePoint):{ case(Tool::NodePoint):{
VPointF point; VPointF point;
if(mode == Draw::Calculation){ if(mode == Draw::Calculation){
point = data->GetPoint(id); point = data->GetPoint(id);
@ -89,7 +89,7 @@ void DialogDetail::NewItem(qint64 id, Tools::Enum typeTool, Draw::Mode mode, Nod
name = point.name(); name = point.name();
break; break;
} }
case(Tools::NodeArc):{ case(Tool::NodeArc):{
VArc arc; VArc arc;
if(mode == Draw::Calculation){ if(mode == Draw::Calculation){
arc = data->GetArc(id); arc = data->GetArc(id);
@ -99,7 +99,7 @@ void DialogDetail::NewItem(qint64 id, Tools::Enum typeTool, Draw::Mode mode, Nod
name = data->GetNameArc(arc.GetCenter(), id, mode); name = data->GetNameArc(arc.GetCenter(), id, mode);
break; break;
} }
case(Tools::NodeSpline):{ case(Tool::NodeSpline):{
VSpline spl; VSpline spl;
if(mode == Draw::Calculation){ if(mode == Draw::Calculation){
spl = data->GetSpline(id); spl = data->GetSpline(id);
@ -109,7 +109,7 @@ void DialogDetail::NewItem(qint64 id, Tools::Enum typeTool, Draw::Mode mode, Nod
name = spl.GetName(); name = spl.GetName();
break; break;
} }
case(Tools::NodeSplinePath):{ case(Tool::NodeSplinePath):{
VSplinePath splPath; VSplinePath splPath;
if(mode == Draw::Calculation){ if(mode == Draw::Calculation){
splPath = data->GetSplinePath(id); splPath = data->GetSplinePath(id);

View File

@ -31,17 +31,17 @@ class DialogDetail : public DialogTool
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DialogDetail(const VContainer *data, Draw::Mode mode, QWidget *parent = 0); explicit DialogDetail(const VContainer *data, Draw::Draws mode, QWidget *parent = 0);
VDetail getDetails() const; VDetail getDetails() const;
void setDetails(const VDetail &value); void setDetails(const VDetail &value);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
private: private:
Ui::DialogDetail ui; Ui::DialogDetail ui;
VDetail details; VDetail details;
void NewItem(qint64 id, Tools::Enum typeTool, Draw::Mode mode, NodeDetail::Type typeNode); void NewItem(qint64 id, Tool::Tools typeTool, Draw::Draws mode, NodeDetail::NodeDetails typeNode);
}; };
#endif // DIALOGDETAIL_H #endif // DIALOGDETAIL_H

View File

@ -26,7 +26,7 @@
#include "container/vpointf.h" #include "container/vpointf.h"
#include "container/calculator.h" #include "container/calculator.h"
DialogEndLine::DialogEndLine(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogEndLine::DialogEndLine(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(new Ui::DialogEndLine), pointName(QString()), typeLine(QString()), DialogTool(data, mode, parent), ui(new Ui::DialogEndLine), pointName(QString()), typeLine(QString()),
formula(QString()), angle(0), basePointId(0){ formula(QString()), angle(0), basePointId(0){
ui->setupUi(this); ui->setupUi(this);
@ -79,7 +79,7 @@ DialogEndLine::DialogEndLine(const VContainer *data, Draw::Mode mode, QWidget *p
connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogEndLine::FormulaChanged); connect(ui->lineEditFormula, &QLineEdit::textChanged, this, &DialogEndLine::FormulaChanged);
} }
void DialogEndLine::ChoosedObject(qint64 id, Scene::Type type){ void DialogEndLine::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;

View File

@ -38,7 +38,7 @@ class DialogEndLine : public DialogTool
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DialogEndLine(const VContainer *data, Draw::Mode mode = Draw::Calculation, explicit DialogEndLine(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0); QWidget *parent = 0);
~DialogEndLine(); ~DialogEndLine();
QString getPointName() const; QString getPointName() const;
@ -52,7 +52,7 @@ public:
qint64 getBasePointId() const; qint64 getBasePointId() const;
void setBasePointId(const qint64 &value, const qint64 &id); void setBasePointId(const qint64 &value, const qint64 &id);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
private: private:
Q_DISABLE_COPY(DialogEndLine) Q_DISABLE_COPY(DialogEndLine)

View File

@ -144,12 +144,12 @@ QString DialogHistory::Record(const VToolRecord &tool){
qint64 center = 0; qint64 center = 0;
QDomElement domElement; QDomElement domElement;
switch( tool.getTypeTool() ){ switch( tool.getTypeTool() ){
case Tools::ArrowTool: case Tool::ArrowTool:
break; break;
case Tools::SinglePointTool: case Tool::SinglePointTool:
record = QString("%1 - Базова точка").arg(data->GetPoint(tool.getId()).name()); record = QString("%1 - Базова точка").arg(data->GetPoint(tool.getId()).name());
break; break;
case Tools::EndLineTool: case Tool::EndLineTool:
domElement = doc->elementById(QString().setNum(tool.getId())); domElement = doc->elementById(QString().setNum(tool.getId()));
if(domElement.isElement()){ if(domElement.isElement()){
basePointId = domElement.attribute("basePoint", "").toLongLong(); basePointId = domElement.attribute("basePoint", "").toLongLong();
@ -157,7 +157,7 @@ QString DialogHistory::Record(const VToolRecord &tool){
record = QString("%1_%2 - Відрізок з точки %1 до точки %2").arg(data->GetPoint(basePointId).name(), record = QString("%1_%2 - Відрізок з точки %1 до точки %2").arg(data->GetPoint(basePointId).name(),
data->GetPoint(tool.getId()).name()); data->GetPoint(tool.getId()).name());
break; break;
case Tools::LineTool: case Tool::LineTool:
domElement = doc->elementById(QString().setNum(tool.getId())); domElement = doc->elementById(QString().setNum(tool.getId()));
if(domElement.isElement()){ if(domElement.isElement()){
firstPointId = domElement.attribute("firstPoint", "").toLongLong(); firstPointId = domElement.attribute("firstPoint", "").toLongLong();
@ -166,7 +166,7 @@ QString DialogHistory::Record(const VToolRecord &tool){
record = QString("%1_%2 - Лінія з точки %1 до точки %2").arg(data->GetPoint(firstPointId).name(), record = QString("%1_%2 - Лінія з точки %1 до точки %2").arg(data->GetPoint(firstPointId).name(),
data->GetPoint(secondPointId).name()); data->GetPoint(secondPointId).name());
break; break;
case Tools::AlongLineTool: case Tool::AlongLineTool:
domElement = doc->elementById(QString().setNum(tool.getId())); domElement = doc->elementById(QString().setNum(tool.getId()));
if(domElement.isElement()){ if(domElement.isElement()){
basePointId = domElement.attribute("firstPoint", "").toLongLong(); basePointId = domElement.attribute("firstPoint", "").toLongLong();
@ -176,10 +176,10 @@ QString DialogHistory::Record(const VToolRecord &tool){
data->GetPoint(secondPointId).name(), data->GetPoint(secondPointId).name(),
data->GetPoint(tool.getId()).name()); data->GetPoint(tool.getId()).name());
break; break;
case Tools::ShoulderPointTool: case Tool::ShoulderPointTool:
record = QString("%1 - Плечева точка").arg(data->GetPoint(tool.getId()).name()); record = QString("%1 - Плечева точка").arg(data->GetPoint(tool.getId()).name());
break; break;
case Tools::NormalTool: case Tool::NormalTool:
domElement = doc->elementById(QString().setNum(tool.getId())); domElement = doc->elementById(QString().setNum(tool.getId()));
if(domElement.isElement()){ if(domElement.isElement()){
basePointId = domElement.attribute("firstPoint", "").toLongLong(); basePointId = domElement.attribute("firstPoint", "").toLongLong();
@ -189,7 +189,7 @@ QString DialogHistory::Record(const VToolRecord &tool){
data->GetPoint(secondPointId).name(), data->GetPoint(secondPointId).name(),
data->GetPoint(tool.getId()).name()); data->GetPoint(tool.getId()).name());
break; break;
case Tools::BisectorTool: case Tool::BisectorTool:
domElement = doc->elementById(QString().setNum(tool.getId())); domElement = doc->elementById(QString().setNum(tool.getId()));
if(domElement.isElement()){ if(domElement.isElement()){
firstPointId = domElement.attribute("firstPoint", "").toLongLong(); firstPointId = domElement.attribute("firstPoint", "").toLongLong();
@ -201,7 +201,7 @@ QString DialogHistory::Record(const VToolRecord &tool){
data->GetPoint(thirdPointId).name(), data->GetPoint(thirdPointId).name(),
data->GetPoint(tool.getId()).name()); data->GetPoint(tool.getId()).name());
break; break;
case Tools::LineIntersectTool: case Tool::LineIntersectTool:
domElement = doc->elementById(QString().setNum(tool.getId())); domElement = doc->elementById(QString().setNum(tool.getId()));
if(domElement.isElement()){ if(domElement.isElement()){
p1Line1 = domElement.attribute("p1Line1", "").toLongLong(); p1Line1 = domElement.attribute("p1Line1", "").toLongLong();
@ -215,18 +215,18 @@ QString DialogHistory::Record(const VToolRecord &tool){
data->GetPoint(p2Line2).name(), data->GetPoint(p2Line2).name(),
data->GetPoint(tool.getId()).name()); data->GetPoint(tool.getId()).name());
break; break;
case Tools::SplineTool:{ case Tool::SplineTool:{
VSpline spl = data->GetSpline(tool.getId()); VSpline spl = data->GetSpline(tool.getId());
record = QString("Сплайн %1_%2").arg(data->GetPoint(spl.GetP1()).name(), record = QString("Сплайн %1_%2").arg(data->GetPoint(spl.GetP1()).name(),
data->GetPoint(spl.GetP4()).name()); data->GetPoint(spl.GetP4()).name());
} }
break; break;
case Tools::ArcTool:{ case Tool::ArcTool:{
VArc arc = data->GetArc(tool.getId()); VArc arc = data->GetArc(tool.getId());
record = QString("Дуга з центром в точці %1").arg(data->GetPoint(arc.GetCenter()).name()); record = QString("Дуга з центром в точці %1").arg(data->GetPoint(arc.GetCenter()).name());
} }
break; break;
case Tools::SplinePathTool:{ case Tool::SplinePathTool:{
VSplinePath splPath = data->GetSplinePath(tool.getId()); VSplinePath splPath = data->GetSplinePath(tool.getId());
QVector<VSplinePoint> points = splPath.GetSplinePath(); QVector<VSplinePoint> points = splPath.GetSplinePath();
if(points.size() != 0 ){ if(points.size() != 0 ){
@ -238,7 +238,7 @@ QString DialogHistory::Record(const VToolRecord &tool){
} }
} }
break; break;
case Tools::PointOfContact: case Tool::PointOfContact:
domElement = doc->elementById(QString().setNum(tool.getId())); domElement = doc->elementById(QString().setNum(tool.getId()));
if(domElement.isElement()){ if(domElement.isElement()){
center = domElement.attribute("center", "").toLongLong(); center = domElement.attribute("center", "").toLongLong();

View File

@ -24,7 +24,7 @@
#include <QPushButton> #include <QPushButton>
#include <QCloseEvent> #include <QCloseEvent>
DialogLine::DialogLine(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogLine::DialogLine(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(new Ui::DialogLine), number(0), firstPoint(0), secondPoint(0){ DialogTool(data, mode, parent), ui(new Ui::DialogLine), number(0), firstPoint(0), secondPoint(0){
ui->setupUi(this); ui->setupUi(this);
bOk = ui->buttonBox->button(QDialogButtonBox::Ok); bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
@ -75,7 +75,7 @@ void DialogLine::DialogAccepted(){
DialogClosed(QDialog::Accepted); DialogClosed(QDialog::Accepted);
} }
void DialogLine::ChoosedObject(qint64 id, Scene::Type type){ void DialogLine::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;

View File

@ -36,7 +36,7 @@ class DialogLine : public DialogTool
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DialogLine(const VContainer *data, Draw::Mode mode = Draw::Calculation, explicit DialogLine(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0); QWidget *parent = 0);
~DialogLine(); ~DialogLine();
qint64 getFirstPoint() const; qint64 getFirstPoint() const;
@ -44,7 +44,7 @@ public:
qint64 getSecondPoint() const; qint64 getSecondPoint() const;
void setSecondPoint(const qint64 &value); void setSecondPoint(const qint64 &value);
public slots: public slots:
void ChoosedObject(qint64 id, Scene::Type type); void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
private: private:
Q_DISABLE_COPY(DialogLine) Q_DISABLE_COPY(DialogLine)

View File

@ -22,7 +22,7 @@
#include "dialoglineintersect.h" #include "dialoglineintersect.h"
#include "ui_dialoglineintersect.h" #include "ui_dialoglineintersect.h"
DialogLineIntersect::DialogLineIntersect(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogLineIntersect::DialogLineIntersect(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(new Ui::DialogLineIntersect), number(0), pointName(QString()), DialogTool(data, mode, parent), ui(new Ui::DialogLineIntersect), number(0), pointName(QString()),
p1Line1(0), p2Line1(0), p1Line2(0), p2Line2(0), flagPoint(true){ p1Line1(0), p2Line1(0), p1Line2(0), p2Line2(0), flagPoint(true){
ui->setupUi(this); ui->setupUi(this);
@ -45,7 +45,7 @@ DialogLineIntersect::~DialogLineIntersect()
delete ui; delete ui;
} }
void DialogLineIntersect::ChoosedObject(qint64 id, Scene::Type type){ void DialogLineIntersect::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;

View File

@ -32,7 +32,7 @@ class DialogLineIntersect : public DialogTool
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DialogLineIntersect(const VContainer *data, Draw::Mode mode = Draw::Calculation, explicit DialogLineIntersect(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0); QWidget *parent = 0);
~DialogLineIntersect(); ~DialogLineIntersect();
qint64 getP1Line1() const; qint64 getP1Line1() const;
@ -46,7 +46,7 @@ public:
QString getPointName() const; QString getPointName() const;
void setPointName(const QString &value); void setPointName(const QString &value);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
void P1Line1Changed( int index); void P1Line1Changed( int index);
void P2Line1Changed( int index); void P2Line1Changed( int index);

View File

@ -23,7 +23,7 @@
#include "ui_dialognormal.h" #include "ui_dialognormal.h"
#include <QMenu> #include <QMenu>
DialogNormal::DialogNormal(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogNormal::DialogNormal(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(new Ui::DialogNormal), number(0), pointName(QString()), DialogTool(data, mode, parent), ui(new Ui::DialogNormal), number(0), pointName(QString()),
typeLine(QString()), formula(QString()), angle(0), firstPointId(0), secondPointId(0){ typeLine(QString()), formula(QString()), angle(0), firstPointId(0), secondPointId(0){
ui->setupUi(this); ui->setupUi(this);
@ -82,7 +82,7 @@ DialogNormal::~DialogNormal()
delete ui; delete ui;
} }
void DialogNormal::ChoosedObject(qint64 id, Scene::Type type){ void DialogNormal::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;

View File

@ -38,7 +38,7 @@ class DialogNormal : public DialogTool
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DialogNormal(const VContainer *data, Draw::Mode mode = Draw::Calculation, explicit DialogNormal(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0); QWidget *parent = 0);
~DialogNormal(); ~DialogNormal();
QString getPointName() const; QString getPointName() const;
@ -54,7 +54,7 @@ public:
qint64 getSecondPointId() const; qint64 getSecondPointId() const;
void setSecondPointId(const qint64 &value, const qint64 &id); void setSecondPointId(const qint64 &value, const qint64 &id);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
private: private:
Q_DISABLE_COPY(DialogNormal) Q_DISABLE_COPY(DialogNormal)

View File

@ -21,7 +21,7 @@
#include "dialogpointofcontact.h" #include "dialogpointofcontact.h"
DialogPointOfContact::DialogPointOfContact(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogPointOfContact::DialogPointOfContact(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(), number(0), pointName(QString()), radius(QString()), center(0), DialogTool(data, mode, parent), ui(), number(0), pointName(QString()), radius(QString()), center(0),
firstPoint(0), secondPoint(0){ firstPoint(0), secondPoint(0){
ui.setupUi(this); ui.setupUi(this);
@ -58,7 +58,7 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, Draw::Mode mo
connect(ui.lineEditFormula, &QLineEdit::textChanged, this, &DialogPointOfContact::FormulaChanged); connect(ui.lineEditFormula, &QLineEdit::textChanged, this, &DialogPointOfContact::FormulaChanged);
} }
void DialogPointOfContact::ChoosedObject(qint64 id, Scene::Type type){ void DialogPointOfContact::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;

View File

@ -33,7 +33,7 @@ class DialogPointOfContact : public DialogTool
Q_OBJECT Q_OBJECT
public: public:
explicit DialogPointOfContact(const VContainer *data, Draw::Mode mode = Draw::Calculation, explicit DialogPointOfContact(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0); QWidget *parent = 0);
QString getPointName() const; QString getPointName() const;
void setPointName(const QString &value); void setPointName(const QString &value);
@ -51,7 +51,7 @@ public:
void setSecondPoint(const qint64 &value, const qint64 &id); void setSecondPoint(const qint64 &value, const qint64 &id);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
private: private:
Q_DISABLE_COPY(DialogPointOfContact) Q_DISABLE_COPY(DialogPointOfContact)

View File

@ -22,7 +22,7 @@
#include "dialogshoulderpoint.h" #include "dialogshoulderpoint.h"
#include "ui_dialogshoulderpoint.h" #include "ui_dialogshoulderpoint.h"
DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogShoulderPoint::DialogShoulderPoint(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(new Ui::DialogShoulderPoint), number(0), pointName(QString()), DialogTool(data, mode, parent), ui(new Ui::DialogShoulderPoint), number(0), pointName(QString()),
typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0){ typeLine(QString()), formula(QString()), p1Line(0), p2Line(0), pShoulder(0){
ui->setupUi(this); ui->setupUi(this);
@ -66,7 +66,7 @@ DialogShoulderPoint::~DialogShoulderPoint()
delete ui; delete ui;
} }
void DialogShoulderPoint::ChoosedObject(qint64 id, Scene::Type type){ void DialogShoulderPoint::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;

View File

@ -35,7 +35,7 @@ class DialogShoulderPoint : public DialogTool
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DialogShoulderPoint(const VContainer *data, Draw::Mode mode = Draw::Calculation, explicit DialogShoulderPoint(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0); QWidget *parent = 0);
~DialogShoulderPoint(); ~DialogShoulderPoint();
QString getPointName() const; QString getPointName() const;
@ -51,7 +51,7 @@ public:
qint64 getPShoulder() const; qint64 getPShoulder() const;
void setPShoulder(const qint64 &value, const qint64 &id); void setPShoulder(const qint64 &value, const qint64 &id);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
private: private:
Q_DISABLE_COPY(DialogShoulderPoint) Q_DISABLE_COPY(DialogShoulderPoint)

View File

@ -22,7 +22,7 @@
#include "dialogspline.h" #include "dialogspline.h"
#include "ui_dialogspline.h" #include "ui_dialogspline.h"
DialogSpline::DialogSpline(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogSpline::DialogSpline(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(new Ui::DialogSpline), number(0), p1(0), p4(0), angle1(0), angle2(0), DialogTool(data, mode, parent), ui(new Ui::DialogSpline), number(0), p1(0), p4(0), angle1(0), angle2(0),
kAsm1(1), kAsm2(1), kCurve(1){ kAsm1(1), kAsm2(1), kCurve(1){
ui->setupUi(this); ui->setupUi(this);
@ -41,7 +41,7 @@ DialogSpline::~DialogSpline(){
delete ui; delete ui;
} }
void DialogSpline::ChoosedObject(qint64 id, Scene::Type type){ void DialogSpline::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;

View File

@ -33,7 +33,7 @@ class DialogSpline : public DialogTool
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DialogSpline(const VContainer *data, Draw::Mode mode = Draw::Calculation, explicit DialogSpline(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0); QWidget *parent = 0);
~DialogSpline(); ~DialogSpline();
qint64 getP1() const; qint64 getP1() const;
@ -51,7 +51,7 @@ public:
qreal getKCurve() const; qreal getKCurve() const;
void setKCurve(const qreal &value); void setKCurve(const qreal &value);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
private: private:
Q_DISABLE_COPY(DialogSpline) Q_DISABLE_COPY(DialogSpline)

View File

@ -23,7 +23,7 @@
#include "ui_dialogsplinepath.h" #include "ui_dialogsplinepath.h"
#include "geometry/vsplinepoint.h" #include "geometry/vsplinepoint.h"
DialogSplinePath::DialogSplinePath(const VContainer *data, Draw::Mode mode, QWidget *parent) : DialogSplinePath::DialogSplinePath(const VContainer *data, Draw::Draws mode, QWidget *parent) :
DialogTool(data, mode, parent), ui(new Ui::DialogSplinePath), path(VSplinePath()){ DialogTool(data, mode, parent), ui(new Ui::DialogSplinePath), path(VSplinePath()){
ui->setupUi(this); ui->setupUi(this);
bOk = ui->buttonBox->button(QDialogButtonBox::Ok); bOk = ui->buttonBox->button(QDialogButtonBox::Ok);
@ -68,7 +68,7 @@ void DialogSplinePath::SetPath(const VSplinePath &value){
} }
void DialogSplinePath::ChoosedObject(qint64 id, Scene::Type type){ void DialogSplinePath::ChoosedObject(qint64 id, Scene::Scenes type){
if(idDetail == 0 && mode == Draw::Modeling){ if(idDetail == 0 && mode == Draw::Modeling){
if(type == Scene::Detail){ if(type == Scene::Detail){
idDetail = id; idDetail = id;

View File

@ -34,13 +34,13 @@ class DialogSplinePath : public DialogTool
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DialogSplinePath(const VContainer *data, Draw::Mode mode = Draw::Calculation, explicit DialogSplinePath(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0); QWidget *parent = 0);
~DialogSplinePath(); ~DialogSplinePath();
VSplinePath GetPath() const; VSplinePath GetPath() const;
void SetPath(const VSplinePath &value); void SetPath(const VSplinePath &value);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
virtual void DialogAccepted(); virtual void DialogAccepted();
void PointChenged(int row); void PointChenged(int row);
void currentPointChanged( int index ); void currentPointChanged( int index );

View File

@ -26,7 +26,7 @@
#include "geometry/vdetail.h" #include "geometry/vdetail.h"
#include <QDebug> #include <QDebug>
DialogTool::DialogTool(const VContainer *data, Draw::Mode mode, QWidget *parent):QDialog(parent), data(data), DialogTool::DialogTool(const VContainer *data, Draw::Draws mode, QWidget *parent):QDialog(parent), data(data),
isInitialized(false), flagName(true), flagFormula(true), timerFormula(0), bOk(0), spinBoxAngle(0), isInitialized(false), flagName(true), flagFormula(true), timerFormula(0), bOk(0), spinBoxAngle(0),
lineEditFormula(0), listWidget(0), labelResultCalculation(0), labelDescription(0), lineEditFormula(0), listWidget(0), labelResultCalculation(0), labelDescription(0),
radioButtonSizeGrowth(0), radioButtonStandartTable(0), radioButtonIncrements(0), radioButtonSizeGrowth(0), radioButtonStandartTable(0), radioButtonIncrements(0),
@ -74,14 +74,14 @@ void DialogTool::FillComboBoxPoints(QComboBox *box, const qint64 &id) const{
} }
VDetail det = data->GetDetail(idDetail); VDetail det = data->GetDetail(idDetail);
for(qint32 i = 0; i< det.CountNode(); ++i){ for(qint32 i = 0; i< det.CountNode(); ++i){
if(det[i].getTypeTool() == Tools::NodePoint || if(det[i].getTypeTool() == Tool::NodePoint ||
det[i].getTypeTool() == Tools::AlongLineTool || det[i].getTypeTool() == Tool::AlongLineTool ||
det[i].getTypeTool() == Tools::BisectorTool || det[i].getTypeTool() == Tool::BisectorTool ||
det[i].getTypeTool() == Tools::EndLineTool || det[i].getTypeTool() == Tool::EndLineTool ||
det[i].getTypeTool() == Tools::LineIntersectTool || det[i].getTypeTool() == Tool::LineIntersectTool ||
det[i].getTypeTool() == Tools::NormalTool || det[i].getTypeTool() == Tool::NormalTool ||
det[i].getTypeTool() == Tools::PointOfContact || det[i].getTypeTool() == Tool::PointOfContact ||
det[i].getTypeTool() == Tools::ShoulderPointTool){ det[i].getTypeTool() == Tool::ShoulderPointTool){
if(det[i].getId() != id){ if(det[i].getId() != id){
VPointF point = data->GetModelingPoint(det[i].getId()); VPointF point = data->GetModelingPoint(det[i].getId());
box->addItem(point.name(), det[i].getId()); box->addItem(point.name(), det[i].getId());
@ -200,7 +200,7 @@ void DialogTool::CheckState(){
} }
void DialogTool::ChoosedObject(qint64 id, Scene::Type type){ void DialogTool::ChoosedObject(qint64 id, Scene::Scenes type){
Q_UNUSED(id); Q_UNUSED(id);
Q_UNUSED(type); Q_UNUSED(type);
} }

View File

@ -38,7 +38,7 @@ class DialogTool : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
DialogTool(const VContainer *data, Draw::Mode mode = Draw::Calculation, DialogTool(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0); QWidget *parent = 0);
virtual ~DialogTool(); virtual ~DialogTool();
qint64 getIdDetail() const; qint64 getIdDetail() const;
@ -46,7 +46,7 @@ public:
signals: signals:
void DialogClosed(int result); void DialogClosed(int result);
public slots: public slots:
virtual void ChoosedObject(qint64 id, Scene::Type type); virtual void ChoosedObject(qint64 id, Scene::Scenes type);
void NamePointChanged(); void NamePointChanged();
virtual void DialogAccepted(); virtual void DialogAccepted();
virtual void DialogRejected(); virtual void DialogRejected();
@ -86,7 +86,7 @@ protected:
QRadioButton *radioButtonIncrements; QRadioButton *radioButtonIncrements;
QRadioButton *radioButtonLengthLine; QRadioButton *radioButtonLengthLine;
qint64 idDetail; qint64 idDetail;
Draw::Mode mode; Draw::Draws mode;
bool CheckObject(const qint64 &id); bool CheckObject(const qint64 &id);
virtual void closeEvent ( QCloseEvent * event ); virtual void closeEvent ( QCloseEvent * event );
virtual void showEvent( QShowEvent *event ); virtual void showEvent( QShowEvent *event );

View File

@ -29,7 +29,7 @@ VArc::VArc () : f1(0), formulaF1(QString()), f2(0), formulaF2(QString()), radius
} }
VArc::VArc (const QMap<qint64, VPointF> *points, qint64 center, qreal radius, QString formulaRadius, VArc::VArc (const QMap<qint64, VPointF> *points, qint64 center, qreal radius, QString formulaRadius,
qreal f1, QString formulaF1, qreal f2, QString formulaF2, Draw::Mode mode, qint64 idObject) qreal f1, QString formulaF1, qreal f2, QString formulaF2, Draw::Draws mode, qint64 idObject)
: f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2), radius(radius), formulaRadius(formulaRadius), : f1(f1), formulaF1(formulaF1), f2(f2), formulaF2(formulaF2), radius(radius), formulaRadius(formulaRadius),
center(center), points(points), _referens(0), mode(mode), idObject(idObject){ center(center), points(points), _referens(0), mode(mode), idObject(idObject){
} }
@ -213,12 +213,12 @@ void VArc::decrementReferens(){
} }
Draw::Mode VArc::getMode() const Draw::Draws VArc::getMode() const
{ {
return mode; return mode;
} }
void VArc::setMode(const Draw::Mode &value) void VArc::setMode(const Draw::Draws &value)
{ {
mode = value; mode = value;
} }

View File

@ -46,7 +46,7 @@ public:
*/ */
VArc (const QMap<qint64, VPointF> *points, qint64 center, qreal radius, QString formulaRadius, VArc (const QMap<qint64, VPointF> *points, qint64 center, qreal radius, QString formulaRadius,
qreal f1, QString formulaF1, qreal f2 , QString formulaF2, qreal f1, QString formulaF1, qreal f2 , QString formulaF2,
Draw::Mode mode = Draw::Calculation, qint64 idObject = 0); Draw::Draws mode = Draw::Calculation, qint64 idObject = 0);
VArc(const VArc &arc); VArc(const VArc &arc);
VArc& operator= (const VArc &arc); VArc& operator= (const VArc &arc);
/** /**
@ -101,8 +101,8 @@ public:
qint32 referens() const; qint32 referens() const;
void incrementReferens(); void incrementReferens();
void decrementReferens(); void decrementReferens();
Draw::Mode getMode() const; Draw::Draws getMode() const;
void setMode(const Draw::Mode &value); void setMode(const Draw::Draws &value);
qint64 getIdObject() const; qint64 getIdObject() const;
void setIdObject(const qint64 &value); void setIdObject(const qint64 &value);
@ -129,7 +129,7 @@ private:
qint64 center; qint64 center;
const QMap<qint64, VPointF> *points; const QMap<qint64, VPointF> *points;
qint32 _referens; qint32 _referens;
Draw::Mode mode; Draw::Draws mode;
qint64 idObject; qint64 idObject;
}; };

View File

@ -28,18 +28,14 @@
#include <QPainterPath> #include <QPainterPath>
namespace Detail { namespace Detail {
enum Contour enum Contour { OpenContour, CloseContour };
{ Q_DECLARE_FLAGS(Contours, Contour)
OpenContour,
CloseContour
};
enum Equidistant enum Equidistant { OpenEquidistant, CloseEquidistant };
{ Q_DECLARE_FLAGS(Equidistants, Equidistant)
OpenEquidistant,
CloseEquidistant
};
} }
Q_DECLARE_OPERATORS_FOR_FLAGS(Detail::Contours)
Q_DECLARE_OPERATORS_FOR_FLAGS(Detail::Equidistants)
class VDetail class VDetail
{ {

View File

@ -21,11 +21,11 @@
#include "vnodedetail.h" #include "vnodedetail.h"
VNodeDetail::VNodeDetail():id(0), typeTool(Tools::NodePoint), mode(Draw::Calculation), VNodeDetail::VNodeDetail():id(0), typeTool(Tool::NodePoint), mode(Draw::Calculation),
typeNode(NodeDetail::Contour){ typeNode(NodeDetail::Contour){
} }
VNodeDetail::VNodeDetail(qint64 id, Tools::Enum typeTool, Draw::Mode mode, NodeDetail::Type typeNode):id(id), VNodeDetail::VNodeDetail(qint64 id, Tool::Tools typeTool, Draw::Draws mode, NodeDetail::NodeDetails typeNode):id(id),
typeTool(typeTool), mode(mode), typeNode(typeNode){ typeTool(typeTool), mode(mode), typeNode(typeNode){
} }
@ -33,11 +33,11 @@ VNodeDetail::VNodeDetail(const VNodeDetail &node):id(node.getId()), typeTool(nod
mode(node.getMode()), typeNode(node.getTypeNode()){ mode(node.getMode()), typeNode(node.getTypeNode()){
} }
Tools::Enum VNodeDetail::getTypeTool() const{ Tool::Tools VNodeDetail::getTypeTool() const{
return typeTool; return typeTool;
} }
void VNodeDetail::setTypeTool(const Tools::Enum &value){ void VNodeDetail::setTypeTool(const Tool::Tools &value){
typeTool = value; typeTool = value;
} }
@ -49,18 +49,18 @@ void VNodeDetail::setId(const qint64 &value){
id = value; id = value;
} }
Draw::Mode VNodeDetail::getMode() const{ Draw::Draws VNodeDetail::getMode() const{
return mode; return mode;
} }
void VNodeDetail::setMode(const Draw::Mode &value){ void VNodeDetail::setMode(const Draw::Draws &value){
mode = value; mode = value;
} }
NodeDetail::Type VNodeDetail::getTypeNode() const{ NodeDetail::NodeDetails VNodeDetail::getTypeNode() const{
return typeNode; return typeNode;
} }
void VNodeDetail::setTypeNode(const NodeDetail::Type &value){ void VNodeDetail::setTypeNode(const NodeDetail::NodeDetails &value){
typeNode = value; typeNode = value;
} }

View File

@ -27,33 +27,31 @@
#include "options.h" #include "options.h"
namespace NodeDetail { namespace NodeDetail {
enum Type enum NodeDetail { Contour, Modeling };
{ Q_DECLARE_FLAGS(NodeDetails, NodeDetail)
Contour,
Modeling
};
} }
Q_DECLARE_OPERATORS_FOR_FLAGS(NodeDetail::NodeDetails)
class VNodeDetail class VNodeDetail
{ {
public: public:
VNodeDetail(); VNodeDetail();
VNodeDetail(qint64 id, Tools::Enum typeTool, Draw::Mode mode, NodeDetail::Type typeNode); VNodeDetail(qint64 id, Tool::Tools typeTool, Draw::Draws mode, NodeDetail::NodeDetails typeNode);
VNodeDetail(const VNodeDetail &node); VNodeDetail(const VNodeDetail &node);
qint64 getId() const; qint64 getId() const;
void setId(const qint64 &value); void setId(const qint64 &value);
Tools::Enum getTypeTool() const; Tool::Tools getTypeTool() const;
void setTypeTool(const Tools::Enum &value); void setTypeTool(const Tool::Tools &value);
Draw::Mode getMode() const; Draw::Draws getMode() const;
void setMode(const Draw::Mode &value); void setMode(const Draw::Draws &value);
NodeDetail::Type getTypeNode() const; NodeDetail::NodeDetails getTypeNode() const;
void setTypeNode(const NodeDetail::Type &value); void setTypeNode(const NodeDetail::NodeDetails &value);
private: private:
qint64 id; qint64 id;
Tools::Enum typeTool; Tool::Tools typeTool;
Draw::Mode mode; Draw::Draws mode;
NodeDetail::Type typeNode; NodeDetail::NodeDetails typeNode;
}; };
Q_DECLARE_METATYPE(VNodeDetail) Q_DECLARE_METATYPE(VNodeDetail)

View File

@ -35,14 +35,14 @@ VSpline::VSpline ( const VSpline & spline ):p1(spline.GetP1 ()), p2(spline.GetP2
} }
VSpline::VSpline (const QMap<qint64, VPointF> *points, qint64 p1, qint64 p4, qreal angle1, qreal angle2, VSpline::VSpline (const QMap<qint64, VPointF> *points, qint64 p1, qint64 p4, qreal angle1, qreal angle2,
qreal kAsm1, qreal kAsm2 , qreal kCurve, Draw::Mode mode, qint64 idObject):p1(p1), p2(QPointF()), p3(QPointF()), qreal kAsm1, qreal kAsm2 , qreal kCurve, Draw::Draws mode, qint64 idObject):p1(p1), p2(QPointF()), p3(QPointF()),
p4(p4), angle1(angle1), angle2(angle2), kAsm1(kAsm1), kAsm2(kAsm2), kCurve(kCurve), points(points), p4(p4), angle1(angle1), angle2(angle2), kAsm1(kAsm1), kAsm2(kAsm2), kCurve(kCurve), points(points),
_referens(0), mode(mode), idObject(idObject){ _referens(0), mode(mode), idObject(idObject){
ModifiSpl ( p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve ); ModifiSpl ( p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve );
} }
VSpline::VSpline (const QMap<qint64, VPointF> *points, qint64 p1, QPointF p2, QPointF p3, qint64 p4, VSpline::VSpline (const QMap<qint64, VPointF> *points, qint64 p1, QPointF p2, QPointF p3, qint64 p4,
qreal kCurve, Draw::Mode mode, qint64 idObject):p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1), kAsm2(1), qreal kCurve, Draw::Draws mode, qint64 idObject):p1(p1), p2(p2), p3(p3), p4(p4), angle1(0), angle2(0), kAsm1(1), kAsm2(1),
kCurve(1), points(points), _referens(0), mode(mode), idObject(idObject){ kCurve(1), points(points), _referens(0), mode(mode), idObject(idObject){
ModifiSpl ( p1, p2, p3, p4, kCurve); ModifiSpl ( p1, p2, p3, p4, kCurve);
} }
@ -768,11 +768,11 @@ qint32 VSpline::Cubic(qreal *x, qreal a, qreal b, qreal c){
// this->ModifiSpl(P1, P2, P3, P4); // this->ModifiSpl(P1, P2, P3, P4);
//} //}
Draw::Mode VSpline::getMode() const{ Draw::Draws VSpline::getMode() const{
return mode; return mode;
} }
void VSpline::setMode(const Draw::Mode &value){ void VSpline::setMode(const Draw::Draws &value){
mode = value; mode = value;
} }

View File

@ -53,7 +53,7 @@ public:
*/ */
VSpline (const QMap<qint64, VPointF> *points, qint64 p1, qint64 p4, qreal angle1, VSpline (const QMap<qint64, VPointF> *points, qint64 p1, qint64 p4, qreal angle1,
qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve, qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve,
Draw::Mode mode = Draw::Calculation, qint64 idObject = 0); Draw::Draws mode = Draw::Calculation, qint64 idObject = 0);
/** /**
* @brief VSpline конструктор. * @brief VSpline конструктор.
* @param p1 початкова точка сплайну. * @param p1 початкова точка сплайну.
@ -62,7 +62,7 @@ public:
* @param p4 кінцева точка сплайну. * @param p4 кінцева точка сплайну.
*/ */
VSpline (const QMap<qint64, VPointF> *points, qint64 p1, QPointF p2, QPointF p3, VSpline (const QMap<qint64, VPointF> *points, qint64 p1, QPointF p2, QPointF p3,
qint64 p4, qreal kCurve, Draw::Mode mode = Draw::Calculation, qint64 p4, qreal kCurve, Draw::Draws mode = Draw::Calculation,
qint64 idObject = 0); qint64 idObject = 0);
/** /**
* @brief ModifiSpl модифікує сплайн. * @brief ModifiSpl модифікує сплайн.
@ -183,8 +183,8 @@ public:
qint32 referens() const; qint32 referens() const;
void incrementReferens(); void incrementReferens();
void decrementReferens(); void decrementReferens();
Draw::Mode getMode() const; Draw::Draws getMode() const;
void setMode(const Draw::Mode &value); void setMode(const Draw::Draws &value);
static QVector<QPointF> SplinePoints(QPointF p1, QPointF p4, qreal angle1, static QVector<QPointF> SplinePoints(QPointF p1, QPointF p4, qreal angle1,
qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve); qreal angle2, qreal kAsm1, qreal kAsm2, qreal kCurve);
qint64 getIdObject() const; qint64 getIdObject() const;
@ -230,7 +230,7 @@ private:
qreal kCurve; qreal kCurve;
const QMap<qint64, VPointF> *points; const QMap<qint64, VPointF> *points;
qint32 _referens; qint32 _referens;
Draw::Mode mode; Draw::Draws mode;
qint64 idObject; qint64 idObject;
/** /**
* @brief LengthBezier повертає дожину сплайну за його чотирьма точками. * @brief LengthBezier повертає дожину сплайну за його чотирьма точками.

View File

@ -25,7 +25,7 @@ VSplinePath::VSplinePath(): path(QVector<VSplinePoint>()), kCurve(1), mode(Draw:
_referens(0), idObject(0){ _referens(0), idObject(0){
} }
VSplinePath::VSplinePath(const QMap<qint64, VPointF> *points, qreal kCurve, Draw::Mode mode, qint64 idObject): path(QVector<VSplinePoint>()), VSplinePath::VSplinePath(const QMap<qint64, VPointF> *points, qreal kCurve, Draw::Draws mode, qint64 idObject): path(QVector<VSplinePoint>()),
kCurve(kCurve), mode(mode), points(points), _referens(0), idObject(idObject){ kCurve(kCurve), mode(mode), points(points), _referens(0), idObject(idObject){
} }
@ -34,11 +34,11 @@ VSplinePath::VSplinePath(const VSplinePath &splPath): path(*splPath.GetPoint()),
idObject(splPath.getIdObject()){ idObject(splPath.getIdObject()){
} }
Draw::Mode VSplinePath::getMode() const{ Draw::Draws VSplinePath::getMode() const{
return mode; return mode;
} }
void VSplinePath::setMode(const Draw::Mode &value){ void VSplinePath::setMode(const Draw::Draws &value){
mode = value; mode = value;
} }

View File

@ -48,7 +48,7 @@ public:
* @brief VSplinePath конструктор по замовчуванню. * @brief VSplinePath конструктор по замовчуванню.
*/ */
VSplinePath(const QMap<qint64, VPointF> *points, qreal kCurve = 1, VSplinePath(const QMap<qint64, VPointF> *points, qreal kCurve = 1,
Draw::Mode mode = Draw::Calculation, qint64 idObject = 0); Draw::Draws mode = Draw::Calculation, qint64 idObject = 0);
VSplinePath(const VSplinePath& splPath); VSplinePath(const VSplinePath& splPath);
/** /**
* @brief append додає точку сплайну до шляху. * @brief append додає точку сплайну до шляху.
@ -77,8 +77,8 @@ public:
qint32 referens() const; qint32 referens() const;
void incrementReferens(); void incrementReferens();
void decrementReferens(); void decrementReferens();
Draw::Mode getMode() const; Draw::Draws getMode() const;
void setMode(const Draw::Mode &value); void setMode(const Draw::Draws &value);
qint64 getIdObject() const; qint64 getIdObject() const;
void setIdObject(const qint64 &value); void setIdObject(const qint64 &value);
@ -89,7 +89,7 @@ protected:
*/ */
QVector<VSplinePoint> path; QVector<VSplinePoint> path;
qreal kCurve; qreal kCurve;
Draw::Mode mode; Draw::Draws mode;
const QMap<qint64, VPointF> *points; const QMap<qint64, VPointF> *points;
qint32 _referens; qint32 _referens;
qint64 idObject; qint64 idObject;

View File

@ -37,7 +37,7 @@
#include "exception/vexceptionwrongparameterid.h" #include "exception/vexceptionwrongparameterid.h"
MainWindow::MainWindow(QWidget *parent) : MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent), ui(new Ui::MainWindow), tool(Tools::ArrowTool), currentScene(0), sceneDraw(0), QMainWindow(parent), ui(new Ui::MainWindow), tool(Tool::ArrowTool), currentScene(0), sceneDraw(0),
sceneDetails(0), mouseCoordinate(0), helpLabel(0), view(0), isInitialized(false), dialogTable(0), sceneDetails(0), mouseCoordinate(0), helpLabel(0), view(0), isInitialized(false), dialogTable(0),
dialogEndLine(QSharedPointer<DialogEndLine>()), dialogLine(QSharedPointer<DialogLine>()), dialogEndLine(QSharedPointer<DialogEndLine>()), dialogLine(QSharedPointer<DialogLine>()),
dialogAlongLine(QSharedPointer<DialogAlongLine>()), dialogAlongLine(QSharedPointer<DialogAlongLine>()),
@ -152,7 +152,7 @@ void MainWindow::ActionNewDraw(){
connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem); connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem);
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
tools->insert(id, spoint); tools->insert(id, spoint);
VDrawTool::AddRecord(id, Tools::SinglePointTool, doc); VDrawTool::AddRecord(id, Tool::SinglePointTool, doc);
SetEnableTool(true); SetEnableTool(true);
SetEnableWidgets(true); SetEnableWidgets(true);
changeInFile = true; changeInFile = true;
@ -191,7 +191,7 @@ void MainWindow::OptionDraw(){
} }
template <typename Dialog, typename Func> template <typename Dialog, typename Func>
void MainWindow::SetToolButton(bool checked, Tools::Enum t, const QString &cursor, void MainWindow::SetToolButton(bool checked, Tool::Tools t, const QString &cursor,
QSharedPointer<Dialog> &dialog, Func closeDialogSlot){ QSharedPointer<Dialog> &dialog, Func closeDialogSlot){
if(checked){ if(checked){
CanselTool(); CanselTool();
@ -211,8 +211,8 @@ void MainWindow::SetToolButton(bool checked, Tools::Enum t, const QString &curso
} }
} }
template <typename Tool> template <typename T>
void MainWindow::AddToolToDetail(Tool *tool, const qint64 &id, Tools::Enum typeTool, void MainWindow::AddToolToDetail(T *tool, const qint64 &id, Tool::Tools typeTool,
const qint64 &idDetail){ const qint64 &idDetail){
QMap<qint64, VDataTool*>* tools = doc->getTools(); QMap<qint64, VDataTool*>* tools = doc->getTools();
VToolDetail *det = qobject_cast<VToolDetail*>(tools->value(idDetail)); VToolDetail *det = qobject_cast<VToolDetail*>(tools->value(idDetail));
@ -221,7 +221,7 @@ void MainWindow::AddToolToDetail(Tool *tool, const qint64 &id, Tools::Enum typeT
} }
void MainWindow::ToolEndLine(bool checked){ void MainWindow::ToolEndLine(bool checked){
SetToolButton(checked, Tools::EndLineTool, ":/cursor/endline_cursor.png", dialogEndLine, SetToolButton(checked, Tool::EndLineTool, ":/cursor/endline_cursor.png", dialogEndLine,
&MainWindow::ClosedDialogEndLine); &MainWindow::ClosedDialogEndLine);
} }
@ -231,14 +231,14 @@ void MainWindow::ClosedDialogEndLine(int result){
VToolEndLine::Create(dialogEndLine, currentScene, doc, data); VToolEndLine::Create(dialogEndLine, currentScene, doc, data);
} else { } else {
VModelingEndLine *endLine = VModelingEndLine::Create(dialogEndLine, doc, data); VModelingEndLine *endLine = VModelingEndLine::Create(dialogEndLine, doc, data);
AddToolToDetail(endLine, endLine->getId(), Tools::EndLineTool, dialogEndLine->getIdDetail()); AddToolToDetail(endLine, endLine->getId(), Tool::EndLineTool, dialogEndLine->getIdDetail());
} }
} }
ArrowTool(); ArrowTool();
} }
void MainWindow::ToolLine(bool checked){ void MainWindow::ToolLine(bool checked){
SetToolButton(checked, Tools::LineTool, ":/cursor/line_cursor.png", dialogLine, SetToolButton(checked, Tool::LineTool, ":/cursor/line_cursor.png", dialogLine,
&MainWindow::ClosedDialogLine); &MainWindow::ClosedDialogLine);
} }
@ -248,14 +248,14 @@ void MainWindow::ClosedDialogLine(int result){
VToolLine::Create(dialogLine, currentScene, doc, data); VToolLine::Create(dialogLine, currentScene, doc, data);
} else { } else {
VModelingLine *line = VModelingLine::Create(dialogLine, doc, data); VModelingLine *line = VModelingLine::Create(dialogLine, doc, data);
AddToolToDetail(line, line->getId(), Tools::LineTool, dialogLine->getIdDetail()); AddToolToDetail(line, line->getId(), Tool::LineTool, dialogLine->getIdDetail());
} }
} }
ArrowTool(); ArrowTool();
} }
void MainWindow::ToolAlongLine(bool checked){ void MainWindow::ToolAlongLine(bool checked){
SetToolButton(checked, Tools::AlongLineTool, ":/cursor/alongline_cursor.png", dialogAlongLine, SetToolButton(checked, Tool::AlongLineTool, ":/cursor/alongline_cursor.png", dialogAlongLine,
&MainWindow::ClosedDialogAlongLine); &MainWindow::ClosedDialogAlongLine);
} }
@ -265,14 +265,14 @@ void MainWindow::ClosedDialogAlongLine(int result){
VToolAlongLine::Create(dialogAlongLine, currentScene, doc, data); VToolAlongLine::Create(dialogAlongLine, currentScene, doc, data);
} else{ } else{
VModelingAlongLine *point = VModelingAlongLine::Create(dialogAlongLine, doc, data); VModelingAlongLine *point = VModelingAlongLine::Create(dialogAlongLine, doc, data);
AddToolToDetail(point, point->getId(), Tools::AlongLineTool, dialogAlongLine->getIdDetail()); AddToolToDetail(point, point->getId(), Tool::AlongLineTool, dialogAlongLine->getIdDetail());
} }
} }
ArrowTool(); ArrowTool();
} }
void MainWindow::ToolShoulderPoint(bool checked){ void MainWindow::ToolShoulderPoint(bool checked){
SetToolButton(checked, Tools::ShoulderPointTool, ":/cursor/shoulder_cursor.png", dialogShoulderPoint, SetToolButton(checked, Tool::ShoulderPointTool, ":/cursor/shoulder_cursor.png", dialogShoulderPoint,
&MainWindow::ClosedDialogShoulderPoint); &MainWindow::ClosedDialogShoulderPoint);
} }
@ -282,7 +282,7 @@ void MainWindow::ClosedDialogShoulderPoint(int result){
VToolShoulderPoint::Create(dialogShoulderPoint, currentScene, doc, data); VToolShoulderPoint::Create(dialogShoulderPoint, currentScene, doc, data);
} else { } else {
VModelingShoulderPoint *point = VModelingShoulderPoint::Create(dialogShoulderPoint, doc, data); VModelingShoulderPoint *point = VModelingShoulderPoint::Create(dialogShoulderPoint, doc, data);
AddToolToDetail(point, point->getId(), Tools::ShoulderPointTool, AddToolToDetail(point, point->getId(), Tool::ShoulderPointTool,
dialogShoulderPoint->getIdDetail()); dialogShoulderPoint->getIdDetail());
} }
} }
@ -290,7 +290,7 @@ void MainWindow::ClosedDialogShoulderPoint(int result){
} }
void MainWindow::ToolNormal(bool checked){ void MainWindow::ToolNormal(bool checked){
SetToolButton(checked, Tools::NormalTool, ":/cursor/normal_cursor.png", dialogNormal, SetToolButton(checked, Tool::NormalTool, ":/cursor/normal_cursor.png", dialogNormal,
&MainWindow::ClosedDialogNormal); &MainWindow::ClosedDialogNormal);
} }
@ -300,14 +300,14 @@ void MainWindow::ClosedDialogNormal(int result){
VToolNormal::Create(dialogNormal, currentScene, doc, data); VToolNormal::Create(dialogNormal, currentScene, doc, data);
} else { } else {
VModelingNormal *point = VModelingNormal::Create(dialogNormal, doc, data); VModelingNormal *point = VModelingNormal::Create(dialogNormal, doc, data);
AddToolToDetail(point, point->getId(), Tools::NormalTool, dialogNormal->getIdDetail()); AddToolToDetail(point, point->getId(), Tool::NormalTool, dialogNormal->getIdDetail());
} }
} }
ArrowTool(); ArrowTool();
} }
void MainWindow::ToolBisector(bool checked){ void MainWindow::ToolBisector(bool checked){
SetToolButton(checked, Tools::BisectorTool, ":/cursor/bisector_cursor.png", dialogBisector, SetToolButton(checked, Tool::BisectorTool, ":/cursor/bisector_cursor.png", dialogBisector,
&MainWindow::ClosedDialogBisector); &MainWindow::ClosedDialogBisector);
} }
@ -317,14 +317,14 @@ void MainWindow::ClosedDialogBisector(int result){
VToolBisector::Create(dialogBisector, currentScene, doc, data); VToolBisector::Create(dialogBisector, currentScene, doc, data);
} else { } else {
VModelingBisector *point = VModelingBisector::Create(dialogBisector, doc, data); VModelingBisector *point = VModelingBisector::Create(dialogBisector, doc, data);
AddToolToDetail(point, point->getId(), Tools::BisectorTool, dialogBisector->getIdDetail()); AddToolToDetail(point, point->getId(), Tool::BisectorTool, dialogBisector->getIdDetail());
} }
} }
ArrowTool(); ArrowTool();
} }
void MainWindow::ToolLineIntersect(bool checked){ void MainWindow::ToolLineIntersect(bool checked){
SetToolButton(checked, Tools::LineIntersectTool, ":/cursor/intersect_cursor.png", dialogLineIntersect, SetToolButton(checked, Tool::LineIntersectTool, ":/cursor/intersect_cursor.png", dialogLineIntersect,
&MainWindow::ClosedDialogLineIntersect); &MainWindow::ClosedDialogLineIntersect);
} }
@ -334,7 +334,7 @@ void MainWindow::ClosedDialogLineIntersect(int result){
VToolLineIntersect::Create(dialogLineIntersect, currentScene, doc, data); VToolLineIntersect::Create(dialogLineIntersect, currentScene, doc, data);
} else { } else {
VModelingLineIntersect *point = VModelingLineIntersect::Create(dialogLineIntersect, doc, data); VModelingLineIntersect *point = VModelingLineIntersect::Create(dialogLineIntersect, doc, data);
AddToolToDetail(point, point->getId(), Tools::LineIntersectTool, AddToolToDetail(point, point->getId(), Tool::LineIntersectTool,
dialogLineIntersect->getIdDetail()); dialogLineIntersect->getIdDetail());
} }
} }
@ -342,7 +342,7 @@ void MainWindow::ClosedDialogLineIntersect(int result){
} }
void MainWindow::ToolSpline(bool checked){ void MainWindow::ToolSpline(bool checked){
SetToolButton(checked, Tools::SplineTool, ":/cursor/spline_cursor.png", dialogSpline, SetToolButton(checked, Tool::SplineTool, ":/cursor/spline_cursor.png", dialogSpline,
&MainWindow::ClosedDialogSpline); &MainWindow::ClosedDialogSpline);
} }
@ -352,14 +352,14 @@ void MainWindow::ClosedDialogSpline(int result){
VToolSpline::Create(dialogSpline, currentScene, doc, data); VToolSpline::Create(dialogSpline, currentScene, doc, data);
} else { } else {
VModelingSpline *spl = VModelingSpline::Create(dialogSpline, doc, data); VModelingSpline *spl = VModelingSpline::Create(dialogSpline, doc, data);
AddToolToDetail(spl, spl->getId(), Tools::SplineTool, dialogSpline->getIdDetail()); AddToolToDetail(spl, spl->getId(), Tool::SplineTool, dialogSpline->getIdDetail());
} }
} }
ArrowTool(); ArrowTool();
} }
void MainWindow::ToolArc(bool checked){ void MainWindow::ToolArc(bool checked){
SetToolButton(checked, Tools::ArcTool, ":/cursor/arc_cursor.png", dialogArc, SetToolButton(checked, Tool::ArcTool, ":/cursor/arc_cursor.png", dialogArc,
&MainWindow::ClosedDialogArc); &MainWindow::ClosedDialogArc);
} }
@ -369,14 +369,14 @@ void MainWindow::ClosedDialogArc(int result){
VToolArc::Create(dialogArc, currentScene, doc, data); VToolArc::Create(dialogArc, currentScene, doc, data);
} else { } else {
VModelingArc *arc = VModelingArc::Create(dialogArc, doc, data); VModelingArc *arc = VModelingArc::Create(dialogArc, doc, data);
AddToolToDetail(arc, arc->getId(), Tools::ArcTool, dialogArc->getIdDetail()); AddToolToDetail(arc, arc->getId(), Tool::ArcTool, dialogArc->getIdDetail());
} }
} }
ArrowTool(); ArrowTool();
} }
void MainWindow::ToolSplinePath(bool checked){ void MainWindow::ToolSplinePath(bool checked){
SetToolButton(checked, Tools::SplinePathTool, ":/cursor/splinepath_cursor.png", dialogSplinePath, SetToolButton(checked, Tool::SplinePathTool, ":/cursor/splinepath_cursor.png", dialogSplinePath,
&MainWindow::ClosedDialogSplinePath); &MainWindow::ClosedDialogSplinePath);
} }
@ -386,14 +386,14 @@ void MainWindow::ClosedDialogSplinePath(int result){
VToolSplinePath::Create(dialogSplinePath, currentScene, doc, data); VToolSplinePath::Create(dialogSplinePath, currentScene, doc, data);
} else { } else {
VModelingSplinePath *spl = VModelingSplinePath::Create(dialogSplinePath, doc, data); VModelingSplinePath *spl = VModelingSplinePath::Create(dialogSplinePath, doc, data);
AddToolToDetail(spl, spl->getId(), Tools::SplinePathTool, dialogSplinePath->getIdDetail()); AddToolToDetail(spl, spl->getId(), Tool::SplinePathTool, dialogSplinePath->getIdDetail());
} }
} }
ArrowTool(); ArrowTool();
} }
void MainWindow::ToolPointOfContact(bool checked){ void MainWindow::ToolPointOfContact(bool checked){
SetToolButton(checked, Tools::PointOfContact, ":/cursor/pointcontact_cursor.png", dialogPointOfContact, SetToolButton(checked, Tool::PointOfContact, ":/cursor/pointcontact_cursor.png", dialogPointOfContact,
&MainWindow::ClosedDialogPointOfContact); &MainWindow::ClosedDialogPointOfContact);
} }
@ -404,7 +404,7 @@ void MainWindow::ClosedDialogPointOfContact(int result){
} else { } else {
VModelingPointOfContact *point = VModelingPointOfContact::Create(dialogPointOfContact, doc, VModelingPointOfContact *point = VModelingPointOfContact::Create(dialogPointOfContact, doc,
data); data);
AddToolToDetail(point, point->getId(), Tools::PointOfContact, AddToolToDetail(point, point->getId(), Tool::PointOfContact,
dialogPointOfContact->getIdDetail()); dialogPointOfContact->getIdDetail());
} }
} }
@ -414,7 +414,7 @@ void MainWindow::ClosedDialogPointOfContact(int result){
void MainWindow::ToolDetail(bool checked){ void MainWindow::ToolDetail(bool checked){
if(checked){ if(checked){
CanselTool(); CanselTool();
tool = Tools::Detail; tool = Tool::Detail;
QPixmap pixmap("://cursor/new_detail_cursor.png"); QPixmap pixmap("://cursor/new_detail_cursor.png");
QCursor cur(pixmap, 2, 3); QCursor cur(pixmap, 2, 3);
view->setCursor(cur); view->setCursor(cur);
@ -575,79 +575,79 @@ void MainWindow::mouseMove(QPointF scenePos){
void MainWindow::CanselTool(){ void MainWindow::CanselTool(){
switch( tool ) switch( tool )
{ {
case Tools::ArrowTool: case Tool::ArrowTool:
ui->actionArrowTool->setChecked(false); ui->actionArrowTool->setChecked(false);
break; break;
case Tools::SinglePointTool: case Tool::SinglePointTool:
//Nothing to do here because we can't create this tool from main window. //Nothing to do here because we can't create this tool from main window.
break; break;
case Tools::EndLineTool: case Tool::EndLineTool:
dialogEndLine.clear(); dialogEndLine.clear();
ui->toolButtonEndLine->setChecked(false); ui->toolButtonEndLine->setChecked(false);
currentScene->setFocus(Qt::OtherFocusReason); currentScene->setFocus(Qt::OtherFocusReason);
currentScene->clearSelection(); currentScene->clearSelection();
break; break;
case Tools::LineTool: case Tool::LineTool:
dialogLine.clear(); dialogLine.clear();
ui->toolButtonLine->setChecked(false); ui->toolButtonLine->setChecked(false);
currentScene->setFocus(Qt::OtherFocusReason); currentScene->setFocus(Qt::OtherFocusReason);
currentScene->clearFocus(); currentScene->clearFocus();
break; break;
case Tools::AlongLineTool: case Tool::AlongLineTool:
dialogAlongLine.clear(); dialogAlongLine.clear();
ui->toolButtonAlongLine->setChecked(false); ui->toolButtonAlongLine->setChecked(false);
currentScene->setFocus(Qt::OtherFocusReason); currentScene->setFocus(Qt::OtherFocusReason);
currentScene->clearSelection(); currentScene->clearSelection();
break; break;
case Tools::ShoulderPointTool: case Tool::ShoulderPointTool:
dialogShoulderPoint.clear(); dialogShoulderPoint.clear();
ui->toolButtonShoulderPoint->setChecked(false); ui->toolButtonShoulderPoint->setChecked(false);
currentScene->setFocus(Qt::OtherFocusReason); currentScene->setFocus(Qt::OtherFocusReason);
currentScene->clearSelection(); currentScene->clearSelection();
break; break;
case Tools::NormalTool: case Tool::NormalTool:
dialogNormal.clear(); dialogNormal.clear();
ui->toolButtonNormal->setChecked(false); ui->toolButtonNormal->setChecked(false);
currentScene->setFocus(Qt::OtherFocusReason); currentScene->setFocus(Qt::OtherFocusReason);
currentScene->clearSelection(); currentScene->clearSelection();
break; break;
case Tools::BisectorTool: case Tool::BisectorTool:
dialogBisector.clear(); dialogBisector.clear();
ui->toolButtonBisector->setChecked(false); ui->toolButtonBisector->setChecked(false);
currentScene->setFocus(Qt::OtherFocusReason); currentScene->setFocus(Qt::OtherFocusReason);
currentScene->clearSelection(); currentScene->clearSelection();
break; break;
case Tools::LineIntersectTool: case Tool::LineIntersectTool:
dialogLineIntersect.clear(); dialogLineIntersect.clear();
ui->toolButtonLineIntersect->setChecked(false); ui->toolButtonLineIntersect->setChecked(false);
currentScene->setFocus(Qt::OtherFocusReason); currentScene->setFocus(Qt::OtherFocusReason);
currentScene->clearSelection(); currentScene->clearSelection();
break; break;
case Tools::SplineTool: case Tool::SplineTool:
dialogSpline.clear(); dialogSpline.clear();
ui->toolButtonSpline->setChecked(false); ui->toolButtonSpline->setChecked(false);
currentScene->setFocus(Qt::OtherFocusReason); currentScene->setFocus(Qt::OtherFocusReason);
currentScene->clearSelection(); currentScene->clearSelection();
break; break;
case Tools::ArcTool: case Tool::ArcTool:
dialogArc.clear(); dialogArc.clear();
ui->toolButtonArc->setChecked(false); ui->toolButtonArc->setChecked(false);
currentScene->setFocus(Qt::OtherFocusReason); currentScene->setFocus(Qt::OtherFocusReason);
currentScene->clearSelection(); currentScene->clearSelection();
break; break;
case Tools::SplinePathTool: case Tool::SplinePathTool:
dialogSplinePath.clear(); dialogSplinePath.clear();
ui->toolButtonSplinePath->setChecked(false); ui->toolButtonSplinePath->setChecked(false);
currentScene->setFocus(Qt::OtherFocusReason); currentScene->setFocus(Qt::OtherFocusReason);
currentScene->clearSelection(); currentScene->clearSelection();
break; break;
case Tools::PointOfContact: case Tool::PointOfContact:
dialogPointOfContact.clear(); dialogPointOfContact.clear();
ui->toolButtonPointOfContact->setChecked(false); ui->toolButtonPointOfContact->setChecked(false);
currentScene->setFocus(Qt::OtherFocusReason); currentScene->setFocus(Qt::OtherFocusReason);
currentScene->clearSelection(); currentScene->clearSelection();
break; break;
case Tools::Detail: case Tool::Detail:
dialogDetail.clear(); dialogDetail.clear();
ui->toolButtonNewDetail->setChecked(false); ui->toolButtonNewDetail->setChecked(false);
break; break;
@ -660,7 +660,7 @@ void MainWindow::CanselTool(){
void MainWindow::ArrowTool(){ void MainWindow::ArrowTool(){
CanselTool(); CanselTool();
ui->actionArrowTool->setChecked(true); ui->actionArrowTool->setChecked(true);
tool = Tools::ArrowTool; tool = Tool::ArrowTool;
QCursor cur(Qt::ArrowCursor); QCursor cur(Qt::ArrowCursor);
view->setCursor(cur); view->setCursor(cur);
helpLabel->setText(""); helpLabel->setText("");

View File

@ -113,7 +113,7 @@ protected:
private: private:
Q_DISABLE_COPY(MainWindow) Q_DISABLE_COPY(MainWindow)
Ui::MainWindow *ui; Ui::MainWindow *ui;
Tools::Enum tool; Tool::Tools tool;
VMainGraphicsScene *currentScene; VMainGraphicsScene *currentScene;
VMainGraphicsScene *sceneDraw; VMainGraphicsScene *sceneDraw;
VMainGraphicsScene *sceneDetails; VMainGraphicsScene *sceneDetails;
@ -140,7 +140,7 @@ private:
QComboBox *comboBoxDraws; QComboBox *comboBoxDraws;
QString fileName; QString fileName;
bool changeInFile; bool changeInFile;
Draw::Mode mode; Draw::Draws mode;
void ToolBarOption(); void ToolBarOption();
void ToolBarDraws(); void ToolBarDraws();
void CanselTool(); void CanselTool();
@ -148,12 +148,12 @@ private:
void SetEnableWidgets(bool enable); void SetEnableWidgets(bool enable);
void SetEnableTool(bool enable); void SetEnableTool(bool enable);
template <typename Dialog, typename Func> template <typename Dialog, typename Func>
void SetToolButton(bool checked, Tools::Enum t, const QString &cursor, void SetToolButton(bool checked, Tool::Tools t, const QString &cursor,
QSharedPointer<Dialog> &dialog, QSharedPointer<Dialog> &dialog,
Func closeDialogSlot); Func closeDialogSlot);
void MinimumScrollBar(); void MinimumScrollBar();
template <typename Tool> template <typename T>
void AddToolToDetail(Tool *tool, const qint64 &id, Tools::Enum typeTool, void AddToolToDetail(T *tool, const qint64 &id, Tool::Tools typeTool,
const qint64 &idDetail); const qint64 &idDetail);
}; };

View File

@ -22,7 +22,7 @@
#ifndef OPTIONS_H #ifndef OPTIONS_H
#define OPTIONS_H #define OPTIONS_H
#include <QtGlobal> #include <QFlags>
#define PrintDPI 96 #define PrintDPI 96
#define PaperSize 50000 #define PaperSize 50000
@ -31,23 +31,14 @@
#define widthMainLine toPixel(0.8) #define widthMainLine toPixel(0.8)
#define widthHairLine widthMainLine/3 #define widthHairLine widthMainLine/3
namespace Scene{ namespace Scene{
enum Type enum Scene { Point, Line, Spline, Arc, SplinePath, Detail };
{ Q_DECLARE_FLAGS(Scenes, Scene)
Point,
Line,
Spline,
Arc,
SplinePath,
Detail
};
} }
Q_DECLARE_OPERATORS_FOR_FLAGS( Scene::Scenes )
namespace Tools{ namespace Tool{
enum Enum enum Tool {ArrowTool,
{
ArrowTool,
SinglePointTool, SinglePointTool,
EndLineTool, EndLineTool,
LineTool, LineTool,
@ -66,14 +57,14 @@ namespace Tools{
NodeSpline, NodeSpline,
NodeSplinePath NodeSplinePath
}; };
Q_DECLARE_FLAGS(Tools, Tool)
} }
Q_DECLARE_OPERATORS_FOR_FLAGS( Tool::Tools )
namespace Draw { namespace Draw {
enum Mode enum Draw { Calculation, Modeling };
{ Q_DECLARE_FLAGS(Draws, Draw)
Calculation,
Modeling
};
} }
Q_DECLARE_OPERATORS_FOR_FLAGS(Draw::Draws)
#endif // OPTIONS_H #endif // OPTIONS_H

View File

@ -36,7 +36,7 @@ VDrawTool::~VDrawTool(){
void VDrawTool::setDialog(){ void VDrawTool::setDialog(){
} }
void VDrawTool::AddRecord(const qint64 id, Tools::Enum 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();
if(cursor <= 0){ if(cursor <= 0){

View File

@ -32,7 +32,7 @@ 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, Tools::Enum toolType, VDomDocument *doc); static void AddRecord(const qint64 id, Tool::Tools toolType, VDomDocument *doc);
void ignoreContextMenu(bool enable); void ignoreContextMenu(bool 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);

View File

@ -112,7 +112,7 @@ void VToolAlongLine::Create(QSharedPointer<DialogAlongLine> &dialog, VMainGraphi
void VToolAlongLine::Create(const qint64 _id, const QString &pointName, const QString &typeLine, void VToolAlongLine::Create(const qint64 _id, const QString &pointName, const QString &typeLine,
const QString &formula, const qint64 &firstPointId, const qint64 &secondPointId, const QString &formula, const qint64 &firstPointId, const qint64 &secondPointId,
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation){ VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation){
VPointF firstPoint = data->GetPoint(firstPointId); VPointF firstPoint = data->GetPoint(firstPointId);
VPointF secondPoint = data->GetPoint(secondPointId); VPointF secondPoint = data->GetPoint(secondPointId);
QLineF line = QLineF(firstPoint.toQPointF(), secondPoint.toQPointF()); QLineF line = QLineF(firstPoint.toQPointF(), secondPoint.toQPointF());
@ -135,7 +135,7 @@ void VToolAlongLine::Create(const qint64 _id, const QString &pointName, const QS
} }
} }
} }
VDrawTool::AddRecord(id, Tools::AlongLineTool, doc); VDrawTool::AddRecord(id, Tool::AlongLineTool, doc);
data->AddLine(firstPointId, id); data->AddLine(firstPointId, id);
data->AddLine(id, secondPointId); data->AddLine(id, secondPointId);
if(parse == Document::FullParse){ if(parse == Document::FullParse){

View File

@ -38,7 +38,7 @@ public:
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 qint64 &firstPointId, const qint64 &secondPointId, const QString &formula, const qint64 &firstPointId, const qint64 &secondPointId,
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation); VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -62,7 +62,7 @@ void VToolArc::Create(QSharedPointer<DialogArc> &dialog, VMainGraphicsScene *sce
void VToolArc::Create(const qint64 _id, const qint64 &center, const QString &radius, const QString &f1, void VToolArc::Create(const qint64 _id, const qint64 &center, const QString &radius, const QString &f1,
const QString &f2, VMainGraphicsScene *scene, VDomDocument *doc, const QString &f2, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation){ VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation){
qreal calcRadius = 0, calcF1 = 0, calcF2 = 0; qreal calcRadius = 0, calcF1 = 0, calcF2 = 0;
Calculator cal(data); Calculator cal(data);
@ -100,7 +100,7 @@ void VToolArc::Create(const qint64 _id, const qint64 &center, const QString &rad
} }
} }
data->AddLengthArc(data->GetNameArc(center,id), arc.GetLength()); data->AddLengthArc(data->GetNameArc(center,id), arc.GetLength());
VDrawTool::AddRecord(id, Tools::ArcTool, doc); VDrawTool::AddRecord(id, Tool::ArcTool, doc);
if(parse == Document::FullParse){ if(parse == Document::FullParse){
VToolArc *toolArc = new VToolArc(doc, data, id, typeCreation); VToolArc *toolArc = new VToolArc(doc, data, id, typeCreation);
scene->addItem(toolArc); scene->addItem(toolArc);

View File

@ -40,7 +40,7 @@ public:
VContainer *data); VContainer *data);
static void Create(const qint64 _id, const qint64 &center, const QString &radius, static void Create(const qint64 _id, const qint64 &center, const QString &radius,
const QString &f1, const QString &f2, VMainGraphicsScene *scene, VDomDocument *doc, const QString &f1, const QString &f2, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation); VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -78,7 +78,7 @@ void VToolBisector::Create(const qint64 _id, const QString &formula, const qint6
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, VDomDocument *doc, VContainer *data, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
Document::Enum parse, Tool::Enum typeCreation){ const Document::Documents &parse, Tool::Enum typeCreation){
VPointF firstPoint = data->GetPoint(firstPointId); VPointF firstPoint = data->GetPoint(firstPointId);
VPointF secondPoint = data->GetPoint(secondPointId); VPointF secondPoint = data->GetPoint(secondPointId);
VPointF thirdPoint = data->GetPoint(thirdPointId); VPointF thirdPoint = data->GetPoint(thirdPointId);
@ -104,7 +104,7 @@ void VToolBisector::Create(const qint64 _id, const QString &formula, const qint6
} }
} }
data->AddLine(firstPointId, id); data->AddLine(firstPointId, id);
VDrawTool::AddRecord(id, Tools::BisectorTool, doc); VDrawTool::AddRecord(id, Tool::BisectorTool, doc);
if(parse == Document::FullParse){ if(parse == Document::FullParse){
VToolBisector *point = new VToolBisector(doc, data, id, typeLine, formula, VToolBisector *point = new VToolBisector(doc, data, id, typeLine, formula,
firstPointId, secondPointId, thirdPointId, firstPointId, secondPointId, thirdPointId,

View File

@ -41,7 +41,8 @@ public:
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, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, Document::Enum parse, Tool::Enum typeCreation); VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -61,7 +61,7 @@ void VToolEndLine::Create(QSharedPointer<DialogEndLine> &dialog, VMainGraphicsSc
void VToolEndLine::Create(const qint64 _id, const QString &pointName, const QString &typeLine, void VToolEndLine::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, VMainGraphicsScene *scene, VDomDocument *doc, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation){ VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation){
VPointF basePoint = data->GetPoint(basePointId); VPointF basePoint = data->GetPoint(basePointId);
QLineF line = QLineF(basePoint.toQPointF(), QPointF(basePoint.x()+100, basePoint.y())); QLineF line = QLineF(basePoint.toQPointF(), QPointF(basePoint.x()+100, basePoint.y()));
@ -86,7 +86,7 @@ void VToolEndLine::Create(const qint64 _id, const QString &pointName, const QStr
} }
} }
data->AddLine(basePointId, id); data->AddLine(basePointId, id);
VDrawTool::AddRecord(id, Tools::EndLineTool, doc); VDrawTool::AddRecord(id, Tool::EndLineTool, doc);
if(parse == Document::FullParse){ if(parse == Document::FullParse){
VToolEndLine *point = new VToolEndLine(doc, data, id, typeLine, formula, angle, VToolEndLine *point = new VToolEndLine(doc, data, id, typeLine, formula, angle,
basePointId, typeCreation); basePointId, typeCreation);

View File

@ -39,8 +39,8 @@ public:
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, const qreal &my,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data, Document::Enum parse, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
Tool::Enum typeCreation); const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -53,7 +53,7 @@ void VToolLine::Create(QSharedPointer<DialogLine> &dialog, VMainGraphicsScene *s
} }
void VToolLine::Create(const qint64 &id, const qint64 &firstPoint, const qint64 &secondPoint, void VToolLine::Create(const qint64 &id, const qint64 &firstPoint, const qint64 &secondPoint,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data, Document::Enum parse, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation){ Tool::Enum typeCreation){
Q_CHECK_PTR(scene); Q_CHECK_PTR(scene);
Q_CHECK_PTR(doc); Q_CHECK_PTR(doc);
@ -66,7 +66,7 @@ void VToolLine::Create(const qint64 &id, const qint64 &firstPoint, const qint64
Q_CHECK_PTR(tool); Q_CHECK_PTR(tool);
tool->VDataTool::setData(data); tool->VDataTool::setData(data);
} }
VDrawTool::AddRecord(id, Tools::LineTool, doc); VDrawTool::AddRecord(id, Tool::LineTool, doc);
if(parse == Document::FullParse){ if(parse == Document::FullParse){
qint64 id = data->getNextId(); qint64 id = data->getNextId();
VToolLine *line = new VToolLine(doc, data, id, firstPoint, secondPoint, typeCreation); VToolLine *line = new VToolLine(doc, data, id, firstPoint, secondPoint, typeCreation);

View File

@ -36,8 +36,8 @@ public:
static void Create(QSharedPointer<DialogLine> &dialog, VMainGraphicsScene *scene, VDomDocument *doc, static void Create(QSharedPointer<DialogLine> &dialog, VMainGraphicsScene *scene, 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, Document::Enum parse, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
Tool::Enum typeCreation); const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void ChangedActivDraw(const QString newName); virtual void ChangedActivDraw(const QString newName);

View File

@ -58,7 +58,7 @@ void VToolLineIntersect::Create(QSharedPointer<DialogLineIntersect> &dialog, VMa
void VToolLineIntersect::Create(const qint64 _id, const qint64 &p1Line1Id, const qint64 &p2Line1Id, void VToolLineIntersect::Create(const qint64 _id, const qint64 &p1Line1Id, const qint64 &p2Line1Id,
const qint64 &p1Line2Id, const qint64 &p2Line2Id, const QString &pointName, const qint64 &p1Line2Id, const qint64 &p2Line2Id, const QString &pointName,
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation){ VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation){
VPointF p1Line1 = data->GetPoint(p1Line1Id); VPointF p1Line1 = data->GetPoint(p1Line1Id);
VPointF p2Line1 = data->GetPoint(p2Line1Id); VPointF p2Line1 = data->GetPoint(p2Line1Id);
VPointF p1Line2 = data->GetPoint(p1Line2Id); VPointF p1Line2 = data->GetPoint(p1Line2Id);
@ -87,7 +87,7 @@ void VToolLineIntersect::Create(const qint64 _id, const qint64 &p1Line1Id, const
data->AddLine(id, p2Line1Id); data->AddLine(id, p2Line1Id);
data->AddLine(p1Line2Id, id); data->AddLine(p1Line2Id, id);
data->AddLine(id, p2Line2Id); data->AddLine(id, p2Line2Id);
VDrawTool::AddRecord(id, Tools::LineIntersectTool, doc); VDrawTool::AddRecord(id, Tool::LineIntersectTool, doc);
if(parse == Document::FullParse){ if(parse == Document::FullParse){
VToolLineIntersect *point = new VToolLineIntersect(doc, data, id, p1Line1Id, VToolLineIntersect *point = new VToolLineIntersect(doc, data, id, p1Line1Id,
p2Line1Id, p1Line2Id, p2Line1Id, p1Line2Id,

View File

@ -41,7 +41,7 @@ public:
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 &p2Line2Id, const QString &pointName, const qint64 &p1Line2Id, const qint64 &p2Line2Id, const QString &pointName,
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation); VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -63,7 +63,7 @@ void VToolNormal::Create(QSharedPointer<DialogNormal> &dialog, VMainGraphicsScen
void VToolNormal::Create(const qint64 _id, const QString &formula, const qint64 &firstPointId, void VToolNormal::Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
const qint64 &secondPointId, const QString typeLine, const QString pointName, const qint64 &secondPointId, const QString typeLine, const QString pointName,
const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, Document::Enum parse, Tool::Enum typeCreation){ VDomDocument *doc, VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation){
VPointF firstPoint = data->GetPoint(firstPointId); VPointF firstPoint = data->GetPoint(firstPointId);
VPointF secondPoint = data->GetPoint(secondPointId); VPointF secondPoint = data->GetPoint(secondPointId);
Calculator cal(data); Calculator cal(data);
@ -87,7 +87,7 @@ void VToolNormal::Create(const qint64 _id, const QString &formula, const qint64
} }
} }
data->AddLine(firstPointId, id); data->AddLine(firstPointId, id);
VDrawTool::AddRecord(id, Tools::NormalTool, doc); VDrawTool::AddRecord(id, Tool::NormalTool, doc);
if(parse == Document::FullParse){ if(parse == Document::FullParse){
VToolNormal *point = new VToolNormal(doc, data, id, typeLine, formula, angle, VToolNormal *point = new VToolNormal(doc, data, id, typeLine, formula, angle,
firstPointId, secondPointId, typeCreation); firstPointId, secondPointId, typeCreation);

View File

@ -41,7 +41,7 @@ public:
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 QString typeLine, const QString pointName, const qint64 &secondPointId, const QString typeLine, const QString pointName,
const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, Document::Enum parse, Tool::Enum typeCreation); VDomDocument *doc, VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation);
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint,
const qreal &length, const qreal &angle = 0); const qreal &length, const qreal &angle = 0);
public slots: public slots:

View File

@ -82,7 +82,7 @@ void VToolPointOfContact::Create(const qint64 _id, const QString &radius, const
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,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
Document::Enum parse, Tool::Enum typeCreation){ const Document::Documents &parse, Tool::Enum typeCreation){
VPointF centerP = data->GetPoint(center); VPointF centerP = data->GetPoint(center);
VPointF firstP = data->GetPoint(firstPointId); VPointF firstP = data->GetPoint(firstPointId);
VPointF secondP = data->GetPoint(secondPointId); VPointF secondP = data->GetPoint(secondPointId);
@ -107,7 +107,7 @@ void VToolPointOfContact::Create(const qint64 _id, const QString &radius, const
} }
} }
} }
VDrawTool::AddRecord(id, Tools::PointOfContact, doc); VDrawTool::AddRecord(id, Tool::PointOfContact, doc);
if(parse == Document::FullParse){ if(parse == Document::FullParse){
VToolPointOfContact *point = new VToolPointOfContact(doc, data, id, radius, center, VToolPointOfContact *point = new VToolPointOfContact(doc, data, id, radius, center,
firstPointId, secondPointId, typeCreation); firstPointId, secondPointId, typeCreation);

View File

@ -39,7 +39,7 @@ public:
static void Create(const qint64 _id, const QString &radius, const qint64 &center, const qint64 &firstPointId, static void Create(const qint64 _id, const QString &radius, const qint64 &center, const qint64 &firstPointId,
const qint64 &secondPointId, const QString &pointName, const qint64 &secondPointId, const QString &pointName,
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation); VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -86,7 +86,7 @@ void VToolShoulderPoint::Create(const qint64 _id, const QString &formula, const
const qint64 &p2Line, const qint64 &pShoulder, const QString &typeLine, const qint64 &p2Line, const qint64 &pShoulder, const QString &typeLine,
const QString &pointName, const qreal &mx, const qreal &my, const QString &pointName, const qreal &mx, const qreal &my,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
Document::Enum parse, Tool::Enum typeCreation){ const Document::Documents &parse, Tool::Enum typeCreation){
VPointF firstPoint = data->GetPoint(p1Line); VPointF firstPoint = data->GetPoint(p1Line);
VPointF secondPoint = data->GetPoint(p2Line); VPointF secondPoint = data->GetPoint(p2Line);
VPointF shoulderPoint = data->GetPoint(pShoulder); VPointF shoulderPoint = data->GetPoint(pShoulder);
@ -113,7 +113,7 @@ void VToolShoulderPoint::Create(const qint64 _id, const QString &formula, const
} }
data->AddLine(p1Line, id); data->AddLine(p1Line, id);
data->AddLine(p2Line, id); data->AddLine(p2Line, id);
VDrawTool::AddRecord(id, Tools::ShoulderPointTool, doc); VDrawTool::AddRecord(id, Tool::ShoulderPointTool, doc);
if(parse == Document::FullParse){ if(parse == Document::FullParse){
VToolShoulderPoint *point = new VToolShoulderPoint(doc, data, id, typeLine, formula, VToolShoulderPoint *point = new VToolShoulderPoint(doc, data, id, typeLine, formula,
p1Line, p2Line, pShoulder, p1Line, p2Line, pShoulder,

View File

@ -40,7 +40,7 @@ public:
static void Create(const qint64 _id, const QString &formula, const qint64 &p1Line, const qint64 &p2Line, static void Create(const qint64 _id, const QString &formula, const qint64 &p1Line, const qint64 &p2Line,
const qint64 &pShoulder, const QString &typeLine, const QString &pointName, const qint64 &pShoulder, const QString &typeLine, const QString &pointName,
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc, const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation); VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -89,7 +89,7 @@ void VToolSpline::Create(QSharedPointer<DialogSpline> &dialog, VMainGraphicsScen
void VToolSpline::Create(const qint64 _id, const qint64 &p1, const qint64 &p4, const qreal &kAsm1, void VToolSpline::Create(const qint64 _id, const qint64 &p1, const qint64 &p4, const qreal &kAsm1,
const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve, const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data, Document::Enum parse, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation){ Tool::Enum typeCreation){
VSpline spline = VSpline(data->DataPoints(), p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve); VSpline spline = VSpline(data->DataPoints(), p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve);
qint64 id = _id; qint64 id = _id;
@ -107,7 +107,7 @@ void VToolSpline::Create(const qint64 _id, const qint64 &p1, const qint64 &p4, c
} }
} }
data->AddLengthSpline(data->GetNameSpline(p1, p4), spline.GetLength()); data->AddLengthSpline(data->GetNameSpline(p1, p4), spline.GetLength());
VDrawTool::AddRecord(id, Tools::SplineTool, doc); VDrawTool::AddRecord(id, Tool::SplineTool, doc);
if(parse == Document::FullParse){ if(parse == Document::FullParse){
VToolSpline *spl = new VToolSpline(doc, data, id, typeCreation); VToolSpline *spl = new VToolSpline(doc, data, id, typeCreation);
scene->addItem(spl); scene->addItem(spl);

View File

@ -41,7 +41,7 @@ public:
VContainer *data); VContainer *data);
static void Create(const qint64 _id, const qint64 &p1, const qint64 &p4, const qreal &kAsm1, static void Create(const qint64 _id, const qint64 &p1, const qint64 &p4, const qreal &kAsm1,
const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve, const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal &kCurve,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data, Document::Enum parse, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation); Tool::Enum typeCreation);
signals: signals:
void RefreshLine ( const qint32 &indexSpline, SplinePoint::Position position, void RefreshLine ( const qint32 &indexSpline, SplinePoint::Position position,

View File

@ -74,7 +74,7 @@ void VToolSplinePath::Create(QSharedPointer<DialogSplinePath> &dialog, VMainGrap
} }
void VToolSplinePath::Create(const qint64 _id, const VSplinePath &path, VMainGraphicsScene *scene, void VToolSplinePath::Create(const qint64 _id, const VSplinePath &path, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, Document::Enum parse, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation){ Tool::Enum typeCreation){
qint64 id = _id; qint64 id = _id;
if(typeCreation == Tool::FromGui){ if(typeCreation == Tool::FromGui){
@ -91,7 +91,7 @@ void VToolSplinePath::Create(const qint64 _id, const VSplinePath &path, VMainGra
} }
} }
data->AddLengthSpline(data->GetNameSplinePath(path), path.GetLength()); data->AddLengthSpline(data->GetNameSplinePath(path), path.GetLength());
VDrawTool::AddRecord(id, Tools::SplinePathTool, doc); VDrawTool::AddRecord(id, Tool::SplinePathTool, doc);
if(parse == Document::FullParse){ if(parse == Document::FullParse){
VToolSplinePath *spl = new VToolSplinePath(doc, data, id, typeCreation); VToolSplinePath *spl = new VToolSplinePath(doc, data, id, typeCreation);
scene->addItem(spl); scene->addItem(spl);

View File

@ -40,7 +40,7 @@ public:
static void Create(QSharedPointer<DialogSplinePath> &dialog, VMainGraphicsScene *scene, static void Create(QSharedPointer<DialogSplinePath> &dialog, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data); VDomDocument *doc, VContainer *data);
static void Create(const qint64 _id, const VSplinePath &path, VMainGraphicsScene *scene, static void Create(const qint64 _id, const VSplinePath &path, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, Document::Enum parse, Tool::Enum typeCreation); VDomDocument *doc, VContainer *data, const Document::Documents &parse, Tool::Enum 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);

View File

@ -113,7 +113,7 @@ VModelingAlongLine *VModelingAlongLine::Create(const qint64 _id, const QString &
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 qreal &mx, const qreal &my, VDomDocument *doc, const qreal &mx, const qreal &my, VDomDocument *doc,
VContainer *data, Document::Enum parse, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation){ Tool::Enum typeCreation){
VModelingAlongLine *point = 0; VModelingAlongLine *point = 0;
VPointF firstPoint = data->GetModelingPoint(firstPointId); VPointF firstPoint = data->GetModelingPoint(firstPointId);

View File

@ -38,7 +38,7 @@ public:
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 qreal &mx, const qreal &my, const qint64 &secondPointId, const qreal &mx, const qreal &my,
VDomDocument *doc, VContainer *data, Document::Enum parse, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation); Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();

View File

@ -61,7 +61,7 @@ VModelingArc* VModelingArc::Create(QSharedPointer<DialogArc> &dialog, VDomDocume
VModelingArc* VModelingArc::Create(const qint64 _id, const qint64 &center, const QString &radius, VModelingArc* VModelingArc::Create(const qint64 _id, const qint64 &center, const QString &radius,
const QString &f1, const QString &f2, VDomDocument *doc, const QString &f1, const QString &f2, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation){ VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation){
VModelingArc *toolArc = 0; VModelingArc *toolArc = 0;
qreal calcRadius = 0, calcF1 = 0, calcF2 = 0; qreal calcRadius = 0, calcF1 = 0, calcF2 = 0;

View File

@ -39,7 +39,7 @@ public:
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 &center, const QString &radius, static VModelingArc* Create(const qint64 _id, const qint64 &center, const QString &radius,
const QString &f1, const QString &f2, VDomDocument *doc, VContainer *data, const QString &f1, const QString &f2, VDomDocument *doc, VContainer *data,
Document::Enum parse, Tool::Enum typeCreation); const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -78,7 +78,7 @@ VModelingBisector *VModelingBisector::Create(const qint64 _id, const QString &fo
const qint64 &firstPointId, const qint64 &secondPointId, const qint64 &firstPointId, const qint64 &secondPointId,
const qint64 &thirdPointId, const QString &typeLine, const qint64 &thirdPointId, const QString &typeLine,
const QString &pointName, const qreal &mx, const qreal &my, const QString &pointName, const qreal &mx, const qreal &my,
VDomDocument *doc, VContainer *data, Document::Enum parse, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation){ Tool::Enum typeCreation){
VModelingBisector *point = 0; VModelingBisector *point = 0;
VPointF firstPoint = data->GetModelingPoint(firstPointId); VPointF firstPoint = data->GetModelingPoint(firstPointId);

View File

@ -43,7 +43,7 @@ public:
const qint64 &secondPointId, const qint64 &thirdPointId, const qint64 &secondPointId, const qint64 &thirdPointId,
const QString &typeLine, const QString &pointName, const qreal &mx, const QString &typeLine, const QString &pointName, const qreal &mx,
const qreal &my, VDomDocument *doc, VContainer *data, const qreal &my, VDomDocument *doc, VContainer *data,
Document::Enum parse, Tool::Enum typeCreation); const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -62,7 +62,7 @@ VModelingEndLine *VModelingEndLine::Create(const qint64 _id, const QString &poin
const QString &typeLine, const QString &formula, const QString &typeLine, const QString &formula,
const qreal &angle, const qint64 &basePointId, const qreal &mx, const qreal &angle, const qint64 &basePointId, const qreal &mx,
const qreal &my, VDomDocument *doc, VContainer *data, const qreal &my, VDomDocument *doc, VContainer *data,
Document::Enum parse, Tool::Enum typeCreation){ const Document::Documents &parse, Tool::Enum typeCreation){
VModelingEndLine *point = 0; VModelingEndLine *point = 0;
VPointF basePoint = data->GetModelingPoint(basePointId); VPointF basePoint = data->GetModelingPoint(basePointId);
QLineF line = QLineF(basePoint.toQPointF(), QPointF(basePoint.x()+100, basePoint.y())); QLineF line = QLineF(basePoint.toQPointF(), QPointF(basePoint.x()+100, basePoint.y()));

View File

@ -40,7 +40,7 @@ public:
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,
Document::Enum parse, Tool::Enum typeCreation); const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -53,7 +53,7 @@ VModelingLine *VModelingLine::Create(QSharedPointer<DialogLine> &dialog, VDomDoc
} }
VModelingLine *VModelingLine::Create(const qint64 &id, const qint64 &firstPoint, const qint64 &secondPoint, VModelingLine *VModelingLine::Create(const qint64 &id, const qint64 &firstPoint, const qint64 &secondPoint,
VDomDocument *doc, VContainer *data, Document::Enum parse, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation){ Tool::Enum typeCreation){
VModelingLine *line = 0; VModelingLine *line = 0;
Q_CHECK_PTR(doc); Q_CHECK_PTR(doc);

View File

@ -35,7 +35,7 @@ public:
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,
VDomDocument *doc, VContainer *data, Document::Enum parse, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation); Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();

View File

@ -59,7 +59,7 @@ VModelingLineIntersect *VModelingLineIntersect::Create(const qint64 _id, const q
const qint64 &p2Line1Id, const qint64 &p1Line2Id, const qint64 &p2Line1Id, const qint64 &p1Line2Id,
const qint64 &p2Line2Id, const QString &pointName, const qint64 &p2Line2Id, const QString &pointName,
const qreal &mx, const qreal &my, VDomDocument *doc, const qreal &mx, const qreal &my, VDomDocument *doc,
VContainer *data, Document::Enum parse, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation){ Tool::Enum typeCreation){
VModelingLineIntersect *point = 0; VModelingLineIntersect *point = 0;
VPointF p1Line1 = data->GetModelingPoint(p1Line1Id); VPointF p1Line1 = data->GetModelingPoint(p1Line1Id);

View File

@ -41,7 +41,7 @@ public:
static VModelingLineIntersect* Create(const qint64 _id, const qint64 &p1Line1Id, const qint64 &p2Line1Id, static VModelingLineIntersect* Create(const qint64 _id, const qint64 &p1Line1Id, const qint64 &p2Line1Id,
const qint64 &p1Line2Id, const qint64 &p2Line2Id, const qint64 &p1Line2Id, const qint64 &p2Line2Id,
const QString &pointName, const qreal &mx, const qreal &my, const QString &pointName, const qreal &mx, const qreal &my,
VDomDocument *doc, VContainer *data, Document::Enum parse, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation); Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();

View File

@ -64,7 +64,7 @@ VModelingNormal *VModelingNormal::Create(const qint64 _id, const QString &formul
const qint64 &firstPointId, const qint64 &secondPointId, const qint64 &firstPointId, const qint64 &secondPointId,
const QString typeLine, const QString pointName, const QString typeLine, const QString pointName,
const qreal angle, const qreal &mx, const qreal &my, const qreal angle, const qreal &mx, const qreal &my,
VDomDocument *doc, VContainer *data, Document::Enum parse, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation){ Tool::Enum typeCreation){
VModelingNormal *point = 0; VModelingNormal *point = 0;
VPointF firstPoint = data->GetModelingPoint(firstPointId); VPointF firstPoint = data->GetModelingPoint(firstPointId);

View File

@ -40,7 +40,7 @@ public:
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, Document::Enum parse, const qreal &my, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation); Tool::Enum typeCreation);
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint,
const qreal &length, const qreal &angle = 0); const qreal &length, const qreal &angle = 0);

View File

@ -83,7 +83,7 @@ VModelingPointOfContact *VModelingPointOfContact::Create(const qint64 _id, const
const qint64 &secondPointId, const qint64 &secondPointId,
const QString &pointName, const qreal &mx, const QString &pointName, const qreal &mx,
const qreal &my, VDomDocument *doc, const qreal &my, VDomDocument *doc,
VContainer *data, Document::Enum parse, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation){ Tool::Enum typeCreation){
VModelingPointOfContact *point = 0; VModelingPointOfContact *point = 0;
VPointF centerP = data->GetModelingPoint(center); VPointF centerP = data->GetModelingPoint(center);

View File

@ -40,7 +40,7 @@ public:
static VModelingPointOfContact* Create(const qint64 _id, const QString &radius, const qint64 &center, static VModelingPointOfContact* Create(const qint64 _id, const QString &radius, const qint64 &center,
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, Document::Enum parse, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation); Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();

View File

@ -87,7 +87,7 @@ VModelingShoulderPoint *VModelingShoulderPoint::Create(const qint64 _id, const Q
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, VDomDocument *doc, VContainer *data, const qreal &my, VDomDocument *doc, VContainer *data,
Document::Enum parse, Tool::Enum typeCreation){ const Document::Documents &parse, Tool::Enum typeCreation){
VModelingShoulderPoint *point = 0; VModelingShoulderPoint *point = 0;
VPointF firstPoint = data->GetModelingPoint(p1Line); VPointF firstPoint = data->GetModelingPoint(p1Line);
VPointF secondPoint = data->GetModelingPoint(p2Line); VPointF secondPoint = data->GetModelingPoint(p2Line);

View File

@ -42,7 +42,7 @@ public:
const qint64 &p2Line, const qint64 &pShoulder, const qint64 &p2Line, const qint64 &pShoulder,
const QString &typeLine, const QString &pointName, const QString &typeLine, const QString &pointName,
const qreal &mx, const qreal &my, VDomDocument *doc, const qreal &mx, const qreal &my, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation); VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
virtual void FullUpdateFromGui(int result); virtual void FullUpdateFromGui(int result);

View File

@ -90,7 +90,7 @@ VModelingSpline *VModelingSpline::Create(QSharedPointer<DialogSpline> &dialog, V
VModelingSpline *VModelingSpline::Create(const qint64 _id, const qint64 &p1, const qint64 &p4, VModelingSpline *VModelingSpline::Create(const qint64 _id, const qint64 &p1, const qint64 &p4,
const qreal &kAsm1, const qreal kAsm2, const qreal &angle1, const qreal &kAsm1, const qreal kAsm2, const qreal &angle1,
const qreal &angle2, const qreal &kCurve, VDomDocument *doc, const qreal &angle2, const qreal &kCurve, VDomDocument *doc,
VContainer *data, Document::Enum parse, Tool::Enum typeCreation){ VContainer *data, const Document::Documents &parse, Tool::Enum typeCreation){
VModelingSpline *spl = 0; VModelingSpline *spl = 0;
VSpline spline = VSpline(data->DataModelingPoints(), p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve); VSpline spline = VSpline(data->DataModelingPoints(), p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve);
qint64 id = _id; qint64 id = _id;

View File

@ -42,7 +42,7 @@ public:
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 &kAsm1,
const qreal kAsm2, const qreal &angle1, const qreal &angle2, const qreal kAsm2, const qreal &angle1, const qreal &angle2,
const qreal &kCurve, VDomDocument *doc, VContainer *data, const qreal &kCurve, VDomDocument *doc, VContainer *data,
Document::Enum parse, Tool::Enum typeCreation); const Document::Documents &parse, Tool::Enum typeCreation);
signals: signals:
void RefreshLine ( const qint32 &indexSpline, SplinePoint::Position position, void RefreshLine ( const qint32 &indexSpline, SplinePoint::Position position,
const QPointF &controlPoint, const QPointF &splinePoint ); const QPointF &controlPoint, const QPointF &splinePoint );

View File

@ -74,7 +74,7 @@ VModelingSplinePath *VModelingSplinePath::Create(QSharedPointer<DialogSplinePath
} }
VModelingSplinePath * VModelingSplinePath::Create(const qint64 _id, const VSplinePath &path, VModelingSplinePath * VModelingSplinePath::Create(const qint64 _id, const VSplinePath &path,
VDomDocument *doc, VContainer *data, Document::Enum parse, VDomDocument *doc, VContainer *data, const Document::Documents &parse,
Tool::Enum typeCreation){ Tool::Enum typeCreation){
VModelingSplinePath *spl = 0; VModelingSplinePath *spl = 0;
qint64 id = _id; qint64 id = _id;

View File

@ -40,7 +40,7 @@ public:
static VModelingSplinePath* Create(QSharedPointer<DialogSplinePath> &dialog, static VModelingSplinePath* Create(QSharedPointer<DialogSplinePath> &dialog,
VDomDocument *doc, 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, Document::Enum parse, Tool::Enum typeCreation); VContainer *data, const Document::Documents &parse, Tool::Enum 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);

View File

@ -23,7 +23,7 @@
#include <QDebug> #include <QDebug>
VAbstractNode::VAbstractNode(VDomDocument *doc, VContainer *data, qint64 id, qint64 idNode, VAbstractNode::VAbstractNode(VDomDocument *doc, VContainer *data, qint64 id, qint64 idNode,
Draw::Mode typeobject, QObject *parent) : Draw::Draws typeobject, QObject *parent) :
VAbstractTool(doc, data, id, parent), idNode(idNode), typeobject(typeobject){ VAbstractTool(doc, data, id, parent), idNode(idNode), typeobject(typeobject){
} }

View File

@ -29,11 +29,11 @@ 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,
Draw::Mode typeobject, QObject *parent = 0 ); Draw::Draws typeobject, QObject *parent = 0 );
virtual ~VAbstractNode(); virtual ~VAbstractNode();
protected: protected:
qint64 idNode; qint64 idNode;
Draw::Mode typeobject; Draw::Draws typeobject;
void AddToModeling(const QDomElement &domElement); void AddToModeling(const QDomElement &domElement);
}; };

View File

@ -21,7 +21,7 @@
#include "vnodearc.h" #include "vnodearc.h"
VNodeArc::VNodeArc(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc, Draw::Mode typeobject, VNodeArc::VNodeArc(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc, Draw::Draws typeobject,
Tool::Enum typeCreation, QGraphicsItem * parent) : Tool::Enum typeCreation, QGraphicsItem * parent) :
VAbstractNode(doc, data, id, idArc, typeobject), QGraphicsPathItem(parent){ VAbstractNode(doc, data, id, idArc, typeobject), QGraphicsPathItem(parent){
RefreshGeometry(); RefreshGeometry();
@ -35,7 +35,7 @@ VNodeArc::VNodeArc(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc,
} }
VNodeArc *VNodeArc::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc, VNodeArc *VNodeArc::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc,
Draw::Mode typeobject, Document::Enum parse, Tool::Enum typeCreation){ Draw::Draws typeobject, const Document::Documents &parse, Tool::Enum typeCreation){
VNodeArc *arc = 0; VNodeArc *arc = 0;
if(parse == Document::FullParse){ if(parse == Document::FullParse){
arc = new VNodeArc(doc, data, id, idArc, typeobject, typeCreation); arc = new VNodeArc(doc, data, id, idArc, typeobject, typeCreation);

View File

@ -29,10 +29,10 @@ class VNodeArc :public VAbstractNode, public QGraphicsPathItem
{ {
Q_OBJECT Q_OBJECT
public: public:
VNodeArc(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc, Draw::Mode typeobject, VNodeArc(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc, Draw::Draws typeobject,
Tool::Enum typeCreation, QGraphicsItem * parent = 0); Tool::Enum typeCreation, QGraphicsItem * parent = 0);
static VNodeArc *Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc, static VNodeArc *Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc,
Draw::Mode typeobject, Document::Enum parse, Tool::Enum typeCreation); Draw::Draws typeobject, const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
protected: protected:

View File

@ -22,7 +22,7 @@
#include "vnodepoint.h" #include "vnodepoint.h"
VNodePoint::VNodePoint(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint, VNodePoint::VNodePoint(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint,
Draw::Mode typeobject, Tool::Enum typeCreation, QGraphicsItem *parent) Draw::Draws typeobject, Tool::Enum typeCreation, QGraphicsItem *parent)
:VAbstractNode(doc, data, id, idPoint, typeobject), QGraphicsEllipseItem(parent), :VAbstractNode(doc, data, id, idPoint, typeobject), QGraphicsEllipseItem(parent),
radius(toPixel(1.5)), namePoint(0), lineName(0){ radius(toPixel(1.5)), namePoint(0), lineName(0){
namePoint = new VGraphicsSimpleTextItem(this); namePoint = new VGraphicsSimpleTextItem(this);
@ -40,7 +40,7 @@ VNodePoint::VNodePoint(VDomDocument *doc, VContainer *data, qint64 id, qint64 id
} }
VNodePoint *VNodePoint::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint, VNodePoint *VNodePoint::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint,
Draw::Mode typeobject, Document::Enum parse, Tool::Enum typeCreation){ Draw::Draws typeobject, const Document::Documents &parse, Tool::Enum typeCreation){
VNodePoint *point = 0; VNodePoint *point = 0;
if(parse == Document::FullParse){ if(parse == Document::FullParse){
point = new VNodePoint(doc, data, id, idPoint, typeobject, typeCreation); point = new VNodePoint(doc, data, id, idPoint, typeobject, typeCreation);

View File

@ -29,10 +29,10 @@ class VNodePoint: public VAbstractNode, public QGraphicsEllipseItem
{ {
Q_OBJECT Q_OBJECT
public: public:
VNodePoint(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint, Draw::Mode typeobject, VNodePoint(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint, Draw::Draws typeobject,
Tool::Enum typeCreation, QGraphicsItem * parent = 0 ); Tool::Enum typeCreation, QGraphicsItem * parent = 0 );
static VNodePoint *Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint, static VNodePoint *Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint,
Draw::Mode typeobject, Document::Enum parse, Tool::Enum typeCreation); Draw::Draws typeobject, const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
void NameChangePosition(const QPointF pos); void NameChangePosition(const QPointF pos);

View File

@ -22,7 +22,7 @@
#include "vnodespline.h" #include "vnodespline.h"
VNodeSpline::VNodeSpline(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, VNodeSpline::VNodeSpline(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline,
Draw::Mode typeobject, Tool::Enum typeCreation, QGraphicsItem * parent) : Draw::Draws typeobject, Tool::Enum typeCreation, QGraphicsItem * parent) :
VAbstractNode(doc, data, id, idSpline, typeobject), QGraphicsPathItem(parent){ VAbstractNode(doc, data, id, idSpline, typeobject), QGraphicsPathItem(parent){
RefreshGeometry(); RefreshGeometry();
this->setPen(QPen(baseColor, widthHairLine)); this->setPen(QPen(baseColor, widthHairLine));
@ -35,7 +35,7 @@ VNodeSpline::VNodeSpline(VDomDocument *doc, VContainer *data, qint64 id, qint64
} }
VNodeSpline *VNodeSpline::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, VNodeSpline *VNodeSpline::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline,
Draw::Mode typeobject, Document::Enum parse, Tool::Enum typeCreation){ Draw::Draws typeobject, const Document::Documents &parse, Tool::Enum typeCreation){
VNodeSpline *spl = 0; VNodeSpline *spl = 0;
if(parse == Document::FullParse){ if(parse == Document::FullParse){
spl = new VNodeSpline(doc, data, id, idSpline, typeobject, typeCreation); spl = new VNodeSpline(doc, data, id, idSpline, typeobject, typeCreation);

View File

@ -29,10 +29,10 @@ class VNodeSpline:public VAbstractNode, public QGraphicsPathItem
{ {
Q_OBJECT Q_OBJECT
public: public:
VNodeSpline(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, Draw::Mode typeobject, VNodeSpline(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, Draw::Draws typeobject,
Tool::Enum typeCreation, QGraphicsItem * parent = 0); Tool::Enum 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::Mode typeobject, Document::Enum parse, Tool::Enum typeCreation); Draw::Draws typeobject, const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile (); virtual void FullUpdateFromFile ();
protected: protected:

View File

@ -22,7 +22,7 @@
#include "vnodesplinepath.h" #include "vnodesplinepath.h"
VNodeSplinePath::VNodeSplinePath(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, VNodeSplinePath::VNodeSplinePath(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline,
Draw::Mode typeobject, Tool::Enum typeCreation, Draw::Draws typeobject, Tool::Enum typeCreation,
QGraphicsItem * parent) : QGraphicsItem * parent) :
VAbstractNode(doc, data, id, idSpline, typeobject), QGraphicsPathItem(parent){ VAbstractNode(doc, data, id, idSpline, typeobject), QGraphicsPathItem(parent){
RefreshGeometry(); RefreshGeometry();
@ -36,7 +36,7 @@ VNodeSplinePath::VNodeSplinePath(VDomDocument *doc, VContainer *data, qint64 id,
} }
VNodeSplinePath *VNodeSplinePath::Create(VDomDocument *doc, VContainer *data, qint64 id, VNodeSplinePath *VNodeSplinePath::Create(VDomDocument *doc, VContainer *data, qint64 id,
qint64 idSpline, Draw::Mode typeobject, Document::Enum parse, qint64 idSpline, Draw::Draws typeobject, const Document::Documents &parse,
Tool::Enum typeCreation){ Tool::Enum typeCreation){
VNodeSplinePath *splPath = 0; VNodeSplinePath *splPath = 0;
if(parse == Document::FullParse){ if(parse == Document::FullParse){

View File

@ -30,9 +30,9 @@ 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::Mode typeobject, Tool::Enum typeCreation, QGraphicsItem * parent = 0); Draw::Draws typeobject, Tool::Enum typeCreation, QGraphicsItem * parent = 0);
static VNodeSplinePath *Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, static VNodeSplinePath *Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline,
Draw::Mode typeobject, Document::Enum parse, Tool::Enum typeCreation); Draw::Draws typeobject, const Document::Documents &parse, Tool::Enum typeCreation);
public slots: public slots:
virtual void FullUpdateFromFile(); virtual void FullUpdateFromFile();
protected: protected:

View File

@ -51,7 +51,7 @@ public slots:
virtual void FullUpdateFromFile()=0; virtual void FullUpdateFromFile()=0;
signals: signals:
void toolhaveChange(); void toolhaveChange();
void ChoosedTool(qint64 id, Scene::Type type); void ChoosedTool(qint64 id, Scene::Scenes type);
void FullUpdateTree(); void FullUpdateTree();
protected: protected:
VDomDocument *doc; VDomDocument *doc;

Some files were not shown because too many files have changed in this diff Show More