Documentation for dialogs.

--HG--
branch : feature
This commit is contained in:
dismine 2013-11-19 22:56:49 +02:00
parent c44bf1c517
commit 8d1146c1af
98 changed files with 7068 additions and 123 deletions

View file

@ -78,7 +78,7 @@ private:
*/
qint32 index;
/**
* @brief data container of all variables.
* @brief data container with data container of all variables.
*/
const VContainer *data;
/**

View file

@ -3,11 +3,11 @@ SOURCES += \
container/vincrementtablerow.cpp \
container/vcontainer.cpp \
container/calculator.cpp \
container/vstandarttablecell.cpp
container/vstandarttablerow.cpp
HEADERS += \
container/vstandarttablecell.h \
container/vpointf.h \
container/vincrementtablerow.h \
container/vcontainer.h \
container/calculator.h
container/calculator.h \
container/vstandarttablerow.h

View file

@ -34,7 +34,7 @@ qint64 VContainer::_id = 0;
VContainer::VContainer()
:base(QHash<QString, qint32>()), points(QHash<qint64, VPointF>()),
pointsModeling(QHash<qint64, VPointF>()),
standartTable(QHash<QString, VStandartTableCell>()), incrementTable(QHash<QString, VIncrementTableRow>()),
standartTable(QHash<QString, VStandartTableRow>()), incrementTable(QHash<QString, VIncrementTableRow>()),
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), splines(QHash<qint64, VSpline>()),
splinesModeling(QHash<qint64, VSpline>()),
lengthSplines(QHash<QString, qreal>()), arcs(QHash<qint64, VArc>()), arcsModeling(QHash<qint64, VArc>()),
@ -56,7 +56,7 @@ VContainer &VContainer::operator =(const VContainer &data)
VContainer::VContainer(const VContainer &data)
:base(QHash<QString, qint32>()), points(QHash<qint64, VPointF>()),
pointsModeling(QHash<qint64, VPointF>()),
standartTable(QHash<QString, VStandartTableCell>()), incrementTable(QHash<QString, VIncrementTableRow>()),
standartTable(QHash<QString, VStandartTableRow>()), incrementTable(QHash<QString, VIncrementTableRow>()),
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), splines(QHash<qint64, VSpline>()),
splinesModeling(QHash<qint64, VSpline>()),
lengthSplines(QHash<QString, qreal>()), arcs(QHash<qint64, VArc>()), arcsModeling(QHash<qint64, VArc>()),
@ -110,7 +110,7 @@ val VContainer::GetObject(const QHash<key, val> &obj, key id)
}
}
VStandartTableCell VContainer::GetStandartTableCell(const QString &name) const
VStandartTableRow VContainer::GetStandartTableCell(const QString &name) const
{
Q_ASSERT(name.isEmpty()==false);
return GetObject(standartTable, name);
@ -584,7 +584,7 @@ void VContainer::AddLineAngle(const QString &name, const qreal &value)
qreal VContainer::GetValueStandartTableCell(const QString& name) const
{
VStandartTableCell cell = GetStandartTableCell(name);
VStandartTableRow cell = GetStandartTableCell(name);
qreal k_size = ( static_cast<qreal> (size()/10.0) - 50.0 ) / 2.0;
qreal k_growth = ( static_cast<qreal> (growth()/10.0) - 176.0 ) / 6.0;
qreal value = cell.GetBase() + k_size*cell.GetKsize() + k_growth*cell.GetKgrowth();
@ -812,60 +812,60 @@ void VContainer::AddLengthLine(const QString &name, const qreal &value)
void VContainer::CreateManTableIGroup ()
{
AddStandartTableCell("Pkor", VStandartTableCell(84, 0, 3));
AddStandartTableCell("Pkor", VStandartTableCell(84, 0, 3));
AddStandartTableCell("Vtos", VStandartTableCell(1450, 2, 51));
AddStandartTableCell("Vtosh", VStandartTableCell(1506, 2, 54));
AddStandartTableCell("Vpt", VStandartTableCell(1438, 3, 52));
AddStandartTableCell("Vst", VStandartTableCell(1257, -1, 49));
AddStandartTableCell("Vlt", VStandartTableCell(1102, 0, 43));
AddStandartTableCell("Vk", VStandartTableCell(503, 0, 22));
AddStandartTableCell("Vsht", VStandartTableCell(1522, 2, 54));
AddStandartTableCell("Vzy", VStandartTableCell(1328, 0, 49));
AddStandartTableCell("Vlop", VStandartTableCell(1320, 0, 49));
AddStandartTableCell("Vps", VStandartTableCell(811, -1, 36));
AddStandartTableCell("Ssh", VStandartTableCell(202, 4, 1));
AddStandartTableCell("SgI", VStandartTableCell(517, 18, 2));
AddStandartTableCell("SgII", VStandartTableCell(522, 19, 1));
AddStandartTableCell("SgIII", VStandartTableCell(500, 20, 0));
AddStandartTableCell("St", VStandartTableCell(390, 20, 0));
AddStandartTableCell("Sb", VStandartTableCell(492, 15, 5));
AddStandartTableCell("SbI", VStandartTableCell(482, 12, 6));
AddStandartTableCell("Obed", VStandartTableCell(566, 18, 6));
AddStandartTableCell("Ok", VStandartTableCell(386, 8, 8));
AddStandartTableCell("Oi", VStandartTableCell(380, 8, 6));
AddStandartTableCell("Osch", VStandartTableCell(234, 4, 4));
AddStandartTableCell("Dsb", VStandartTableCell(1120, 0, 44));
AddStandartTableCell("Dsp", VStandartTableCell(1110, 0, 43));
AddStandartTableCell("Dn", VStandartTableCell(826, -3, 37));
AddStandartTableCell("Dps", VStandartTableCell(316, 4, 7));
AddStandartTableCell("Dpob", VStandartTableCell(783, 14, 15));
AddStandartTableCell("Ds", VStandartTableCell(260, 1, 6));
AddStandartTableCell("Op", VStandartTableCell(316, 12, 0));
AddStandartTableCell("Ozap", VStandartTableCell(180, 4, 0));
AddStandartTableCell("Pkis", VStandartTableCell(250, 4, 0));
AddStandartTableCell("SHp", VStandartTableCell(160, 1, 4));
AddStandartTableCell("Dlych", VStandartTableCell(500, 2, 15));
AddStandartTableCell("Dzap", VStandartTableCell(768, 2, 24));
AddStandartTableCell("DIIIp", VStandartTableCell(970, 2, 29));
AddStandartTableCell("Vprp", VStandartTableCell(214, 3, 3));
AddStandartTableCell("Vg", VStandartTableCell(262, 8, 3));
AddStandartTableCell("Dtp", VStandartTableCell(460, 7, 9));
AddStandartTableCell("Dp", VStandartTableCell(355, 5, 5));
AddStandartTableCell("Vprz", VStandartTableCell(208, 3, 5));
AddStandartTableCell("Dts", VStandartTableCell(438, 2, 10));
AddStandartTableCell("DtsI", VStandartTableCell(469, 2, 10));
AddStandartTableCell("Dvcht", VStandartTableCell(929, 9, 19));
AddStandartTableCell("SHg", VStandartTableCell(370, 14, 4));
AddStandartTableCell("Cg", VStandartTableCell(224, 6, 0));
AddStandartTableCell("SHs", VStandartTableCell(416, 10, 2));
AddStandartTableCell("dpzr", VStandartTableCell(121, 6, 0));
AddStandartTableCell("Ogol", VStandartTableCell(576, 4, 4));
AddStandartTableCell("Ssh1", VStandartTableCell(205, 5, 0));
AddStandartTableCell("St", VStandartTableCell(410, 20, 0));
AddStandartTableCell("Drzap", VStandartTableCell(594, 3, 19));
AddStandartTableCell("DbII", VStandartTableCell(1020, 0, 44));
AddStandartTableCell("Sb", VStandartTableCell(504, 15, 4));
AddStandartTableCell("Pkor", VStandartTableRow(84, 0, 3));
AddStandartTableCell("Pkor", VStandartTableRow(84, 0, 3));
AddStandartTableCell("Vtos", VStandartTableRow(1450, 2, 51));
AddStandartTableCell("Vtosh", VStandartTableRow(1506, 2, 54));
AddStandartTableCell("Vpt", VStandartTableRow(1438, 3, 52));
AddStandartTableCell("Vst", VStandartTableRow(1257, -1, 49));
AddStandartTableCell("Vlt", VStandartTableRow(1102, 0, 43));
AddStandartTableCell("Vk", VStandartTableRow(503, 0, 22));
AddStandartTableCell("Vsht", VStandartTableRow(1522, 2, 54));
AddStandartTableCell("Vzy", VStandartTableRow(1328, 0, 49));
AddStandartTableCell("Vlop", VStandartTableRow(1320, 0, 49));
AddStandartTableCell("Vps", VStandartTableRow(811, -1, 36));
AddStandartTableCell("Ssh", VStandartTableRow(202, 4, 1));
AddStandartTableCell("SgI", VStandartTableRow(517, 18, 2));
AddStandartTableCell("SgII", VStandartTableRow(522, 19, 1));
AddStandartTableCell("SgIII", VStandartTableRow(500, 20, 0));
AddStandartTableCell("St", VStandartTableRow(390, 20, 0));
AddStandartTableCell("Sb", VStandartTableRow(492, 15, 5));
AddStandartTableCell("SbI", VStandartTableRow(482, 12, 6));
AddStandartTableCell("Obed", VStandartTableRow(566, 18, 6));
AddStandartTableCell("Ok", VStandartTableRow(386, 8, 8));
AddStandartTableCell("Oi", VStandartTableRow(380, 8, 6));
AddStandartTableCell("Osch", VStandartTableRow(234, 4, 4));
AddStandartTableCell("Dsb", VStandartTableRow(1120, 0, 44));
AddStandartTableCell("Dsp", VStandartTableRow(1110, 0, 43));
AddStandartTableCell("Dn", VStandartTableRow(826, -3, 37));
AddStandartTableCell("Dps", VStandartTableRow(316, 4, 7));
AddStandartTableCell("Dpob", VStandartTableRow(783, 14, 15));
AddStandartTableCell("Ds", VStandartTableRow(260, 1, 6));
AddStandartTableCell("Op", VStandartTableRow(316, 12, 0));
AddStandartTableCell("Ozap", VStandartTableRow(180, 4, 0));
AddStandartTableCell("Pkis", VStandartTableRow(250, 4, 0));
AddStandartTableCell("SHp", VStandartTableRow(160, 1, 4));
AddStandartTableCell("Dlych", VStandartTableRow(500, 2, 15));
AddStandartTableCell("Dzap", VStandartTableRow(768, 2, 24));
AddStandartTableCell("DIIIp", VStandartTableRow(970, 2, 29));
AddStandartTableCell("Vprp", VStandartTableRow(214, 3, 3));
AddStandartTableCell("Vg", VStandartTableRow(262, 8, 3));
AddStandartTableCell("Dtp", VStandartTableRow(460, 7, 9));
AddStandartTableCell("Dp", VStandartTableRow(355, 5, 5));
AddStandartTableCell("Vprz", VStandartTableRow(208, 3, 5));
AddStandartTableCell("Dts", VStandartTableRow(438, 2, 10));
AddStandartTableCell("DtsI", VStandartTableRow(469, 2, 10));
AddStandartTableCell("Dvcht", VStandartTableRow(929, 9, 19));
AddStandartTableCell("SHg", VStandartTableRow(370, 14, 4));
AddStandartTableCell("Cg", VStandartTableRow(224, 6, 0));
AddStandartTableCell("SHs", VStandartTableRow(416, 10, 2));
AddStandartTableCell("dpzr", VStandartTableRow(121, 6, 0));
AddStandartTableCell("Ogol", VStandartTableRow(576, 4, 4));
AddStandartTableCell("Ssh1", VStandartTableRow(205, 5, 0));
AddStandartTableCell("St", VStandartTableRow(410, 20, 0));
AddStandartTableCell("Drzap", VStandartTableRow(594, 3, 19));
AddStandartTableCell("DbII", VStandartTableRow(1020, 0, 44));
AddStandartTableCell("Sb", VStandartTableRow(504, 15, 4));
}
QVector<QPointF> VContainer::GetReversePoint(const QVector<QPointF> &points) const

View file

@ -29,7 +29,7 @@
#ifndef VCONTAINER_H
#define VCONTAINER_H
#include "vstandarttablecell.h"
#include "vstandarttablerow.h"
#include "vincrementtablerow.h"
#include "../geometry/varc.h"
#include "../geometry/vsplinepath.h"
@ -80,7 +80,7 @@ public:
* @param name name of standart table row
* @return row of standart table
*/
VStandartTableCell GetStandartTableCell(const QString& name) const;
VStandartTableRow GetStandartTableCell(const QString& name) const;
/**
* @brief GetIncrementTableRow return increment table row by name
* @param name name of increment table row
@ -181,7 +181,7 @@ public:
* @param name name of row of standart table
* @param cell row of standart table
*/
inline void AddStandartTableCell(const QString& name, const VStandartTableCell& cell)
inline void AddStandartTableCell(const QString& name, const VStandartTableRow& cell)
{standartTable[name] = cell;}
/**
* @brief AddIncrementTableRow add new row of increment table
@ -340,7 +340,7 @@ public:
* @param name name of row
* @param cell row of standart table
*/
inline void UpdateStandartTableCell(const QString& name, const VStandartTableCell& cell)
inline void UpdateStandartTableCell(const QString& name, const VStandartTableRow& cell)
{standartTable[name] = cell;}
/**
* @brief UpdateIncrementTableRow update increment table row by name
@ -433,82 +433,82 @@ public:
*/
inline void RemoveIncrementTableRow(const QString& name) {incrementTable.remove(name);}
/**
* @brief DataPoints return container of points
* @brief data container with dataPoints return container of points
* @return pointer on container of points
*/
inline const QHash<qint64, VPointF> *DataPoints() const {return &points;}
/**
* @brief DataPointsModeling return container of points modeling
* @brief data container with dataPointsModeling return container of points modeling
* @return pointer on container of points modeling
*/
inline const QHash<qint64, VPointF> *DataPointsModeling() const {return &pointsModeling;}
/**
* @brief DataSplines return container of splines
* @brief data container with dataSplines return container of splines
* @return pointer on container of splines
*/
inline const QHash<qint64, VSpline> *DataSplines() const {return &splines;}
/**
* @brief DataSplinesModeling return container of splines modeling
* @brief data container with dataSplinesModeling return container of splines modeling
* @return pointer on container of splines modeling
*/
inline const QHash<qint64, VSpline> *DataSplinesModeling() const {return &splinesModeling;}
/**
* @brief DataArcs return container of arcs
* @brief data container with dataArcs return container of arcs
* @return pointer on container of arcs
*/
inline const QHash<qint64, VArc> *DataArcs() const {return &arcs;}
/**
* @brief DataArcsModeling return container of arcs modeling
* @brief data container with dataArcsModeling return container of arcs modeling
* @return pointer on container of arcs modeling
*/
inline const QHash<qint64, VArc> *DataArcsModeling() const {return &arcsModeling;}
/**
* @brief DataBase return container of data
* @brief data container with dataBase return container of data
* @return pointer on container of base data
*/
inline const QHash<QString, qint32> *DataBase() const {return &base;}
/**
* @brief DataStandartTable return container of standart table
* @brief data container with dataStandartTable return container of standart table
* @return pointer on container of standart table
*/
inline const QHash<QString, VStandartTableCell> *DataStandartTable() const {return &standartTable;}
inline const QHash<QString, VStandartTableRow> *DataStandartTable() const {return &standartTable;}
/**
* @brief DataIncrementTable return container of increment table
* @brief data container with dataIncrementTable return container of increment table
* @return pointer on container of increment table
*/
inline const QHash<QString, VIncrementTableRow> *DataIncrementTable() const {return &incrementTable;}
/**
* @brief DataLengthLines return container of lines lengths
* @brief data container with dataLengthLines return container of lines lengths
* @return pointer on container of lines lengths
*/
inline const QHash<QString, qreal> *DataLengthLines() const {return &lengthLines;}
/**
* @brief DataLengthSplines return container of splines lengths
* @brief data container with dataLengthSplines return container of splines lengths
* @return pointer on container of splines lengths
*/
inline const QHash<QString, qreal> *DataLengthSplines() const {return &lengthSplines;}
/**
* @brief DataLengthArcs return container of arcs length
* @brief data container with dataLengthArcs return container of arcs length
* @return pointer on container of arcs length
*/
inline const QHash<QString, qreal> *DataLengthArcs() const {return &lengthArcs;}
/**
* @brief DataLineAngles return container of angles of line
* @brief data container with dataLineAngles return container of angles of line
* @return pointer on container of angles of line
*/
inline const QHash<QString, qreal> *DataLineAngles() const {return &lineAngles;}
/**
* @brief DataSplinePaths return container of spline paths
* @brief data container with dataSplinePaths return container of spline paths
* @return pointer on container of spline paths
*/
inline const QHash<qint64, VSplinePath> *DataSplinePaths() const {return &splinePaths;}
/**
* @brief DataSplinePathsModeling return container of spline paths modeling
* @brief data container with dataSplinePathsModeling return container of spline paths modeling
* @return pointer on container of spline paths modeling
*/
inline const QHash<qint64, VSplinePath> *DataSplinePathsModeling() const {return &splinePathsModeling;}
/**
* @brief DataDetails return container of details
* @brief data container with dataDetails return container of details
* @return pointer on container of details
*/
inline const QHash<qint64, VDetail> *DataDetails() const {return &details;}
@ -593,7 +593,7 @@ private:
/**
* @brief standartTable container of standart table rows
*/
QHash<QString, VStandartTableCell> standartTable;
QHash<QString, VStandartTableRow> standartTable;
/**
* @brief incrementTable
*/

View file

@ -29,27 +29,96 @@
#ifndef VINCREMENTTABLEROW_H
#define VINCREMENTTABLEROW_H
/**
* @brief The VIncrementTableRow class keep data row of increment table
*/
class VIncrementTableRow
{
public:
/**
* @brief VIncrementTableRow create enpty row
*/
VIncrementTableRow();
/**
* @brief VIncrementTableRow create row
* @param id id
* @param base value in base size and growth
* @param ksize increment in sizes
* @param kgrowth increment in growths
* @param description description of increment
*/
VIncrementTableRow(qint64 id, qreal base, qreal ksize, qreal kgrowth,
QString description = QString());
/**
* @brief getId return id of row
* @return id
*/
inline qint64 getId() const {return id;}
/**
* @brief setId set id of row
* @param value id
*/
inline void setId(const qint64 &value) {id = value;}
/**
* @brief getBase return value in base size and growth
* @return value
*/
inline qreal getBase() const {return base;}
/**
* @brief setBase set value in base size and growth
* @param value base value
*/
inline void setBase(const qreal &value) {base = value;}
/**
* @brief getKsize return increment in sizes
* @return increment
*/
inline qreal getKsize() const {return ksize;}
/**
* @brief setKsize set increment in sizes
* @param value value of increment
*/
inline void setKsize(const qreal &value) {ksize = value;}
/**
* @brief getKgrowth return increment in growths
* @return increment
*/
inline qreal getKgrowth() const {return kgrowth;}
/**
* @brief setKgrowth set increment in growths
* @param value value of increment
*/
inline void setKgrowth(const qreal &value) {kgrowth = value;}
/**
* @brief getDescription return description
* @return description
*/
inline QString getDescription() const {return description;}
/**
* @brief setDescription set description for row
* @param value description
*/
inline void setDescription(const QString &value) {description = value;}
private:
/**
* @brief id identificator
*/
qint64 id;
/**
* @brief base value in base size and growth
*/
qreal base;
/**
* @brief ksize increment in sizes
*/
qreal ksize;
/**
* @brief kgrowth increment in growths
*/
qreal kgrowth;
/**
* @brief description description of increment
*/
QString description;
};

View file

@ -29,41 +29,147 @@
#ifndef VPOINTF_H
#define VPOINTF_H
/**
* @brief The VPointF class keep data of point.
*/
class VPointF
{
public:
/**
* @brief VPointF creat empty point
*/
inline VPointF ()
:_name(QString()), _mx(0), _my(0), _x(0), _y(0), mode(Draw::Calculation), idObject(0){}
/**
* @brief VPointF copy constructor
* @param point
*/
inline VPointF (const VPointF &point )
:_name(point.name()), _mx(point.mx()), _my(point.my()), _x(point.x()), _y(point.y()),
mode(point.getMode()), idObject(point.getIdObject()){}
/**
* @brief VPointF create new point
* @param x x coordinate
* @param y y coordinate
* @param name name of point
* @param mx offset name respect to x
* @param my offset name respect to y
* @param mode mode of draw
* @param idObject point modeling keep here id of parent point
*/
inline VPointF ( qreal x, qreal y, QString name, qreal mx, qreal my,
Draw::Draws mode = Draw::Calculation, qint64 idObject = 0)
:_name(name), _mx(mx), _my(my), _x(x), _y(y), mode(mode), idObject(idObject){}
/**
* @brief operator = assignment operator
* @param point point
* @return point
*/
VPointF &operator=(const VPointF &point);
~VPointF(){}
/**
* @brief name return name of point
* @return name
*/
inline QString name() const { return _name;}
/**
* @brief mx return offset name respect to x
* @return offset
*/
inline qreal mx() const {return _mx;}
/**
* @brief my return offset name respect to y
* @return offset
*/
inline qreal my() const {return _my;}
/**
* @brief setName set name of point
* @param name name
*/
inline void setName(const QString &name) {_name = name;}
/**
* @brief setMx set offset name respect to x
* @param mx offset
*/
inline void setMx(qreal mx) {_mx = mx;}
/**
* @brief setMy set offset name respect to y
* @param my offset
*/
inline void setMy(qreal my) {_my = my;}
/**
* @brief toQPointF convert to QPointF
* @return QPointF point
*/
inline QPointF toQPointF()const {return QPointF(_x, _y);}
/**
* @brief x return x coordinate
* @return value
*/
inline qreal x() const {return _x;}
/**
* @brief setX set x coordinate
* @param value x coordinate
*/
inline void setX(const qreal &value){_x = value;}
/**
* @brief y return y coordinate
* @return value
*/
inline qreal y() const {return _y;}
/**
* @brief setY set y coordinate
* @param value y coordinate
*/
inline void setY(const qreal &value){_y = value;}
/**
* @brief getMode return mode of point
* @return mode
*/
inline Draw::Draws getMode() const{return mode;}
/**
* @brief setMode set mode for point
* @param value mode
*/
inline void setMode(const Draw::Draws &value) {mode = value;}
/**
* @brief getIdObject return id of parrent.
* @return id
*/
inline qint64 getIdObject() const {return idObject;}
/**
* @brief setIdObject set id of parent
* @param value id
*/
inline void setIdObject(const qint64 &value) {idObject = value;}
private:
/**
* @brief _name name of point
*/
QString _name;
/**
* @brief _mx offset name respect to x
*/
qreal _mx;
/**
* @brief _my offset name respect to y
*/
qreal _my;
/**
* @brief _x x coordinate
*/
qreal _x;
/**
* @brief _y y coordinate
*/
qreal _y;
/**
* @brief mode mode of point
*/
Draw::Draws mode;
/**
* @brief idObject id of parent. Only for point modeling. All another return 0.
*/
qint64 idObject;
};

View file

@ -26,10 +26,10 @@
**
*************************************************************************/
#include "vstandarttablecell.h"
#include "vstandarttablerow.h"
VStandartTableCell::VStandartTableCell()
VStandartTableRow::VStandartTableRow()
:base(0), ksize(0), kgrowth(0), description(QString()){}
VStandartTableCell::VStandartTableCell(qint32 base, qreal ksize, qreal kgrowth, QString description)
VStandartTableRow::VStandartTableRow(qint32 base, qreal ksize, qreal kgrowth, QString description)
:base(base), ksize(ksize), kgrowth(kgrowth), description(description){}

