Vera++.
--HG-- branch : feature
This commit is contained in:
parent
25e6df1c1d
commit
79f2ddde2a
|
@ -31,7 +31,8 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
|
{
|
||||||
class DialogIndividualMeasurements;
|
class DialogIndividualMeasurements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,8 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
|
{
|
||||||
class DialogMeasurements;
|
class DialogMeasurements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,8 @@
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include "../../xml/vpattern.h"
|
#include "../../xml/vpattern.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
|
{
|
||||||
class DialogPatternProperties;
|
class DialogPatternProperties;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,8 @@
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui
|
||||||
|
{
|
||||||
class DialogStandardMeasurements;
|
class DialogStandardMeasurements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -389,7 +389,8 @@ protected:
|
||||||
* @param id don't show this id in list
|
* @param id don't show this id in list
|
||||||
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
* @param cut if set to ComboMode::CutSpline don't show id+1 and id+2
|
||||||
*/
|
*/
|
||||||
void setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value, const quint32 &id,
|
void setCurrentSplinePathId(QComboBox *box, quint32 &splinePathId, const quint32 &value,
|
||||||
|
const quint32 &id,
|
||||||
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
ComboMode::ComboBoxCutSpline cut = ComboMode::NoCutSpline) const;
|
||||||
/**
|
/**
|
||||||
* @brief getCurrentPointId return current point id in combobox
|
* @brief getCurrentPointId return current point id in combobox
|
||||||
|
|
|
@ -72,7 +72,8 @@ bool DialogUnionDetails::CheckObject(const quint32 &id, const quint32 &idDetail)
|
||||||
return det.Containes(id);
|
return det.Containes(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Scene::Scenes &type, quint32 &idDetail, ptrdiff_t &index)
|
void DialogUnionDetails::ChoosedDetail(const quint32 &id, const Scene::Scenes &type, quint32 &idDetail,
|
||||||
|
ptrdiff_t &index)
|
||||||
{
|
{
|
||||||
if (idDetail == 0)
|
if (idDetail == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1258,10 +1258,14 @@ bool MainWindow::MaybeSave()
|
||||||
"Do you want to save your changes?"),
|
"Do you want to save your changes?"),
|
||||||
QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
|
QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
|
||||||
if (ret == QMessageBox::Save)
|
if (ret == QMessageBox::Save)
|
||||||
|
{
|
||||||
return Save();
|
return Save();
|
||||||
|
}
|
||||||
else if (ret == QMessageBox::Cancel)
|
else if (ret == QMessageBox::Cancel)
|
||||||
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -530,7 +530,7 @@ void TableWindow::PdfToPs(const QString &name, const QStringList ¶ms) const
|
||||||
qDebug() << proc.errorString();
|
qDebug() << proc.errorString();
|
||||||
|
|
||||||
QFile f(name);
|
QFile f(name);
|
||||||
if (!f.exists())
|
if (f.exists() == false)
|
||||||
{
|
{
|
||||||
QMessageBox msgBox(QMessageBox::Critical, "Critical error!", "Creating file '"+name+"' failed!",
|
QMessageBox msgBox(QMessageBox::Critical, "Critical error!", "Creating file '"+name+"' failed!",
|
||||||
QMessageBox::Ok | QMessageBox::Default);
|
QMessageBox::Ok | QMessageBox::Default);
|
||||||
|
|
|
@ -32,10 +32,9 @@
|
||||||
|
|
||||||
const QString VToolBisector::ToolType = QStringLiteral("bisector");
|
const QString VToolBisector::ToolType = QStringLiteral("bisector");
|
||||||
|
|
||||||
VToolBisector::VToolBisector(VPattern *doc, VContainer *data, const quint32 &id,
|
VToolBisector::VToolBisector(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||||
const QString &typeLine, const QString &formula, const quint32 &firstPointId,
|
const QString &formula, const quint32 &firstPointId, const quint32 &secondPointId,
|
||||||
const quint32 &secondPointId, const quint32 &thirdPointId, const Tool::Sources &typeCreation,
|
const quint32 &thirdPointId, const Tool::Sources &typeCreation, QGraphicsItem *parent)
|
||||||
QGraphicsItem *parent)
|
|
||||||
:VToolLinePoint(doc, data, id, typeLine, formula, secondPointId, 0, parent), firstPointId(0), thirdPointId(0)
|
:VToolLinePoint(doc, data, id, typeLine, formula, secondPointId, 0, parent), firstPointId(0), thirdPointId(0)
|
||||||
{
|
{
|
||||||
this->firstPointId = firstPointId;
|
this->firstPointId = firstPointId;
|
||||||
|
|
|
@ -78,8 +78,8 @@ void VToolLine::Create(DialogTool *dialog, VMainGraphicsScene *scene, VPattern *
|
||||||
Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Tool::FromGui);
|
Create(0, firstPoint, secondPoint, typeLine, scene, doc, data, Document::FullParse, Tool::FromGui);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint, const QString &typeLine,
|
void VToolLine::Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint,
|
||||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
const QString &typeLine, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||||
const Document::Documents &parse, const Tool::Sources &typeCreation)
|
const Document::Documents &parse, const Tool::Sources &typeCreation)
|
||||||
{
|
{
|
||||||
Q_CHECK_PTR(scene);
|
Q_CHECK_PTR(scene);
|
||||||
|
|
|
@ -78,8 +78,8 @@ public:
|
||||||
* @param parse parser file mode.
|
* @param parse parser file mode.
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
*/
|
*/
|
||||||
static void Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint, const QString &typeLine,
|
static void Create(const quint32 &_id, const quint32 &firstPoint, const quint32 &secondPoint,
|
||||||
VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
const QString &typeLine, VMainGraphicsScene *scene, VPattern *doc, VContainer *data,
|
||||||
const Document::Documents &parse, const Tool::Sources &typeCreation);
|
const Document::Documents &parse, const Tool::Sources &typeCreation);
|
||||||
static const QString TagName;
|
static const QString TagName;
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -32,9 +32,9 @@
|
||||||
|
|
||||||
const QString VToolShoulderPoint::ToolType = QStringLiteral("shoulder");
|
const QString VToolShoulderPoint::ToolType = QStringLiteral("shoulder");
|
||||||
|
|
||||||
VToolShoulderPoint::VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id,
|
VToolShoulderPoint::VToolShoulderPoint(VPattern *doc, VContainer *data, const quint32 &id, const QString &typeLine,
|
||||||
const QString &typeLine, const QString &formula, const quint32 &p1Line,
|
const QString &formula, const quint32 &p1Line, const quint32 &p2Line,
|
||||||
const quint32 &p2Line, const quint32 &pShoulder, const Tool::Sources &typeCreation,
|
const quint32 &pShoulder, const Tool::Sources &typeCreation,
|
||||||
QGraphicsItem * parent)
|
QGraphicsItem * parent)
|
||||||
:VToolLinePoint(doc, data, id, typeLine, formula, p1Line, 0, parent), p2Line(p2Line), pShoulder(pShoulder)
|
:VToolLinePoint(doc, data, id, typeLine, formula, p1Line, 0, parent), p2Line(p2Line), pShoulder(pShoulder)
|
||||||
{
|
{
|
||||||
|
|
|
@ -262,22 +262,22 @@ Qt::PenStyle VAbstractTool::LineStyle()
|
||||||
QStringList styles = Styles();
|
QStringList styles = Styles();
|
||||||
switch (styles.indexOf(typeLine))
|
switch (styles.indexOf(typeLine))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0: // TypeLineNone
|
||||||
return Qt::NoPen;
|
return Qt::NoPen;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1: // TypeLineLine
|
||||||
return Qt::SolidLine;
|
return Qt::SolidLine;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2: // TypeLineDashLine
|
||||||
return Qt::DashLine;
|
return Qt::DashLine;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3: // TypeLineDotLine
|
||||||
return Qt::DotLine;
|
return Qt::DotLine;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4: // TypeLineDashDotLine
|
||||||
return Qt::DashDotLine;
|
return Qt::DashDotLine;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5: // TypeLineDashDotDotLine
|
||||||
return Qt::DashDotDotLine;
|
return Qt::DashDotDotLine;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -80,9 +80,10 @@ public:
|
||||||
* @param parse parser file mode.
|
* @param parse parser file mode.
|
||||||
* @param typeCreation way we create this tool.
|
* @param typeCreation way we create this tool.
|
||||||
*/
|
*/
|
||||||
static void Create(const quint32 _id, const VDetail &d1, const VDetail &d2, const quint32 &d1id, const quint32 &d2id,
|
static void Create(const quint32 _id, const VDetail &d1, const VDetail &d2, const quint32 &d1id,
|
||||||
const quint32 &indexD1, const quint32 &indexD2, VMainGraphicsScene *scene, VPattern *doc,
|
const quint32 &d2id, const quint32 &indexD1, const quint32 &indexD2, VMainGraphicsScene *scene,
|
||||||
VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation);
|
VPattern *doc, VContainer *data, const Document::Documents &parse,
|
||||||
|
const Tool::Sources &typeCreation);
|
||||||
/**
|
/**
|
||||||
* @brief GetDetailFromFile parse detail from file.
|
* @brief GetDetailFromFile parse detail from file.
|
||||||
* @param doc dom document container.
|
* @param doc dom document container.
|
||||||
|
|
|
@ -624,7 +624,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
|
||||||
<< VToolLineIntersect::ToolType << VToolPointOfContact::ToolType << VNodePoint::ToolType
|
<< VToolLineIntersect::ToolType << VToolPointOfContact::ToolType << VNodePoint::ToolType
|
||||||
<< VToolHeight::ToolType << VToolTriangle::ToolType << VToolPointOfIntersection::ToolType
|
<< VToolHeight::ToolType << VToolTriangle::ToolType << VToolPointOfIntersection::ToolType
|
||||||
<< VToolCutSpline::ToolType << VToolCutSplinePath::ToolType << VToolCutArc::ToolType;
|
<< VToolCutSpline::ToolType << VToolCutSplinePath::ToolType << VToolCutArc::ToolType;
|
||||||
switch(points.indexOf(type)) {
|
switch (points.indexOf(type))
|
||||||
|
{
|
||||||
case 0: //VToolSinglePoint::ToolType
|
case 0: //VToolSinglePoint::ToolType
|
||||||
{
|
{
|
||||||
VToolSinglePoint *spoint = 0;
|
VToolSinglePoint *spoint = 0;
|
||||||
|
@ -747,8 +748,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
|
||||||
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||||
const qreal angle = GetParametrDouble(domElement, VAbstractTool::AttrAngle, "0.0");
|
const qreal angle = GetParametrDouble(domElement, VAbstractTool::AttrAngle, "0.0");
|
||||||
|
|
||||||
VToolNormal::Create(id, formula, firstPointId, secondPointId, typeLine, name,
|
VToolNormal::Create(id, formula, firstPointId, secondPointId, typeLine, name, angle, mx, my, scene,
|
||||||
angle, mx, my, scene, this,data, parse, Tool::FromFile);
|
this, data, parse, Tool::FromFile);
|
||||||
}
|
}
|
||||||
catch (const VExceptionBadId &e)
|
catch (const VExceptionBadId &e)
|
||||||
{
|
{
|
||||||
|
@ -815,8 +816,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
|
||||||
const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
||||||
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||||
|
|
||||||
VToolPointOfContact::Create(id, radius, center, firstPointId, secondPointId, name,
|
VToolPointOfContact::Create(id, radius, center, firstPointId, secondPointId, name, mx, my, scene, this,
|
||||||
mx, my, scene, this,data, parse, Tool::FromFile);
|
data, parse, Tool::FromFile);
|
||||||
}
|
}
|
||||||
catch (const VExceptionBadId &e)
|
catch (const VExceptionBadId &e)
|
||||||
{
|
{
|
||||||
|
@ -834,8 +835,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
|
||||||
const VPointF *point = data->GeometricObject<const VPointF *>(idObject );
|
const VPointF *point = data->GeometricObject<const VPointF *>(idObject );
|
||||||
const qreal mx = toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0"));
|
const qreal mx = toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMx, "10.0"));
|
||||||
const qreal my = toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0"));
|
const qreal my = toPixel(GetParametrDouble(domElement, VAbstractTool::AttrMy, "15.0"));
|
||||||
data->UpdateGObject(id, new VPointF(point->x(), point->y(), point->name(),
|
data->UpdateGObject(id, new VPointF(point->x(), point->y(), point->name(), mx, my, idObject,
|
||||||
mx, my, idObject,Draw::Modeling));
|
Draw::Modeling));
|
||||||
VNodePoint::Create(this, data, id, idObject, parse, Tool::FromFile, idTool);
|
VNodePoint::Create(this, data, id, idObject, parse, Tool::FromFile, idTool);
|
||||||
}
|
}
|
||||||
catch (const VExceptionBadId &e)
|
catch (const VExceptionBadId &e)
|
||||||
|
@ -900,8 +901,8 @@ void VPattern::ParsePointElement(VMainGraphicsScene *scene, const QDomElement &d
|
||||||
const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
const quint32 firstPointId = GetParametrUInt(domElement, VAbstractTool::AttrFirstPoint, "0");
|
||||||
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
const quint32 secondPointId = GetParametrUInt(domElement, VAbstractTool::AttrSecondPoint, "0");
|
||||||
|
|
||||||
VToolPointOfIntersection::Create(id, name, firstPointId, secondPointId,
|
VToolPointOfIntersection::Create(id, name, firstPointId, secondPointId, mx, my, scene, this, data,
|
||||||
mx, my, scene, this, data, parse,Tool::FromFile);
|
parse, Tool::FromFile);
|
||||||
}
|
}
|
||||||
catch (const VExceptionBadId &e)
|
catch (const VExceptionBadId &e)
|
||||||
{
|
{
|
||||||
|
@ -1006,7 +1007,8 @@ void VPattern::ParseSplineElement(VMainGraphicsScene *scene, const QDomElement &
|
||||||
|
|
||||||
QStringList splines;
|
QStringList splines;
|
||||||
splines << VToolSpline::ToolType << VToolSplinePath::ToolType << VNodeSpline::ToolType << VNodeSplinePath::ToolType;
|
splines << VToolSpline::ToolType << VToolSplinePath::ToolType << VNodeSpline::ToolType << VNodeSplinePath::ToolType;
|
||||||
switch(splines.indexOf(type)) {
|
switch (splines.indexOf(type))
|
||||||
|
{
|
||||||
case 0: //VToolSpline::ToolType
|
case 0: //VToolSpline::ToolType
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1130,7 +1132,8 @@ void VPattern::ParseArcElement(VMainGraphicsScene *scene, const QDomElement &dom
|
||||||
QStringList arcs;
|
QStringList arcs;
|
||||||
arcs << VToolArc::ToolType << VNodeArc::ToolType;
|
arcs << VToolArc::ToolType << VNodeArc::ToolType;
|
||||||
|
|
||||||
switch(arcs.indexOf(type)) {
|
switch (arcs.indexOf(type))
|
||||||
|
{
|
||||||
case 0: //VToolArc::ToolType
|
case 0: //VToolArc::ToolType
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1185,7 +1188,8 @@ void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &d
|
||||||
QStringList tools;
|
QStringList tools;
|
||||||
tools << VToolUnionDetails::ToolType;
|
tools << VToolUnionDetails::ToolType;
|
||||||
|
|
||||||
switch(tools.indexOf(type)) {
|
switch (tools.indexOf(type))
|
||||||
|
{
|
||||||
case 0: //VToolUnionDetails::ToolType
|
case 0: //VToolUnionDetails::ToolType
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user