View file

@ -26,23 +26,64 @@
**
*************************************************************************/
#ifndef VSTANDARTTABLECELL_H
#define VSTANDARTTABLECELL_H
#ifndef VSTANDARTTABLEROW_H
#define VSTANDARTTABLEROW_H
class VStandartTableCell
/**
* @brief The VStandartTableRow class keep data row of standart table
*/
class VStandartTableRow
{
public:
VStandartTableCell();
VStandartTableCell(qint32 base, qreal ksize, qreal kgrowth, QString description = QString());
/**
* @brief VStandartTableRow create empty row
*/
VStandartTableRow();
/**
* @brief VStandartTableRow create row
* @param base value in base size and growth
* @param ksize increment in sizes
* @param kgrowth increment in growths
* @param description description of increment
*/
VStandartTableRow(qint32 base, qreal ksize, qreal kgrowth, QString description = QString());
/**
* @brief GetBase return value in base size and growth
* @return value
*/
inline qint32 GetBase() const {return base;}
/**
* @brief GetKsize return increment in sizes
* @return increment
*/
inline qreal GetKsize() const {return ksize;}
/**
* @brief GetKgrowth return increment in growths
* @return increment
*/
inline qreal GetKgrowth() const {return kgrowth;}
/**
* @brief GetDescription return description
* @return description
*/
inline QString GetDescription() const {return description;}
private:
/**
* @brief base value in base size and growth
*/
qint32 base;
/**
* @brief ksize increment in sizes
*/
qreal ksize;
/**
* @brief kgrowth increment in growths
*/
qreal kgrowth;
/**
* @brief description description measurement
*/
QString description;
};
#endif // VSTANDARTTABLECELL_H
#endif // VSTANDARTTABLEROW_H

View file

@ -36,34 +36,114 @@ namespace Ui
class DialogAlongLine;
}
/**
* @brief The DialogAlongLine class dialog for ToolAlongLine. Help create point and edit option.
*/
class DialogAlongLine : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogAlongLine create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogAlongLine(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0);
~DialogAlongLine();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
/**
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
/**
* @brief setTypeLine set type of line
* @param value type
*/
void setTypeLine(const QString &value);
/**
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
/**
* @brief setFormula set string of formula
* @param value formula
*/
void setFormula(const QString &value);
/**
* @brief getFirstPointId return id first point of line
* @return id
*/
inline qint64 getFirstPointId() const {return firstPointId;}
/**
* @brief setFirstPointId set id first point of line
* @param value id
* @param id id of current point
*/
void setFirstPointId(const qint64 &value, const qint64 &id);
/**
* @brief getSecondPointId return id second point of line
* @return id
*/
inline qint64 getSecondPointId() const {return secondPointId;}
/**
* @brief setSecondPointId set id second point of line
* @param value id
* @param id id of current point
*/
void setSecondPointId(const qint64 &value, const qint64 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogAlongLine)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogAlongLine *ui;
/**
* @brief number number of handled objects
*/
qint32 number;
/**
* @brief pointName name of point
*/
QString pointName;
/**
* @brief typeLine type of line
*/
QString typeLine;
/**
* @brief formula formula
*/
QString formula;
/**
* @brief firstPointId id first point of line
*/
qint64 firstPointId;
/**
* @brief secondPointId id second point of line
*/
qint64 secondPointId;
};

View file

@ -36,49 +36,171 @@ namespace Ui
class DialogArc;
}
/**
* @brief The DialogArc class dialog for ToolArc. Help create arc and edit option.
*/
class DialogArc : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogArc create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogArc(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0);
~DialogArc();
/**
* @brief GetCenter return id of center point
* @return id id
*/
inline qint64 GetCenter() const {return center;}
/**
* @brief SetCenter set id of center point
* @param value id
*/
void SetCenter(const qint64 &value);
/**
* @brief GetRadius return formula of radius
* @return formula
*/
inline QString GetRadius() const {return radius;}
/**
* @brief SetRadius set formula of radius
* @param value formula
*/
void SetRadius(const QString &value);
/**
* @brief GetF1 return formula first angle of arc
* @return formula
*/
inline QString GetF1() const {return f1;}
/**
* @brief SetF1 set formula first angle of arc
* @param value formula
*/
void SetF1(const QString &value);
/**
* @brief GetF2 return formula second angle of arc
* @return formula
*/
inline QString GetF2() const {return f2;}
/**
* @brief SetF2 set formula second angle of arc
* @param value formula
*/
void SetF2(const QString &value);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
/**
* @brief ValChenged show description angles of lines
* @param row number of row
*/
virtual void ValChenged(int row);
/**
* @brief PutRadius put variable into formula of radius
*/
void PutRadius();
/**
* @brief PutF1 put variable into formula of first angle
*/
void PutF1();
/**
* @brief PutF2 put variable into formula of second angle
*/
void PutF2();
/**
* @brief LineAngles show variable angles of lines
*/
void LineAngles();
/**
* @brief RadiusChanged after change formula of radius calculate value and show result
*/
void RadiusChanged();
/**
* @brief F1Changed after change formula of first angle calculate value and show result
*/
void F1Changed();
/**
* @brief F2Changed after change formula of second angle calculate value and show result
*/
void F2Changed();
protected:
/**
* @brief CheckState if all is right enable button ok
*/
virtual void CheckState();
private:
Q_DISABLE_COPY(DialogArc)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogArc *ui;
/**
* @brief flagRadius true if value of radius is correct
*/
bool flagRadius;
/**
* @brief flagF1 true if value of first angle is correct
*/
bool flagF1;
/**
* @brief flagF2 true if value of second angle is correct
*/
bool flagF2;
/**
* @brief timerRadius timer of check formula of radius
*/
QTimer *timerRadius;
/**
* @brief timerF1 timer of check formula of first angle
*/
QTimer *timerF1;
/**
* @brief timerF2 timer of check formula of second angle
*/
QTimer *timerF2;
/**
* @brief center id of center point
*/
qint64 center;
/**
* @brief radius formula of radius
*/
QString radius;
/**
* @brief f1 formula of first angle
*/
QString f1;
/**
* @brief f2 formula of second angle
*/
QString f2;
/**
* @brief EvalRadius calculate value of radius
*/
void EvalRadius();
/**
* @brief EvalF1 calculate value of first angle
*/
void EvalF1();
/**
* @brief EvalF2 calculate value of second angle
*/
void EvalF2();
/**
* @brief ShowLineAngles show varibles angles of lines
*/
void ShowLineAngles();
};

View file

@ -36,37 +36,129 @@ namespace Ui
class DialogBisector;
}
/**
* @brief The DialogBisector class dialog for ToolBisector. Help create point and edit option.
*/
class DialogBisector : public DialogTool
{
Q_OBJECT
public:
explicit DialogBisector(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0);
/**
* @brief DialogBisector create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogBisector(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0);
~DialogBisector();
/**
* @brief getPointName return name of point
* @return name
*/
QString getPointName() const {return pointName;}
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
/**
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
/**
* @brief setTypeLine set type of line
* @param value type
*/
void setTypeLine(const QString &value);
/**
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
/**
* @brief setFormula set string of formula
* @param value formula
*/
void setFormula(const QString &value);
/**
* @brief getFirstPointId return id of first point
* @return id
*/
inline qint64 getFirstPointId() const {return firstPointId;}
/**
* @brief setFirstPointId set id of first point
* @param value id
* @param id don't show this id in list
*/
void setFirstPointId(const qint64 &value, const qint64 &id);
/**
* @brief getSecondPointId return id of second point
* @return id
*/
inline qint64 getSecondPointId() const {return secondPointId;}
/**
* @brief setSecondPointId set id of second point
* @param value id
* @param id don't show this id in list
*/
void setSecondPointId(const qint64 &value, const qint64 &id);
/**
* @brief getThirdPointId return id of third point
* @return id
*/
inline qint64 getThirdPointId() const {return thirdPointId;}
/**
* @brief setThirdPointId set id of third point
* @param value id
* @param id don't show this id in list
*/
void setThirdPointId(const qint64 &value, const qint64 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogBisector)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogBisector *ui;
/**
* @brief number number of handled objects
*/
qint32 number;
/**
* @brief pointName name of point
*/
QString pointName;
/**
* @brief typeLine type of line
*/
QString typeLine;
/**
* @brief formula formula
*/
QString formula;
/**
* @brief firstPointId id of first point
*/
qint64 firstPointId;
/**
* @brief secondPointId id of second point
*/
qint64 secondPointId;
/**
* @brief thirdPointId id of third point
*/
qint64 thirdPointId;
};

View file

@ -32,26 +32,92 @@
#include "ui_dialogdetail.h"
#include "dialogtool.h"
/**
* @brief The DialogDetail class dialog for ToolDetai. Help create detail and edit option.
*/
class DialogDetail : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogDetail create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogDetail(const VContainer *data, Draw::Draws mode, QWidget *parent = 0);
/**
* @brief getDetails return detail
* @return detail
*/
inline VDetail getDetails() const {return details;}
/**
* @brief setDetails set detail
* @param value detail
*/
void setDetails(const VDetail &value);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of objects (points, arcs, splines, spline paths)
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
/**
* @brief BiasXChanged changed value of offset for object respect to x
* @param d value in mm
*/
void BiasXChanged(qreal d);
/**
* @brief BiasYChanged changed value of offset for object respect to y
* @param d value in mm
*/
void BiasYChanged(qreal d);
/**
* @brief ClickedSeams save supplement of seams for detail
* @param checked 1 - need supplement, 0 - don't need supplement
*/
void ClickedSeams(bool checked);
/**
* @brief ClickedClosed save closed equdistant or not
* @param checked 1 - closed, 0 - don't closed
*/
void ClickedClosed(bool checked);
/**
* @brief ObjectChanged changed new object (point, arc, spline or spline path) form list
* @param row number of row
*/
void ObjectChanged(int row);
private:
/**
* @brief ui keeps information about user interface
*/
Ui::DialogDetail ui;
/**
* @brief details detail
*/
VDetail details;
/**
* @brief supplement keep option supplement of seams
*/
bool supplement;
/**
* @brief closed keep option about equdistant (closed or not)
*/
bool closed;
/**
* @brief NewItem add new object (point, arc, spline or spline path) to list
* @param id id of object
* @param typeTool type of tool
* @param mode mode
* @param typeNode type of node in detail
* @param mx offset respect to x
* @param my offset respect to y
*/
void NewItem(qint64 id, const Tool::Tools &typeTool, const Draw::Draws &mode,
const NodeDetail::NodeDetails &typeNode, qreal mx = 0, qreal my = 0);
};

View file

@ -36,32 +36,108 @@ namespace Ui
class DialogEndLine;
}
/**
* @brief The DialogEndLine class dialog for ToolEndLine. Help create point and edit option.
*/
class DialogEndLine : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogEndLine create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogEndLine(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0);
~DialogEndLine();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
/**
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
/**
* @brief setTypeLine set type of line
* @param value type
*/
void setTypeLine(const QString &value);
/**
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
/**
* @brief setFormula set string of formula
* @param value formula
*/
void setFormula(const QString &value);
/**
* @brief getAngle return angle of line
* @return angle in degree
*/
inline qreal getAngle() const {return angle;}
/**
* @brief setAngle set angle of line
* @param value angle in degree
*/
void setAngle(const qreal &value);
/**
* @brief getBasePointId return id base point of line
* @return id
*/
inline qint64 getBasePointId() const {return basePointId;}
/**
* @brief setBasePointId set id base point of line
* @param value id
* @param id don't show this id in list
*/
void setBasePointId(const qint64 &value, const qint64 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogEndLine)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogEndLine *ui;
/**
* @brief pointName name of point
*/
QString pointName;
/**
* @brief typeLine type of line
*/
QString typeLine;
/**
* @brief formula formula
*/
QString formula;
/**
* @brief angle angle of line
*/
qreal angle;
/**
* @brief basePointId id base point of line
*/
qint64 basePointId;
};

View file

@ -36,34 +36,115 @@ namespace Ui
class DialogHeight;
}
/**
* @brief The DialogHeight class dialog for ToolHeight. Help create point and edit option.
*/
class DialogHeight : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogHeight create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogHeight(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0);
~DialogHeight();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
/**
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
/**
* @brief setTypeLine set type of line
* @param value type
*/
void setTypeLine(const QString &value);
/**
* @brief getBasePointId return id base point of height
* @return id
*/
inline qint64 getBasePointId() const {return basePointId;}
/**
* @brief setBasePointId set id base point of height
* @param value id
* @param id don't show this id in list
*/
void setBasePointId(const qint64 &value, const qint64 &id);
/**
* @brief getP1LineId return id first point of line
* @return id id
*/
inline qint64 getP1LineId() const {return p1LineId;}
/**
* @brief setP1LineId set id first point of line
* @param value id
* @param id don't show this id in list
*/
void setP1LineId(const qint64 &value, const qint64 &id);
/**
* @brief getP2LineId return id second point of line
* @return id
*/
inline qint64 getP2LineId() const{return p2LineId;}
/**
* @brief setP2LineId set id second point of line
* @param value id
* @param id don't show this id in list
*/
void setP2LineId(const qint64 &value, const qint64 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogHeight)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogHeight *ui;
/**
* @brief number number of handled objects
*/
qint32 number;
/**
* @brief pointName name of point
*/
QString pointName;
/**
* @brief typeLine type of line
*/
QString typeLine;
/**
* @brief basePointId id base point of height
*/
qint64 basePointId;
/**
* @brief p1LineId id first point of line
*/
qint64 p1LineId;
/**
* @brief p2LineId id second point of line
*/
qint64 p2LineId;
};

View file

@ -37,30 +37,90 @@ namespace Ui
class DialogHistory;
}
/**
* @brief The DialogHistory class show dialog history.
*/
class DialogHistory : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogHistory create dialog
* @param data container with data
* @param doc dom document container
* @param parent parent widget
*/
DialogHistory(VContainer *data, VDomDocument *doc, QWidget *parent = 0);
virtual ~DialogHistory();
public slots:
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
/**
* @brief cellClicked changed history record
* @param row number row in table
* @param column number column in table
*/
void cellClicked(int row, int column);
/**
* @brief ChangedCursor changed cursor of input. Cursor show after what record we will insert new object
* @param id id of object
*/
void ChangedCursor(qint64 id);
/**
* @brief UpdateHistory update history table
*/
void UpdateHistory();
signals:
/**
* @brief ShowHistoryTool signal change color of selected in records tool
* @param id id of tool
* @param color new color of tool
* @param enable true enable selection, false disable selection
*/
void ShowHistoryTool(qint64 id, Qt::GlobalColor color, bool enable);
protected:
/**
* @brief closeEvent handle when windows is closing
* @param event event
*/
virtual void closeEvent ( QCloseEvent * event );
private:
Q_DISABLE_COPY(DialogHistory)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogHistory *ui;
/**
* @brief doc dom document container
*/
VDomDocument *doc;
/**
* @brief cursorRow save number of row where is cursor
*/
qint32 cursorRow;
/**
* @brief cursorToolRecordRow save number of row selected record
*/
qint32 cursorToolRecordRow;
/**
* @brief FillTable fill table
*/
void FillTable();
/**
* @brief Record return description for record
* @param tool record data
* @return description
*/
QString Record(const VToolRecord &tool);
/**
* @brief InitialTable set initial option of table
*/
void InitialTable();
/**
* @brief ShowPoint show selected point
*/
void ShowPoint();
};

View file

@ -67,14 +67,14 @@ DialogIncrements::DialogIncrements(VContainer *data, VDomDocument *doc, QWidget
void DialogIncrements::FillStandartTable()
{
const QHash<QString, VStandartTableCell> *standartTable = data->DataStandartTable();
const QHash<QString, VStandartTableRow> *standartTable = data->DataStandartTable();
qint32 currentRow = -1;
QHashIterator<QString, VStandartTableCell> i(*standartTable);
QHashIterator<QString, VStandartTableRow> i(*standartTable);
ui->tableWidgetStandart->setRowCount ( standartTable->size() );
while (i.hasNext())
{
i.next();
VStandartTableCell cell = i.value();
VStandartTableRow cell = i.value();
currentRow++;
QTableWidgetItem *item = new QTableWidgetItem(QString(i.key()));

View file

@ -37,38 +37,124 @@ namespace Ui
class DialogIncrements;
}
/**
* @brief The DialogIncrements class show dialog increments. Tables of all variables in program will be here.
*/
class DialogIncrements : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogIncrements create dialog
* @param data container with data
* @param doc dom document container
* @param parent parent widget
*/
DialogIncrements(VContainer *data, VDomDocument *doc, QWidget *parent = 0);
~DialogIncrements();
public slots:
/**
* @brief clickedToolButtonAdd create new row in table
*/
void clickedToolButtonAdd();
/**
* @brief clickedToolButtonRemove remove one row from table
*/
void clickedToolButtonRemove();
/**
* @brief cellChanged cell in table was changed
* @param row number of row
* @param column number of column
*/
void cellChanged ( qint32 row, qint32 column );
/**
* @brief FullUpdateFromFile update information in tables form file
*/
void FullUpdateFromFile();
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
signals:
/**
* @brief FullUpdateTree signal update data for dom document
*/
void FullUpdateTree();
/**
* @brief haveLiteChange signal show sign of change
*/
void haveLiteChange();
private:
Q_DISABLE_COPY(DialogIncrements)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogIncrements *ui;
/**
* @brief data container with data
*/
VContainer *data; // need because we must change data
/**
* @brief doc dom document container
*/
VDomDocument *doc;
/**
* @brief row save number of row current selected cell
*/
qint32 row;
/**
* @brief column save number of column current selected cell
*/
qint32 column;
/**
* @brief InitialStandartTable initial option standart table
*/
void InitialStandartTable();
/**
* @brief InitialIncrementTable initial option increment table
*/
void InitialIncrementTable();
/**
* @brief InitialLinesTable initial option lines table
*/
void InitialLinesTable();
/**
* @brief InitialSplinesTable initial option splines table
*/
void InitialSplinesTable();
/**
* @brief InitialArcsTable initial option arcs table
*/
void InitialArcsTable();
/**
* @brief FillStandartTable fill data for standart table
*/
void FillStandartTable();
/**
* @brief FillIncrementTable fill data for increment table
*/
void FillIncrementTable();
/**
* @brief FillLengthLines fill data for table of lines lengths
*/
void FillLengthLines();
/**
* @brief FillLengthSplines fill data for table of splines lengths
*/
void FillLengthSplines();
/**
* @brief FillLengthArcs fill data for table of arcs lengths
*/
void FillLengthArcs();
/**
* @brief AddIncrementToFile save created increment to file
* @param id id of increment
* @param name name
* @param base base value
* @param ksize increment in sizes
* @param kgrowth increment in growths
* @param description description of increment
*/
void AddIncrementToFile(qint64 id, QString name, qreal base, qreal ksize, qreal kgrowth,
QString description);
};

View file

@ -36,24 +36,69 @@ namespace Ui
class DialogLine;
}
/**
* @brief The DialogLine class dialog for ToolLine. Help create line and edit option.
*/
class DialogLine : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogLine create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogLine(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0);
~DialogLine();
/**
* @brief getFirstPoint return id first point
* @return id
*/
inline qint64 getFirstPoint() const {return firstPoint;}
/**
* @brief setFirstPoint set id first point
* @param value id
*/
void setFirstPoint(const qint64 &value);
/**
* @brief getSecondPoint return id second point
* @return id
*/
inline qint64 getSecondPoint() const {return secondPoint;}
/**
* @brief setSecondPoint set id second point
* @param value id
*/
void setSecondPoint(const qint64 &value);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogLine)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogLine *ui;
/**
* @brief number number of handled objects
*/
qint32 number;
/**
* @brief firstPoint id first point
*/
qint64 firstPoint;
/**
* @brief secondPoint id second point
*/
qint64 secondPoint;
};

View file

@ -36,41 +36,145 @@ namespace Ui
class DialogLineIntersect;
}
/**
* @brief The DialogLineIntersect class dialog for ToolLineIntersect. Help create point and edit option.
*/
class DialogLineIntersect : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogLineIntersect create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogLineIntersect(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0);
~DialogLineIntersect();
/**
* @brief getP1Line1 return id first point of first line
* @return id
*/
inline qint64 getP1Line1() const {return p1Line1;}
/**
* @brief setP1Line1 set id first point of first line
* @param value id
*/
void setP1Line1(const qint64 &value);
/**
* @brief getP2Line1 return id second point of first line
* @return id
*/
inline qint64 getP2Line1() const {return p2Line1;}
/**
* @brief setP2Line1 set id second point of first line
* @param value id
*/
void setP2Line1(const qint64 &value);
/**
* @brief getP1Line2 return id first point of second line
* @return id
*/
inline qint64 getP1Line2() const {return p1Line2;}
/**
* @brief setP1Line2 set id first point of second line
* @param value id
*/
void setP1Line2(const qint64 &value);
/**
* @brief getP2Line2 return id second point of second line
* @return id
*/
inline qint64 getP2Line2() const {return p2Line2;}
/**
* @brief setP2Line2 set id second point of second line
* @param value id
*/
void setP2Line2(const qint64 &value);
/**
* @brief getPointName return name of point
* @return
*/
inline QString getPointName() const {return pointName;}
/**
* @brief setPointName set name of point
* @param value
*/
void setPointName(const QString &value);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
/**
* @brief P1Line1Changed changed first point of first line
* @param index index in list
*/
void P1Line1Changed( int index);
/**
* @brief P2Line1Changed changed second point of first line
* @param index index in list
*/
void P2Line1Changed( int index);
/**
* @brief P1Line2Changed changed first point of second line
* @param index index in list
*/
void P1Line2Changed( int index);
/**
* @brief P2Line2Changed changed second point of second line
* @param index index in list
*/
void P2Line2Changed( int index);
private:
Q_DISABLE_COPY(DialogLineIntersect)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogLineIntersect *ui;
/**
* @brief number number of handled objects
*/
qint32 number;
/**
* @brief pointName name of point
*/
QString pointName;
/**
* @brief p1Line1 id first point of first line
*/
qint64 p1Line1;
/**
* @brief p2Line1 id second point of first line
*/
qint64 p2Line1;
/**
* @brief p1Line2 id first point of second line
*/
qint64 p1Line2;
/**
* @brief p2Line2 id second point of second line
*/
qint64 p2Line2;
/**
* @brief flagPoint keep state of point
*/
bool flagPoint;
/**
* @brief CheckState check state of dialog. Enable or disable button ok.
*/
virtual void CheckState();
/**
* @brief CheckIntersecion check intersection of points
* @return true - line have intersection, false = don't have
*/
bool CheckIntersecion();
};

View file

@ -36,36 +36,127 @@ namespace Ui
class DialogNormal;
}
/**
* @brief The DialogNormal class dialog for ToolNormal. Help create point and edit option.
*/
class DialogNormal : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogNormal create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogNormal(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0);
~DialogNormal();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const{return pointName;}
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
/**
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
/**
* @brief setTypeLine set type of line
* @param value type
*/
void setTypeLine(const QString &value);
/**
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
/**
* @brief setFormula set string of formula
* @param value formula
*/
void setFormula(const QString &value);
/**
* @brief getAngle return aditional angle of normal
* @return angle in degree
*/
inline qreal getAngle() const {return angle;}
/**
* @brief setAngle set aditional angle of normal
* @param value angle in degree
*/
void setAngle(const qreal &value);
/**
* @brief getFirstPointId return id of first point
* @return id
*/
inline qint64 getFirstPointId() const {return firstPointId;}
/**
* @brief setFirstPointId set id of first point
* @param value id
* @param id don't show this id in list
*/
void setFirstPointId(const qint64 &value, const qint64 &id);
/**
* @brief getSecondPointId return id of second point
* @return id
*/
inline qint64 getSecondPointId() const {return secondPointId;}
/**
* @brief setSecondPointId set id of second point
* @param value id
* @param id don't show this id in list
*/
void setSecondPointId(const qint64 &value, const qint64 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogNormal)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogNormal *ui;
/**
* @brief number number of handled objects
*/
qint32 number;
/**
* @brief pointName name of point
*/
QString pointName;
/**
* @brief typeLine type of line
*/
QString typeLine;
/**
* @brief formula formula
*/
QString formula;
/**
* @brief angle aditional angle of normal
*/
qreal angle;
/**
* @brief firstPointId id first point of line
*/
qint64 firstPointId;
/**
* @brief secondPointId id second point of line
*/
qint64 secondPointId;
};

View file

@ -32,33 +32,114 @@
#include "ui_dialogpointofcontact.h"
#include "dialogtool.h"
/**
* @brief The DialogPointOfContact class dialog for ToolPointOfContact. Help create point and edit option.
*/
class DialogPointOfContact : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogPointOfContact create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogPointOfContact(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0);
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
/**
* @brief getRadius return formula radius of arc
* @return formula
*/
inline QString getRadius() const {return radius;}
/**
* @brief setRadius set formula radius of arc
* @param value formula
*/
void setRadius(const QString &value);
/**
* @brief GetCenter return id of center point
* @return id
*/
inline qint64 getCenter() const {return center;}
/**
* @brief SetCenter set id of center point
* @param value id
* @param id don't show this id in list.
*/
void setCenter(const qint64 &value, const qint64 &id);
/**
* @brief getFirstPoint return id first point
* @return id
*/
inline qint64 getFirstPoint() const {return firstPoint;}
/**
* @brief setFirstPoint set id first point
* @param value id
* @param id don't show this id in list.
*/
void setFirstPoint(const qint64 &value, const qint64 &id);
/**
* @brief getSecondPoint return id second point
* @return id
*/
inline qint64 getSecondPoint() const {return secondPoint;}
/**
* @brief setSecondPoint set id second point
* @param value id
* @param id don't show this id in list.
*/
void setSecondPoint(const qint64 &value, const qint64 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogPointOfContact)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogPointOfContact ui;
/**
* @brief number number of handled objects
*/
qint32 number;
/**
* @brief pointName name of point
*/
QString pointName;
/**
* @brief radius radius of arc
*/
QString radius;
/**
* @brief center id center point of arc
*/
qint64 center;
/**
* @brief firstPoint id first point of line
*/
qint64 firstPoint;
/**
* @brief secondPoint id second point of line
*/
qint64 secondPoint;
};

View file

@ -36,28 +36,86 @@ namespace Ui
class DialogPointOfIntersection;
}
/**
* @brief The DialogPointOfIntersection class dialog for ToolPointOfIntersection. Help create point and edit option.
*/
class DialogPointOfIntersection : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogPointOfIntersection create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogPointOfIntersection(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0);
~DialogPointOfIntersection();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
/**
* @brief getFirstPointId return id of first point
* @return id
*/
inline qint64 getFirstPointId() const {return firstPointId;}
/**
* @brief setFirstPointId set id of first point
* @param value id
* @param id don't show this id in list.
*/
void setFirstPointId(const qint64 &value, const qint64 &id);
/**
* @brief getSecondPointId return id of second point
* @return id
*/
inline qint64 getSecondPointId() const {return secondPointId;}
/**
* @brief setSecondPointId set id of second point
* @param value id
* @param id don't show this id in list.
*/
void setSecondPointId(const qint64 &value, const qint64 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogPointOfIntersection)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogPointOfIntersection *ui;
/**
* @brief number number of handled objects
*/
qint32 number;
/**
* @brief pointName name of point
*/
QString pointName;
/**
* @brief firstPointId id first point of line
*/
qint64 firstPointId;
/**
* @brief secondPointId id second point of line
*/
qint64 secondPointId;
};

View file

@ -36,37 +36,129 @@ namespace Ui
class DialogShoulderPoint;
}
/**
* @brief The DialogShoulderPoint class dialog for ToolShoulderPoint. Help create point and edit option.
*/
class DialogShoulderPoint : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogShoulderPoint create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogShoulderPoint(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0);
~DialogShoulderPoint();
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
/**
* @brief getTypeLine return type of line
* @return type
*/
inline QString getTypeLine() const {return typeLine;}
/**
* @brief setTypeLine set type of line
* @param value type
*/
void setTypeLine(const QString &value);
/**
* @brief getFormula return string of formula
* @return formula
*/
inline QString getFormula() const {return formula;}
/**
* @brief setFormula set string of formula
* @param value formula
*/
void setFormula(const QString &value);
/**
* @brief getP1Line return id first point of line
* @return id
*/
inline qint64 getP1Line() const {return p1Line;}
/**
* @brief setP1Line set id first point of line
* @param value id
* @param id don't show this id in list
*/
void setP1Line(const qint64 &value, const qint64 &id);
/**
* @brief getP2Line return id second point of line
* @return id
*/
inline qint64 getP2Line() const {return p2Line;}
/**
* @brief setP2Line set id second point of line
* @param value id
* @param id don't show this id in list
*/
void setP2Line(const qint64 &value, const qint64 &id);
/**
* @brief getPShoulder return id shoulder point
* @return id
*/
inline qint64 getPShoulder() const {return pShoulder;}
/**
* @brief setPShoulder set id shoulder point
* @param value id
* @param id don't show this id in list
*/
void setPShoulder(const qint64 &value, const qint64 &id);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogShoulderPoint)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogShoulderPoint *ui;
/**
* @brief number number of handled objects
*/
qint32 number;
/**
* @brief pointName name of point
*/
QString pointName;
/**
* @brief typeLine type of line
*/
QString typeLine;
/**
* @brief formula formula
*/
QString formula;
/**
* @brief p1Line id first point of line
*/
qint64 p1Line;
/**
* @brief p2Line id second point of line
*/
qint64 p2Line;
/**
* @brief pShoulder id shoulder point
*/
qint64 pShoulder;
};

View file

@ -36,22 +36,59 @@ namespace Ui
class DialogSinglePoint;
}
/**
* @brief The DialogSinglePoint class dialog for ToolSinglePoint. Help create point and edit option.
*/
class DialogSinglePoint : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogSinglePoint create dialog
* @param data container with data
* @param parent parent widget
*/
DialogSinglePoint(const VContainer *data, QWidget *parent = 0);
/**
* @brief setData set name and point
* @param name name of point
* @param point data for point
*/
void setData(const QString &name, const QPointF &point);
/**
* @brief getName return name
* @return name
*/
inline QString getName()const {return name;}
/**
* @brief getPoint return point
* @return point
*/
inline QPointF getPoint()const {return point;}
~DialogSinglePoint();
public slots:
/**
* @brief mousePress get mouse position
* @param scenePos position of cursor
*/
void mousePress(const QPointF &scenePos);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogSinglePoint)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogSinglePoint *ui;
/**
* @brief name name of point
*/
QString name;
/**
* @brief point data of point
*/
QPointF point;
};

View file

@ -36,39 +36,139 @@ namespace Ui
class DialogSpline;
}
/**
* @brief The DialogSpline class dialog for ToolSpline. Help create spline and edit option.
*/
class DialogSpline : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogSpline create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogSpline(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0);
~DialogSpline();
/**
* @brief getP1 return id first point of spline
* @return id
*/
inline qint64 getP1() const {return p1;}
/**
* @brief setP1 set id first point of spline
* @param value id
*/
void setP1(const qint64 &value);
/**
* @brief getP4 return id fourth point of spline
* @return id
*/
inline qint64 getP4() const {return p4;}
/**
* @brief setP4 set id fourth point of spline
* @param value id
*/
void setP4(const qint64 &value);
/**
* @brief getAngle1 return first angle of spline
* @return angle in degree
*/
inline qreal getAngle1() const {return angle1;}
/**
* @brief setAngle1 set first angle of spline
* @param value angle in degree
*/
void setAngle1(const qreal &value);
/**
* @brief getAngle2 return second angle of spline
* @return angle in degree
*/
inline qreal getAngle2() const {return angle2;}
/**
* @brief setAngle2 set second angle of spline
* @param value angle in degree
*/
void setAngle2(const qreal &value);
/**
* @brief getKAsm1 return first coefficient asymmetry
* @return value. Can be >= 0.
*/
inline qreal getKAsm1() const {return kAsm1;}
/**
* @brief setKAsm1 set first coefficient asymmetry
* @param value value. Can be >= 0.
*/
void setKAsm1(const qreal &value);
/**
* @brief getKAsm2 return second coefficient asymmetry
* @return value. Can be >= 0.
*/
inline qreal getKAsm2() const {return kAsm2;}
/**
* @brief setKAsm2 set second coefficient asymmetry
* @param value value. Can be >= 0.
*/
void setKAsm2(const qreal &value);
/**
* @brief getKCurve return coefficient curve
* @return value. Can be >= 0.
*/
inline qreal getKCurve() const {return kCurve;}
/**
* @brief setKCurve set coefficient curve
* @param value value. Can be >= 0.
*/
void setKCurve(const qreal &value);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogSpline)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogSpline *ui;
/**
* @brief number number of handled objects
*/
qint32 number;
qint64 p1; // перша точка
qint64 p4; // четверта точка
qreal angle1; // кут нахилу дотичної в першій точці
qreal angle2; // кут нахилу дотичної в другій точці
/**
* @brief p1 id first point of spline
*/
qint64 p1;
/**
* @brief p4 id fourth point of spline
*/
qint64 p4;
/**
* @brief angle1 first angle of spline in degree
*/
qreal angle1;
/**
* @brief angle2 second angle of spline in degree
*/
qreal angle2;
/**
* @brief kAsm1 first coefficient asymmetry
*/
qreal kAsm1;
/**
* @brief kAsm2 second coefficient asymmetry
*/
qreal kAsm2;
/**
* @brief kCurve coefficient curve
*/
qreal kCurve;
};

View file

@ -37,31 +37,108 @@ namespace Ui
class DialogSplinePath;
}
/**
* @brief The DialogSplinePath class dialog for ToolSplinePath. Help create spline path and edit option.
*/
class DialogSplinePath : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogSplinePath create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogSplinePath(const VContainer *data, Draw::Draws mode = Draw::Calculation,
QWidget *parent = 0);
~DialogSplinePath();
/**
* @brief GetPath return spline path
* @return path
*/
inline VSplinePath GetPath() const {return path;}
/**
* @brief SetPath set spline path
* @param value path
*/
void SetPath(const VSplinePath &value);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type don't show this id in list
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
/**
* @brief PointChenged selected another point in list
* @param row number of row
*/
void PointChenged(int row);
/**
* @brief currentPointChanged changed point in combo box
* @param index index in list
*/
void currentPointChanged( int index );
/**
* @brief Angle1Changed changed first angle
* @param index index in list
*/
void Angle1Changed( int index );
/**
* @brief Angle2Changed changed second angle
* @param index index in list
*/
void Angle2Changed( int index );
/**
* @brief KAsm1Changed changed first coefficient asymmetry
* @param d value
*/
void KAsm1Changed(qreal d);
/**
* @brief KAsm2Changed changed second coefficient asymmetry
* @param d value
*/
void KAsm2Changed(qreal d);
private:
Q_DISABLE_COPY(DialogSplinePath)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogSplinePath *ui;
/**
* @brief path spline path
*/
VSplinePath path;
/**
* @brief NewItem add point to list
* @param id id
* @param kAsm1 first coefficient asymmetry
* @param angle angle in degree
* @param kAsm2 second coefficient asymmetry
*/
void NewItem(qint64 id, qreal kAsm1, qreal angle, qreal kAsm2);
/**
* @brief dataPoint show data of point in fields
* @param id id
* @param kAsm1 first coefficient asymmetry
* @param angle1 first angle of spline
* @param kAsm2 second coefficient asymmetry
* @param angle2 second angle of spline
*/
void DataPoint(qint64 id, qreal kAsm1, qreal angle1, qreal kAsm2, qreal angle2);
/**
* @brief EnableFields enable or disable fields
*/
void EnableFields();
/**
* @brief SetAngle set angle of point
* @param angle angle in degree
*/
void SetAngle(qint32 angle);
};

View file

@ -443,7 +443,7 @@ void DialogTool::ValChenged(int row)
}
if (radioButtonStandartTable->isChecked())
{
VStandartTableCell stable = data->GetStandartTableCell(item->text());
VStandartTableRow stable = data->GetStandartTableCell(item->text());
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetValueStandartTableCell(item->text()))
.arg(stable.GetDescription());
labelDescription->setText(desc);

View file

@ -32,80 +32,324 @@
#include <QDialog>
#include "../container/vcontainer.h"
/**
* @brief The DialogTool class parent for all dialog of tools.
*/
class DialogTool : public QDialog
{
Q_OBJECT
public:
/**
* @brief DialogTool create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogTool(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0);
virtual ~DialogTool() {}
/**
* @brief getIdDetail return id detail
* @return id
*/
inline qint64 getIdDetail() const {return idDetail;}
/**
* @brief setIdDetail set id detail
* @param value id
*/
inline void setIdDetail(const qint64 &value) {idDetail = value;}
signals:
/**
* @brief DialogClosed signal dialog closed
* @param result keep result
*/
void DialogClosed(int result);
/**
* @brief ToolTip emit tooltipe for tool
* @param toolTip text tooltipe
*/
void ToolTip(const QString &toolTip);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief NamePointChanged check name of point
*/
void NamePointChanged();
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
/**
* @brief DialogRejected emit signal dialog rejected
*/
virtual void DialogRejected();
/**
* @brief formula check formula
*/
void FormulaChanged();
/**
* @brief ArrowUp set angle value 90 degree
*/
void ArrowUp();
/**
* @brief ArrowDown set angle value 270 degree
*/
void ArrowDown();
/**
* @brief ArrowLeft set angle value 180 degree
*/
void ArrowLeft();
/**
* @brief ArrowRight set angle value 0 degree
*/
void ArrowRight();
/**
* @brief ArrowLeftUp set angle value 135 degree
*/
void ArrowLeftUp();
/**
* @brief ArrowLeftDown set angle value 225 degree
*/
void ArrowLeftDown();
/**
* @brief ArrowRightUp set angle value 45 degree
*/
void ArrowRightUp();
/**
* @brief ArrowRightDown set angle value 315 degree
*/
void ArrowRightDown();
/**
* @brief EvalFormula evaluate formula
*/
void EvalFormula();
/**
* @brief SizeGrowth show in list base variables
*/
void SizeGrowth();
/**
* @brief StandartTable show in list standart table variables
*/
void StandartTable();
/**
* @brief LengthLines show in list lengths of lines variables
*/
void LengthLines();
/**
* @brief LengthArcs show in list lengths of arcs variables
*/
void LengthArcs();
/**
* @brief LengthCurves show in list lengths of curves variables
*/
void LengthCurves();
/**
* @brief Increments show in list increment variables
*/
void Increments();
/**
* @brief PutHere put variable into edit
*/
void PutHere();
/**
* @brief PutVal put variable into edit
* @param item chosen item of list widget
*/
void PutVal(QListWidgetItem * item);
/**
* @brief ValChenged show description when current variable changed
* @param row number of row
*/
virtual void ValChenged(int row);
/**
* @brief UpdateList update lists of variables
*/
void UpdateList();
protected:
Q_DISABLE_COPY(DialogTool)
/**
* @brief data container with data
*/
const VContainer *data;
/**
* @brief isInitialized true if window is initialized
*/
bool isInitialized;
/**
* @brief flagName true if name is correct
*/
bool flagName;
/**
* @brief flagFormula true if formula correct
*/
bool flagFormula;
/**
* @brief timerFormula timer for check formula
*/
QTimer *timerFormula;
/**
* @brief bOk button ok
*/
QPushButton *bOk;
/**
* @brief spinBoxAngle spinbox for angle
*/
QDoubleSpinBox *spinBoxAngle;
/**
* @brief lineEditFormula linEdit for formula
*/
QLineEdit *lineEditFormula;
/**
* @brief listWidget listWidget with variables
*/
QListWidget *listWidget;
/**
* @brief labelResultCalculation label with result of calculation
*/
QLabel *labelResultCalculation;
/**
* @brief labelDescription description of variable
*/
QLabel *labelDescription;
/**
* @brief labelEditNamePoint label used when need show wrong name of point
*/
QLabel *labelEditNamePoint;
/**
* @brief labelEditFormula label used when need show wrong formula
*/
QLabel *labelEditFormula;
/**
* @brief radioButtonSizeGrowth radio button for base variables
*/
QRadioButton *radioButtonSizeGrowth;
/**
* @brief radioButtonStandartTable radio button for standart table variables
*/
QRadioButton *radioButtonStandartTable;
/**
* @brief radioButtonIncrements radio button for increments variables
*/
QRadioButton *radioButtonIncrements;
/**
* @brief radioButtonLengthLine radio button for lengths od lines variables
*/
QRadioButton *radioButtonLengthLine;
/**
* @brief radioButtonLengthArc radio button for lengths of arcs variables
*/
QRadioButton *radioButtonLengthArc;
/**
* @brief radioButtonLengthCurve radio button for lengths of curves variables
*/
QRadioButton *radioButtonLengthCurve;
/**
* @brief idDetail id detail
*/
qint64 idDetail;
/**
* @brief mode mode
*/
Draw::Draws mode;
/**
* @brief CheckObject check if object belongs to detail
* @param id id of object (point, arc, spline, spline path)
* @return true - belons, false - don't
*/
bool CheckObject(const qint64 &id);
/**
* @brief closeEvent handle when dialog cloded
* @param event event
*/
virtual void closeEvent ( QCloseEvent * event );
/**
* @brief showEvent handle when window show
* @param event event
*/
virtual void showEvent( QShowEvent *event );
/**
* @brief FillComboBoxPoints fill comboBox list of points
* @param box comboBox
* @param id don't show this id in list
*/
void FillComboBoxPoints(QComboBox *box, const qint64 &id = 0)const;
/**
* @brief FillComboBoxTypeLine fill comboBox list of type lines
* @param box comboBox
*/
void FillComboBoxTypeLine(QComboBox *box) const;
/**
* @brief CheckState enable, when all is correct, or disable, when something wrong, button ok
*/
virtual void CheckState();
/**
* @brief getTypeLine return type of line
* @param box combobox
* @return type
*/
QString GetTypeLine(const QComboBox *box)const;
template <class key, class val> void ShowVariable(const QHash<key, val> *var);
template <class key, class val>
/**
* @brief ShowVariable show variables in list
* @param var container with variables
*/
void ShowVariable(const QHash<key, val> *var);
/**
* @brief SetupTypeLine setupe type of line
* @param box combobox
* @param value string from pattern file
*/
void SetupTypeLine(QComboBox *box, const QString &value);
/**
* @brief ChangeCurrentText select item in combobox by name
* @param box combobox
* @param value name of item
*/
void ChangeCurrentText(QComboBox *box, const QString &value);
/**
* @brief ChangeCurrentData select item in combobox by id
* @param box combobox
* @param value id of item
*/
void ChangeCurrentData(QComboBox *box, const qint64 &value) const;
/**
* @brief PutValHere put variable into line edit from list
* @param lineEdit lineEdit
* @param listWidget listWidget
*/
void PutValHere(QLineEdit *lineEdit, QListWidget *listWidget);
/**
* @brief ValFormulaChanged handle change formula
* @param flag flag state of formula
* @param edit LineEdit
* @param timer timer of formula
*/
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer);
/**
* @brief Eval evaluate formula and show result
* @param edit lineEdit of formula
* @param flag flag state of formula
* @param timer timer of formula
* @param label label for signal error
*/
void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label);
/**
* @brief setCurrentPointId set current point id in combobox
* @param box combobox
* @param pointId save current point id
* @param value point id
* @param id don't show this id in list
*/
void setCurrentPointId(QComboBox *box, qint64 &pointId, const qint64 &value, const qint64 &id) const;
/**
* @brief getCurrentPointId return current point id in combobox
* @param box combobox
* @return id or -1 if combobox is empty
*/
qint64 getCurrentPointId(QComboBox *box) const;
};

View file

@ -36,33 +36,115 @@ namespace Ui
class DialogTriangle;
}
/**
* @brief The DialogTriangle class dialog for ToolTriangle. Help create point and edit option.
*/
class DialogTriangle : public DialogTool
{
Q_OBJECT
public:
/**
* @brief DialogTriangle create dialog
* @param data container with data
* @param mode mode of creation tool
* @param parent parent widget
*/
DialogTriangle(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0);
~DialogTriangle();
/**
* @brief getAxisP1Id return id first point of axis
* @return id
*/
inline qint64 getAxisP1Id() const {return axisP1Id;}
/**
* @brief setAxisP1Id set id first point of axis
* @param value id
* @param id don't show this point in list
*/
void setAxisP1Id(const qint64 &value, const qint64 &id);
/**
* @brief getAxisP2Id return id second point of axis
* @return id
*/
inline qint64 getAxisP2Id() const {return axisP2Id;}
/**
* @brief setAxisP2Id set id second point of axis
* @param value id
* @param id don't show this point in list
*/
void setAxisP2Id(const qint64 &value, const qint64 &id);
/**
* @brief getFirstPointId return id of first point
* @return id
*/
inline qint64 getFirstPointId() const {return firstPointId;}
/**
* @brief setFirstPointId set id of first point
* @param value id
* @param id don't show this point in list
*/
void setFirstPointId(const qint64 &value, const qint64 &id);
/**
* @brief getSecondPointId return id of second point
* @return id
*/
inline qint64 getSecondPointId() const {return secondPointId;}
/**
* @brief setSecondPointId set id of second point
* @param value id
* @param id don't show this point in list
*/
void setSecondPointId(const qint64 &value, const qint64 &id);
/**
* @brief getPointName return name of point
* @return name
*/
inline QString getPointName() const {return pointName;}
/**
* @brief setPointName set name of point
* @param value name
*/
void setPointName(const QString &value);
public slots:
/**
* @brief ChoosedObject gets id and type of selected object. Save right data and ignore wrong.
* @param id id of point or detail
* @param type type of object
*/
virtual void ChoosedObject(qint64 id, const Scene::Scenes &type);
/**
* @brief DialogAccepted save data and emit signal about closed dialog.
*/
virtual void DialogAccepted();
private:
Q_DISABLE_COPY(DialogTriangle)
/**
* @brief ui keeps information about user interface
*/
Ui::DialogTriangle *ui;
/**
* @brief number number of handled objects
*/
qint32 number;
/**
* @brief pointName name of point
*/
QString pointName;
/**
* @brief axisP1Id id first point of axis
*/
qint64 axisP1Id;
/**
* @brief axisP2Id id second point of axis
*/
qint64 axisP2Id;
/**
* @brief firstPointId id first point of line
*/
qint64 firstPointId;
/**
* @brief secondPointId id second point of line
*/
qint64 secondPointId;
};

View file

@ -32,18 +32,51 @@
#include <QException>
/**
* @brief The VException class
*/
class VException : public QException
{
public:
/**
* @brief VException
* @param what
*/
VException(const QString &what);
/**
* @brief VException
* @param e
*/
VException(const VException &e):what(e.What()){}
virtual ~VException() Q_DECL_NOEXCEPT_EXPR(true){}
/**
* @brief raise
*/
inline void raise() const { throw *this; }
/**
* @brief clone
* @return
*/
inline VException *clone() const { return new VException(*this); }
/**
* @brief ErrorMessage
* @return
*/
virtual QString ErrorMessage() const;
/**
* @brief DetailedInformation
* @return
*/
virtual QString DetailedInformation() const { return QString(); }
/**
* @brief What
* @return
*/
inline QString What() const {return what;}
protected:
/**
* @brief what
*/
QString what;
};

View file

@ -31,21 +31,56 @@
#include "vexception.h"
/**
* @brief The VExceptionBadId class
*/
class VExceptionBadId : public VException
{
public:
/**
* @brief VExceptionBadId
* @param what
* @param id
*/
VExceptionBadId(const QString &what, const qint64 &id)
:VException(what), id(id), key(QString()){}
/**
* @brief VExceptionBadId
* @param what
* @param key
*/
VExceptionBadId(const QString &what, const QString &key)
:VException(what), id(0), key(key){}
/**
* @brief VExceptionBadId
* @param e
*/
VExceptionBadId(const VExceptionBadId &e)
:VException(e), id(e.BadId()), key(e.BadKey()){}
virtual ~VExceptionBadId() Q_DECL_NOEXCEPT_EXPR(true){}
/**
* @brief ErrorMessage
* @return
*/
virtual QString ErrorMessage() const;
/**
* @brief BadId
* @return
*/
inline qint64 BadId() const {return id; }
/**
* @brief BadKey
* @return
*/
inline QString BadKey() const {return key; }
protected:
/**
* @brief id
*/
qint64 id;
/**
* @brief key
*/
QString key;
};

View file

@ -31,16 +31,39 @@
#include "vexception.h"
/**
* @brief The VExceptionConversionError class
*/
class VExceptionConversionError : public VException
{
public:
/**
* @brief VExceptionConversionError
* @param what
* @param str
*/
VExceptionConversionError(const QString &what, const QString &str);
/**
* @brief VExceptionConversionError
* @param e
*/
VExceptionConversionError(const VExceptionConversionError &e)
:VException(e), str(e.String()){}
virtual ~VExceptionConversionError() Q_DECL_NOEXCEPT_EXPR(true) {}
/**
* @brief ErrorMessage
* @return
*/
virtual QString ErrorMessage() const;
/**
* @brief String
* @return
*/
inline QString String() const {return str;}
protected:
/**
* @brief str
*/
QString str;
};

View file

@ -31,24 +31,73 @@
#include "vexception.h"
/**
* @brief The VExceptionEmptyParameter class
*/
class VExceptionEmptyParameter : public VException
{
public:
/**
* @brief VExceptionEmptyParameter
* @param what
* @param name
* @param domElement
*/
VExceptionEmptyParameter(const QString &what, const QString &name, const QDomElement &domElement);
/**
* @brief VExceptionEmptyParameter
* @param e
*/
VExceptionEmptyParameter(const VExceptionEmptyParameter &e)
:VException(e), name(e.Name()), tagText(e.TagText()), tagName(e.TagName()),
lineNumber(e.LineNumber()){}
virtual ~VExceptionEmptyParameter() Q_DECL_NOEXCEPT_EXPR(true) {}
/**
* @brief ErrorMessage
* @return
*/
virtual QString ErrorMessage() const;
/**
* @brief DetailedInformation
* @return
*/
virtual QString DetailedInformation() const;
/**
* @brief Name
* @return
*/
inline QString Name() const {return name;}
/**
* @brief TagText
* @return
*/
inline QString TagText() const {return tagText;}
/**
* @brief TagName
* @return
*/
inline QString TagName() const {return tagName;}
/**
* @brief LineNumber
* @return
*/
inline qint32 LineNumber() const {return lineNumber;}
protected:
/**
* @brief name
*/
QString name;
/**
* @brief tagText
*/
QString tagText;
/**
* @brief tagName
*/
QString tagName;
/**
* @brief lineNumber
*/
qint32 lineNumber;
};

View file

@ -31,25 +31,77 @@
#include "vexception.h"
/**
* @brief The VExceptionObjectError class
*/
class VExceptionObjectError : public VException
{
public:
/**
* @brief VExceptionObjectError
* @param what
* @param domElement
*/
VExceptionObjectError(const QString &what, const QDomElement &domElement);
/**
* @brief VExceptionObjectError
* @param e
*/
VExceptionObjectError(const VExceptionObjectError &e)
:VException(e), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber()),
moreInfo(e.MoreInformation()){}
virtual ~VExceptionObjectError() Q_DECL_NOEXCEPT_EXPR(true) {}
/**
* @brief ErrorMessage
* @return
*/
virtual QString ErrorMessage() const;
/**
* @brief DetailedInformation
* @return
*/
virtual QString DetailedInformation() const;
/**
* @brief TagText
* @return
*/
inline QString TagText() const {return tagText;}
/**
* @brief TagName
* @return
*/
inline QString TagName() const {return tagName;}
/**
* @brief LineNumber
* @return
*/
inline qint32 LineNumber() const {return lineNumber;}
/**
* @brief AddMoreInformation
* @param info
*/
void AddMoreInformation(const QString &info);
/**
* @brief MoreInformation
* @return
*/
inline QString MoreInformation() const {return moreInfo;}
protected:
/**
* @brief tagText
*/
QString tagText;
/**
* @brief tagName
*/
QString tagName;
/**
* @brief lineNumber
*/
qint32 lineNumber;
/**
* @brief moreInfo
*/
QString moreInfo;
};

View file

@ -31,21 +31,62 @@
#include "vexception.h"
/**
* @brief The VExceptionUniqueId class
*/
class VExceptionUniqueId : public VException
{
public:
/**
* @brief VExceptionUniqueId
* @param what
* @param domElement
*/
VExceptionUniqueId(const QString &what, const QDomElement &domElement);
/**
* @brief VExceptionUniqueId
* @param e
*/
VExceptionUniqueId(const VExceptionUniqueId &e)
:VException(e), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber()){}
virtual ~VExceptionUniqueId() Q_DECL_NOEXCEPT_EXPR(true){}
/**
* @brief ErrorMessage
* @return
*/
virtual QString ErrorMessage() const;
/**
* @brief DetailedInformation
* @return
*/
virtual QString DetailedInformation() const;
/**
* @brief TagText
* @return
*/
inline QString TagText() const {return tagText;}
/**
* @brief TagName
* @return
*/
inline QString TagName() const {return tagName;}
/**
* @brief LineNumber
* @return
*/
inline qint32 LineNumber() const {return lineNumber;}
protected:
/**
* @brief tagText
*/
QString tagText;
/**
* @brief tagName
*/
QString tagName;
/**
* @brief lineNumber
*/
qint32 lineNumber;
};

View file

@ -31,21 +31,62 @@
#include "vexception.h"
/**
* @brief The VExceptionWrongParameterId class
*/
class VExceptionWrongParameterId : public VException
{
public:
/**
* @brief VExceptionWrongParameterId
* @param what
* @param domElement
*/
VExceptionWrongParameterId(const QString &what, const QDomElement &domElement);
/**
* @brief VExceptionWrongParameterId
* @param e
*/
VExceptionWrongParameterId(const VExceptionWrongParameterId &e)
:VException(e), tagText(e.TagText()), tagName(e.TagName()), lineNumber(e.LineNumber()){}
virtual ~VExceptionWrongParameterId() Q_DECL_NOEXCEPT_EXPR(true){}
/**
* @brief ErrorMessage
* @return
*/
virtual QString ErrorMessage() const;
/**
* @brief DetailedInformation
* @return
*/
virtual QString DetailedInformation() const;
/**
* @brief TagText
* @return
*/
inline QString TagText() const {return tagText;}
/**
* @brief TagName
* @return
*/
inline QString TagName() const {return tagName;}
/**
* @brief LineNumber
* @return
*/
inline qint32 LineNumber() const {return lineNumber;}
protected:
/**
* @brief tagText
*/
QString tagText;
/**
* @brief tagName
*/
QString tagName;
/**
* @brief lineNumber
*/
qint32 lineNumber;
};

View file

@ -42,33 +42,50 @@ class VArc
{
Q_DECLARE_TR_FUNCTIONS(VArc)
public:
/**
* @brief VArc конструктор по замовчуванню.
*/
/**
* @brief VArc конструктор по замовчуванню.
*/
VArc ();
/**
* @brief VArc конструктор.
* @param center точка центру.
* @param radius радіус.
* @param f1 початковий кут в градусах.
* @param f2 кінцевий кут в градусах.
*/
/**
* @brief VArc конструктор.
* @param center точка центру.
* @param radius радіус.
* @param f1 початковий кут в градусах.
* @param f2 кінцевий кут в градусах.
*/
VArc (const QHash<qint64, VPointF> *points, qint64 center, qreal radius, QString formulaRadius,
qreal f1, QString formulaF1, qreal f2, QString formulaF2,
Draw::Draws mode = Draw::Calculation, qint64 idObject = 0);
/**
* @brief VArc
* @param arc
*/
VArc(const VArc &arc);
/**
* @brief operator =
* @param arc
* @return
*/
VArc& operator= (const VArc &arc);
/**
* @brief GetF1 повертає початковий кут дуги.
* @return повертає кут в градусах.
*/
inline QString GetFormulaF1 () const {return formulaF1;}
/**
* @brief GetF1
* @return
*/
inline qreal GetF1 () const {return f1;}
/**
* @brief GetF2 повертає кінцевий кут дуги.
* @return повертає кут в градусах.
*/
inline QString GetFormulaF2 () const {return formulaF2;}
/**
* @brief GetF2
* @return
*/
inline qreal GetF2 () const {return f2;}
/**
* @brief GetLength повертає довжину дуги.
@ -80,13 +97,25 @@ public:
* @return повертає радіус дуги.
*/
inline QString GetFormulaRadius () const {return formulaRadius;}
/**
* @brief GetRadius
* @return
*/
inline qreal GetRadius () const {return radius;}
/**
* @brief GetCenter повертає точку центра дуги.
* @return повертає точку центра дуги.
*/
inline qint64 GetCenter () const {return center;}
/**
* @brief GetCenterPoint
* @return
*/
QPointF GetCenterPoint() const;
/**
* @brief GetCenterVPoint
* @return
*/
VPointF GetCenterVPoint() const;
/**
* @brief GetP1 повертає першу точку з якої починається дуга.
@ -98,45 +127,111 @@ public:
* @return точку кінця дуги.
*/
QPointF GetP2 () const;
/**
* @brief GetDataPoints
* @return
*/
const QHash<qint64, VPointF> GetDataPoints() const;
/**
* @brief GetPath будує шлях по даній дузі.
* @return повертає шлях.
*/
QPainterPath GetPath() const;
/**
* @brief AngleArc
* @return
*/
qreal AngleArc() const;
/**
* @brief NumberSplOfArc
* @return
*/
qint32 NumberSplOfArc () const;
/**
* @brief GetPoints
* @return
*/
QVector<QPointF> GetPoints () const;
/**
* @brief SplOfArc
* @param number
* @return
*/
QVector<QPointF> SplOfArc( qint32 number ) const;
/**
* @brief getMode
* @return
*/
inline Draw::Draws getMode() const {return mode;}
/**
* @brief setMode
* @param value
*/
inline void setMode(const Draw::Draws &value) {mode = value;}
/**
* @brief getIdObject
* @return
*/
inline qint64 getIdObject() const {return idObject;}
/**
* @brief setIdObject
* @param value
*/
inline void setIdObject(const qint64 &value) {idObject = value;}
/**
* @brief name
* @return
*/
QString name() const {return _name;}
/**
* @brief setName
* @param name
*/
void setName(const QString &name) {_name = name;}
private:
/**
* @brief f1 початковий кут в градусах
*/
qreal f1; // початковий кут нахилу дуги (градуси)
/**
* @brief formulaF1
*/
QString formulaF1;
/**
* @brief f2 кінцевий кут в градусах
*/
qreal f2; // кінцевий кут нахилу дуги (градуси)
/**
* @brief formulaF2
*/
QString formulaF2;
/**
* @brief radius радіус дуги.
*/
qreal radius;
/**
* @brief formulaRadius
*/
QString formulaRadius;
/**
* @brief center центральна точка дуги.
*/
qint64 center;
/**
* @brief points
*/
QHash<qint64, VPointF> points;
/**
* @brief mode
*/
Draw::Draws mode;
/**
* @brief idObject
*/
qint64 idObject;
/**
* @brief _name
*/
QString _name;
};

View file

@ -33,48 +33,172 @@
namespace Detail
{
/**
* @brief The Contour enum
*/
enum Contour { OpenContour, CloseContour };
Q_DECLARE_FLAGS(Contours, Contour)
/**
* @brief The Equidistant enum
*/
enum Equidistant { OpenEquidistant, CloseEquidistant };
Q_DECLARE_FLAGS(Equidistants, Equidistant)
}
Q_DECLARE_OPERATORS_FOR_FLAGS(Detail::Contours)
Q_DECLARE_OPERATORS_FOR_FLAGS(Detail::Equidistants)
/**
* @brief The VDetail class
*/
class VDetail
{
public:
/**
* @brief VDetail
*/
VDetail();
/**
* @brief VDetail
* @param name
* @param nodes
*/
VDetail(const QString &name, const QVector<VNodeDetail> &nodes);
/**
* @brief VDetail
* @param detail
*/
VDetail(const VDetail &detail);
/**
* @brief operator =
* @param detail
* @return
*/
VDetail &operator=(const VDetail &detail);
/**
* @brief append
* @param node
*/
inline void append(const VNodeDetail &node) {nodes.append(node);}
/**
* @brief Clear
*/
void Clear();
/**
* @brief CountNode
* @return
*/
inline qint32 CountNode() const {return nodes.size();}
/**
* @brief Containes
* @param id
* @return
*/
bool Containes(const qint64 &id)const;
/**
* @brief operator []
* @param indx
* @return
*/
VNodeDetail & operator[](ptrdiff_t indx);
/**
* @brief getName
* @return
*/
inline QString getName() const {return name;}
/**
* @brief setName
* @param value
*/
inline void setName(const QString &value) {name = value;}
/**
* @brief getMx
* @return
*/
inline qreal getMx() const {return mx;}
/**
* @brief setMx
* @param value
*/
inline void setMx(const qreal &value) {mx = value;}
/**
* @brief getMy
* @return
*/
inline qreal getMy() const {return my;}
/**
* @brief setMy
* @param value
*/
inline void setMy(const qreal &value) {my = value;}
/**
* @brief getSupplement
* @return
*/
inline bool getSupplement() const {return supplement;}
/**
* @brief setSupplement
* @param value
*/
inline void setSupplement(bool value) {supplement = value;}
/**
* @brief getClosed
* @return
*/
inline bool getClosed() const {return closed;}
/**
* @brief setClosed
* @param value
*/
inline void setClosed(bool value) {closed = value;}
/**
* @brief getWidth
* @return
*/
inline qreal getWidth() const {return width;}
/**
* @brief setWidth
* @param value
*/
inline void setWidth(const qreal &value) {width = value;}
/**
* @brief getNodes
* @return
*/
inline QVector<VNodeDetail> getNodes() const {return nodes;}
/**
* @brief setNodes
* @param value
*/
inline void setNodes(const QVector<VNodeDetail> &value) {nodes = value;}
private:
/**
* @brief nodes
*/
QVector<VNodeDetail> nodes;
/**
* @brief name
*/
QString name;
/**
* @brief mx
*/
qreal mx;
/**
* @brief my
*/
qreal my;
/**
* @brief supplement
*/
bool supplement;
/**
* @brief closed
*/
bool closed;
/**
* @brief width
*/
qreal width;
};

View file

@ -34,37 +34,130 @@
namespace NodeDetail
{
/**
* @brief The NodeDetail enum
*/
enum NodeDetail { Contour, Modeling };
Q_DECLARE_FLAGS(NodeDetails, NodeDetail)
}
Q_DECLARE_OPERATORS_FOR_FLAGS(NodeDetail::NodeDetails)
/**
* @brief The VNodeDetail class
*/
class VNodeDetail
{
public:
/**
* @brief VNodeDetail
*/
VNodeDetail();
/**
* @brief VNodeDetail
* @param id
* @param typeTool
* @param mode
* @param typeNode
* @param mx
* @param my
*/
VNodeDetail(qint64 id, Tool::Tools typeTool, Draw::Draws mode, NodeDetail::NodeDetails typeNode,
qreal mx = 0, qreal my = 0);
/**
* @brief VNodeDetail
* @param node
*/
VNodeDetail(const VNodeDetail &node);
/**
* @brief operator =
* @param node
* @return
*/
VNodeDetail &operator=(const VNodeDetail &node);
/**
* @brief getId
* @return
*/
inline qint64 getId() const {return id;}
/**
* @brief setId
* @param value
*/
inline void setId(const qint64 &value) {id = value;}
/**
* @brief getTypeTool
* @return
*/
inline Tool::Tools getTypeTool() const {return typeTool;}
/**
* @brief setTypeTool
* @param value
*/
inline void setTypeTool(const Tool::Tools &value) {typeTool = value;}
/**
* @brief getMode
* @return
*/
inline Draw::Draws getMode() const {return mode;}
/**
* @brief setMode
* @param value
*/
inline void setMode(const Draw::Draws &value) {mode = value;}
/**
* @brief getTypeNode
* @return
*/
inline NodeDetail::NodeDetails getTypeNode() const {return typeNode;}
/**
* @brief setTypeNode
* @param value
*/
inline void setTypeNode(const NodeDetail::NodeDetails &value) {typeNode = value;}
/**
* @brief getMx
* @return
*/
inline qreal getMx() const {return mx;}
/**
* @brief setMx
* @param value
*/
inline void setMx(const qreal &value) {mx = value;}
/**
* @brief getMy
* @return
*/
inline qreal getMy() const {return my;}
/**
* @brief setMy
* @param value
*/
inline void setMy(const qreal &value) {my = value;}
private:
/**
* @brief id
*/
qint64 id;
/**
* @brief typeTool
*/
Tool::Tools typeTool;
/**
* @brief mode
*/
Draw::Draws mode;
/**
* @brief typeNode
*/
NodeDetail::NodeDetails typeNode;
/**
* @brief mx
*/
qreal mx;
/**
* @brief my
*/
qreal my;
};

View file

@ -107,6 +107,10 @@ public:
* @return перша точка сплайну.
*/
qint64 GetP1 () const {return p1;}
/**
* @brief GetPointP1
* @return
*/
VPointF GetPointP1() const;
/**
* @brief GetP2 повертує першу контрольну точку сплайну.
@ -123,6 +127,10 @@ public:
* @return остання точка сплайну.
*/
inline qint64 GetP4 () const {return p4;}
/**
* @brief GetPointP4
* @return
*/
VPointF GetPointP4 () const;
/**
* @brief GetAngle1 повертає кут першої напрямної.
@ -139,10 +147,30 @@ public:
* @return довжина сплайну.
*/
qreal GetLength () const;
/**
* @brief GetName
* @return
*/
QString GetName () const;
/**
* @brief GetKasm1
* @return
*/
inline qreal GetKasm1() const {return kAsm1;}
/**
* @brief GetKasm2
* @return
*/
inline qreal GetKasm2() const {return kAsm2;}
/**
* @brief GetKcurve
* @return
*/
inline qreal GetKcurve() const {return kCurve;}
/**
* @brief GetDataPoints
* @return
*/
inline const QHash<qint64, VPointF> GetDataPoints() const {return points;}
/**
* @brief CrossingSplLine перевіряє перетин сплайну з лінією.
@ -186,14 +214,54 @@ public:
* @param Pmirror точка відносно якої відбувається вертикальне дзеркалення сплайну.
*/
// void Mirror(const QPointF Pmirror);
/**
* @brief getMode
* @return
*/
inline Draw::Draws getMode() const {return mode;}
/**
* @brief setMode
* @param value
*/
inline void setMode(const Draw::Draws &value) {mode = value;}
/**
* @brief SplinePoints
* @param p1
* @param p4
* @param angle1
* @param angle2
* @param kAsm1
* @param kAsm2
* @param kCurve
* @return
*/
static QVector<QPointF> SplinePoints(const QPointF &p1, const QPointF &p4, qreal angle1, qreal angle2, qreal kAsm1,
qreal kAsm2, qreal kCurve);
/**
* @brief getIdObject
* @return
*/
inline qint64 getIdObject() const {return idObject;}
/**
* @brief setIdObject
* @param value
*/
inline void setIdObject(const qint64 &value) {idObject = value;}
/**
* @brief operator =
* @param spl
* @return
*/
VSpline &operator=(const VSpline &spl);
/**
* @brief name
* @return
*/
QString name() const {return _name;}
/**
* @brief setName
* @param name
*/
void setName(const QString &name) {_name = name;}
protected:
/**
@ -230,12 +298,33 @@ private:
* @brief angle2 кут в градусах другої напрямної.
*/
qreal angle2; // кут нахилу дотичної в другій точці
/**
* @brief kAsm1
*/
qreal kAsm1;
/**
* @brief kAsm2
*/
qreal kAsm2;
/**
* @brief kCurve
*/
qreal kCurve;
/**
* @brief points
*/
QHash<qint64, VPointF> points;
/**
* @brief mode
*/
Draw::Draws mode;
/**
* @brief idObject
*/
qint64 idObject;
/**
* @brief _name
*/
QString _name;
/**
* @brief LengthBezier повертає дожину сплайну за його чотирьма точками.

View file

@ -36,6 +36,9 @@
namespace SplinePoint
{
/**
* @brief The Position enum
*/
enum Position { FirstPoint, LastPoint };
Q_DECLARE_FLAGS(Positions, Position)
}
@ -48,56 +51,165 @@ class VSplinePath
{
Q_DECLARE_TR_FUNCTIONS(VSplinePath)
public:
/**
* @brief VSplinePath конструктор по замовчуванню.
*/
/**
* @brief VSplinePath конструктор по замовчуванню.
*/
VSplinePath();
/**
* @brief VSplinePath конструктор по замовчуванню.
*/
/**
* @brief VSplinePath конструктор по замовчуванню.
*/
VSplinePath(const QHash<qint64, VPointF> *points, qreal kCurve = 1,
Draw::Draws mode = Draw::Calculation, qint64 idObject = 0);
/**
* @brief VSplinePath
* @param splPath
*/
VSplinePath(const VSplinePath& splPath);
/**
* @brief append додає точку сплайну до шляху.
* @param point точка.
*/
void append(const VSplinePoint &point);
/**
* @brief Count
* @return
*/
qint32 Count() const;
/**
* @brief CountPoint
* @return
*/
inline qint32 CountPoint() const {return path.size();}
/**
* @brief GetSpline
* @param index
* @return
*/
VSpline GetSpline(qint32 index) const;
/**
* @brief GetPath
* @return
*/
QPainterPath GetPath() const;
/**
* @brief GetPathPoints
* @return
*/
QVector<QPointF> GetPathPoints() const;
/**
* @brief GetSplinePath
* @return
*/
inline QVector<VSplinePoint> GetSplinePath() const {return path;}
/**
* @brief GetLength
* @return
*/
qreal GetLength() const;
/**
* @brief GetDataPoints
* @return
*/
inline QHash<qint64, VPointF> GetDataPoints() const {return points;}
/**
* @brief UpdatePoint
* @param indexSpline
* @param pos
* @param point
*/
void UpdatePoint(qint32 indexSpline, const SplinePoint::Position &pos, const VSplinePoint &point);
/**
* @brief GetSplinePoint
* @param indexSpline
* @param pos
* @return
*/
VSplinePoint GetSplinePoint(qint32 indexSpline, SplinePoint::Position pos) const;
/**
* @brief Clear очищає шлях сплайнів.
*/
inline void Clear() {path.clear();}
/**
* @brief getKCurve
* @return
*/
inline qreal getKCurve() const {return kCurve;}
/**
* @brief setKCurve
* @param value
*/
inline void setKCurve(const qreal &value) {kCurve = value;}
/**
* @brief GetPoint
* @return
*/
inline const QVector<VSplinePoint> *GetPoint() const {return &path;}
/**
* @brief operator =
* @param path
* @return
*/
VSplinePath &operator=(const VSplinePath &path);
/**
* @brief operator []
* @param indx
* @return
*/
VSplinePoint &operator[](ptrdiff_t indx);
/**
* @brief getMode
* @return
*/
inline Draw::Draws getMode() const {return mode;}
/**
* @brief setMode
* @param value
*/
inline void setMode(const Draw::Draws &value) {mode = value;}
/**
* @brief getIdObject
* @return
*/
inline qint64 getIdObject() const {return idObject;}
/**
* @brief setIdObject
* @param value
*/
inline void setIdObject(const qint64 &value) {idObject = value;}
/**
* @brief name
* @return
*/
QString name() const {return _name;}
/**
* @brief setName
* @param name
*/
void setName(const QString &name) {_name = name;}
protected:
/**
* @brief path вектор з точок сплайна.
*/
QVector<VSplinePoint> path;
/**
* @brief kCurve
*/
qreal kCurve;
/**
* @brief mode
*/
Draw::Draws mode;
/**
* @brief points
*/
QHash<qint64, VPointF> points;
/**
* @brief idObject
*/
qint64 idObject;
/**
* @brief _name
*/
QString _name;
};

View file

@ -48,6 +48,10 @@ public:
* @param factor коефіцієнт довжини дотичної.
*/
VSplinePoint(qint64 pSpline, qreal kAsm1, qreal angle, qreal kAsm2);
/**
* @brief VSplinePoint
* @param point
*/
VSplinePoint(const VSplinePoint &point);
~VSplinePoint() {}
/**
@ -55,12 +59,20 @@ public:
* @return точка.
*/
inline qint64 P() const {return pSpline;}
/**
* @brief SetP
* @param value
*/
inline void SetP(const qint64 &value) {pSpline = value;}
/**
* @brief Angle1 повертає кут дотичної сплайна.
* @return кут в градусах.
*/
inline qreal Angle1() const {return angle+180;}
/**
* @brief SetAngle
* @param value
*/
inline void SetAngle(const qreal &value) {angle = value;}
/**
* @brief Angle2 повертає кут дотичної сплайна.
@ -72,12 +84,20 @@ public:
* @return коефіцієнт.
*/
inline qreal KAsm1() const {return kAsm1;}
/**
* @brief SetKAsm1
* @param value
*/
inline void SetKAsm1(const qreal &value) {kAsm1 = value;}
/**
* @brief KAsm2 повертає коефіцієнт довжини дотичної.
* @return коефіцієнт.
*/
inline qreal KAsm2() const {return kAsm2;}
/**
* @brief SetKAsm2
* @param value
*/
inline void SetKAsm2(const qreal &value) {kAsm2 = value;}
protected:
/**

View file

@ -44,65 +44,272 @@ namespace Ui
class MainWindow;
}
/**
* @brief The MainWindow class
*/
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
/**
* @brief MainWindow
* @param parent
*/
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
/**
* @brief OpenPattern
* @param fileName
*/
void OpenPattern(const QString &fileName);
public slots:
/**
* @brief mouseMove
* @param scenePos
*/
void mouseMove(const QPointF &scenePos);
/**
* @brief ActionAroowTool
*/
void ActionAroowTool();
/**
* @brief ActionDraw
* @param checked
*/
void ActionDraw(bool checked);
/**
* @brief ActionDetails
* @param checked
*/
void ActionDetails(bool checked);
/**
* @brief ActionNewDraw
*/
void ActionNewDraw();
/**
* @brief ActionSaveAs
*/
void ActionSaveAs();
/**
* @brief ActionSave
*/
void ActionSave();
/**
* @brief ActionOpen
*/
void ActionOpen();
/**
* @brief ActionNew
*/
void ActionNew();
/**
* @brief ActionTable
* @param checked
*/
void ActionTable(bool checked);
/**
* @brief ActionHistory
* @param checked
*/
void ActionHistory(bool checked);
/**
* @brief ActionLayout
* @param checked
*/
void ActionLayout(bool checked);
/**
* @brief currentDrawChanged
* @param index
*/
void currentDrawChanged( int index );
/**
* @brief OptionDraw
*/
void OptionDraw();
/**
* @brief haveChange
*/
void haveChange();
/**
* @brief ChangedSize
* @param text
*/
void ChangedSize(const QString &text);
/**
* @brief ChangedGrowth
* @param text
*/
void ChangedGrowth(const QString & text);
/**
* @brief ClosedActionTable
*/
void ClosedActionTable();
/**
* @brief ClosedActionHistory
*/
void ClosedActionHistory();
/**
* @brief ToolEndLine
* @param checked
*/
void ToolEndLine(bool checked);
/**
* @brief ToolLine
* @param checked
*/
void ToolLine(bool checked);
/**
* @brief ToolAlongLine
* @param checked
*/
void ToolAlongLine(bool checked);
/**
* @brief ToolShoulderPoint
* @param checked
*/
void ToolShoulderPoint(bool checked);
/**
* @brief ToolNormal
* @param checked
*/
void ToolNormal(bool checked);
/**
* @brief ToolBisector
* @param checked
*/
void ToolBisector(bool checked);
/**
* @brief ToolLineIntersect
* @param checked
*/
void ToolLineIntersect(bool checked);
/**
* @brief ToolSpline
* @param checked
*/
void ToolSpline(bool checked);
/**
* @brief ToolArc
* @param checked
*/
void ToolArc(bool checked);
/**
* @brief ToolSplinePath
* @param checked
*/
void ToolSplinePath(bool checked);
/**
* @brief ToolPointOfContact
* @param checked
*/
void ToolPointOfContact(bool checked);
/**
* @brief ToolDetail
* @param checked
*/
void ToolDetail(bool checked);
/**
* @brief ToolHeight
* @param checked
*/
void ToolHeight(bool checked);
/**
* @brief ToolTriangle
* @param checked
*/
void ToolTriangle(bool checked);
/**
* @brief ToolPointOfIntersection
* @param checked
*/
void ToolPointOfIntersection(bool checked);
/**
* @brief ClosedDialogEndLine
* @param result
*/
void ClosedDialogEndLine(int result);
/**
* @brief ClosedDialogLine
* @param result
*/
void ClosedDialogLine(int result);
/**
* @brief ClosedDialogAlongLine
* @param result
*/
void ClosedDialogAlongLine(int result);
/**
* @brief ClosedDialogShoulderPoint
* @param result
*/
void ClosedDialogShoulderPoint(int result);
/**
* @brief ClosedDialogNormal
* @param result
*/
void ClosedDialogNormal(int result);
/**
* @brief ClosedDialogBisector
* @param result
*/
void ClosedDialogBisector(int result);
/**
* @brief ClosedDialogLineIntersect
* @param result
*/
void ClosedDialogLineIntersect(int result);
/**
* @brief ClosedDialogSpline
* @param result
*/
void ClosedDialogSpline(int result);
/**
* @brief ClosedDialogArc
* @param result
*/
void ClosedDialogArc(int result);
/**
* @brief ClosedDialogSplinePath
* @param result
*/
void ClosedDialogSplinePath(int result);
/**
* @brief ClosedDialogPointOfContact
* @param result
*/
void ClosedDialogPointOfContact(int result);
/**
* @brief ClosedDialogDetail
* @param result
*/
void ClosedDialogDetail(int result);
/**
* @brief ClosedDialogHeight
* @param result
*/
void ClosedDialogHeight(int result);
/**
* @brief ClosedDialogTriangle
* @param result
*/
void ClosedDialogTriangle(int result);
/**
* @brief ClosedDialogPointOfIntersection
* @param result
*/
void ClosedDialogPointOfIntersection(int result);
/**
* @brief About
*/
void About();
/**
* @brief AboutQt
*/
void AboutQt();
/**
* @brief ShowToolTip
* @param toolTip
*/
void ShowToolTip(const QString &toolTip);
/**
* @brief tableClosed Слот, що виконується при отриманні сигналу закриття вікна укладання
@ -116,60 +323,226 @@ signals:
*/
void ModelChosen(QVector<VItem*> listDetails);
protected:
/**
* @brief keyPressEvent
* @param event
*/
virtual void keyPressEvent ( QKeyEvent * event );
/**
* @brief showEvent
* @param event
*/
virtual void showEvent( QShowEvent *event );
/**
* @brief closeEvent
* @param event
*/
virtual void closeEvent( QCloseEvent * event );
/**
* @brief Clear
*/
void Clear();
private:
Q_DISABLE_COPY(MainWindow)
/**
* @brief ui keeps information about user interface
*/
Ui::MainWindow *ui;
/**
* @brief tool
*/
Tool::Tools tool;
/**
* @brief currentScene
*/
VMainGraphicsScene *currentScene;
/**
* @brief sceneDraw
*/
VMainGraphicsScene *sceneDraw;
/**
* @brief sceneDetails
*/
VMainGraphicsScene *sceneDetails;
/**
* @brief mouseCoordinate
*/
QLabel *mouseCoordinate;
/**
* @brief helpLabel
*/
QLabel *helpLabel;
/**
* @brief view
*/
VMainGraphicsView *view;
/**
* @brief isInitialized
*/
bool isInitialized;
/**
* @brief dialogTable
*/
DialogIncrements *dialogTable;
/**
* @brief dialogEndLine
*/
QSharedPointer<DialogEndLine> dialogEndLine;
/**
* @brief dialogLine
*/
QSharedPointer<DialogLine> dialogLine;
/**
* @brief dialogAlongLine
*/
QSharedPointer<DialogAlongLine> dialogAlongLine;
/**
* @brief dialogShoulderPoint
*/
QSharedPointer<DialogShoulderPoint> dialogShoulderPoint;
/**
* @brief dialogNormal
*/
QSharedPointer<DialogNormal> dialogNormal;
/**
* @brief dialogBisector
*/
QSharedPointer<DialogBisector> dialogBisector;
/**
* @brief dialogLineIntersect
*/
QSharedPointer<DialogLineIntersect> dialogLineIntersect;
/**
* @brief dialogSpline
*/
QSharedPointer<DialogSpline> dialogSpline;
/**
* @brief dialogArc
*/
QSharedPointer<DialogArc> dialogArc;
/**
* @brief dialogSplinePath
*/
QSharedPointer<DialogSplinePath> dialogSplinePath;
/**
* @brief dialogPointOfContact
*/
QSharedPointer<DialogPointOfContact> dialogPointOfContact;
/**
* @brief dialogDetail
*/
QSharedPointer<DialogDetail> dialogDetail;
/**
* @brief dialogHeight
*/
QSharedPointer<DialogHeight> dialogHeight;
/**
* @brief dialogTriangle
*/
QSharedPointer<DialogTriangle> dialogTriangle;
/**
* @brief dialogPointOfIntersection
*/
QSharedPointer<DialogPointOfIntersection> dialogPointOfIntersection;
/**
* @brief dialogHistory
*/
DialogHistory *dialogHistory;
/**
* @brief doc dom document container
*/
VDomDocument *doc;
/**
* @brief data container with data
*/
VContainer *data;
/**
* @brief comboBoxDraws
*/
QComboBox *comboBoxDraws;
/**
* @brief fileName
*/
QString fileName;
/**
* @brief changeInFile
*/
bool changeInFile;
/**
* @brief mode
*/
Draw::Draws mode;
/**
* @brief ToolBarOption
*/
void ToolBarOption();
/**
* @brief ToolBarDraws
*/
void ToolBarDraws();
/**
* @brief CanselTool
*/
void CanselTool();
/**
* @brief ArrowTool
*/
void ArrowTool();
/**
* @brief SetEnableWidgets
* @param enable
*/
void SetEnableWidgets(bool enable);
/**
* @brief SetEnableTool
* @param enable
*/
void SetEnableTool(bool enable);
/**
*
*/
template <typename Dialog, typename Func>
/**
* @brief SetToolButton
* @param checked
* @param t
* @param cursor
* @param toolTip
* @param dialog
* @param closeDialogSlot
*/
void SetToolButton(bool checked, Tool::Tools t, const QString &cursor, const QString &toolTip,
QSharedPointer<Dialog> &dialog, Func closeDialogSlot);
/**
* @brief MinimumScrollBar
*/
void MinimumScrollBar();
template <typename T>
/**
* @brief AddToolToDetail
* @param tool
* @param id
* @param typeTool
* @param idDetail
*/
void AddToolToDetail(T *tool, const qint64 &id, Tool::Tools typeTool,
const qint64 &idDetail);
template <typename DrawTool, typename ModelingTool, typename Dialog>
/**
* @brief ClosedDialog
* @param dialog
* @param result
*/
void ClosedDialog(QSharedPointer<Dialog> &dialog, int result);
/**
* @brief SafeSaveing
* @param fileName
* @return
*/
bool SafeSaveing(const QString &fileName)const;
/**
* @brief AutoSavePattern
*/
void AutoSavePattern();
};

View file

@ -40,6 +40,9 @@
namespace Scene
{
/**
* @brief The Scene enum
*/
enum Scene { Point, Line, Spline, Arc, SplinePath, Detail };
Q_DECLARE_FLAGS(Scenes, Scene)
}
@ -47,6 +50,9 @@ Q_DECLARE_OPERATORS_FOR_FLAGS( Scene::Scenes )
namespace Tool
{
/**
* @brief The Tool enum
*/
enum Tool
{
ArrowTool,
@ -73,6 +79,9 @@ namespace Tool
};
Q_DECLARE_FLAGS(Tools, Tool)
/**
* @brief The Source enum
*/
enum Source { FromGui, FromFile };
Q_DECLARE_FLAGS(Sources, Source)
}
@ -81,6 +90,9 @@ Q_DECLARE_OPERATORS_FOR_FLAGS( Tool::Sources )
namespace Draw
{
/**
* @brief The Draw enum
*/
enum Draw { Calculation, Modeling };
Q_DECLARE_FLAGS(Draws, Draw)
}

View file

@ -54,7 +54,7 @@ public:
QLabel* colission;
/**
* @brief TableWindow Конструктор класу вікна створення розкладки.
* @param parent Батько об'єкту. За замовчуванням = 0.
* @param parent parent widget Батько об'єкту. За замовчуванням = 0.
*/
explicit TableWindow(QWidget *parent = 0);
/**
@ -131,11 +131,15 @@ protected:
* @param event Подія що отримується.
*/
void showEvent ( QShowEvent * event );
/**
* @brief keyPressEvent
* @param event
*/
void keyPressEvent ( QKeyEvent * event );
private:
Q_DISABLE_COPY(TableWindow)
/**
* @brief ui Змінна для доступу до об'єктів вікна.
* @brief ui keeps information about user interface Змінна для доступу до об'єктів вікна.
*/
Ui::TableWindow* ui;
/**
@ -190,8 +194,20 @@ private:
* @brief sceneRect Мінімальний розмір листа паперу що буде показуватися на сцені.
*/
QRectF sceneRect;
/**
* @brief SvgFile
* @param name
*/
void SvgFile(const QString &name)const;
/**
* @brief PngFile
* @param name
*/
void PngFile(const QString &name)const;
/**
* @brief PsFile
* @param name
*/
void PsFile(const QString &name)const;
};

View file

@ -31,28 +31,97 @@
#include "../vabstracttool.h"
/**
* @brief The VDrawTool class
*/
class VDrawTool : public VAbstractTool
{
Q_OBJECT
public:
/**
* @brief VDrawTool
* @param doc dom document container
* @param data
* @param id
* @param parent
*/
VDrawTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent = 0);
virtual ~VDrawTool() {}
/**
* @brief setDialog
*/
virtual void setDialog() {}
/**
* @brief AddRecord
* @param id
* @param toolType
* @param doc dom document container
*/
static void AddRecord(const qint64 id, const Tool::Tools &toolType, VDomDocument *doc);
/**
* @brief ignoreContextMenu
* @param enable
*/
void ignoreContextMenu(bool enable) {ignoreContextMenuEvent = enable;}
public slots:
/**
* @brief ShowTool
* @param id
* @param color
* @param enable
*/
virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
/**
* @brief ChangedActivDraw
* @param newName
*/
virtual void ChangedActivDraw(const QString &newName);
/**
* @brief ChangedNameDraw
* @param oldName
* @param newName
*/
void ChangedNameDraw(const QString &oldName, const QString &newName);
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result)=0;
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief ignoreContextMenuEvent
*/
bool ignoreContextMenuEvent;
/**
* @brief ignoreFullUpdate
*/
bool ignoreFullUpdate;
/**
* @brief nameActivDraw
*/
QString nameActivDraw;
/**
* @brief factor
*/
static qreal factor;
/**
* @brief AddToCalculation
* @param domElement
*/
void AddToCalculation(const QDomElement &domElement);
template <typename Dialog, typename Tool>
/**
* @brief ContextMenu
* @param dialog
* @param tool
* @param event
* @param showRemove
*/
void ContextMenu(QSharedPointer<Dialog> &dialog, Tool *tool, QGraphicsSceneContextMenuEvent *event,
bool showRemove = true)
{
@ -118,6 +187,13 @@ protected:
}
}
template <typename Item>
/**
* @brief ShowItem
* @param item
* @param id
* @param color
* @param enable
*/
void ShowItem(Item *item, qint64 id, Qt::GlobalColor color, bool enable)
{
Q_ASSERT(item != 0);

View file

@ -32,31 +32,102 @@
#include "vtoollinepoint.h"
#include "../../dialogs/dialogalongline.h"
/**
* @brief The VToolAlongLine class
*/
class VToolAlongLine : public VToolLinePoint
{
Q_OBJECT
public:
/**
* @brief VToolAlongLine
* @param doc dom document container
* @param data
* @param id
* @param formula
* @param firstPointId
* @param secondPointId
* @param typeLine
* @param typeCreation
* @param parent
*/
VToolAlongLine(VDomDocument *doc, VContainer *data, qint64 id, const QString &formula,
const qint64 &firstPointId, const qint64 &secondPointId, const QString &typeLine,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogAlongLine> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param pointName
* @param typeLine
* @param formula
* @param firstPointId
* @param secondPointId
* @param mx
* @param my
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 _id, const QString &pointName, const QString &typeLine, const QString &formula,
const qint64 &firstPointId, const qint64 &secondPointId, const qreal &mx, const qreal &my,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief secondPointId
*/
qint64 secondPointId;
/**
* @brief dialogAlongLine
*/
QSharedPointer<DialogAlongLine> dialogAlongLine;
};

View file

@ -34,35 +34,124 @@
#include "../../dialogs/dialogarc.h"
#include "../../widgets/vcontrolpointspline.h"
/**
* @brief The VToolArc class
*/
class VToolArc :public VDrawTool, public QGraphicsPathItem
{
Q_OBJECT
public:
/**
* @brief VToolArc
* @param doc dom document container
* @param data
* @param id
* @param typeCreation
* @param parent
*/
VToolArc(VDomDocument *doc, VContainer *data, qint64 id, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogArc> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param center
* @param radius
* @param f1
* @param f2
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 _id, const qint64 &center, const QString &radius, const QString &f1,
const QString &f2, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
/**
* @brief ChangedActivDraw
* @param newName
*/
virtual void ChangedActivDraw(const QString &newName);
/**
* @brief ShowTool
* @param id
* @param color
* @param enable
*/
virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief dialogArc
*/
QSharedPointer<DialogArc> dialogArc;
/**
* @brief RefreshGeometry
*/
void RefreshGeometry();
};

View file

@ -32,35 +32,119 @@
#include "vtoollinepoint.h"
#include "../../dialogs/dialogbisector.h"
/**
* @brief The VToolBisector class
*/
class VToolBisector : public VToolLinePoint
{
public:
/**
* @brief VToolBisector
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param formula
* @param firstPointId
* @param secondPointId
* @param thirdPointId
* @param typeCreation
* @param parent
*/
VToolBisector(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const QString &formula, const qint64 &firstPointId, const qint64 &secondPointId,
const qint64 &thirdPointId, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief FindPoint
* @param firstPoint
* @param secondPoint
* @param thirdPoint
* @param length
* @return
*/
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint,
const qreal& length);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogBisector> &dialog, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param formula
* @param firstPointId
* @param secondPointId
* @param thirdPointId
* @param typeLine
* @param pointName
* @param mx
* @param my
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
const qint64 &secondPointId, const qint64 &thirdPointId, const QString &typeLine,
const QString &pointName, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief firstPointId
*/
qint64 firstPointId;
/**
* @brief thirdPointId
*/
qint64 thirdPointId;
/**
* @brief dialogBisector
*/
QSharedPointer<DialogBisector> dialogBisector;
};

View file

@ -32,28 +32,89 @@
#include "vtoollinepoint.h"
#include "../../dialogs/dialogendline.h"
/**
* @brief The VToolEndLine class
*/
class VToolEndLine : public VToolLinePoint
{
Q_OBJECT
public:
/**
* @brief VToolEndLine
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param formula
* @param angle
* @param basePointId
* @param typeCreation
* @param parent
*/
VToolEndLine(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const QString &formula, const qreal &angle, const qint64 &basePointId,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogEndLine> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param pointName
* @param typeLine
* @param formula
* @param angle
* @param basePointId
* @param mx
* @param my
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
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, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
private:
/**
* @brief dialogEndLine
*/
QSharedPointer<DialogEndLine> dialogEndLine;
};

View file

@ -32,31 +32,104 @@
#include "vtoollinepoint.h"
#include "../../dialogs/dialogheight.h"
/**
* @brief The VToolHeight class
*/
class VToolHeight: public VToolLinePoint
{
Q_OBJECT
public:
/**
* @brief VToolHeight
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param basePointId
* @param p1LineId
* @param p2LineId
* @param typeCreation
* @param parent
*/
VToolHeight(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const qint64 &basePointId, const qint64 &p1LineId, const qint64 &p2LineId,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogHeight> &dialog, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param pointName
* @param typeLine
* @param basePointId
* @param p1LineId
* @param p2LineId
* @param mx
* @param my
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 _id, const QString &pointName, const QString &typeLine,
const qint64 &basePointId, const qint64 &p1LineId, const qint64 &p2LineId,
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief FindPoint
* @param line
* @param point
* @return
*/
static QPointF FindPoint(const QLineF &line, const QPointF &point);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
private:
/**
* @brief dialogHeight
*/
QSharedPointer<DialogHeight> dialogHeight;
/**
* @brief p1LineId
*/
qint64 p1LineId;
/**
* @brief p2LineId
*/
qint64 p2LineId;
};

View file

@ -33,35 +33,123 @@
#include <QGraphicsLineItem>
#include "../../dialogs/dialogline.h"
/**
* @brief The VToolLine class
*/
class VToolLine: public VDrawTool, public QGraphicsLineItem
{
Q_OBJECT
public:
/**
* @brief VToolLine
* @param doc dom document container
* @param data
* @param id
* @param firstPoint
* @param secondPoint
* @param typeCreation
* @param parent
*/
VToolLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint,
qint64 secondPoint, const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogLine> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param firstPoint
* @param secondPoint
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 &_id, const qint64 &firstPoint, const qint64 &secondPoint,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief ChangedActivDraw
* @param newName
*/
virtual void ChangedActivDraw(const QString &newName);
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
/**
* @brief ShowTool
* @param id
* @param color
* @param enable
*/
virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief firstPoint
*/
qint64 firstPoint;
/**
* @brief secondPoint
*/
qint64 secondPoint;
/**
* @brief dialogLine
*/
QSharedPointer<DialogLine> dialogLine;
/**
* @brief RefreshGeometry
*/
void RefreshGeometry();
};

View file

@ -32,34 +32,114 @@
#include "vtoolpoint.h"
#include "../../dialogs/dialoglineintersect.h"
/**
* @brief The VToolLineIntersect class
*/
class VToolLineIntersect:public VToolPoint
{
Q_OBJECT
public:
/**
* @brief VToolLineIntersect
* @param doc dom document container
* @param data
* @param id
* @param p1Line1
* @param p2Line1
* @param p1Line2
* @param p2Line2
* @param typeCreation
* @param parent
*/
VToolLineIntersect(VDomDocument *doc, VContainer *data, const qint64 &id, const qint64 &p1Line1,
const qint64 &p2Line1, const qint64 &p1Line2, const qint64 &p2Line2,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogLineIntersect> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param p1Line1Id
* @param p2Line1Id
* @param p1Line2Id
* @param p2Line2Id
* @param pointName
* @param mx
* @param my
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 _id, const qint64 &p1Line1Id, const qint64 &p2Line1Id, const qint64 &p1Line2Id,
const qint64 &p2Line2Id, const QString &pointName, const qreal &mx, const qreal &my,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief p1Line1
*/
qint64 p1Line1;
/**
* @brief p2Line1
*/
qint64 p2Line1;
/**
* @brief p1Line2
*/
qint64 p1Line2;
/**
* @brief p2Line2
*/
qint64 p2Line2;
/**
* @brief dialogLineIntersect
*/
QSharedPointer<DialogLineIntersect> dialogLineIntersect;
};

View file

@ -31,23 +31,66 @@
#include "vtoolpoint.h"
/**
* @brief The VToolLinePoint class
*/
class VToolLinePoint : public VToolPoint
{
Q_OBJECT
public:
/**
* @brief VToolLinePoint
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param formula
* @param basePointId
* @param angle
* @param parent
*/
VToolLinePoint(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const QString &formula, const qint64 &basePointId, const qreal &angle,
QGraphicsItem * parent = 0);
public slots:
/**
* @brief ChangedActivDraw
* @param newName
*/
virtual void ChangedActivDraw(const QString &newName);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief typeLine
*/
QString typeLine;
/**
* @brief formula
*/
QString formula;
/**
* @brief angle
*/
qreal angle;
/**
* @brief basePointId
*/
qint64 basePointId;
/**
* @brief mainLine
*/
QGraphicsLineItem *mainLine;
/**
* @brief RefreshGeometry
*/
virtual void RefreshGeometry();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens() {doc->DecrementReferens(basePointId);}
private:
Q_DISABLE_COPY(VToolLinePoint)

View file

@ -32,35 +32,116 @@
#include "vtoollinepoint.h"
#include "../../dialogs/dialognormal.h"
/**
* @brief The VToolNormal class
*/
class VToolNormal : public VToolLinePoint
{
Q_OBJECT
public:
/**
* @brief VToolNormal
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param formula
* @param angle
* @param firstPointId
* @param secondPointId
* @param typeCreation
* @param parent
*/
VToolNormal(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const QString &formula, const qreal &angle, const qint64 &firstPointId,
const qint64 &secondPointId, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogNormal> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param formula
* @param firstPointId
* @param secondPointId
* @param typeLine
* @param pointName
* @param angle
* @param mx
* @param my
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
const qint64 &secondPointId, const QString &typeLine, const QString &pointName,
const qreal angle, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief FindPoint
* @param firstPoint
* @param secondPoint
* @param length
* @param angle
* @return
*/
static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const qreal &length,
const qreal &angle = 0);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief secondPointId
*/
qint64 secondPointId;
/**
* @brief dialogNormal
*/
QSharedPointer<DialogNormal> dialogNormal;
};

View file

@ -32,28 +32,96 @@
#include "vdrawtool.h"
#include "../../widgets/vgraphicssimpletextitem.h"
/**
* @brief The VToolPoint class
*/
class VToolPoint: public VDrawTool, public QGraphicsEllipseItem
{
Q_OBJECT
public:
/**
* @brief VToolPoint
* @param doc dom document container
* @param data
* @param id
* @param parent
*/
VToolPoint(VDomDocument *doc, VContainer *data, qint64 id, QGraphicsItem * parent = 0);
virtual ~VToolPoint(){}
/**
* @brief TagName
*/
static const QString TagName;
public slots:
/**
* @brief NameChangePosition
* @param pos
*/
void NameChangePosition(const QPointF &pos);
/**
* @brief ChangedActivDraw
* @param newName
*/
virtual void ChangedActivDraw(const QString &newName);
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result) = 0;
/**
* @brief ShowTool
* @param id
* @param color
* @param enable
*/
virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief radius
*/
qreal radius;
/**
* @brief namePoint
*/
VGraphicsSimpleTextItem *namePoint;
/**
* @brief lineName
*/
QGraphicsLineItem *lineName;
/**
* @brief UpdateNamePosition
* @param mx
* @param my
*/
virtual void UpdateNamePosition(qreal mx, qreal my);
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief RefreshPointGeometry
* @param point
*/
virtual void RefreshPointGeometry(const VPointF &point);
/**
* @brief RefreshLine
*/
void RefreshLine();
private:
Q_DISABLE_COPY(VToolPoint)

View file

@ -32,36 +32,124 @@
#include "vtoolpoint.h"
#include "../../dialogs/dialogpointofcontact.h"
/**
* @brief The VToolPointOfContact class
*/
class VToolPointOfContact : public VToolPoint
{
public:
/**
* @brief VToolPointOfContact
* @param doc dom document container
* @param data
* @param id
* @param radius
* @param center
* @param firstPointId
* @param secondPointId
* @param typeCreation
* @param parent
*/
VToolPointOfContact(VDomDocument *doc, VContainer *data, const qint64 &id,
const QString &radius, const qint64 &center,
const qint64 &firstPointId, const qint64 &secondPointId,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief FindPoint
* @param radius
* @param center
* @param firstPoint
* @param secondPoint
* @return
*/
static QPointF FindPoint(const qreal &radius, const QPointF &center, const QPointF &firstPoint,
const QPointF &secondPoint);
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogPointOfContact> &dialog, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param radius
* @param center
* @param firstPointId
* @param secondPointId
* @param pointName
* @param mx
* @param my
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 _id, const QString &radius, const qint64 &center,
const qint64 &firstPointId, const qint64 &secondPointId, const QString &pointName,
const qreal &mx, const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data, const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief radius
*/
QString radius;
/**
* @brief center
*/
qint64 center;
/**
* @brief firstPointId
*/
qint64 firstPointId;
/**
* @brief secondPointId
*/
qint64 secondPointId;
/**
* @brief dialogPointOfContact
*/
QSharedPointer<DialogPointOfContact> dialogPointOfContact;
};

View file

@ -32,32 +32,98 @@
#include "vtoolpoint.h"
#include "../../dialogs/dialogpointofintersection.h"
/**
* @brief The VToolPointOfIntersection class
*/
class VToolPointOfIntersection : public VToolPoint
{
Q_OBJECT
public:
/**
* @brief VToolPointOfIntersection
* @param doc dom document container
* @param data
* @param id
* @param firstPointId
* @param secondPointId
* @param typeCreation
* @param parent
*/
VToolPointOfIntersection(VDomDocument *doc, VContainer *data, const qint64 &id,
const qint64 &firstPointId, const qint64 &secondPointId,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogPointOfIntersection> &dialog, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param pointName
* @param firstPointId
* @param secondPointId
* @param mx
* @param my
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 _id, const QString &pointName, const qint64 &firstPointId,
const qint64 &secondPointId, const qreal &mx, const qreal &my, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
private:
Q_DISABLE_COPY(VToolPointOfIntersection)
/**
* @brief firstPointId
*/
qint64 firstPointId;
/**
* @brief secondPointId
*/
qint64 secondPointId;
/**
* @brief dialogPointOfIntersection
*/
QSharedPointer<DialogPointOfIntersection> dialogPointOfIntersection;
};

View file

@ -32,34 +32,118 @@
#include "vtoollinepoint.h"
#include "../../dialogs/dialogshoulderpoint.h"
/**
* @brief The VToolShoulderPoint class
*/
class VToolShoulderPoint : public VToolLinePoint
{
public:
/**
* @brief VToolShoulderPoint
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param formula
* @param p1Line
* @param p2Line
* @param pShoulder
* @param typeCreation
* @param parent
*/
VToolShoulderPoint(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const QString &formula, const qint64 &p1Line, const qint64 &p2Line,
const qint64 &pShoulder, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief FindPoint
* @param p1Line
* @param p2Line
* @param pShoulder
* @param length
* @return
*/
static QPointF FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder,
const qreal &length);
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogShoulderPoint> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param formula
* @param p1Line
* @param p2Line
* @param pShoulder
* @param typeLine
* @param pointName
* @param mx
* @param my
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
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 qreal &mx,
const qreal &my, VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief p2Line
*/
qint64 p2Line;
/**
* @brief pShoulder
*/
qint64 pShoulder;
/**
* @brief dialogShoulderPoint
*/
QSharedPointer<DialogShoulderPoint> dialogShoulderPoint;
};

View file

@ -32,27 +32,81 @@
#include "vtoolpoint.h"
#include "../../dialogs/dialogsinglepoint.h"
/**
* @brief The VToolSinglePoint class
*/
class VToolSinglePoint : public VToolPoint
{
Q_OBJECT
public:
/**
* @brief VToolSinglePoint
* @param doc dom document container
* @param data
* @param id
* @param typeCreation
* @param parent
*/
VToolSinglePoint (VDomDocument *doc, VContainer *data, qint64 id, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0 );
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
/**
* @brief ChangedActivDraw
* @param newName
*/
virtual void ChangedActivDraw(const QString &newName);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
signals:
/**
* @brief FullUpdateTree
*/
void FullUpdateTree();
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief itemChange
* @param change
* @param value
* @return
*/
QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
/**
* @brief decrementReferens
*/
virtual void decrementReferens();
private:
/**
* @brief dialogSinglePoint
*/
QSharedPointer<DialogSinglePoint> dialogSinglePoint;
};

View file

@ -35,43 +35,155 @@
#include "../../widgets/vcontrolpointspline.h"
#include "../../geometry/vsplinepath.h"
/**
* @brief The VToolSpline class
*/
class VToolSpline:public VDrawTool, public QGraphicsPathItem
{
Q_OBJECT
public:
/**
* @brief VToolSpline
* @param doc dom document container
* @param data
* @param id
* @param typeCreation
* @param parent
*/
VToolSpline (VDomDocument *doc, VContainer *data, qint64 id, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0 );
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogSpline> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param p1
* @param p4
* @param kAsm1
* @param kAsm2
* @param angle1
* @param angle2
* @param kCurve
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
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,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType;
signals:
/**
* @brief RefreshLine
* @param indexSpline
* @param position
* @param controlPoint
* @param splinePoint
*/
void RefreshLine ( const qint32 &indexSpline, SplinePoint::Position position, const QPointF &controlPoint,
const QPointF &splinePoint );
/**
* @brief setEnabledPoint
* @param enable
*/
void setEnabledPoint ( bool enable );
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile ();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui ( int result );
/**
* @brief ControlPointChangePosition
* @param indexSpline
* @param position
* @param pos
*/
void ControlPointChangePosition (const qint32 &indexSpline, const SplinePoint::Position &position,
const QPointF &pos);
/**
* @brief ChangedActivDraw
* @param newName
*/
virtual void ChangedActivDraw ( const QString &newName );
/**
* @brief ShowTool
* @param id
* @param color
* @param enable
*/
virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile ();
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief dialogSpline
*/
QSharedPointer<DialogSpline> dialogSpline;
/**
* @brief controlPoints
*/
QVector<VControlPointSpline *> controlPoints;
/**
* @brief RefreshGeometry
*/
void RefreshGeometry ();
};

View file

@ -34,45 +34,167 @@
#include "../../dialogs/dialogsplinepath.h"
#include "../../widgets/vcontrolpointspline.h"
/**
* @brief The VToolSplinePath class
*/
class VToolSplinePath:public VDrawTool, public QGraphicsPathItem
{
Q_OBJECT
public:
/**
* @brief VToolSplinePath
* @param doc dom document container
* @param data
* @param id
* @param typeCreation
* @param parent
*/
VToolSplinePath(VDomDocument *doc, VContainer *data, qint64 id, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogSplinePath> &dialog, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param path
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 _id, const VSplinePath &path, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType;
signals:
/**
* @brief RefreshLine
* @param indexSpline
* @param pos
* @param controlPoint
* @param splinePoint
*/
void RefreshLine(const qint32 &indexSpline, SplinePoint::Position pos,
const QPointF &controlPoint, const QPointF &splinePoint);
/**
* @brief setEnabledPoint
* @param enable
*/
void setEnabledPoint(bool enable);
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
/**
* @brief ControlPointChangePosition
* @param indexSpline
* @param position
* @param pos
*/
void ControlPointChangePosition(const qint32 &indexSpline, const SplinePoint::Position &position,
const QPointF &pos);
/**
* @brief ChangedActivDraw
* @param newName
*/
virtual void ChangedActivDraw(const QString &newName);
/**
* @brief ShowTool
* @param id
* @param color
* @param enable
*/
virtual void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
/**
* @brief SetFactor
* @param factor
*/
virtual void SetFactor(qreal factor);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief dialogSplinePath
*/
QSharedPointer<DialogSplinePath> dialogSplinePath;
/**
* @brief controlPoints
*/
QVector<VControlPointSpline *> controlPoints;
/**
* @brief RefreshGeometry
*/
void RefreshGeometry();
/**
* @brief AddPathPoint
* @param domElement
* @param splPoint
*/
void AddPathPoint(QDomElement &domElement, const VSplinePoint &splPoint);
/**
* @brief UpdatePathPoint
* @param node
* @param path
*/
void UpdatePathPoint(QDomNode& node, VSplinePath &path);
/**
* @brief CorectControlPoints
* @param spl
* @param splPath
* @param indexSpline
*/
void CorectControlPoints(const VSpline &spl, VSplinePath &splPath, const qint32 &indexSpline);
};

View file

@ -32,36 +32,120 @@
#include "vtoolpoint.h"
#include "../../dialogs/dialogtriangle.h"
/**
* @brief The VToolTriangle class
*/
class VToolTriangle : public VToolPoint
{
Q_OBJECT
public:
/**
* @brief VToolTriangle
* @param doc dom document container
* @param data
* @param id
* @param axisP1Id
* @param axisP2Id
* @param firstPointId
* @param secondPointId
* @param typeCreation
* @param parent
*/
VToolTriangle(VDomDocument *doc, VContainer *data, const qint64 &id, const qint64 &axisP1Id,
const qint64 &axisP2Id, const qint64 &firstPointId, const qint64 &secondPointId,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogTriangle> &dialog, VMainGraphicsScene *scene, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param pointName
* @param axisP1Id
* @param axisP2Id
* @param firstPointId
* @param secondPointId
* @param mx
* @param my
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 _id, const QString &pointName, const qint64 &axisP1Id, const qint64 &axisP2Id,
const qint64 &firstPointId, const qint64 &secondPointId, const qreal &mx, const qreal &my,
VMainGraphicsScene *scene, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief FindPoint
* @param axisP1
* @param axisP2
* @param firstPoint
* @param secondPoint
* @return
*/
static QPointF FindPoint(const QPointF &axisP1, const QPointF &axisP2, const QPointF &firstPoint,
const QPointF &secondPoint);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
private:
Q_DISABLE_COPY(VToolTriangle)
/**
* @brief axisP1Id
*/
qint64 axisP1Id;
/**
* @brief axisP2Id
*/
qint64 axisP2Id;
/**
* @brief firstPointId
*/
qint64 firstPointId;
/**
* @brief secondPointId
*/
qint64 secondPointId;
/**
* @brief dialogTriangle
*/
QSharedPointer<DialogTriangle> dialogTriangle;
};

View file

@ -32,30 +32,97 @@
#include "vmodelinglinepoint.h"
#include "../../dialogs/dialogalongline.h"
/**
* @brief The VModelingAlongLine class
*/
class VModelingAlongLine : public VModelingLinePoint
{
Q_OBJECT
public:
/**
* @brief VModelingAlongLine
* @param doc dom document container
* @param data
* @param id
* @param formula
* @param firstPointId
* @param secondPointId
* @param typeLine
* @param typeCreation
* @param parent
*/
VModelingAlongLine(VDomDocument *doc, VContainer *data, qint64 id,
const QString &formula, const qint64 &firstPointId,
const qint64 &secondPointId, const QString &typeLine,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingAlongLine* Create(QSharedPointer<DialogAlongLine> &dialog, VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param pointName
* @param typeLine
* @param formula
* @param firstPointId
* @param secondPointId
* @param mx
* @param my
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingAlongLine* Create(const qint64 _id, const QString &pointName, const QString &typeLine,
const QString &formula, const qint64 &firstPointId, const qint64 &secondPointId,
const qreal &mx, const qreal &my, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief secondPointId
*/
qint64 secondPointId;
/**
* @brief dialogAlongLine
*/
QSharedPointer<DialogAlongLine> dialogAlongLine;
};

View file

@ -34,31 +34,106 @@
#include "../../dialogs/dialogarc.h"
#include "../../widgets/vcontrolpointspline.h"
/**
* @brief The VModelingArc class
*/
class VModelingArc :public VModelingTool, public QGraphicsPathItem
{
Q_OBJECT
public:
/**
* @brief VModelingArc
* @param doc dom document container
* @param data
* @param id
* @param typeCreation
* @param parent
*/
VModelingArc(VDomDocument *doc, VContainer *data, qint64 id, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingArc* Create(QSharedPointer<DialogArc> &dialog, VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param center
* @param radius
* @param f1
* @param f2
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingArc* Create(const qint64 _id, const qint64 &center, const QString &radius, const QString &f1,
const QString &f2, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief dialogArc
*/
QSharedPointer<DialogArc> dialogArc;
/**
* @brief RefreshGeometry
*/
void RefreshGeometry();
};

View file

@ -32,33 +32,105 @@
#include "vmodelinglinepoint.h"
#include "../../dialogs/dialogbisector.h"
/**
* @brief The VModelingBisector class
*/
class VModelingBisector : public VModelingLinePoint
{
Q_OBJECT
public:
/**
* @brief VModelingBisector
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param formula
* @param firstPointId
* @param secondPointId
* @param thirdPointId
* @param typeCreation
* @param parent
*/
VModelingBisector(VDomDocument *doc, VContainer *data, const qint64 &id,
const QString &typeLine, const QString &formula,
const qint64 &firstPointId, const qint64 &secondPointId,
const qint64 &thirdPointId, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingBisector* Create(QSharedPointer<DialogBisector> &dialog, VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param formula
* @param firstPointId
* @param secondPointId
* @param thirdPointId
* @param typeLine
* @param pointName
* @param mx
* @param my
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingBisector* Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
const qint64 &secondPointId, const qint64 &thirdPointId, const QString &typeLine,
const QString &pointName, const qreal &mx, const qreal &my, VDomDocument *doc,
VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief firstPointId
*/
qint64 firstPointId;
/**
* @brief thirdPointId
*/
qint64 thirdPointId;
/**
* @brief dialogBisector
*/
QSharedPointer<DialogBisector> dialogBisector;
};

View file

@ -32,28 +32,89 @@
#include "vmodelinglinepoint.h"
#include "../../dialogs/dialogendline.h"
/**
* @brief The VModelingEndLine class
*/
class VModelingEndLine : public VModelingLinePoint
{
Q_OBJECT
public:
/**
* @brief VModelingEndLine
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param formula
* @param angle
* @param basePointId
* @param typeCreation
* @param parent
*/
VModelingEndLine(VDomDocument *doc, VContainer *data, const qint64 &id,
const QString &typeLine, const QString &formula, const qreal &angle,
const qint64 &basePointId, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingEndLine* Create(QSharedPointer<DialogEndLine> &dialog, VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param pointName
* @param typeLine
* @param formula
* @param angle
* @param basePointId
* @param mx
* @param my
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingEndLine* 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, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
private:
/**
* @brief dialogEndLine
*/
QSharedPointer<DialogEndLine> dialogEndLine;
};

View file

@ -32,30 +32,97 @@
#include "vmodelinglinepoint.h"
#include "../../dialogs/dialogheight.h"
/**
* @brief The VModelingHeight class
*/
class VModelingHeight : public VModelingLinePoint
{
Q_OBJECT
public:
/**
* @brief VModelingHeight
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param basePointId
* @param p1LineId
* @param p2LineId
* @param typeCreation
* @param parent
*/
VModelingHeight(VDomDocument *doc, VContainer *data, const qint64 &id,
const QString &typeLine, const qint64 &basePointId, const qint64 &p1LineId,
const qint64 &p2LineId, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingHeight* Create(QSharedPointer<DialogHeight> &dialog, VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param pointName
* @param typeLine
* @param basePointId
* @param p1LineId
* @param p2LineId
* @param mx
* @param my
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingHeight* Create(const qint64 _id, const QString &pointName, const QString &typeLine,
const qint64 &basePointId, const qint64 &p1LineId, const qint64 &p2LineId,
const qreal &mx, const qreal &my, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
private:
/**
* @brief dialogHeight
*/
QSharedPointer<DialogHeight> dialogHeight;
/**
* @brief p1LineId
*/
qint64 p1LineId;
/**
* @brief p2LineId
*/
qint64 p2LineId;
};

View file

@ -33,32 +33,106 @@
#include <QGraphicsLineItem>
#include "../../dialogs/dialogline.h"
/**
* @brief The VModelingLine class
*/
class VModelingLine: public VModelingTool, public QGraphicsLineItem
{
Q_OBJECT
public:
/**
* @brief VModelingLine
* @param doc dom document container
* @param data
* @param id
* @param firstPoint
* @param secondPoint
* @param typeCreation
* @param parent
*/
VModelingLine(VDomDocument *doc, VContainer *data, qint64 id, qint64 firstPoint,
qint64 secondPoint, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingLine* Create(QSharedPointer<DialogLine> &dialog, VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param firstPoint
* @param secondPoint
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingLine* Create(const qint64 &_id, const qint64 &firstPoint, const qint64 &secondPoint,
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief firstPoint
*/
qint64 firstPoint;
/**
* @brief secondPoint
*/
qint64 secondPoint;
/**
* @brief dialogLine
*/
QSharedPointer<DialogLine> dialogLine;
};

View file

@ -32,35 +32,111 @@
#include "vmodelingpoint.h"
#include "../../dialogs/dialoglineintersect.h"
/**
* @brief The VModelingLineIntersect class
*/
class VModelingLineIntersect:public VModelingPoint
{
Q_OBJECT
public:
/**
* @brief VModelingLineIntersect
* @param doc dom document container
* @param data
* @param id
* @param p1Line1
* @param p2Line1
* @param p1Line2
* @param p2Line2
* @param typeCreation
* @param parent
*/
VModelingLineIntersect(VDomDocument *doc, VContainer *data, const qint64 &id,
const qint64 &p1Line1, const qint64 &p2Line1,
const qint64 &p1Line2, const qint64 &p2Line2,
const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingLineIntersect* Create(QSharedPointer<DialogLineIntersect> &dialog, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param p1Line1Id
* @param p2Line1Id
* @param p1Line2Id
* @param p2Line2Id
* @param pointName
* @param mx
* @param my
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingLineIntersect* Create(const qint64 _id, const qint64 &p1Line1Id, const qint64 &p2Line1Id,
const qint64 &p1Line2Id, const qint64 &p2Line2Id, const QString &pointName,
const qreal &mx, const qreal &my, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief p1Line1
*/
qint64 p1Line1;
/**
* @brief p2Line1
*/
qint64 p2Line1;
/**
* @brief p1Line2
*/
qint64 p1Line2;
/**
* @brief p2Line2
*/
qint64 p2Line2;
/**
* @brief dialogLineIntersect
*/
QSharedPointer<DialogLineIntersect> dialogLineIntersect;
};

View file

@ -31,20 +31,55 @@
#include "vmodelingpoint.h"
/**
* @brief The VModelingLinePoint class
*/
class VModelingLinePoint : public VModelingPoint
{
Q_OBJECT
public:
/**
* @brief VModelingLinePoint
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param formula
* @param basePointId
* @param angle
* @param parent
*/
VModelingLinePoint(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const QString &formula, const qint64 &basePointId, const qreal &angle,
QGraphicsItem * parent = 0);
protected:
/**
* @brief typeLine
*/
QString typeLine;
/**
* @brief formula
*/
QString formula;
/**
* @brief angle
*/
qreal angle;
/**
* @brief basePointId
*/
qint64 basePointId;
/**
* @brief mainLine
*/
QGraphicsLineItem *mainLine;
/**
* @brief RefreshGeometry
*/
virtual void RefreshGeometry();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens() {doc->DecrementReferens(basePointId);}
private:
Q_DISABLE_COPY(VModelingLinePoint)

View file

@ -32,31 +32,100 @@
#include "vmodelinglinepoint.h"
#include "../../dialogs/dialognormal.h"
/**
* @brief The VModelingNormal class
*/
class VModelingNormal : public VModelingLinePoint
{
Q_OBJECT
public:
/**
* @brief VModelingNormal
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param formula
* @param angle
* @param firstPointId
* @param secondPointId
* @param typeCreation
* @param parent
*/
VModelingNormal(VDomDocument *doc, VContainer *data, const qint64 &id,
const QString &typeLine, const QString &formula, const qreal &angle,
const qint64 &firstPointId, const qint64 &secondPointId,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingNormal* Create(QSharedPointer<DialogNormal> &dialog, VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param formula
* @param firstPointId
* @param secondPointId
* @param typeLine
* @param pointName
* @param angle
* @param mx
* @param my
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingNormal* Create(const qint64 _id, const QString &formula, const qint64 &firstPointId,
const qint64 &secondPointId, const QString &typeLine, const QString &pointName,
const qreal angle, const qreal &mx, const qreal &my, VDomDocument *doc,
VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief secondPointId
*/
qint64 secondPointId;
/**
* @brief dialogNormal
*/
QSharedPointer<DialogNormal> dialogNormal;
};

View file

@ -32,25 +32,79 @@
#include "vmodelingtool.h"
#include "../../widgets/vgraphicssimpletextitem.h"
/**
* @brief The VModelingPoint class
*/
class VModelingPoint: public VModelingTool, public QGraphicsEllipseItem
{
Q_OBJECT
public:
/**
* @brief VModelingPoint
* @param doc dom document container
* @param data
* @param id
* @param parent
*/
VModelingPoint(VDomDocument *doc, VContainer *data, qint64 id, QGraphicsItem * parent = 0);
virtual ~VModelingPoint() {}
/**
* @brief TagName
*/
static const QString TagName;
public slots:
/**
* @brief NameChangePosition
* @param pos
*/
void NameChangePosition(const QPointF &pos);
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result) = 0;
protected:
/**
* @brief radius
*/
qreal radius;
/**
* @brief namePoint
*/
VGraphicsSimpleTextItem *namePoint;
/**
* @brief lineName
*/
QGraphicsLineItem *lineName;
/**
* @brief UpdateNamePosition
* @param mx
* @param my
*/
virtual void UpdateNamePosition(qreal mx, qreal my);
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief RefreshPointGeometry
* @param point
*/
virtual void RefreshPointGeometry(const VPointF &point);
/**
* @brief RefreshLine
*/
void RefreshLine();
private:
Q_DISABLE_COPY(VModelingPoint)

View file

@ -32,36 +32,112 @@
#include "vmodelingpoint.h"
#include "../../dialogs/dialogpointofcontact.h"
/**
* @brief The VModelingPointOfContact class
*/
class VModelingPointOfContact : public VModelingPoint
{
Q_OBJECT
public:
/**
* @brief VModelingPointOfContact
* @param doc dom document container
* @param data
* @param id
* @param radius
* @param center
* @param firstPointId
* @param secondPointId
* @param typeCreation
* @param parent
*/
VModelingPointOfContact(VDomDocument *doc, VContainer *data, const qint64 &id,
const QString &radius, const qint64 &center,
const qint64 &firstPointId, const qint64 &secondPointId,
const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingPointOfContact* Create(QSharedPointer<DialogPointOfContact> &dialog, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param radius
* @param center
* @param firstPointId
* @param secondPointId
* @param pointName
* @param mx
* @param my
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingPointOfContact* Create(const qint64 _id, const QString &radius, const qint64 &center,
const qint64 &firstPointId, const qint64 &secondPointId,
const QString &pointName, const qreal &mx, const qreal &my,
VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief radius
*/
QString radius;
/**
* @brief center
*/
qint64 center;
/**
* @brief firstPointId
*/
qint64 firstPointId;
/**
* @brief secondPointId
*/
qint64 secondPointId;
/**
* @brief dialogPointOfContact
*/
QSharedPointer<DialogPointOfContact> dialogPointOfContact;
};

View file

@ -32,33 +32,99 @@
#include "vmodelingpoint.h"
#include "../../dialogs/dialogpointofintersection.h"
/**
* @brief The VModelingPointOfIntersection class
*/
class VModelingPointOfIntersection : public VModelingPoint
{
Q_OBJECT
public:
/**
* @brief VModelingPointOfIntersection
* @param doc dom document container
* @param data
* @param id
* @param firstPointId
* @param secondPointId
* @param typeCreation
* @param parent
*/
VModelingPointOfIntersection(VDomDocument *doc, VContainer *data, const qint64 &id,
const qint64 &firstPointId, const qint64 &secondPointId,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingPointOfIntersection* Create(QSharedPointer<DialogPointOfIntersection> &dialog, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param pointName
* @param firstPointId
* @param secondPointId
* @param mx
* @param my
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingPointOfIntersection* Create(const qint64 _id, const QString &pointName,
const qint64 &firstPointId, const qint64 &secondPointId,
const qreal &mx, const qreal &my, VDomDocument *doc,
VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
private:
Q_DISABLE_COPY(VModelingPointOfIntersection)
/**
* @brief firstPointId
*/
qint64 firstPointId;
/**
* @brief secondPointId
*/
qint64 secondPointId;
/**
* @brief dialogPointOfIntersection
*/
QSharedPointer<DialogPointOfIntersection> dialogPointOfIntersection;
};

View file

@ -32,33 +32,105 @@
#include "vmodelinglinepoint.h"
#include "../../dialogs/dialogshoulderpoint.h"
/**
* @brief The VModelingShoulderPoint class
*/
class VModelingShoulderPoint : public VModelingLinePoint
{
Q_OBJECT
public:
/**
* @brief VModelingShoulderPoint
* @param doc dom document container
* @param data
* @param id
* @param typeLine
* @param formula
* @param p1Line
* @param p2Line
* @param pShoulder
* @param typeCreation
* @param parent
*/
VModelingShoulderPoint(VDomDocument *doc, VContainer *data, const qint64 &id, const QString &typeLine,
const QString &formula, const qint64 &p1Line, const qint64 &p2Line,
const qint64 &pShoulder, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingShoulderPoint* Create(QSharedPointer<DialogShoulderPoint> &dialog, VDomDocument *doc,
VContainer *data);
/**
* @brief Create
* @param _id
* @param formula
* @param p1Line
* @param p2Line
* @param pShoulder
* @param typeLine
* @param pointName
* @param mx
* @param my
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingShoulderPoint* Create(const qint64 _id, const QString &formula, const qint64 &p1Line,
const qint64 &p2Line, const qint64 &pShoulder, const QString &typeLine,
const QString &pointName, const qreal &mx, const qreal &my, VDomDocument *doc,
VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief p2Line
*/
qint64 p2Line;
/**
* @brief pShoulder
*/
qint64 pShoulder;
/**
* @brief dialogShoulderPoint
*/
QSharedPointer<DialogShoulderPoint> dialogShoulderPoint;
};

View file

@ -35,39 +35,137 @@
#include "../../widgets/vcontrolpointspline.h"
#include "../../geometry/vsplinepath.h"
/**
* @brief The VModelingSpline class
*/
class VModelingSpline:public VModelingTool, public QGraphicsPathItem
{
Q_OBJECT
public:
/**
* @brief VModelingSpline
* @param doc dom document container
* @param data
* @param id
* @param typeCreation
* @param parent
*/
VModelingSpline (VDomDocument *doc, VContainer *data, qint64 id,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0 );
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingSpline* Create(QSharedPointer<DialogSpline> &dialog, VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param p1
* @param p4
* @param kAsm1
* @param kAsm2
* @param angle1
* @param angle2
* @param kCurve
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
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 &kCurve,
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType;
signals:
/**
* @brief RefreshLine
* @param indexSpline
* @param position
* @param controlPoint
* @param splinePoint
*/
void RefreshLine (const qint32 &indexSpline, SplinePoint::Position position,
const QPointF &controlPoint, const QPointF &splinePoint );
/**
* @brief setEnabledPoint
* @param enable
*/
void setEnabledPoint ( bool enable );
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile ();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui ( int result );
/**
* @brief ControlPointChangePosition
* @param indexSpline
* @param position
* @param pos
*/
void ControlPointChangePosition (const qint32 &indexSpline, SplinePoint::Position position,
const QPointF &pos);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile ();
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief dialogSpline
*/
QSharedPointer<DialogSpline> dialogSpline;
/**
* @brief controlPoints
*/
QVector<VControlPointSpline *> controlPoints;
/**
* @brief RefreshGeometry
*/
void RefreshGeometry ();
};

View file

@ -34,41 +34,149 @@
#include "../../dialogs/dialogsplinepath.h"
#include "../../widgets/vcontrolpointspline.h"
/**
* @brief The VModelingSplinePath class
*/
class VModelingSplinePath:public VModelingTool, public QGraphicsPathItem
{
Q_OBJECT
public:
/**
* @brief VModelingSplinePath
* @param doc dom document container
* @param data
* @param id
* @param typeCreation
* @param parent
*/
VModelingSplinePath(VDomDocument *doc, VContainer *data, qint64 id, const Tool::Sources &typeCreation,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingSplinePath* Create(QSharedPointer<DialogSplinePath> &dialog, VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param path
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingSplinePath* Create(const qint64 _id, const VSplinePath &path, VDomDocument *doc,
VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType;
signals:
/**
* @brief RefreshLine
* @param indexSpline
* @param pos
* @param controlPoint
* @param splinePoint
*/
void RefreshLine(const qint32 &indexSpline, SplinePoint::Position pos, const QPointF &controlPoint,
const QPointF &splinePoint);
/**
* @brief setEnabledPoint
* @param enable
*/
void setEnabledPoint(bool enable);
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
/**
* @brief ControlPointChangePosition
* @param indexSpline
* @param position
* @param pos
*/
void ControlPointChangePosition(const qint32 &indexSpline, SplinePoint::Position position,
const QPointF &pos);
protected:
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
/**
* @brief dialogSplinePath
*/
QSharedPointer<DialogSplinePath> dialogSplinePath;
/**
* @brief controlPoints
*/
QVector<VControlPointSpline *> controlPoints;
/**
* @brief RefreshGeometry
*/
void RefreshGeometry();
/**
* @brief AddPathPoint
* @param domElement
* @param splPoint
*/
void AddPathPoint(QDomElement &domElement, const VSplinePoint &splPoint);
/**
* @brief UpdatePathPoint
* @param node
* @param path
*/
void UpdatePathPoint(QDomNode& node, VSplinePath &path);
/**
* @brief CorectControlPoints
* @param spl
* @param splPath
* @param indexSpline
*/
void CorectControlPoints(const VSpline &spl, VSplinePath &splPath, const qint32 &indexSpline);
};

View file

@ -32,22 +32,63 @@
#include "../vabstracttool.h"
#include <QMenu>
/**
* @brief The VModelingTool class
*/
class VModelingTool: public VAbstractTool
{
Q_OBJECT
public:
/**
* @brief VModelingTool
* @param doc dom document container
* @param data
* @param id
* @param parent
*/
VModelingTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent = 0);
virtual ~VModelingTool(){}
/**
* @brief setDialog
*/
virtual void setDialog(){}
/**
* @brief ignoreContextMenu
* @param enable
*/
inline void ignoreContextMenu(bool enable) {ignoreContextMenuEvent = enable;}
public slots:
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result)=0;
protected:
/**
* @brief ignoreContextMenuEvent
*/
bool ignoreContextMenuEvent;
/**
* @brief ignoreFullUpdate
*/
bool ignoreFullUpdate;
/**
* @brief AddToModeling
* @param domElement
*/
void AddToModeling(const QDomElement &domElement);
/**
* @brief decrementReferens
*/
virtual void decrementReferens();
template <typename Dialog, typename Tool>
/**
* @brief ContextMenu
* @param dialog
* @param tool
* @param event
* @param showRemove
*/
void ContextMenu(QSharedPointer<Dialog> &dialog, Tool *tool, QGraphicsSceneContextMenuEvent *event,
bool showRemove = true)
{

View file

@ -33,33 +33,109 @@
#include "../drawTools/vtooltriangle.h"
#include "../../dialogs/dialogtriangle.h"
/**
* @brief The VModelingTriangle class
*/
class VModelingTriangle : public VModelingPoint
{
Q_OBJECT
public:
/**
* @brief VModelingTriangle
* @param doc dom document container
* @param data
* @param id
* @param axisP1Id
* @param axisP2Id
* @param firstPointId
* @param secondPointId
* @param typeCreation
* @param parent
*/
VModelingTriangle(VDomDocument *doc, VContainer *data, const qint64 &id, const qint64 &axisP1Id,
const qint64 &axisP2Id, const qint64 &firstPointId, const qint64 &secondPointId,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param doc dom document container
* @param data
* @return
*/
static VModelingTriangle* Create(QSharedPointer<DialogTriangle> &dialog, VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param pointName
* @param axisP1Id
* @param axisP2Id
* @param firstPointId
* @param secondPointId
* @param mx
* @param my
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
* @return
*/
static VModelingTriangle* Create(const qint64 _id, const QString &pointName, const qint64 &axisP1Id,
const qint64 &axisP2Id, const qint64 &firstPointId, const qint64 &secondPointId,
const qreal &mx, const qreal &my, VDomDocument *doc, VContainer *data,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
protected:
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief AddToFile
*/
virtual void AddToFile();
private:
Q_DISABLE_COPY(VModelingTriangle)
/**
* @brief axisP1Id
*/
qint64 axisP1Id;
/**
* @brief axisP2Id
*/
qint64 axisP2Id;
/**
* @brief firstPointId
*/
qint64 firstPointId;
/**
* @brief secondPointId
*/
qint64 secondPointId;
/**
* @brief dialogTriangle
*/
QSharedPointer<DialogTriangle> dialogTriangle;
};

View file

@ -31,21 +31,58 @@
#include "../vabstracttool.h"
/**
* @brief The VAbstractNode class
*/
class VAbstractNode : public VAbstractTool
{
Q_OBJECT
public:
/**
* @brief VAbstractNode
* @param doc dom document container
* @param data
* @param id
* @param idNode
* @param typeobject
* @param parent
*/
VAbstractNode(VDomDocument *doc, VContainer *data, qint64 id, qint64 idNode,
Draw::Draws typeobject, QObject *parent = 0 );
virtual ~VAbstractNode() {}
/**
* @brief AttrIdObject
*/
static const QString AttrIdObject;
/**
* @brief AttrTypeObject
*/
static const QString AttrTypeObject;
/**
* @brief TypeObjectCalculation
*/
static const QString TypeObjectCalculation;
/**
* @brief TypeObjectModeling
*/
static const QString TypeObjectModeling;
protected:
/**
* @brief idNode
*/
qint64 idNode;
/**
* @brief typeobject
*/
Draw::Draws typeobject;
/**
* @brief AddToModeling
* @param domElement
*/
void AddToModeling(const QDomElement &domElement);
/**
* @brief decrementReferens
*/
virtual void decrementReferens();
};

View file

@ -32,24 +32,74 @@
#include "vabstractnode.h"
#include <QGraphicsPathItem>
/**
* @brief The VNodeArc class
*/
class VNodeArc :public VAbstractNode, public QGraphicsPathItem
{
Q_OBJECT
public:
/**
* @brief VNodeArc
* @param doc dom document container
* @param data
* @param id
* @param idArc
* @param typeobject
* @param typeCreation
* @param parent
*/
VNodeArc(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc, Draw::Draws typeobject,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief Create
* @param doc dom document container
* @param data
* @param id
* @param idArc
* @param typeobject
* @param parse
* @param typeCreation
*/
static void Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idArc, const Draw::Draws &typeobject,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
protected:
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
private:
/**
* @brief RefreshGeometry
*/
void RefreshGeometry();
};

View file

@ -32,29 +32,101 @@
#include "vabstractnode.h"
#include "../../widgets/vgraphicssimpletextitem.h"
/**
* @brief The VNodePoint class
*/
class VNodePoint: public VAbstractNode, public QGraphicsEllipseItem
{
Q_OBJECT
public:
/**
* @brief VNodePoint
* @param doc dom document container
* @param data
* @param id
* @param idPoint
* @param typeobject
* @param typeCreation
* @param parent
*/
VNodePoint(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint, Draw::Draws typeobject,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0 );
/**
* @brief Create
* @param doc dom document container
* @param data
* @param id
* @param idPoint
* @param typeobject
* @param parse
* @param typeCreation
*/
static void Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idPoint, const Draw::Draws &typeobject,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
/**
* @brief NameChangePosition
* @param pos
*/
void NameChangePosition(const QPointF &pos);
protected:
/**
* @brief radius
*/
qreal radius;
/**
* @brief namePoint
*/
VGraphicsSimpleTextItem *namePoint;
/**
* @brief lineName
*/
QGraphicsLineItem *lineName;
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief UpdateNamePosition
* @param mx
* @param my
*/
virtual void UpdateNamePosition(qreal mx, qreal my);
/**
* @brief RefreshPointGeometry
* @param point
*/
virtual void RefreshPointGeometry(const VPointF &point);
/**
* @brief RefreshLine
*/
void RefreshLine();
private:
Q_DISABLE_COPY(VNodePoint)

View file

@ -32,25 +32,76 @@
#include "vabstractnode.h"
#include <QGraphicsPathItem>
/**
* @brief The VNodeSpline class
*/
class VNodeSpline:public VAbstractNode, public QGraphicsPathItem
{
Q_OBJECT
public:
/**
* @brief VNodeSpline
* @param doc dom document container
* @param data
* @param id
* @param idSpline
* @param typeobject
* @param typeCreation
* @param parent
*/
VNodeSpline(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, Draw::Draws typeobject,
const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief Create
* @param doc dom document container
* @param data
* @param id
* @param idSpline
* @param typeobject
* @param parse
* @param typeCreation
* @return
*/
static VNodeSpline *Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline,
const Draw::Draws &typeobject, const Document::Documents &parse,
const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile ();
protected:
/**
* @brief AddToFile
*/
virtual void AddToFile ();
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
private:
/**
* @brief RefreshGeometry
*/
void RefreshGeometry ();
};

View file

@ -32,24 +32,74 @@
#include "vabstractnode.h"
#include <QGraphicsPathItem>
/**
* @brief The VNodeSplinePath class
*/
class VNodeSplinePath : public VAbstractNode, public QGraphicsPathItem
{
Q_OBJECT
public:
/**
* @brief VNodeSplinePath
* @param doc dom document container
* @param data
* @param id
* @param idSpline
* @param typeobject
* @param typeCreation
* @param parent
*/
VNodeSplinePath(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline,
Draw::Draws typeobject, const Tool::Sources &typeCreation, QGraphicsItem * parent = 0);
/**
* @brief Create
* @param doc dom document container
* @param data
* @param id
* @param idSpline
* @param typeobject
* @param parse
* @param typeCreation
*/
static void Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 idSpline, const Draw::Draws &typeobject,
const Document::Documents &parse, const Tool::Sources &typeCreation);
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief ToolType
*/
static const QString ToolType;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile();
protected:
/**
* @brief AddToFile
*/
virtual void AddToFile();
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
private:
/**
* @brief RefreshGeometry
*/
void RefreshGeometry();
};

View file

@ -32,72 +32,280 @@
#include "vdatatool.h"
#include "../xml/vdomdocument.h"
/**
* @brief The VAbstractTool class
*/
class VAbstractTool: public VDataTool
{
Q_OBJECT
public:
/**
* @brief VAbstractTool
* @param doc dom document container
* @param data
* @param id
* @param parent
*/
VAbstractTool(VDomDocument *doc, VContainer *data, qint64 id, QObject *parent = 0);
virtual ~VAbstractTool() {}
/**
* @brief LineIntersectRect
* @param rec
* @param line
* @return
*/
static QPointF LineIntersectRect(QRectF rec, QLineF line);
/**
* @brief LineIntersectCircle
* @param center
* @param radius
* @param line
* @param p1
* @param p2
* @return
*/
static qint32 LineIntersectCircle(const QPointF &center, qreal radius, const QLineF &line, QPointF &p1,
QPointF &p2);
/**
* @brief ClosestPoint
* @param line
* @param p
* @return
*/
static QPointF ClosestPoint(const QLineF &line, const QPointF &p);
/**
* @brief addVector
* @param p
* @param p1
* @param p2
* @param k
* @return
*/
static QPointF addVector (const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k);
/**
* @brief getId
* @return
*/
inline qint64 getId() const {return id;}
/**
* @brief LineCoefficients
* @param line
* @param a
* @param b
* @param c
*/
static void LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c);
/**
* @brief AttrId
*/
static const QString AttrId;
/**
* @brief AttrType
*/
static const QString AttrType;
/**
* @brief AttrMx
*/
static const QString AttrMx;
/**
* @brief AttrMy
*/
static const QString AttrMy;
/**
* @brief AttrName
*/
static const QString AttrName;
/**
* @brief AttrX
*/
static const QString AttrX;
/**
* @brief AttrY
*/
static const QString AttrY;
/**
* @brief AttrTypeLine
*/
static const QString AttrTypeLine;
/**
* @brief AttrLength
*/
static const QString AttrLength;
/**
* @brief AttrBasePoint
*/
static const QString AttrBasePoint;
/**
* @brief AttrFirstPoint
*/
static const QString AttrFirstPoint;
/**
* @brief AttrSecondPoint
*/
static const QString AttrSecondPoint;
/**
* @brief AttrThirdPoint
*/
static const QString AttrThirdPoint;
/**
* @brief AttrCenter
*/
static const QString AttrCenter;
/**
* @brief AttrRadius
*/
static const QString AttrRadius;
/**
* @brief AttrAngle
*/
static const QString AttrAngle;
/**
* @brief AttrAngle1
*/
static const QString AttrAngle1;
/**
* @brief AttrAngle2
*/
static const QString AttrAngle2;
/**
* @brief AttrP1Line
*/
static const QString AttrP1Line;
/**
* @brief AttrP2Line
*/
static const QString AttrP2Line;
/**
* @brief AttrP1Line1
*/
static const QString AttrP1Line1;
/**
* @brief AttrP2Line1
*/
static const QString AttrP2Line1;
/**
* @brief AttrP1Line2
*/
static const QString AttrP1Line2;
/**
* @brief AttrP2Line2
*/
static const QString AttrP2Line2;
/**
* @brief AttrPShoulder
*/
static const QString AttrPShoulder;
/**
* @brief AttrPoint1
*/
static const QString AttrPoint1;
/**
* @brief AttrPoint4
*/
static const QString AttrPoint4;
/**
* @brief AttrKAsm1
*/
static const QString AttrKAsm1;
/**
* @brief AttrKAsm2
*/
static const QString AttrKAsm2;
/**
* @brief AttrKCurve
*/
static const QString AttrKCurve;
/**
* @brief AttrPathPoint
*/
static const QString AttrPathPoint;
/**
* @brief AttrPSpline
*/
static const QString AttrPSpline;
/**
* @brief AttrAxisP1
*/
static const QString AttrAxisP1;
/**
* @brief AttrAxisP2
*/
static const QString AttrAxisP2;
/**
* @brief TypeLineNone
*/
static const QString TypeLineNone;
/**
* @brief TypeLineLine
*/
static const QString TypeLineLine;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile()=0;
signals:
/**
* @brief toolhaveChange
*/
void toolhaveChange();
/**
* @brief ChoosedTool
* @param id
* @param type
*/
void ChoosedTool(qint64 id, Scene::Scenes type);
/**
* @brief FullUpdateTree
*/
void FullUpdateTree();
/**
* @brief RemoveTool
* @param tool
*/
void RemoveTool(QGraphicsItem *tool);
protected:
/**
* @brief doc dom document container
*/
VDomDocument *doc;
/**
* @brief id
*/
const qint64 id;
/**
* @brief baseColor
*/
const Qt::GlobalColor baseColor;
/**
* @brief currentColor
*/
Qt::GlobalColor currentColor;
/**
* @brief AddToFile
*/
virtual void AddToFile()=0;
/**
* @brief getData
* @return
*/
inline const VContainer *getData() const {return &data;}
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens(){}
/**
* @brief RemoveAllChild
* @param domElement
*/
void RemoveAllChild(QDomElement &domElement);
template <typename T>
/**
* @brief AddAttribute
* @param domElement
* @param name
* @param value
*/
void AddAttribute(QDomElement &domElement, const QString &name, const T &value)
{
QDomAttr domAttr = doc->createAttribute(name);

View file

@ -32,20 +32,57 @@
#include "../container/vcontainer.h"
//We need QObject class because we use qobject_cast.
/**
* @brief The VDataTool class
*/
class VDataTool : public QObject
{
Q_OBJECT
public:
/**
* @brief VDataTool
* @param data
* @param parent
*/
VDataTool(VContainer *data, QObject *parent = 0): QObject(parent), data(*data), _referens(1){}
virtual ~VDataTool(){}
/**
* @brief operator =
* @param tool
* @return
*/
VDataTool &operator= (const VDataTool &tool);
/**
* @brief getData
* @return
*/
inline VContainer getData() const { return data; }
/**
* @brief setData
* @param value
*/
inline void setData(const VContainer *value) {data = *value;}
/**
* @brief referens
* @return
*/
virtual inline qint64 referens() const {return _referens;}
/**
* @brief incrementReferens
*/
virtual inline void incrementReferens(){++_referens;}
/**
* @brief decrementReferens
*/
virtual void decrementReferens();
protected:
/**
* @brief data container with data
*/
VContainer data;
/**
* @brief _referens
*/
qint64 _referens;
};

View file

@ -33,20 +33,58 @@
#include <QGraphicsPathItem>
#include "../dialogs/dialogdetail.h"
/**
* @brief The VToolDetail class
*/
class VToolDetail: public VAbstractTool, public QGraphicsPathItem
{
Q_OBJECT
public:
/**
* @brief VToolDetail
* @param doc dom document container
* @param data
* @param id
* @param typeCreation
* @param scene
* @param parent
*/
VToolDetail(VDomDocument *doc, VContainer *data, const qint64 &id,
const Tool::Sources &typeCreation, VMainGraphicsScene *scene,
QGraphicsItem * parent = 0);
/**
* @brief setDialog
*/
virtual void setDialog();
/**
* @brief Create
* @param dialog
* @param scene
* @param doc dom document container
* @param data
*/
static void Create(QSharedPointer<DialogDetail> &dialog, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data);
/**
* @brief Create
* @param _id
* @param newDetail
* @param scene
* @param doc dom document container
* @param data
* @param parse
* @param typeCreation
*/
static void Create(const qint64 _id, VDetail &newDetail, VMainGraphicsScene *scene,
VDomDocument *doc, VContainer *data, const Document::Documents &parse,
const Tool::Sources &typeCreation);
template <typename T>
/**
* @brief AddTool
* @param tool
* @param id
* @param typeTool
*/
void AddTool(T *tool, const qint64 &id, Tool::Tools typeTool)
{
tool->setParentItem(this);
@ -61,33 +99,110 @@ public:
AddNode(domElement, node);
}
}
/**
* @brief TagName
*/
static const QString TagName;
/**
* @brief TagNode
*/
static const QString TagNode;
/**
* @brief AttrSupplement
*/
static const QString AttrSupplement;
/**
* @brief AttrClosed
*/
static const QString AttrClosed;
/**
* @brief AttrWidth
*/
static const QString AttrWidth;
/**
* @brief AttrIdObject
*/
static const QString AttrIdObject;
/**
* @brief AttrNodeType
*/
static const QString AttrNodeType;
/**
* @brief NodeTypeContour
*/
static const QString NodeTypeContour;
/**
* @brief NodeTypeModeling
*/
static const QString NodeTypeModeling;
public slots:
/**
* @brief FullUpdateFromFile
*/
virtual void FullUpdateFromFile ();
/**
* @brief FullUpdateFromGui
* @param result
*/
virtual void FullUpdateFromGui(int result);
signals:
/**
* @brief RemoveTool
* @param tool
*/
void RemoveTool(QGraphicsItem *tool);
protected:
/**
* @brief AddToFile
*/
virtual void AddToFile ();
/**
* @brief itemChange
* @param change
* @param value
* @return
*/
QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
/**
* @brief mouseReleaseEvent
* @param event
*/
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
/**
* @brief contextMenuEvent
* @param event
*/
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
/**
* @brief RemoveReferens
*/
virtual void RemoveReferens();
private:
Q_DISABLE_COPY(VToolDetail)
/**
* @brief dialogDetail
*/
QSharedPointer<DialogDetail> dialogDetail;
/**
* @brief sceneDetails
*/
VMainGraphicsScene *sceneDetails;
/**
* @brief RefreshGeometry
*/
void RefreshGeometry ();
/**
* @brief AddNode
* @param domElement
* @param node
*/
void AddNode(QDomElement &domElement, VNodeDetail &node);
template <typename Tool>
/**
* @brief InitTool
* @param scene
* @param node
*/
void InitTool(VMainGraphicsScene *scene, const VNodeDetail &node);
};

View file

@ -31,14 +31,45 @@
#include <QItemDelegate>
/**
* @brief The DoubleSpinBoxDelegate class
*/
class DoubleSpinBoxDelegate : public QItemDelegate
{
Q_OBJECT
public:
/**
* @brief DoubleSpinBoxDelegate
* @param parent
*/
DoubleSpinBoxDelegate(QObject *parent = 0): QItemDelegate(parent){}
/**
* @brief createEditor
* @param parent
* @param option
* @param index
* @return
*/
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
/**
* @brief setEditorData
* @param editor
* @param index
*/
void setEditorData(QWidget *editor, const QModelIndex &index) const;
/**
* @brief setModelData
* @param editor
* @param model
* @param index
*/
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
/**
* @brief updateEditorGeometry
* @param editor
* @param option
* @param index
*/
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
};

View file

@ -31,12 +31,26 @@
#include <QApplication>
/**
* @brief The VApplication class
*/
class VApplication : public QApplication
{
Q_OBJECT
public:
/**
* @brief VApplication
* @param argc
* @param argv
*/
VApplication(int &argc, char ** argv): QApplication(argc, argv){}
virtual ~VApplication() {}
/**
* @brief notify
* @param receiver
* @param event
* @return
*/
virtual bool notify(QObject * receiver, QEvent * event);
};

View file

@ -33,33 +33,110 @@
#include <QObject>
#include "../geometry/vsplinepath.h"
/**
* @brief The VControlPointSpline class
*/
class VControlPointSpline : public QObject, public QGraphicsEllipseItem
{
Q_OBJECT
public:
/**
* @brief VControlPointSpline
* @param indexSpline
* @param position
* @param controlPoint
* @param splinePoint
* @param parent
*/
VControlPointSpline(const qint32 &indexSpline, SplinePoint::Position position,
const QPointF &controlPoint, const QPointF &splinePoint,
QGraphicsItem * parent = 0);
signals:
/**
* @brief ControlPointChangePosition
* @param indexSpline
* @param position
* @param pos
*/
void ControlPointChangePosition(const qint32 &indexSpline, SplinePoint::Position position,
const QPointF pos);
public slots:
/**
* @brief RefreshLine
* @param indexSpline
* @param pos
* @param controlPoint
* @param splinePoint
*/
void RefreshLine(const qint32 &indexSpline, SplinePoint::Position pos, const QPointF &controlPoint,
const QPointF &splinePoint);
/**
* @brief setEnabledPoint
* @param enable
*/
void setEnabledPoint(bool enable);
protected:
/**
* @brief radius
*/
qreal radius;
/**
* @brief controlLine
*/
QGraphicsLineItem *controlLine;
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief itemChange
* @param change
* @param value
* @return
*/
QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
private:
Q_DISABLE_COPY(VControlPointSpline)
/**
* @brief indexSpline
*/
qint32 indexSpline;
/**
* @brief position
*/
SplinePoint::Position position;
/**
* @brief LineIntersectCircle
* @param center
* @param radius
* @param line
* @param p1
* @param p2
* @return
*/
qint32 LineIntersectCircle(const QPointF &center, qreal radius, const QLineF &line, QPointF &p1,
QPointF &p2) const;
/**
* @brief ClosestPoint
* @param line
* @param p
* @return
*/
QPointF ClosestPoint(const QLineF &line, const QPointF &p) const;
/**
* @brief addVector
* @param p
* @param p1
* @param p2
* @param k
* @return
*/
QPointF addVector (const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k) const;
};

View file

@ -31,20 +31,57 @@
#include <QGraphicsSimpleTextItem>
/**
* @brief The VGraphicsSimpleTextItem class
*/
class VGraphicsSimpleTextItem : public QObject, public QGraphicsSimpleTextItem
{
Q_OBJECT
public:
/**
* @brief VGraphicsSimpleTextItem
* @param parent
*/
VGraphicsSimpleTextItem(QGraphicsItem * parent = 0);
/**
* @brief VGraphicsSimpleTextItem
* @param text
* @param parent
*/
VGraphicsSimpleTextItem( const QString & text, QGraphicsItem * parent = 0 );
/**
* @brief FontSize
* @return
*/
qint32 FontSize()const {return fontSize;}
signals:
/**
* @brief NameChangePosition
* @param pos
*/
void NameChangePosition(const QPointF pos);
protected:
/**
* @brief itemChange
* @param change
* @param value
* @return
*/
QVariant itemChange ( GraphicsItemChange change, const QVariant &value );
/**
* @brief hoverMoveEvent
* @param event
*/
virtual void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
/**
* @brief hoverLeaveEvent
* @param event
*/
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
private:
/**
* @brief fontSize
*/
qint32 fontSize;
};

View file

@ -65,7 +65,15 @@ public:
* @param angle кут в градусах на який повертається деталь.
*/
void Rotate ( qreal angle );
/**
* @brief getPaper
* @return
*/
QGraphicsRectItem *getPaper() const {return paper;}
/**
* @brief setPaper
* @param value
*/
void setPaper(QGraphicsRectItem *value) {paper = value;}
public slots:
/**
@ -98,6 +106,9 @@ private:
*номер.
*/
qint32 numInOutList;
/**
* @brief paper
*/
QGraphicsRectItem* paper;
signals:
/**

View file

@ -31,31 +31,105 @@
#include <QGraphicsScene>
/**
* @brief The VMainGraphicsScene class
*/
class VMainGraphicsScene : public QGraphicsScene
{
Q_OBJECT
public:
/**
* @brief VMainGraphicsScene
*/
VMainGraphicsScene();
/**
* @brief VMainGraphicsScene
* @param sceneRect
* @param parent
*/
VMainGraphicsScene(const QRectF & sceneRect, QObject * parent = 0);
/**
* @brief getHorScrollBar
* @return
*/
inline qint32 getHorScrollBar() const {return horScrollBar;}
/**
* @brief setHorScrollBar
* @param value
*/
inline void setHorScrollBar(const qint32 &value) {horScrollBar = value;}
/**
* @brief getVerScrollBar
* @return
*/
inline qint32 getVerScrollBar() const {return verScrollBar;}
/**
* @brief setVerScrollBar
* @param value
*/
inline void setVerScrollBar(const qint32 &value) {verScrollBar = value;}
public slots:
/**
* @brief ChoosedItem
* @param id
* @param type
*/
void ChoosedItem(qint64 id, const Scene::Scenes &type);
/**
* @brief RemoveTool
* @param tool
*/
inline void RemoveTool(QGraphicsItem *tool) {this->removeItem(tool);}
/**
* @brief SetFactor
* @param factor
*/
void SetFactor(qreal factor);
protected:
/**
* @brief mouseMoveEvent
* @param event
*/
void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
/**
* @brief mousePressEvent
* @param event
*/
void mousePressEvent(QGraphicsSceneMouseEvent *event);
signals:
/**
* @brief mouseMove
* @param scenePos
*/
void mouseMove(QPointF scenePos);
/**
* @brief mousePress
* @param scenePos
*/
void mousePress(QPointF scenePos);
/**
* @brief ChoosedObject
* @param id
* @param type
*/
void ChoosedObject(qint64 id, Scene::Scenes type);
/**
* @brief NewFactor
* @param factor
*/
void NewFactor(qreal factor);
private:
/**
* @brief horScrollBar
*/
qint32 horScrollBar;
/**
* @brief verScrollBar
*/
qint32 verScrollBar;
/**
* @brief scaleFactor
*/
qreal scaleFactor;
};

View file

@ -31,15 +31,33 @@
#include <QGraphicsView>
/**
* @brief The VMainGraphicsView class
*/
class VMainGraphicsView : public QGraphicsView
{
Q_OBJECT
public:
/**
* @brief VMainGraphicsView
* @param parent
*/
explicit VMainGraphicsView(QWidget *parent = 0);
signals:
/**
* @brief NewFactor
* @param factor
*/
void NewFactor(qreal factor);
public slots:
/**
* @brief scalingTime
* @param x
*/
void scalingTime(qreal x);
/**
* @brief animFinished
*/
void animFinished();
protected:
/**
@ -47,9 +65,20 @@ protected:
* @param event передається подія.
*/
void wheelEvent ( QWheelEvent * event );
/**
* @brief mousePressEvent
* @param mousePress
*/
void mousePressEvent(QMouseEvent *mousePress);
/**
* @brief mouseReleaseEvent
* @param event
*/
void mouseReleaseEvent(QMouseEvent *event);
private:
/**
* @brief _numScheduledScalings
*/
qint32 _numScheduledScalings;
};

View file

@ -31,10 +31,16 @@
#include <QGraphicsView>
/**
* @brief The VTableGraphicsView class
*/
class VTableGraphicsView : public QGraphicsView
{
Q_OBJECT
public:
/**
* @brief The typeMove_e enum
*/
enum typeMove_e { Left, Right, Up, Down };
VTableGraphicsView(QGraphicsScene* pScene, QWidget *parent = 0);
signals:

View file

@ -37,6 +37,9 @@
namespace Document
{
/**
* @brief The Document enum
*/
enum Document { LiteParse, FullParse};
Q_DECLARE_FLAGS(Documents, Document)
}
@ -46,83 +49,372 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Document::Documents)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#endif
/**
* @brief The VDomDocument class
*/
class VDomDocument : public QObject, public QDomDocument
{
Q_OBJECT
public:
/**
* @brief VDomDocument
* @param data
* @param comboBoxDraws
* @param mode
*/
VDomDocument(VContainer *data, QComboBox *comboBoxDraws, Draw::Draws *mode);
/**
* @brief VDomDocument
* @param name
* @param data
* @param comboBoxDraws
* @param mode
*/
VDomDocument(const QString& name, VContainer *data, QComboBox *comboBoxDraws, Draw::Draws *mode);
/**
* @brief VDomDocument
* @param doc dom document containertype
* @param data
* @param comboBoxDraws
* @param mode
*/
VDomDocument(const QDomDocumentType& doctype, VContainer *data, QComboBox *comboBoxDraws,
Draw::Draws *mode);
~VDomDocument(){}
/**
* @brief elementById
* @param id
* @return
*/
QDomElement elementById(const QString& id);
/**
* @brief CreateEmptyFile
*/
void CreateEmptyFile();
/**
* @brief ChangeActivDraw
* @param name
* @param parse
*/
void ChangeActivDraw(const QString& name, const Document::Documents &parse = Document::FullParse);
/**
* @brief GetNameActivDraw
* @return
*/
inline QString GetNameActivDraw() const {return nameActivDraw;}
/**
* @brief GetActivDrawElement
* @param element
* @return
*/
bool GetActivDrawElement(QDomElement &element);
/**
* @brief GetActivCalculationElement
* @param element
* @return
*/
bool GetActivCalculationElement(QDomElement &element);
/**
* @brief GetActivModelingElement
* @param element
* @return
*/
bool GetActivModelingElement(QDomElement &element);
/**
* @brief GetActivDetailsElement
* @param element
* @return
*/
bool GetActivDetailsElement(QDomElement &element);
/**
* @brief appendDraw
* @param name
* @return
*/
bool appendDraw(const QString& name);
/**
* @brief SetNameDraw
* @param name
* @return
*/
bool SetNameDraw(const QString& name);
/**
* @brief Parse
* @param parse
* @param sceneDraw
* @param sceneDetail
*/
void Parse(const Document::Documents &parse, VMainGraphicsScene *sceneDraw,
VMainGraphicsScene *sceneDetail);
/**
* @brief getTools
* @return
*/
inline QHash<qint64, VDataTool*>* getTools() {return &tools;}
/**
* @brief getHistory
* @return
*/
inline QVector<VToolRecord> *getHistory() {return &history;}
/**
* @brief getCursor
* @return
*/
inline qint64 getCursor() const {return cursor;}
/**
* @brief setCursor
* @param value
*/
void setCursor(const qint64 &value);
/**
* @brief setCurrentData
*/
void setCurrentData();
/**
* @brief AddTool
* @param id
* @param tool
*/
void AddTool(const qint64 &id, VDataTool *tool);
/**
* @brief UpdateToolData
* @param id
* @param data
*/
void UpdateToolData(const qint64 &id, VContainer *data);
/**
* @brief IncrementReferens
* @param id
*/
void IncrementReferens(qint64 id) const;
/**
* @brief DecrementReferens
* @param id
*/
void DecrementReferens(qint64 id) const;
/**
* @brief TestUniqueId
*/
void TestUniqueId() const;
signals:
/**
* @brief ChangedActivDraw
* @param newName
*/
void ChangedActivDraw(const QString &newName);
/**
* @brief ChangedNameDraw
* @param oldName
* @param newName
*/
void ChangedNameDraw(const QString oldName, const QString newName);
/**
* @brief FullUpdateFromFile
*/
void FullUpdateFromFile();
/**
* @brief haveChange
*/
void haveChange();
/**
* @brief ShowTool
* @param id
* @param color
* @param enable
*/
void ShowTool(qint64 id, Qt::GlobalColor color, bool enable);
/**
* @brief ChangedCursor
* @param id
*/
void ChangedCursor(qint64 id);
public slots:
/**
* @brief FullUpdateTree
*/
void FullUpdateTree();
/**
* @brief haveLiteChange
*/
void haveLiteChange();
/**
* @brief ShowHistoryTool
* @param id
* @param color
* @param enable
*/
void ShowHistoryTool(qint64 id, Qt::GlobalColor color, bool enable);
private:
Q_DISABLE_COPY(VDomDocument)
/**
* @brief map
*/
QHash<QString, QDomElement> map;
/**
* @brief nameActivDraw
*/
QString nameActivDraw;
/**
* @brief data container with data
*/
VContainer *data;
/**
* @brief tools
*/
QHash<qint64, VDataTool*> tools;
/**
* @brief history
*/
QVector<VToolRecord> history;
/**
* @brief cursor
*/
qint64 cursor;
/**
* @brief comboBoxDraws
*/
QComboBox *comboBoxDraws;
/**
* @brief mode
*/
Draw::Draws *mode;
/**
* @brief find
* @param node
* @param id
* @return
*/
bool find(const QDomElement &node, const QString& id);
/**
* @brief CheckNameDraw
* @param name
* @return
*/
bool CheckNameDraw(const QString& name) const;
/**
* @brief SetActivDraw
* @param name
*/
void SetActivDraw(const QString& name);
/**
* @brief GetActivNodeElement
* @param name
* @param element
* @return
*/
bool GetActivNodeElement(const QString& name, QDomElement& element);
/**
* @brief ParseDrawElement
* @param sceneDraw
* @param sceneDetail
* @param node
* @param parse
*/
void ParseDrawElement(VMainGraphicsScene *sceneDraw, VMainGraphicsScene *sceneDetail,
const QDomNode& node, const Document::Documents &parse);
/**
* @brief ParseDrawMode
* @param sceneDraw
* @param sceneDetail
* @param node
* @param parse
* @param mode
*/
void ParseDrawMode(VMainGraphicsScene *sceneDraw, VMainGraphicsScene *sceneDetail,
const QDomNode& node, const Document::Documents &parse, const Draw::Draws &mode);
/**
* @brief ParseDetailElement
* @param sceneDetail
* @param domElement
* @param parse
*/
void ParseDetailElement(VMainGraphicsScene *sceneDetail, const QDomElement &domElement,
const Document::Documents &parse);
/**
* @brief ParseDetails
* @param sceneDetail
* @param domElement
* @param parse
*/
void ParseDetails(VMainGraphicsScene *sceneDetail, const QDomElement &domElement,
const Document::Documents &parse);
/**
* @brief ParsePointElement
* @param scene
* @param domElement
* @param parse
* @param type
* @param mode
*/
void ParsePointElement(VMainGraphicsScene *scene, const QDomElement& domElement,
const Document::Documents &parse, const QString &type, const Draw::Draws &mode);
/**
* @brief ParseLineElement
* @param scene
* @param domElement
* @param parse
* @param mode
*/
void ParseLineElement(VMainGraphicsScene *scene, const QDomElement& domElement,
const Document::Documents &parse, const Draw::Draws &mode);
/**
* @brief ParseSplineElement
* @param scene
* @param domElement
* @param parse
* @param type
* @param mode
*/
void ParseSplineElement(VMainGraphicsScene *scene, const QDomElement& domElement,
const Document::Documents &parse, const QString& type, const Draw::Draws &mode);
/**
* @brief ParseArcElement
* @param scene
* @param domElement
* @param parse
* @param type
* @param mode
*/
void ParseArcElement(VMainGraphicsScene *scene, const QDomElement& domElement,
const Document::Documents &parse, const QString& type, const Draw::Draws &mode);
/**
* @brief ParseIncrementsElement
* @param node
*/
void ParseIncrementsElement(const QDomNode& node);
/**
* @brief GetParametrId
* @param domElement
* @return
*/
qint64 GetParametrId(const QDomElement& domElement) const;
/**
* @brief GetParametrLongLong
* @param domElement
* @param name
* @return
*/
qint64 GetParametrLongLong(const QDomElement& domElement, const QString &name) const;
/**
* @brief GetParametrString
* @param domElement
* @param name
* @return
*/
QString GetParametrString(const QDomElement& domElement, const QString &name) const;
/**
* @brief GetParametrDouble
* @param domElement
* @param name
* @return
*/
qreal GetParametrDouble(const QDomElement& domElement, const QString &name) const;
/**
* @brief CollectId
* @param node
* @param vector
*/
void CollectId(const QDomElement &node, QVector<qint64> &vector)const;
};

View file

@ -29,20 +29,65 @@
#ifndef VTOOLRECORD_H
#define VTOOLRECORD_H
/**
* @brief The VToolRecord class
*/
class VToolRecord
{
public:
/**
* @brief VToolRecord
*/
VToolRecord();
/**
* @brief VToolRecord
* @param id
* @param typeTool
* @param nameDraw
*/
VToolRecord(const qint64 &id, const Tool::Tools &typeTool, const QString &nameDraw);
/**
* @brief getId
* @return
*/
inline qint64 getId() const {return id;}
/**
* @brief setId
* @param value
*/
inline void setId(const qint64 &value) {id = value;}
/**
* @brief getTypeTool
* @return
*/
inline Tool::Tools getTypeTool() const {return typeTool;}
/**
* @brief setTypeTool
* @param value
*/
inline void setTypeTool(const Tool::Tools &value) {typeTool = value;}
/**
* @brief getNameDraw
* @return
*/
inline QString getNameDraw() const {return nameDraw;}
/**
* @brief setNameDraw
* @param value
*/
inline void setNameDraw(const QString &value) {nameDraw = value;}
private:
/**
* @brief id
*/
qint64 id;
/**
* @brief typeTool
*/
Tool::Tools typeTool;
/**
* @brief nameDraw
*/
QString nameDraw;
};