diff --git a/Valentina.pro b/Valentina.pro index 15171136b..a12136129 100644 --- a/Valentina.pro +++ b/Valentina.pro @@ -19,9 +19,9 @@ CONFIG += c++11 precompile_header #DEFINES += ... # Precompiled headers (PCH) -PRECOMPILED_HEADER = stable.h +PRECOMPILED_HEADER = src/stable.h win32-msvc* { - PRECOMPILED_SOURCE = stable.cpp + PRECOMPILED_SOURCE = src/stable.cpp } # directory for executable file @@ -39,34 +39,34 @@ RCC_DIR = rcc # files created uic UI_DIR = uic -include(container/container.pri) -include(dialogs/dialogs.pri) -include(exception/exception.pri) -include(geometry/geometry.pri) -include(tools/tools.pri) -include(widgets/widgets.pri) -include(xml/xml.pri) +include(src/container/container.pri) +include(src/dialogs/dialogs.pri) +include(src/exception/exception.pri) +include(src/geometry/geometry.pri) +include(src/tools/tools.pri) +include(src/widgets/widgets.pri) +include(src/xml/xml.pri) -SOURCES += main.cpp\ - mainwindow.cpp \ - tablewindow.cpp \ - stable.cpp +SOURCES += src/main.cpp \ + src/mainwindow.cpp \ + src/tablewindow.cpp \ + src/stable.cpp -HEADERS += mainwindow.h \ - options.h \ - tablewindow.h \ - stable.h \ - version.h +HEADERS += src/mainwindow.h \ + src/options.h \ + src/tablewindow.h \ + src/stable.h \ + src/version.h -FORMS += mainwindow.ui \ - tablewindow.ui +FORMS += src/mainwindow.ui \ + src/tablewindow.ui RESOURCES += \ - icon.qrc \ - cursor.qrc + share/resources/icon.qrc \ + share/resources/cursor.qrc -TRANSLATIONS += translations/valentina_ru.ts \ - translations/valentina_uk.ts +TRANSLATIONS += share/translations/valentina_ru.ts \ + share/translations/valentina_uk.ts CONFIG(debug, debug|release){ # Debug @@ -80,7 +80,7 @@ CONFIG(debug, debug|release){ -Og -Wall -Wextra -pedantic -Weffc++ -Woverloaded-virtual -Wctor-dtor-privacy \ -Wnon-virtual-dtor -Wold-style-cast -Wconversion -Winit-self \ -Wunreachable-code -Wcast-align -Wcast-qual -Wdisabled-optimization -Wfloat-equal \ - -Wformat -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k\ + -Wformat -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k \ -Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-format-attribute \ -Wmissing-include-dirs -Wpacked -Wredundant-decls \ -Wswitch-default -Wswitch-enum -Wuninitialized -Wunused-parameter -Wvariadic-macros \ diff --git a/container/calculator.h b/container/calculator.h deleted file mode 100644 index b18dd6d85..000000000 --- a/container/calculator.h +++ /dev/null @@ -1,174 +0,0 @@ -/************************************************************************ - ** - ** @file calculator.h - ** @author Roman Telezhinsky - ** @date November 15, 2013 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef CALCULATOR_H -#define CALCULATOR_H - -#include "vcontainer.h" - -/** - * @brief The Calculator клас калькулятора формул лекал. Виконує розрахунок формул з підставлянням - * значеннь зміних. - */ -class Calculator -{ -public: - /** - * @brief Calculator конструктор класу. Використовується при розрахунку лекала. - * @param data покажчик на контейнер змінних - */ - explicit Calculator(const VContainer *data):errorMsg(0), token(QString()), tok(0), token_type(0), prog(QString()), - index(0), data(data), debugFormula(QString()){} - /** - * @brief eval виконує розрахунок формули. - * @param prog рядко в якому зберігається формула. - * @return значення формули. - */ - qreal eval(QString prog, QString *errorMsg); -private: - Q_DISABLE_COPY(Calculator) - QString *errorMsg; - /** - * @brief token теперішня лексема. - */ - QString token; - /** - * @brief tok внутрішне представлення лексеми. - */ - qint32 tok; - /** - * @brief token_type тип лексеми. - */ - qint32 token_type; - /** - * @brief prog рядок в якому зберігається формула. - */ - QString prog; /* Содержит анализируемое выражение */ - /** - * @brief index номер символу в рядку формули. - */ - qint32 index; /* Индекс символа в строке*/ - /** - * @brief data контейнер усіх змінних. - */ - const VContainer *data; - /** - * @brief debugFormula рядок розшифрованої формули. - */ - QString debugFormula; - /** - * @brief get_exp виконує розрахунок формули. - * @return значення формули. - */ - qreal get_exp(); - /** - * @brief get_token повертає наступну лексему. - */ - void get_token();/* Получить лексему */ - /** - * @brief StrChr перевіряє чи символ належить рядку. - * @param string рядок - * @param c символ. - * @return true - належить рядку, false - не належить рядку. - */ - static bool StrChr(QString string, QChar c); - /** - * @brief putback повертає зчитану лексему назад у потік. - */ - void putback(); - /** - * @brief level2 метод додавання і віднімання двух термів. - * @param result результат операції. - */ - void level2(qreal *result); - /** - * @brief level3 метод множення, ділення, знаходження процентів. - * @param result результат операції. - */ - void level3(qreal *result); - /** - * @brief level4 метод знаходження степені двох чисел. - * @param result результат операції. - */ - void level4(qreal *result); - /** - * @brief level5 метод знаходження унарного плюса чи мінуса. - * @param result результат операції. - */ - void level5(qreal *result); - /** - * @brief level6 метод обробки виразу в круглих лапках. - * @param result результат операції. - */ - void level6(qreal *result); - /** - * @brief primitive метод визначення значення зміної по її імені. - * @param result результат операції. - */ - void primitive(qreal *result); - /** - * @brief arith виконання специфікованої арифметики. Результат записується в перший елемент. - * @param o знак операції. - * @param r перший елемент. - * @param h другий елемент. - */ - static void arith(QChar o, qreal *r, qreal *h); - /** - * @brief unary метод зміни знаку. - * @param o символ знаку. - * @param r елемент. - */ - static void unary(QChar o, qreal *r); - /** - * @brief find_var метод знаходить змінну за іменем. - * @param s ім'я змінної. - * @return значення зміної. - */ - qreal find_var(QString s); - void serror(qint32 error); - /** - * @brief look_up пошук відповідного внутрішнього формату для теперішньої лексеми в таблиці лексем. - * @param s ім'я лексеми. - * @return внутрішній номер лексеми. - */ - static char look_up(QString s); - /** - * @brief isdelim повертає "істино", якщо с розділювач. - * @param c символ. - * @return розділювач, або ні. - */ - static bool isdelim(QChar c); - /** - * @brief iswhite перевіряє чи с пробіл чи табуляція. - * @param c символ. - * @return так або ні. - */ - static bool iswhite(QChar c); -}; - -#endif // CALCULATOR_H diff --git a/container/container.pri b/container/container.pri deleted file mode 100644 index a6461484b..000000000 --- a/container/container.pri +++ /dev/null @@ -1,13 +0,0 @@ -SOURCES += \ - container/vpointf.cpp \ - container/vincrementtablerow.cpp \ - container/vcontainer.cpp \ - container/calculator.cpp \ - container/vstandarttablecell.cpp - -HEADERS += \ - container/vstandarttablecell.h \ - container/vpointf.h \ - container/vincrementtablerow.h \ - container/vcontainer.h \ - container/calculator.h diff --git a/container/vcontainer.h b/container/vcontainer.h deleted file mode 100644 index 3044cec98..000000000 --- a/container/vcontainer.h +++ /dev/null @@ -1,179 +0,0 @@ -/************************************************************************ - ** - ** @file vcontainer.h - ** @author Roman Telezhinsky - ** @date November 15, 2013 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef VCONTAINER_H -#define VCONTAINER_H - -#include "vstandarttablecell.h" -#include "vincrementtablerow.h" -#include "../geometry/varc.h" -#include "../geometry/vsplinepath.h" -#include "../geometry/vdetail.h" -#include "../widgets/vitem.h" - -/** - * @brief The VContainer class - */ -class VContainer -{ - Q_DECLARE_TR_FUNCTIONS(VContainer) -public: - /** - * @brief VContainer - */ - VContainer(); - VContainer &operator=(const VContainer &data); - VContainer(const VContainer &data); - void setData(const VContainer &data); - /** - * @brief GetPoint - * @param id - * @return - */ - VPointF GetPoint(qint64 id) const; - VPointF GetModelingPoint(qint64 id) const; - VStandartTableCell GetStandartTableCell(const QString& name) const; - VIncrementTableRow GetIncrementTableRow(const QString& name) const; - qreal GetLine(const QString &name) const; - qreal GetLengthArc(const QString &name) const; - qreal GetLengthSpline(const QString &name) const; - qreal GetLineAngle(const QString &name) const; - VSpline GetSpline(qint64 id) const; - VSpline GetModelingSpline(qint64 id) const; - VArc GetArc(qint64 id) const; - VArc GetModelingArc(qint64 id) const; - VSplinePath GetSplinePath(qint64 id) const; - VSplinePath GetModelingSplinePath(qint64 id) const; - VDetail GetDetail(qint64 id) const; - static qint64 getId() {return _id;} - qint64 AddPoint(const VPointF& point); - qint64 AddModelingPoint(const VPointF& point); - qint64 AddDetail(const VDetail& detail); - inline void AddStandartTableCell(const QString& name, const VStandartTableCell& cell) - {standartTable[name] = cell;} - inline void AddIncrementTableRow(const QString& name, const VIncrementTableRow &cell) - {incrementTable[name] = cell;} - void AddLengthLine(const QString &name, const qreal &value); - void AddLengthSpline(const QString &name, const qreal &value); - void AddLengthArc(const qint64 &id); - void AddLengthArc(const QString &name, const qreal &value); - void AddLineAngle(const QString &name, const qreal &value); - void AddLine(const qint64 &firstPointId, const qint64 &secondPointId, - const Draw::Draws &mode = Draw::Calculation); - qint64 AddSpline(const VSpline& spl); - qint64 AddModelingSpline(const VSpline& spl); - qint64 AddSplinePath(const VSplinePath& splPath); - qint64 AddModelingSplinePath(const VSplinePath& splPath); - qint64 AddArc(const VArc& arc); - qint64 AddModelingArc(const VArc& arc); - QString GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint, - const Draw::Draws &mode = Draw::Calculation) const; - QString GetNameLineAngle(const qint64 &firstPoint, const qint64 &secondPoint, - const Draw::Draws &mode = Draw::Calculation) const; - void UpdatePoint(qint64 id, const VPointF& point); - void UpdateModelingPoint(qint64 id, const VPointF& point); - void UpdateDetail(qint64 id, const VDetail& detail); - void UpdateSpline(qint64 id, const VSpline& spl); - void UpdateModelingSpline(qint64 id, const VSpline& spl); - void UpdateSplinePath(qint64 id, const VSplinePath& splPath); - void UpdateModelingSplinePath(qint64 id, const VSplinePath& splPath); - void UpdateArc(qint64 id, const VArc& arc); - void UpdateModelingArc(qint64 id, const VArc& arc); - inline void UpdateStandartTableCell(const QString& name, const VStandartTableCell& cell) - {standartTable[name] = cell;} - inline void UpdateIncrementTableRow(const QString& name, const VIncrementTableRow& cell) - {incrementTable[name] = cell;} - qreal GetValueStandartTableCell(const QString& name) const; - qreal GetValueIncrementTableRow(const QString& name) const; - void Clear(); - void ClearObject(); - inline void ClearIncrementTable() {incrementTable.clear();} - inline void ClearLengthLines() {lengthLines.clear();} - inline void ClearLengthSplines() {lengthSplines.clear();} - inline void ClearLengthArcs() {lengthArcs.clear();} - inline void ClearLineAngles() {lineAngles.clear();} - inline void SetSize(qint32 size) {base["Сг"] = size;} - inline void SetGrowth(qint32 growth) {base["Р"] = growth;} - inline qint32 size() const {return base.value("Сг");} - inline qint32 growth() const {return base.value("Р");} - qreal FindVar(const QString& name, bool *ok)const; - inline bool IncrementTableContains(const QString& name) {return incrementTable.contains(name);} - static qint64 getNextId(); - inline void RemoveIncrementTableRow(const QString& name) {incrementTable.remove(name);} - inline const QHash *DataPoints() const {return &points;} - inline const QHash *DataModelingPoints() const {return &modelingPoints;} - inline const QHash *DataSplines() const {return &splines;} - inline const QHash *DataModelingSplines() const {return &modelingSplines;} - inline const QHash *DataArcs() const {return &arcs;} - inline const QHash *DataModelingArcs() const {return &modelingArcs;} - inline const QHash *DataBase() const {return &base;} - inline const QHash *DataStandartTable() const {return &standartTable;} - inline const QHash *DataIncrementTable() const {return &incrementTable;} - inline const QHash *DataLengthLines() const {return &lengthLines;} - inline const QHash *DataLengthSplines() const {return &lengthSplines;} - inline const QHash *DataLengthArcs() const {return &lengthArcs;} - inline const QHash *DataLineAngles() const {return &lineAngles;} - inline const QHash *DataSplinePaths() const {return &splinePaths;} - inline const QHash *DataModelingSplinePaths() const {return &modelingSplinePaths;} - inline const QHash *DataDetails() const {return &details;} - static void UpdateId(qint64 newId); - QPainterPath ContourPath(qint64 idDetail) const; - QVector biasPoints(const QVector &points, const qreal &mx, const qreal &my) const; - QPainterPath Equidistant(QVector points, const Detail::Equidistant &eqv, const qreal &width)const; - static QLineF ParallelLine(const QLineF &line, qreal width ); - static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width); - QVector EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width)const; - QVector CheckLoops(const QVector &points) const; - void PrepareDetails(QVector & list) const; -private: - static qint64 _id; - QHash base; - QHash points; - QHash modelingPoints; - QHash standartTable; - QHash incrementTable; - QHash lengthLines; - QHash lineAngles; - QHash splines; - QHash modelingSplines; - QHash lengthSplines; - QHash arcs; - QHash modelingArcs; - QHash lengthArcs; - QHash splinePaths; - QHash modelingSplinePaths; - QHash details; - void CreateManTableIGroup (); - QVector GetReversePoint(const QVector &points)const; - qreal GetLengthContour(const QVector &contour, const QVector &newPoints)const; - template static val GetObject(const QHash &obj, key id); - template static void UpdateObject(QHash &obj, const qint64 &id, const val& point); - template static qint64 AddObject(QHash &obj, const val& value); -}; - -#endif // VCONTAINER_H diff --git a/dialogs/dialogarc.h b/dialogs/dialogarc.h deleted file mode 100644 index 014955cce..000000000 --- a/dialogs/dialogarc.h +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************ - ** - ** @file dialogarc.h - ** @author Roman Telezhinsky - ** @date November 15, 2013 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef DIALOGARC_H -#define DIALOGARC_H - -#include "dialogtool.h" - -namespace Ui -{ - class DialogArc; -} - -class DialogArc : public DialogTool -{ - Q_OBJECT -public: - DialogArc(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0); - ~DialogArc(); - inline qint64 GetCenter() const {return center;} - void SetCenter(const qint64 &value); - inline QString GetRadius() const {return radius;} - void SetRadius(const QString &value); - inline QString GetF1() const {return f1;} - void SetF1(const QString &value); - inline QString GetF2() const {return f2;} - void SetF2(const QString &value); -public slots: - virtual void ChoosedObject(qint64 id, const Scene::Scenes &type); - virtual void DialogAccepted(); - virtual void ValChenged(int row); - void PutRadius(); - void PutF1(); - void PutF2(); - void LineAngles(); - void RadiusChanged(); - void F1Changed(); - void F2Changed(); -protected: - virtual void CheckState(); -private: - Q_DISABLE_COPY(DialogArc) - Ui::DialogArc *ui; - bool flagRadius; - bool flagF1; - bool flagF2; - QTimer *timerRadius; - QTimer *timerF1; - QTimer *timerF2; - qint64 center; - QString radius; - QString f1; - QString f2; - void EvalRadius(); - void EvalF1(); - void EvalF2(); - void ShowLineAngles(); -}; - -#endif // DIALOGARC_H diff --git a/dialogs/dialogs.pri b/dialogs/dialogs.pri deleted file mode 100644 index 86876c1d2..000000000 --- a/dialogs/dialogs.pri +++ /dev/null @@ -1,62 +0,0 @@ -HEADERS += \ - dialogs/dialogtriangle.h \ - dialogs/dialogtool.h \ - dialogs/dialogsplinepath.h \ - dialogs/dialogspline.h \ - dialogs/dialogsinglepoint.h \ - dialogs/dialogshoulderpoint.h \ - dialogs/dialogs.h \ - dialogs/dialogpointofintersection.h \ - dialogs/dialogpointofcontact.h \ - dialogs/dialognormal.h \ - dialogs/dialoglineintersect.h \ - dialogs/dialogline.h \ - dialogs/dialogincrements.h \ - dialogs/dialoghistory.h \ - dialogs/dialogheight.h \ - dialogs/dialogendline.h \ - dialogs/dialogdetail.h \ - dialogs/dialogbisector.h \ - dialogs/dialogarc.h \ - dialogs/dialogalongline.h - -SOURCES += \ - dialogs/dialogtriangle.cpp \ - dialogs/dialogtool.cpp \ - dialogs/dialogsplinepath.cpp \ - dialogs/dialogspline.cpp \ - dialogs/dialogsinglepoint.cpp \ - dialogs/dialogshoulderpoint.cpp \ - dialogs/dialogpointofintersection.cpp \ - dialogs/dialogpointofcontact.cpp \ - dialogs/dialognormal.cpp \ - dialogs/dialoglineintersect.cpp \ - dialogs/dialogline.cpp \ - dialogs/dialogincrements.cpp \ - dialogs/dialoghistory.cpp \ - dialogs/dialogheight.cpp \ - dialogs/dialogendline.cpp \ - dialogs/dialogdetail.cpp \ - dialogs/dialogbisector.cpp \ - dialogs/dialogarc.cpp \ - dialogs/dialogalongline.cpp - -FORMS += \ - dialogs/dialogtriangle.ui \ - dialogs/dialogsplinepath.ui \ - dialogs/dialogspline.ui \ - dialogs/dialogsinglepoint.ui \ - dialogs/dialogshoulderpoint.ui \ - dialogs/dialogpointofintersection.ui \ - dialogs/dialogpointofcontact.ui \ - dialogs/dialognormal.ui \ - dialogs/dialoglineintersect.ui \ - dialogs/dialogline.ui \ - dialogs/dialogincrements.ui \ - dialogs/dialoghistory.ui \ - dialogs/dialogheight.ui \ - dialogs/dialogendline.ui \ - dialogs/dialogdetail.ui \ - dialogs/dialogbisector.ui \ - dialogs/dialogarc.ui \ - dialogs/dialogalongline.ui diff --git a/dialogs/dialogspline.h b/dialogs/dialogspline.h deleted file mode 100644 index 6ae6b45fc..000000000 --- a/dialogs/dialogspline.h +++ /dev/null @@ -1,75 +0,0 @@ -/************************************************************************ - ** - ** @file dialogspline.h - ** @author Roman Telezhinsky - ** @date November 15, 2013 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef DIALOGSPLINE_H -#define DIALOGSPLINE_H - -#include "dialogtool.h" - -namespace Ui -{ - class DialogSpline; -} - -class DialogSpline : public DialogTool -{ - Q_OBJECT -public: - DialogSpline(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0); - ~DialogSpline(); - inline qint64 getP1() const {return p1;} - void setP1(const qint64 &value); - inline qint64 getP4() const {return p4;} - void setP4(const qint64 &value); - inline qreal getAngle1() const {return angle1;} - void setAngle1(const qreal &value); - inline qreal getAngle2() const {return angle2;} - void setAngle2(const qreal &value); - inline qreal getKAsm1() const {return kAsm1;} - void setKAsm1(const qreal &value); - inline qreal getKAsm2() const {return kAsm2;} - void setKAsm2(const qreal &value); - inline qreal getKCurve() const {return kCurve;} - void setKCurve(const qreal &value); -public slots: - virtual void ChoosedObject(qint64 id, const Scene::Scenes &type); - virtual void DialogAccepted(); -private: - Q_DISABLE_COPY(DialogSpline) - Ui::DialogSpline *ui; - qint32 number; - qint64 p1; // перша точка - qint64 p4; // четверта точка - qreal angle1; // кут нахилу дотичної в першій точці - qreal angle2; // кут нахилу дотичної в другій точці - qreal kAsm1; - qreal kAsm2; - qreal kCurve; -}; - -#endif // DIALOGSPLINE_H diff --git a/dialogs/dialogtool.h b/dialogs/dialogtool.h deleted file mode 100644 index 34b9ce76e..000000000 --- a/dialogs/dialogtool.h +++ /dev/null @@ -1,112 +0,0 @@ -/************************************************************************ - ** - ** @file dialogtool.h - ** @author Roman Telezhinsky - ** @date November 15, 2013 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2013 Valentina project - ** All Rights Reserved. - ** - ** Valentina is free software: you can redistribute it and/or modify - ** it under the terms of the GNU General Public License as published by - ** the Free Software Foundation, either version 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina is distributed in the hope that it will be useful, - ** but WITHOUT ANY WARRANTY; without even the implied warranty of - ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - ** GNU General Public License for more details. - ** - ** You should have received a copy of the GNU General Public License - ** along with Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef DIALOGTOOL_H -#define DIALOGTOOL_H - -#include -#include "../container/vcontainer.h" - -class DialogTool : public QDialog -{ - Q_OBJECT -public: - DialogTool(const VContainer *data, Draw::Draws mode = Draw::Calculation, QWidget *parent = 0); - virtual ~DialogTool() {} - inline qint64 getIdDetail() const {return idDetail;} - inline void setIdDetail(const qint64 &value) {idDetail = value;} -signals: - void DialogClosed(int result); - void ToolTip(const QString &toolTip); -public slots: - virtual void ChoosedObject(qint64 id, const Scene::Scenes &type); - void NamePointChanged(); - virtual void DialogAccepted(); - virtual void DialogRejected(); - void FormulaChanged(); - void ArrowUp(); - void ArrowDown(); - void ArrowLeft(); - void ArrowRight(); - void ArrowLeftUp(); - void ArrowLeftDown(); - void ArrowRightUp(); - void ArrowRightDown(); - void EvalFormula(); - void SizeGrowth(); - void StandartTable(); - void LengthLines(); - void LengthArcs(); - void LengthCurves(); - void Increments(); - void PutHere(); - void PutVal(QListWidgetItem * item); - virtual void ValChenged(int row); - void UpdateList(); -protected: - Q_DISABLE_COPY(DialogTool) - const VContainer *data; - bool isInitialized; - bool flagName; - bool flagFormula; - QTimer *timerFormula; - QPushButton *bOk; - QDoubleSpinBox *spinBoxAngle; - QLineEdit *lineEditFormula; - QListWidget *listWidget; - QLabel *labelResultCalculation; - QLabel *labelDescription; - QLabel *labelEditNamePoint; - QLabel *labelEditFormula; - QRadioButton *radioButtonSizeGrowth; - QRadioButton *radioButtonStandartTable; - QRadioButton *radioButtonIncrements; - QRadioButton *radioButtonLengthLine; - QRadioButton *radioButtonLengthArc; - QRadioButton *radioButtonLengthCurve; - qint64 idDetail; - Draw::Draws mode; - bool CheckObject(const qint64 &id); - virtual void closeEvent ( QCloseEvent * event ); - virtual void showEvent( QShowEvent *event ); - void FillComboBoxPoints(QComboBox *box, const qint64 &id = 0)const; - void FillComboBoxTypeLine(QComboBox *box) const; - virtual void CheckState(); - QString GetTypeLine(const QComboBox *box)const; - template void ShowVariable(const QHash *var); - void SetupTypeLine(QComboBox *box, const QString &value); - void ChangeCurrentText(QComboBox *box, const QString &value); - void ChangeCurrentData(QComboBox *box, const qint64 &value) const; - void PutValHere(QLineEdit *lineEdit, QListWidget *listWidget); - void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer); - void Eval(QLineEdit *edit, bool &flag, QTimer *timer, QLabel *label); - void setCurrentPointId(QComboBox *box, qint64 &pointId, const qint64 &value, const qint64 &id) const; - qint64 getCurrentPointId(QComboBox *box) const; -}; - -#endif // DIALOGTOOL_H diff --git a/docs/Doxyfile b/doc/doxygen/Doxyfile similarity index 89% rename from docs/Doxyfile rename to doc/doxygen/Doxyfile index f47ebdb2c..f17ebac22 100644 --- a/docs/Doxyfile +++ b/doc/doxygen/Doxyfile @@ -1,8 +1,10 @@ -# Doxyfile 1.8.1.2 +# Doxyfile 1.8.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # +# All text after a double hash (##) is considered a comment and is placed +# in front of the TAG it is preceding . # All text after a hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] @@ -70,11 +72,11 @@ CREATE_SUBDIRS = NO # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. +# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, +# Persian, Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, +# Slovak, Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. -OUTPUT_LANGUAGE = Ukrainian +OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in @@ -126,7 +128,9 @@ FULL_PATH_NAMES = YES # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the -# path to strip. +# path to strip. Note that you specify absolute paths here, but also +# relative paths, which will be relative from the directory where doxygen is +# started. STRIP_FROM_PATH = @@ -229,14 +233,15 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, +# and language is one of the parsers supported by doxygen: IDL, Java, +# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, +# C++. For instance to make doxygen treat .inc files as Fortran files (default +# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note +# that for custom extensions you also need to set FILE_PATTERNS otherwise the +# files are not read by doxygen. EXTENSION_MAPPING = @@ -249,6 +254,13 @@ EXTENSION_MAPPING = MARKDOWN_SUPPORT = YES +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. + +AUTOLINK_SUPPORT = YES + # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and @@ -269,10 +281,10 @@ CPP_CLI_SUPPORT = NO SIP_SUPPORT = NO -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES (the +# default) will make doxygen replace the get and set methods by a property in +# the documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. @@ -301,11 +313,11 @@ SUBGROUPING = YES INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and -# unions with only public data fields will be shown inline in the documentation -# of the scope in which they are defined (i.e. file, namespace, or group -# documentation), provided this scope is documented. If set to NO (the default), -# structs, classes, and unions are shown on a separate page (for HTML and Man -# pages) or section (for LaTeX and RTF). +# unions with only public data fields or simple typedef fields will be shown +# inline in the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO (the default), structs, classes, and unions are shown on a separate +# page (for HTML and Man pages) or section (for LaTeX and RTF). INLINE_SIMPLE_STRUCTS = NO @@ -319,30 +331,14 @@ INLINE_SIMPLE_STRUCTS = NO TYPEDEF_HIDES_STRUCT = NO -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penalty. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -SYMBOL_CACHE_SIZE = 0 - -# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be -# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given -# their name and scope. Since this can be an expensive process and often the -# same symbol appear multiple times in the code, doxygen keeps a cache of -# pre-resolved symbols. If the cache is too small doxygen will become slower. -# If the cache is too large, memory is wasted. The cache size is given by this -# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can +# be an expensive process and often the same symbol appear multiple times in +# the code, doxygen keeps a cache of pre-resolved symbols. If the cache is too +# small doxygen will become slower. If the cache is too large, memory is wasted. +# The cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid +# range is 0..9, the default is 0, corresponding to a cache size of 2^16 = 65536 +# symbols. LOOKUP_CACHE_SIZE = 0 @@ -353,7 +349,7 @@ LOOKUP_CACHE_SIZE = 0 # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES +# the EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES @@ -362,14 +358,15 @@ EXTRACT_ALL = YES EXTRACT_PRIVATE = YES -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal scope will be included in the documentation. +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. @@ -533,7 +530,8 @@ GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. +# documentation sections, marked by \if section-label ... \endif +# and \cond section-label ... \endcond blocks. ENABLED_SECTIONS = @@ -591,7 +589,8 @@ LAYOUT_FILE = # requires the bibtex tool to be installed. See also # http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style # of the bibliography can be controlled using LATEX_BIB_STYLE. To use this -# feature you need bibtex and perl available in the search path. +# feature you need bibtex and perl available in the search path. Do not use +# file names with spaces, bibtex cannot handle them. CITE_BIB_FILES = @@ -655,7 +654,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = +INPUT = # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is @@ -743,8 +742,10 @@ IMAGE_PATH = # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. +# If FILTER_PATTERNS is specified, this tag will be ignored. +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. INPUT_FILTER = @@ -773,6 +774,13 @@ FILTER_SOURCE_FILES = NO FILTER_SOURCE_PATTERNS = +# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- @@ -894,17 +902,27 @@ HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# style sheet in the HTML output directory as well, or it will be erased! +# fine-tune the look of the HTML output. If left blank doxygen will +# generate a default style sheet. Note that it is recommended to use +# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this +# tag will in the future become obsolete. HTML_STYLESHEET = +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional +# user-defined cascading style sheet that is included after the standard +# style sheets created by doxygen. Using this option one can overrule +# certain style aspects. This is preferred over using HTML_STYLESHEET +# since it does not replace the standard style sheet and is therefor more +# robust against future updates. Doxygen will copy the style sheet file to +# the output directory. + +HTML_EXTRA_STYLESHEET = + # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that # the files will be copied as-is; there are no commands or markers available. @@ -985,9 +1003,9 @@ DOCSET_FEEDNAME = "Doxygen generated docs" DOCSET_BUNDLE_ID = org.doxygen.Project -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely +# identify the documentation publisher. This should be a reverse domain-name +# style string, e.g. com.mycompany.MyDocSet.documentation. DOCSET_PUBLISHER_ID = org.doxygen.Publisher @@ -1172,6 +1190,13 @@ FORMULA_TRANSPARENT = YES USE_MATHJAX = NO +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and +# SVG. The default value is HTML-CSS, which is slower, but has the best +# compatibility. + +MATHJAX_FORMAT = HTML-CSS + # When MathJax is enabled you need to specify the location relative to the # HTML output directory using the MATHJAX_RELPATH option. The destination # directory should contain the MathJax.js script. For instance, if the mathjax @@ -1189,6 +1214,11 @@ MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest MATHJAX_EXTENSIONS = +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript +# pieces of code that will be used on startup of the MathJax code. + +MATHJAX_CODEFILE = + # When the SEARCHENGINE tag is enabled doxygen will generate a search box # for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using @@ -1200,15 +1230,55 @@ MATHJAX_EXTENSIONS = SEARCHENGINE = YES # When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvantages are that it is more difficult to setup -# and does not have live searching capabilities. +# implemented using a web server instead of a web client using Javascript. +# There are two flavours of web server based search depending on the +# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for +# searching and an index file used by the script. When EXTERNAL_SEARCH is +# enabled the indexing and searching needs to be provided by external tools. +# See the manual for details. SERVER_BASED_SEARCH = NO +# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP +# script for searching. Instead the search results are written to an XML file +# which needs to be processed by an external indexer. Doxygen will invoke an +# external search engine pointed to by the SEARCHENGINE_URL option to obtain +# the search results. Doxygen ships with an example indexer (doxyindexer) and +# search engine (doxysearch.cgi) which are based on the open source search +# engine library Xapian. See the manual for configuration details. + +EXTERNAL_SEARCH = NO + +# The SEARCHENGINE_URL should point to a search engine hosted by a web server +# which will returned the search results when EXTERNAL_SEARCH is enabled. +# Doxygen ships with an example search engine (doxysearch) which is based on +# the open source search engine library Xapian. See the manual for configuration +# details. + +SEARCHENGINE_URL = + +# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed +# search data is written to a file for indexing by an external tool. With the +# SEARCHDATA_FILE tag the name of this file can be specified. + +SEARCHDATA_FILE = searchdata.xml + +# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the +# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is +# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple +# projects and redirect the results back to the right project. + +EXTERNAL_SEARCH_ID = + +# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen +# projects other than the one defined by this configuration file, but that are +# all added to the same external search index. Each project needs to have a +# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id +# of to a relative location where the documentation can be found. +# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ... + +EXTRA_SEARCH_MAPPINGS = + #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- @@ -1246,7 +1316,7 @@ COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. +# executive. If left blank a4 will be used. PAPER_TYPE = a4 @@ -1269,6 +1339,13 @@ LATEX_HEADER = LATEX_FOOTER = +# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images +# or other source files which should be copied to the LaTeX output directory. +# Note that the files will be copied as-is; there are no commands or markers +# available. + +LATEX_EXTRA_FILES = + # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references @@ -1413,6 +1490,21 @@ XML_DTD = XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- + +# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files +# that can be used to generate PDF. + +GENERATE_DOCBOOK = NO + +# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in +# front of it. If left blank docbook will be used as the default path. + +DOCBOOK_OUTPUT = docbook + #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- @@ -1562,6 +1654,12 @@ ALLEXTERNALS = NO EXTERNAL_GROUPS = YES +# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed +# in the related pages index. If set to NO, only the current project's +# pages will be listed. + +EXTERNAL_PAGES = YES + # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). @@ -1658,7 +1756,7 @@ UML_LOOK = YES # the class node. If there are many fields or methods and many nodes the # graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS # threshold limits the number of items for each type to make the size more -# managable. Set this to 0 for no limit. Note that the threshold may be +# manageable. Set this to 0 for no limit. Note that the threshold may be # exceeded by 50% before the limit is enforced. UML_LIMIT_NUM_FIELDS = 10 diff --git a/exception/exception.pri b/exception/exception.pri deleted file mode 100644 index 4293f086b..000000000 --- a/exception/exception.pri +++ /dev/null @@ -1,17 +0,0 @@ -HEADERS += \ - exception/vexceptionwrongparameterid.h \ - exception/vexceptionuniqueid.h \ - exception/vexceptionobjecterror.h \ - exception/vexceptionemptyparameter.h \ - exception/vexceptionconversionerror.h \ - exception/vexceptionbadid.h \ - exception/vexception.h - -SOURCES += \ - exception/vexceptionwrongparameterid.cpp \ - exception/vexceptionuniqueid.cpp \ - exception/vexceptionobjecterror.cpp \ - exception/vexceptionemptyparameter.cpp \ - exception/vexceptionconversionerror.cpp \ - exception/vexceptionbadid.cpp \ - exception/vexception.cpp diff --git a/geometry/geometry.pri b/geometry/geometry.pri deleted file mode 100644 index 37d5100cc..000000000 --- a/geometry/geometry.pri +++ /dev/null @@ -1,15 +0,0 @@ -HEADERS += \ - geometry/vsplinepoint.h \ - geometry/vsplinepath.h \ - geometry/vspline.h \ - geometry/vnodedetail.h \ - geometry/vdetail.h \ - geometry/varc.h - -SOURCES += \ - geometry/vsplinepoint.cpp \ - geometry/vsplinepath.cpp \ - geometry/vspline.cpp \ - geometry/vnodedetail.cpp \ - geometry/vdetail.cpp \ - geometry/varc.cpp diff --git a/cursor.qrc b/share/resources/cursor.qrc similarity index 100% rename from cursor.qrc rename to share/resources/cursor.qrc diff --git a/cursor/alongline_cursor.png b/share/resources/cursor/alongline_cursor.png similarity index 100% rename from cursor/alongline_cursor.png rename to share/resources/cursor/alongline_cursor.png diff --git a/cursor/arc_cursor.png b/share/resources/cursor/arc_cursor.png similarity index 100% rename from cursor/arc_cursor.png rename to share/resources/cursor/arc_cursor.png diff --git a/cursor/bisector_cursor.png b/share/resources/cursor/bisector_cursor.png similarity index 100% rename from cursor/bisector_cursor.png rename to share/resources/cursor/bisector_cursor.png diff --git a/cursor/endline_cursor.png b/share/resources/cursor/endline_cursor.png similarity index 100% rename from cursor/endline_cursor.png rename to share/resources/cursor/endline_cursor.png diff --git a/cursor/height_cursor.png b/share/resources/cursor/height_cursor.png similarity index 100% rename from cursor/height_cursor.png rename to share/resources/cursor/height_cursor.png diff --git a/cursor/intersect_cursor.png b/share/resources/cursor/intersect_cursor.png similarity index 100% rename from cursor/intersect_cursor.png rename to share/resources/cursor/intersect_cursor.png diff --git a/cursor/line_cursor.png b/share/resources/cursor/line_cursor.png similarity index 100% rename from cursor/line_cursor.png rename to share/resources/cursor/line_cursor.png diff --git a/cursor/new_detail_cursor.png b/share/resources/cursor/new_detail_cursor.png similarity index 100% rename from cursor/new_detail_cursor.png rename to share/resources/cursor/new_detail_cursor.png diff --git a/cursor/normal_cursor.png b/share/resources/cursor/normal_cursor.png similarity index 100% rename from cursor/normal_cursor.png rename to share/resources/cursor/normal_cursor.png diff --git a/cursor/pointcontact_cursor.png b/share/resources/cursor/pointcontact_cursor.png similarity index 100% rename from cursor/pointcontact_cursor.png rename to share/resources/cursor/pointcontact_cursor.png diff --git a/cursor/pointofintersect_cursor.png b/share/resources/cursor/pointofintersect_cursor.png similarity index 100% rename from cursor/pointofintersect_cursor.png rename to share/resources/cursor/pointofintersect_cursor.png diff --git a/cursor/shoulder_cursor.png b/share/resources/cursor/shoulder_cursor.png similarity index 100% rename from cursor/shoulder_cursor.png rename to share/resources/cursor/shoulder_cursor.png diff --git a/cursor/spline_cursor.png b/share/resources/cursor/spline_cursor.png similarity index 100% rename from cursor/spline_cursor.png rename to share/resources/cursor/spline_cursor.png diff --git a/cursor/splinepath_cursor.png b/share/resources/cursor/splinepath_cursor.png similarity index 100% rename from cursor/splinepath_cursor.png rename to share/resources/cursor/splinepath_cursor.png diff --git a/cursor/triangle_cursor.png b/share/resources/cursor/triangle_cursor.png similarity index 100% rename from cursor/triangle_cursor.png rename to share/resources/cursor/triangle_cursor.png diff --git a/icon.qrc b/share/resources/icon.qrc similarity index 100% rename from icon.qrc rename to share/resources/icon.qrc diff --git a/icon/16x16/mirror.png b/share/resources/icon/16x16/mirror.png similarity index 100% rename from icon/16x16/mirror.png rename to share/resources/icon/16x16/mirror.png diff --git a/icon/24x24/arrowDown.png b/share/resources/icon/24x24/arrowDown.png similarity index 100% rename from icon/24x24/arrowDown.png rename to share/resources/icon/24x24/arrowDown.png diff --git a/icon/24x24/arrowLeft.png b/share/resources/icon/24x24/arrowLeft.png similarity index 100% rename from icon/24x24/arrowLeft.png rename to share/resources/icon/24x24/arrowLeft.png diff --git a/icon/24x24/arrowLeftDown.png b/share/resources/icon/24x24/arrowLeftDown.png similarity index 100% rename from icon/24x24/arrowLeftDown.png rename to share/resources/icon/24x24/arrowLeftDown.png diff --git a/icon/24x24/arrowLeftUp.png b/share/resources/icon/24x24/arrowLeftUp.png similarity index 100% rename from icon/24x24/arrowLeftUp.png rename to share/resources/icon/24x24/arrowLeftUp.png diff --git a/icon/24x24/arrowRight.png b/share/resources/icon/24x24/arrowRight.png similarity index 100% rename from icon/24x24/arrowRight.png rename to share/resources/icon/24x24/arrowRight.png diff --git a/icon/24x24/arrowRightDown.png b/share/resources/icon/24x24/arrowRightDown.png similarity index 100% rename from icon/24x24/arrowRightDown.png rename to share/resources/icon/24x24/arrowRightDown.png diff --git a/icon/24x24/arrowRightUp.png b/share/resources/icon/24x24/arrowRightUp.png similarity index 100% rename from icon/24x24/arrowRightUp.png rename to share/resources/icon/24x24/arrowRightUp.png diff --git a/icon/24x24/arrowUp.png b/share/resources/icon/24x24/arrowUp.png similarity index 100% rename from icon/24x24/arrowUp.png rename to share/resources/icon/24x24/arrowUp.png diff --git a/icon/24x24/equal.png b/share/resources/icon/24x24/equal.png similarity index 100% rename from icon/24x24/equal.png rename to share/resources/icon/24x24/equal.png diff --git a/icon/24x24/putHere.png b/share/resources/icon/24x24/putHere.png similarity index 100% rename from icon/24x24/putHere.png rename to share/resources/icon/24x24/putHere.png diff --git a/icon/24x24/putHereLeft.png b/share/resources/icon/24x24/putHereLeft.png similarity index 100% rename from icon/24x24/putHereLeft.png rename to share/resources/icon/24x24/putHereLeft.png diff --git a/icon/32x32/along_line.png b/share/resources/icon/32x32/along_line.png similarity index 100% rename from icon/32x32/along_line.png rename to share/resources/icon/32x32/along_line.png diff --git a/icon/32x32/arc.png b/share/resources/icon/32x32/arc.png similarity index 100% rename from icon/32x32/arc.png rename to share/resources/icon/32x32/arc.png diff --git a/icon/32x32/arrow_cursor.png b/share/resources/icon/32x32/arrow_cursor.png similarity index 100% rename from icon/32x32/arrow_cursor.png rename to share/resources/icon/32x32/arrow_cursor.png diff --git a/icon/32x32/bisector.png b/share/resources/icon/32x32/bisector.png similarity index 100% rename from icon/32x32/bisector.png rename to share/resources/icon/32x32/bisector.png diff --git a/icon/32x32/draw.png b/share/resources/icon/32x32/draw.png similarity index 100% rename from icon/32x32/draw.png rename to share/resources/icon/32x32/draw.png diff --git a/icon/32x32/height.png b/share/resources/icon/32x32/height.png similarity index 100% rename from icon/32x32/height.png rename to share/resources/icon/32x32/height.png diff --git a/icon/32x32/history.png b/share/resources/icon/32x32/history.png similarity index 100% rename from icon/32x32/history.png rename to share/resources/icon/32x32/history.png diff --git a/icon/32x32/intersect.png b/share/resources/icon/32x32/intersect.png similarity index 100% rename from icon/32x32/intersect.png rename to share/resources/icon/32x32/intersect.png diff --git a/icon/32x32/kontur.png b/share/resources/icon/32x32/kontur.png similarity index 100% rename from icon/32x32/kontur.png rename to share/resources/icon/32x32/kontur.png diff --git a/icon/32x32/layout.png b/share/resources/icon/32x32/layout.png similarity index 100% rename from icon/32x32/layout.png rename to share/resources/icon/32x32/layout.png diff --git a/icon/32x32/line.png b/share/resources/icon/32x32/line.png similarity index 100% rename from icon/32x32/line.png rename to share/resources/icon/32x32/line.png diff --git a/icon/32x32/new_detail.png b/share/resources/icon/32x32/new_detail.png similarity index 100% rename from icon/32x32/new_detail.png rename to share/resources/icon/32x32/new_detail.png diff --git a/icon/32x32/new_draw.png b/share/resources/icon/32x32/new_draw.png similarity index 100% rename from icon/32x32/new_draw.png rename to share/resources/icon/32x32/new_draw.png diff --git a/icon/32x32/normal.png b/share/resources/icon/32x32/normal.png similarity index 100% rename from icon/32x32/normal.png rename to share/resources/icon/32x32/normal.png diff --git a/icon/32x32/option_draw.png b/share/resources/icon/32x32/option_draw.png similarity index 100% rename from icon/32x32/option_draw.png rename to share/resources/icon/32x32/option_draw.png diff --git a/icon/32x32/point_of_contact.png b/share/resources/icon/32x32/point_of_contact.png similarity index 100% rename from icon/32x32/point_of_contact.png rename to share/resources/icon/32x32/point_of_contact.png diff --git a/icon/32x32/point_of_intersection.png b/share/resources/icon/32x32/point_of_intersection.png similarity index 100% rename from icon/32x32/point_of_intersection.png rename to share/resources/icon/32x32/point_of_intersection.png diff --git a/icon/32x32/put_after.png b/share/resources/icon/32x32/put_after.png similarity index 100% rename from icon/32x32/put_after.png rename to share/resources/icon/32x32/put_after.png diff --git a/icon/32x32/segment.png b/share/resources/icon/32x32/segment.png similarity index 100% rename from icon/32x32/segment.png rename to share/resources/icon/32x32/segment.png diff --git a/icon/32x32/shoulder.png b/share/resources/icon/32x32/shoulder.png similarity index 100% rename from icon/32x32/shoulder.png rename to share/resources/icon/32x32/shoulder.png diff --git a/icon/32x32/spline.png b/share/resources/icon/32x32/spline.png similarity index 100% rename from icon/32x32/spline.png rename to share/resources/icon/32x32/spline.png diff --git a/icon/32x32/splinePath.png b/share/resources/icon/32x32/splinePath.png similarity index 100% rename from icon/32x32/splinePath.png rename to share/resources/icon/32x32/splinePath.png diff --git a/icon/32x32/table.png b/share/resources/icon/32x32/table.png similarity index 100% rename from icon/32x32/table.png rename to share/resources/icon/32x32/table.png diff --git a/icon/32x32/triangle.png b/share/resources/icon/32x32/triangle.png similarity index 100% rename from icon/32x32/triangle.png rename to share/resources/icon/32x32/triangle.png diff --git a/icon/64x64/icon64x64.png b/share/resources/icon/64x64/icon64x64.png similarity index 100% rename from icon/64x64/icon64x64.png rename to share/resources/icon/64x64/icon64x64.png diff --git a/translations/valentina_ru.ts b/share/translations/valentina_ru.ts similarity index 100% rename from translations/valentina_ru.ts rename to share/translations/valentina_ru.ts diff --git a/translations/valentina_uk.ts b/share/translations/valentina_uk.ts similarity index 100% rename from translations/valentina_uk.ts rename to share/translations/valentina_uk.ts diff --git a/container/calculator.cpp b/src/container/calculator.cpp similarity index 72% rename from container/calculator.cpp rename to src/container/calculator.cpp index 40ea60196..ca6c71dea 100644 --- a/container/calculator.cpp +++ b/src/container/calculator.cpp @@ -27,6 +27,7 @@ *************************************************************************/ #include "calculator.h" +#include #define DELIMITER 1 #define VARIABLE 2 @@ -43,12 +44,12 @@ qreal Calculator::eval(QString prog, QString *errorMsg) this->errorMsg->clear(); debugFormula.clear(); this->prog = prog; - //qDebug()<<"Формула: "<0; --t) -// *r = (*r) * ex; break; default: break; } } -/* Изменение знака */ void Calculator::unary(QChar o, qreal *r) { if (o=='-') @@ -216,7 +202,6 @@ void Calculator::unary(QChar o, qreal *r) } } -/* Поиск значения переменной */ qreal Calculator::find_var(QString s) { bool ok = false; @@ -224,13 +209,12 @@ qreal Calculator::find_var(QString s) if (ok == false) { qDebug()</*%^=()", c) || c=='\n' || c=='\r' || c=='\0') @@ -278,7 +249,6 @@ bool Calculator::isdelim(QChar c) return false; } -/* Возвращает 1, если "с" пробел или табуляция */ bool Calculator::iswhite(QChar c) { if (c==' ' || c=='\t') @@ -300,7 +270,7 @@ void Calculator::get_token() temp=&token; if (prog[index]=='\0') - { /* Конец файла */ + { /* end of file */ token="\0"; tok=FINISHED; token_type=DELIMITER; @@ -309,7 +279,7 @@ void Calculator::get_token() while (iswhite(prog[index])) { - ++index; /* пропуск пробелов */ + ++index; /* skip spaces */ } if (prog[index]=='\r') @@ -322,16 +292,16 @@ void Calculator::get_token() } if (StrChr("+-*^/%=;(),><", prog[index])) - { /* разделитель */ + { /* delimiter */ *temp=prog[index]; - index++; /* переход на следующую позицию */ + index++; /* jump to the next position */ temp->append("\0"); token_type=DELIMITER; debugFormula.append(token); return; } if (prog[index]=='"') - { /* строка в кавычках */ + { /* quoted string */ index++; while (prog[index] != '"' && prog[index] != '\r') { @@ -347,7 +317,7 @@ void Calculator::get_token() return; } if (prog[index].isDigit()) - { /* число */ + { /* number */ while (isdelim(prog[index]) == false) { temp->append(prog[index]); @@ -359,7 +329,7 @@ void Calculator::get_token() } if (prog[index].isPrint()) - { /* переменная или команда */ + { /* variable or command */ while (isdelim(prog[index]) == false) { temp->append(prog[index]); @@ -369,18 +339,17 @@ void Calculator::get_token() } temp->append("\0"); - /* Просматривается, если строка есть команда или переменная */ + /* Seen if there is a command line or a variable */ if (token_type==STRING) { - tok=look_up(token); /* преобразование во внутренний - формат */ + tok=look_up(token); if (tok == false) { token_type = VARIABLE; } else { - token_type = COMMAND; /* это команда */ + token_type = COMMAND; /* It is command */ } } return; @@ -391,7 +360,6 @@ bool Calculator::StrChr(QString string, QChar c) return string.contains(c, Qt::CaseInsensitive); } -/* Возвращает лексему обратно во входной поток */ void Calculator::putback() { QString t; diff --git a/src/container/calculator.h b/src/container/calculator.h new file mode 100644 index 000000000..34513faf0 --- /dev/null +++ b/src/container/calculator.h @@ -0,0 +1,187 @@ +/************************************************************************ + ** + ** @file calculator.h + ** @author Roman Telezhinsky + ** @date November 15, 2013 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef CALCULATOR_H +#define CALCULATOR_H + +#include "vcontainer.h" + +/** + * @brief The Calculator class calculate formulas of pattern. Support operation +,-,/,* and braces. + * Can replace name of variables her value. + */ +class Calculator +{ +public: + /** + * @brief Calculator class constructor. + * @param data pointer to a variable container. + */ + explicit Calculator(const VContainer *data):errorMsg(0), token(QString()), tok(0), token_type(0), prog(QString()), + index(0), data(data), debugFormula(QString()){} + /** + * @brief eval calculate formula. + * @param prog string of formula. + * @param errorMsg keep error message. + * @return value of formula. + */ + qreal eval(QString prog, QString *errorMsg); +private: + Q_DISABLE_COPY(Calculator) + /** + * @brief errorMsg keeps error message of calculation. + */ + QString *errorMsg; + /** + * @brief token теперішня лексема. + */ + QString token; + /** + * @brief tok internal representation of token. + */ + qint32 tok; + /** + * @brief token_type type of token. + */ + qint32 token_type; + /** + * @brief prog string where keeps formula. + */ + QString prog; + /** + * @brief index number character in string of formula. + */ + qint32 index; + /** + * @brief data container with data container of all variables. + */ + const VContainer *data; + /** + * @brief debugFormula decoded string of formula. + */ + QString debugFormula; + /** + * @brief get_exp calculate formula. + * @return value of formula. + */ + qreal get_exp(); + /** + * @brief get_token return next token. + */ + void get_token(); + /** + * @brief StrChr checks whether the character belongs to the line. + * @param string string with formula + * @param c character. + * @return true - belongs to the line, false - don't belongs to the line. + */ + static bool StrChr(QString string, QChar c); + /** + * @brief putback returns the readout token back into the flow. + */ + void putback(); + /** + * @brief level2 method of addition and subtraction of two terms. + * @param result result of operation. + */ + void level2(qreal *result); + /** + * @brief level3 method of multiplication, division, finding percent. + * @param result result of operation. + */ + void level3(qreal *result); + /** + * @brief level4 method of degree two numbers. + * @param result result of operation. + */ + void level4(qreal *result); + /** + * @brief level5 method for finding unary plus or minus. + * @param result result of operation. + */ + void level5(qreal *result); + /** + * @brief level6 processing method of the expression in brackets. + * @param result result of operation. + */ + void level6(qreal *result); + /** + * @brief primitive method of determining the value of a variable by its name. + * @param result result of operation. + */ + void primitive(qreal *result); + /** + * @brief arith perform the specified arithmetic. The result is written to the first element. + * @param o sign of operation. + * @param r first element. + * @param h second element. + */ + static void arith(QChar o, qreal *r, qreal *h); + /** + * @brief unary method changes the sign. + * @param o sign of symbol. + * @param r element. + */ + static void unary(QChar o, qreal *r); + /** + * @brief find_var method is finding variable by name. + * @param s name of variable. + * @return value of variable. + */ + qreal find_var(QString s); + /** + * @brief serror report an error + * @param error error code + */ + void serror(qint32 error); + /** + * @brief look_up finding the internal format for the current token in the token table. + * @param s name of token. + * @return internal number of token. + */ + static char look_up(QString s); + /** + * @brief isdelim return true if c delimiter. + * @param c character. + * @return true - delimiter, false - do not delimiter. + */ + static bool isdelim(QChar c); + /** + * @brief isdelim return true if c delimiter. + * @param c character. + * @return true - delimiter, false - do not delimiter. + */ + static bool iswhite(QChar c); + /** + * @brief iswhite checks whether c space or tab. + * @param c character. + * @return true - space or tab, false - don't space and don't tab. + */ +}; + +#endif // CALCULATOR_H diff --git a/src/container/container.pri b/src/container/container.pri new file mode 100644 index 000000000..be62d71f1 --- /dev/null +++ b/src/container/container.pri @@ -0,0 +1,13 @@ +SOURCES += \ + src/container/vpointf.cpp \ + src/container/vincrementtablerow.cpp \ + src/container/vcontainer.cpp \ + src/container/calculator.cpp \ + src/container/vstandarttablerow.cpp + +HEADERS += \ + src/container/vpointf.h \ + src/container/vincrementtablerow.h \ + src/container/vcontainer.h \ + src/container/calculator.h \ + src/container/vstandarttablerow.h diff --git a/container/vcontainer.cpp b/src/container/vcontainer.cpp similarity index 77% rename from container/vcontainer.cpp rename to src/container/vcontainer.cpp index 5bbe38e15..0aa373568 100644 --- a/container/vcontainer.cpp +++ b/src/container/vcontainer.cpp @@ -33,13 +33,13 @@ qint64 VContainer::_id = 0; VContainer::VContainer() :base(QHash()), points(QHash()), - modelingPoints(QHash()), - standartTable(QHash()), incrementTable(QHash()), + pointsModeling(QHash()), + standartTable(QHash()), incrementTable(QHash()), lengthLines(QHash()), lineAngles(QHash()), splines(QHash()), - modelingSplines(QHash()), - lengthSplines(QHash()), arcs(QHash()), modelingArcs(QHash()), + splinesModeling(QHash()), + lengthSplines(QHash()), arcs(QHash()), arcsModeling(QHash()), lengthArcs(QHash()), - splinePaths(QHash()), modelingSplinePaths(QHash()), + splinePaths(QHash()), splinePathsModeling(QHash()), details(QHash()) { SetSize(500); @@ -55,13 +55,13 @@ VContainer &VContainer::operator =(const VContainer &data) VContainer::VContainer(const VContainer &data) :base(QHash()), points(QHash()), - modelingPoints(QHash()), - standartTable(QHash()), incrementTable(QHash()), + pointsModeling(QHash()), + standartTable(QHash()), incrementTable(QHash()), lengthLines(QHash()), lineAngles(QHash()), splines(QHash()), - modelingSplines(QHash()), - lengthSplines(QHash()), arcs(QHash()), modelingArcs(QHash()), + splinesModeling(QHash()), + lengthSplines(QHash()), arcs(QHash()), arcsModeling(QHash()), lengthArcs(QHash()), - splinePaths(QHash()), modelingSplinePaths(QHash()), + splinePaths(QHash()), splinePathsModeling(QHash()), details(QHash()) { setData(data); @@ -71,19 +71,19 @@ void VContainer::setData(const VContainer &data) { base = *data.DataBase(); points = *data.DataPoints(); - modelingPoints = *data.DataModelingPoints(); + pointsModeling = *data.DataPointsModeling(); standartTable = *data.DataStandartTable(); incrementTable = *data.DataIncrementTable(); lengthLines = *data.DataLengthLines(); lineAngles = *data.DataLineAngles(); splines = *data.DataSplines(); - modelingSplines = *data.DataModelingSplines(); + splinesModeling = *data.DataSplinesModeling(); lengthSplines = *data.DataLengthSplines(); arcs = *data.DataArcs(); - modelingArcs = *data.DataModelingArcs(); + arcsModeling = *data.DataArcsModeling(); lengthArcs = *data.DataLengthArcs(); splinePaths = *data.DataSplinePaths(); - modelingSplinePaths = *data.DataModelingSplinePaths(); + splinePathsModeling = *data.DataSplinePathsModeling(); details = *data.DataDetails(); } @@ -92,9 +92,9 @@ VPointF VContainer::GetPoint(qint64 id) const return GetObject(points, id); } -VPointF VContainer::GetModelingPoint(qint64 id) const +VPointF VContainer::GetPointModeling(qint64 id) const { - return GetObject(modelingPoints, id); + return GetObject(pointsModeling, id); } template @@ -110,7 +110,7 @@ val VContainer::GetObject(const QHash &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); @@ -151,9 +151,9 @@ VSpline VContainer::GetSpline(qint64 id) const return GetObject(splines, id); } -VSpline VContainer::GetModelingSpline(qint64 id) const +VSpline VContainer::GetSplineModeling(qint64 id) const { - return GetObject(modelingSplines, id); + return GetObject(splinesModeling, id); } VArc VContainer::GetArc(qint64 id) const @@ -161,9 +161,9 @@ VArc VContainer::GetArc(qint64 id) const return GetObject(arcs, id); } -VArc VContainer::GetModelingArc(qint64 id) const +VArc VContainer::GetArcModeling(qint64 id) const { - return GetObject(modelingArcs, id); + return GetObject(arcsModeling, id); } VSplinePath VContainer::GetSplinePath(qint64 id) const @@ -171,9 +171,9 @@ VSplinePath VContainer::GetSplinePath(qint64 id) const return GetObject(splinePaths, id); } -VSplinePath VContainer::GetModelingSplinePath(qint64 id) const +VSplinePath VContainer::GetSplinePathModeling(qint64 id) const { - return GetObject(modelingSplinePaths, id); + return GetObject(splinePathsModeling, id); } VDetail VContainer::GetDetail(qint64 id) const @@ -186,9 +186,9 @@ qint64 VContainer::AddPoint(const VPointF &point) return AddObject(points, point); } -qint64 VContainer::AddModelingPoint(const VPointF &point) +qint64 VContainer::AddPointModeling(const VPointF &point) { - return AddObject(modelingPoints, point); + return AddObject(pointsModeling, point); } qint64 VContainer::AddDetail(const VDetail &detail) @@ -221,7 +221,7 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const { case (Tool::NodePoint): { - VPointF point = GetModelingPoint(detail[i].getId()); + VPointF point = GetPointModeling(detail[i].getId()); points.append(point.toQPointF()); if (detail.getSupplement() == true) { @@ -234,7 +234,7 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const break; case (Tool::NodeArc): { - VArc arc = GetModelingArc(detail[i].getId()); + VArc arc = GetArcModeling(detail[i].getId()); qreal len1 = GetLengthContour(points, arc.GetPoints()); qreal lenReverse = GetLengthContour(points, GetReversePoint(arc.GetPoints())); if (len1 <= lenReverse) @@ -257,7 +257,7 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const break; case (Tool::NodeSpline): { - VSpline spline = GetModelingSpline(detail[i].getId()); + VSpline spline = GetSplineModeling(detail[i].getId()); qreal len1 = GetLengthContour(points, spline.GetPoints()); qreal lenReverse = GetLengthContour(points, GetReversePoint(spline.GetPoints())); if (len1 <= lenReverse) @@ -281,7 +281,7 @@ QPainterPath VContainer::ContourPath(qint64 idDetail) const break; case (Tool::NodeSplinePath): { - VSplinePath splinePath = GetModelingSplinePath(detail[i].getId()); + VSplinePath splinePath = GetSplinePathModeling(detail[i].getId()); qreal len1 = GetLengthContour(points, splinePath.GetPathPoints()); qreal lenReverse = GetLengthContour(points, GetReversePoint(splinePath.GetPathPoints())); if (len1 <= lenReverse) @@ -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 (size()/10.0) - 50.0 ) / 2.0; qreal k_growth = ( static_cast (growth()/10.0) - 176.0 ) / 6.0; qreal value = cell.GetBase() + k_size*cell.GetKsize() + k_growth*cell.GetKgrowth(); @@ -609,10 +609,10 @@ void VContainer::Clear() lengthArcs.clear(); lineAngles.clear(); details.clear(); - modelingArcs.clear(); - modelingPoints.clear(); - modelingSplinePaths.clear(); - modelingSplines.clear(); + arcsModeling.clear(); + pointsModeling.clear(); + splinePathsModeling.clear(); + splinesModeling.clear(); ClearObject(); CreateManTableIGroup (); } @@ -679,8 +679,8 @@ void VContainer::AddLine(const qint64 &firstPointId, const qint64 &secondPointId } else { - first = GetModelingPoint(firstPointId); - second = GetModelingPoint(secondPointId); + first = GetPointModeling(firstPointId); + second = GetPointModeling(secondPointId); } AddLengthLine(nameLine, toMM(QLineF(first.toQPointF(), second.toQPointF()).length())); nameLine = GetNameLineAngle(firstPointId, secondPointId, mode); @@ -692,9 +692,9 @@ qint64 VContainer::AddSpline(const VSpline &spl) return AddObject(splines, spl); } -qint64 VContainer::AddModelingSpline(const VSpline &spl) +qint64 VContainer::AddSplineModeling(const VSpline &spl) { - return AddObject(modelingSplines, spl); + return AddObject(splinesModeling, spl); } qint64 VContainer::AddSplinePath(const VSplinePath &splPath) @@ -702,9 +702,9 @@ qint64 VContainer::AddSplinePath(const VSplinePath &splPath) return AddObject(splinePaths, splPath); } -qint64 VContainer::AddModelingSplinePath(const VSplinePath &splPath) +qint64 VContainer::AddSplinePathModeling(const VSplinePath &splPath) { - return AddObject(modelingSplinePaths, splPath); + return AddObject(splinePathsModeling, splPath); } qint64 VContainer::AddArc(const VArc &arc) @@ -712,9 +712,9 @@ qint64 VContainer::AddArc(const VArc &arc) return AddObject(arcs, arc); } -qint64 VContainer::AddModelingArc(const VArc &arc) +qint64 VContainer::AddArcModeling(const VArc &arc) { - return AddObject(modelingArcs, arc); + return AddObject(arcsModeling, arc); } template @@ -736,8 +736,8 @@ QString VContainer::GetNameLine(const qint64 &firstPoint, const qint64 &secondPo } else { - first = GetModelingPoint(firstPoint); - second = GetModelingPoint(secondPoint); + first = GetPointModeling(firstPoint); + second = GetPointModeling(secondPoint); } return QString("Line_%1_%2").arg(first.name(), second.name()); } @@ -753,8 +753,8 @@ QString VContainer::GetNameLineAngle(const qint64 &firstPoint, const qint64 &sec } else { - first = GetModelingPoint(firstPoint); - second = GetModelingPoint(secondPoint); + first = GetPointModeling(firstPoint); + second = GetPointModeling(secondPoint); } return QString("AngleLine_%1_%2").arg(first.name(), second.name()); } @@ -764,9 +764,9 @@ void VContainer::UpdatePoint(qint64 id, const VPointF &point) UpdateObject(points, id, point); } -void VContainer::UpdateModelingPoint(qint64 id, const VPointF &point) +void VContainer::UpdatePointModeling(qint64 id, const VPointF &point) { - UpdateObject(modelingPoints, id, point); + UpdateObject(pointsModeling, id, point); } void VContainer::UpdateDetail(qint64 id, const VDetail &detail) @@ -779,9 +779,9 @@ void VContainer::UpdateSpline(qint64 id, const VSpline &spl) UpdateObject(splines, id, spl); } -void VContainer::UpdateModelingSpline(qint64 id, const VSpline &spl) +void VContainer::UpdateSplineModeling(qint64 id, const VSpline &spl) { - UpdateObject(modelingSplines, id, spl); + UpdateObject(splinesModeling, id, spl); } void VContainer::UpdateSplinePath(qint64 id, const VSplinePath &splPath) @@ -789,9 +789,9 @@ void VContainer::UpdateSplinePath(qint64 id, const VSplinePath &splPath) UpdateObject(splinePaths, id, splPath); } -void VContainer::UpdateModelingSplinePath(qint64 id, const VSplinePath &splPath) +void VContainer::UpdateSplinePathModeling(qint64 id, const VSplinePath &splPath) { - UpdateObject(modelingSplinePaths, id, splPath); + UpdateObject(splinePathsModeling, id, splPath); } void VContainer::UpdateArc(qint64 id, const VArc &arc) @@ -799,9 +799,9 @@ void VContainer::UpdateArc(qint64 id, const VArc &arc) UpdateObject(arcs, id, arc); } -void VContainer::UpdateModelingArc(qint64 id, const VArc &arc) +void VContainer::UpdateArcModeling(qint64 id, const VArc &arc) { - UpdateObject(modelingArcs, id, arc); + UpdateObject(arcsModeling, id, arc); } void VContainer::AddLengthLine(const QString &name, const qreal &value) @@ -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 VContainer::GetReversePoint(const QVector &points) const diff --git a/src/container/vcontainer.h b/src/container/vcontainer.h new file mode 100644 index 000000000..91044d5cf --- /dev/null +++ b/src/container/vcontainer.h @@ -0,0 +1,688 @@ +/************************************************************************ + ** + ** @file vcontainer.h + ** @author Roman Telezhinsky + ** @date November 15, 2013 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef VCONTAINER_H +#define VCONTAINER_H + +#include "vstandarttablerow.h" +#include "vincrementtablerow.h" +#include "../geometry/varc.h" +#include "../geometry/vsplinepath.h" +#include "../geometry/vdetail.h" +#include "../widgets/vitem.h" + +/** + * @brief The VContainer class container of all variables. + */ +class VContainer +{ + Q_DECLARE_TR_FUNCTIONS(VContainer) +public: + /** + * @brief VContainer create empty container + */ + VContainer(); + /** + * @brief operator = copy constructor + * @param data container + * @return copy container + */ + VContainer &operator=(const VContainer &data); + /** + * @brief VContainer create container from another container + * @param data container + */ + VContainer(const VContainer &data); + /** + * @brief setData copy data from container + * @param data container + */ + void setData(const VContainer &data); + /** + * @brief GetPoint returns a point by id + * @param id id of point + * @return point + */ + VPointF GetPoint(qint64 id) const; + /** + * @brief GetPointModeling return a point modeling by id + * @param id id of point modeling + * @return point modeling + */ + VPointF GetPointModeling(qint64 id) const; + /** + * @brief GetStandartTableCell return standart table row by name + * @param name name of standart table row + * @return row of standart table + */ + VStandartTableRow GetStandartTableCell(const QString& name) const; + /** + * @brief GetIncrementTableRow return increment table row by name + * @param name name of increment table row + * @return row of increment table + */ + VIncrementTableRow GetIncrementTableRow(const QString& name) const; + /** + * @brief GetLine return length of line by name + * @param name name of line + * @return length of line in mm + */ + qreal GetLine(const QString &name) const; + /** + * @brief GetLengthArc return length of arc by name + * @param name name of arc + * @return length of arc in mm + */ + qreal GetLengthArc(const QString &name) const; + /** + * @brief GetLengthSpline return length of spline by name + * @param name name of spline + * @return length of spline in mm + */ + qreal GetLengthSpline(const QString &name) const; + /** + * @brief GetLineAngle return angle of line + * @param name name of line angle + * @return angle in degree + */ + qreal GetLineAngle(const QString &name) const; + /** + * @brief GetSpline return spline by id + * @param id id of spline + * @return spline + */ + VSpline GetSpline(qint64 id) const; + /** + * @brief GetSplineModeling return spline modeling by id + * @param id id of spline modeling + * @return spline modeling + */ + VSpline GetSplineModeling(qint64 id) const; + /** + * @brief GetArc return arc by id + * @param id id of arc + * @return arc + */ + VArc GetArc(qint64 id) const; + /** + * @brief GetArcModeling return arc modeling by id + * @param id id of arc modeling + * @return arc modeling + */ + VArc GetArcModeling(qint64 id) const; + /** + * @brief GetSplinePath return spline path by id + * @param id id of spline path + * @return spline path + */ + VSplinePath GetSplinePath(qint64 id) const; + /** + * @brief GetSplinePathModeling return spline path modeling by id + * @param id id of spline modeling path + * @return spline modeling path + */ + VSplinePath GetSplinePathModeling(qint64 id) const; + /** + * @brief GetDetail return detail by id + * @param id id of detail + * @return detail + */ + VDetail GetDetail(qint64 id) const; + /** + * @brief getId return current id + * @return current id + */ + static qint64 getId() {return _id;} + /** + * @brief AddPoint add new point to container + * @param point new point + * @return return id of new point in container + */ + qint64 AddPoint(const VPointF& point); + /** + * @brief AddPointModeling add new point modeling to container + * @param point new point modeling + * @return return id of new point modeling in container + */ + qint64 AddPointModeling(const VPointF& point); + /** + * @brief AddDetail add new detail to container + * @param detail new detail + * @return return id of new detail in container + */ + qint64 AddDetail(const VDetail& detail); + /** + * @brief AddStandartTableCell add new row of standart table + * @param name name of row of standart table + * @param cell row of standart table + */ + inline void AddStandartTableCell(const QString& name, const VStandartTableRow& cell) + {standartTable[name] = cell;} + /** + * @brief AddIncrementTableRow add new row of increment table + * @param name name of new row of increment table + * @param row new row of increment table + */ + inline void AddIncrementTableRow(const QString& name, const VIncrementTableRow &row) + {incrementTable[name] = row;} + /** + * @brief AddLengthLine add length of line to container + * @param name name of line + * @param value length of line + */ + void AddLengthLine(const QString &name, const qreal &value); + /** + * @brief AddLengthSpline add length of spline to container + * @param name name of spline + * @param value length of spline + */ + void AddLengthSpline(const QString &name, const qreal &value); + /** + * @brief AddLengthArc add length of arc to container + * @param id id of arc + */ + void AddLengthArc(const qint64 &id); + /** + * @brief AddLengthArc add length of arc + * @param name name of arc + * @param value length of arc + */ + void AddLengthArc(const QString &name, const qreal &value); + /** + * @brief AddLineAngle add angle of line to container + * @param name name of line angle + * @param value angle in degree + */ + void AddLineAngle(const QString &name, const qreal &value); + /** + * @brief AddLine add line to container + * @param firstPointId id of first point of line + * @param secondPointId id of second point of line + * @param mode mode of line + */ + void AddLine(const qint64 &firstPointId, const qint64 &secondPointId, + const Draw::Draws &mode = Draw::Calculation); + /** + * @brief AddSpline add spline to container + * @param spl new spline + * @return id of spline in container + */ + qint64 AddSpline(const VSpline& spl); + /** + * @brief AddSplineModeling add spline modeling to container + * @param spl new spline modeling + * @return id of spline modeling in container + */ + qint64 AddSplineModeling(const VSpline& spl); + /** + * @brief AddSplinePath add spline path to container + * @param splPath new spline path + * @return id of spline path in container + */ + qint64 AddSplinePath(const VSplinePath& splPath); + /** + * @brief AddSplinePathModeling add spline path modeling to container + * @param splPath new spline path + * @return id of spline path in container + */ + qint64 AddSplinePathModeling(const VSplinePath& splPath); + /** + * @brief AddArc add arc to container + * @param arc new arc + * @return id of arc in container in container + */ + qint64 AddArc(const VArc& arc); + /** + * @brief AddArcModeling add arc modeling to container + * @param arc new arc modeling + * @return id of new arc modeling in container + */ + qint64 AddArcModeling(const VArc& arc); + /** + * @brief GetNameLine return name of line + * @param firstPoint id of first point of line + * @param secondPoint id of second point of line + * @param mode mode of line + * @return name of line + */ + QString GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint, + const Draw::Draws &mode = Draw::Calculation) const; + /** + * @brief GetNameLineAngle return name of line angle + * @param firstPoint id of first point of line + * @param secondPoint id of second point of line + * @param mode mode of line + * @return name of angle of line + */ + QString GetNameLineAngle(const qint64 &firstPoint, const qint64 &secondPoint, + const Draw::Draws &mode = Draw::Calculation) const; + /** + * @brief UpdatePoint update point by id + * @param id id of existing point + * @param point point + */ + void UpdatePoint(qint64 id, const VPointF& point); + /** + * @brief UpdatePointModeling update point modeling by id + * @param id id of existing point modeling + * @param point point modeling + */ + void UpdatePointModeling(qint64 id, const VPointF& point); + /** + * @brief UpdateDetail update detail by id + * @param id id of existing detail + * @param detail detail + */ + void UpdateDetail(qint64 id, const VDetail& detail); + /** + * @brief UpdateSpline update spline by id + * @param id if of existing spline + * @param spl spline + */ + void UpdateSpline(qint64 id, const VSpline& spl); + /** + * @brief UpdateSplineModeling update spline modeling by id + * @param id id of existing spline modeling + * @param spl spline modeling + */ + void UpdateSplineModeling(qint64 id, const VSpline& spl); + /** + * @brief UpdateSplinePath update spline path by id + * @param id id of existing spline path + * @param splPath spline path + */ + void UpdateSplinePath(qint64 id, const VSplinePath& splPath); + /** + * @brief UpdateSplinePathModeling update spline path modeling by id + * @param id id of existing spline path modeling + * @param splPath spline path modeling + */ + void UpdateSplinePathModeling(qint64 id, const VSplinePath& splPath); + /** + * @brief UpdateArc update arc by id + * @param id id of existing arc + * @param arc arc + */ + void UpdateArc(qint64 id, const VArc& arc); + /** + * @brief UpdateArcModeling update arc modeling by id + * @param id id of existing arc modeling + * @param arc arc modeling + */ + void UpdateArcModeling(qint64 id, const VArc& arc); + /** + * @brief UpdateStandartTableCell update standart table row by name + * @param name name of row + * @param cell row of standart table + */ + inline void UpdateStandartTableCell(const QString& name, const VStandartTableRow& cell) + {standartTable[name] = cell;} + /** + * @brief UpdateIncrementTableRow update increment table row by name + * @param name name of row + * @param row row + */ + inline void UpdateIncrementTableRow(const QString& name, const VIncrementTableRow& row) + {incrementTable[name] = row;} + /** + * @brief GetValueStandartTableCell return value of standart table row by name + * @param name name of row + * @return value in mm + */ + qreal GetValueStandartTableCell(const QString& name) const; + /** + * @brief GetValueIncrementTableRow return value of increment table row by name + * @param name name of row + * @return value of row in mm + */ + qreal GetValueIncrementTableRow(const QString& name) const; + /** + * @brief Clear clear data in container. Id will be 0. + */ + void Clear(); + /** + * @brief ClearObject points, splines, arcs, spline paths will be cleared. + */ + void ClearObject(); + /** + * @brief ClearIncrementTable clear increment table + */ + inline void ClearIncrementTable() {incrementTable.clear();} + /** + * @brief ClearLengthLines clear length lines + */ + inline void ClearLengthLines() {lengthLines.clear();} + /** + * @brief ClearLengthSplines clear length splines + */ + inline void ClearLengthSplines() {lengthSplines.clear();} + /** + * @brief ClearLengthArcs clear length arcs + */ + inline void ClearLengthArcs() {lengthArcs.clear();} + /** + * @brief ClearLineAngles clear angles of lines + */ + inline void ClearLineAngles() {lineAngles.clear();} + /** + * @brief SetSize set value of size + * @param size value of size in mm + */ + inline void SetSize(qint32 size) {base["Сг"] = size;} + /** + * @brief SetGrowth set value of growth + * @param growth value of growth in mm + */ + inline void SetGrowth(qint32 growth) {base["Р"] = growth;} + /** + * @brief size return size + * @return size in mm + */ + inline qint32 size() const {return base.value("Сг");} + /** + * @brief growth return growth + * @return growth in mm + */ + inline qint32 growth() const {return base.value("Р");} + /** + * @brief FindVar return value of variable by name + * @param name name of variable + * @param ok false if can't find variable + * @return value of variable + */ + qreal FindVar(const QString& name, bool *ok)const; + /** + * @brief IncrementTableContains check if increment table contains name + * @param name name of row + * @return true if contains + */ + inline bool IncrementTableContains(const QString& name) {return incrementTable.contains(name);} + /** + * @brief getNextId generate next unique id + * @return next unique id + */ + static qint64 getNextId(); + /** + * @brief RemoveIncrementTableRow remove row by name from increment table + * @param name name of existing row + */ + inline void RemoveIncrementTableRow(const QString& name) {incrementTable.remove(name);} + /** + * @brief data container with dataPoints return container of points + * @return pointer on container of points + */ + inline const QHash *DataPoints() const {return &points;} + /** + * @brief data container with dataPointsModeling return container of points modeling + * @return pointer on container of points modeling + */ + inline const QHash *DataPointsModeling() const {return &pointsModeling;} + /** + * @brief data container with dataSplines return container of splines + * @return pointer on container of splines + */ + inline const QHash *DataSplines() const {return &splines;} + /** + * @brief data container with dataSplinesModeling return container of splines modeling + * @return pointer on container of splines modeling + */ + inline const QHash *DataSplinesModeling() const {return &splinesModeling;} + /** + * @brief data container with dataArcs return container of arcs + * @return pointer on container of arcs + */ + inline const QHash *DataArcs() const {return &arcs;} + /** + * @brief data container with dataArcsModeling return container of arcs modeling + * @return pointer on container of arcs modeling + */ + inline const QHash *DataArcsModeling() const {return &arcsModeling;} + /** + * @brief data container with dataBase return container of data + * @return pointer on container of base data + */ + inline const QHash *DataBase() const {return &base;} + /** + * @brief data container with dataStandartTable return container of standart table + * @return pointer on container of standart table + */ + inline const QHash *DataStandartTable() const {return &standartTable;} + /** + * @brief data container with dataIncrementTable return container of increment table + * @return pointer on container of increment table + */ + inline const QHash *DataIncrementTable() const {return &incrementTable;} + /** + * @brief data container with dataLengthLines return container of lines lengths + * @return pointer on container of lines lengths + */ + inline const QHash *DataLengthLines() const {return &lengthLines;} + /** + * @brief data container with dataLengthSplines return container of splines lengths + * @return pointer on container of splines lengths + */ + inline const QHash *DataLengthSplines() const {return &lengthSplines;} + /** + * @brief data container with dataLengthArcs return container of arcs length + * @return pointer on container of arcs length + */ + inline const QHash *DataLengthArcs() const {return &lengthArcs;} + /** + * @brief data container with dataLineAngles return container of angles of line + * @return pointer on container of angles of line + */ + inline const QHash *DataLineAngles() const {return &lineAngles;} + /** + * @brief data container with dataSplinePaths return container of spline paths + * @return pointer on container of spline paths + */ + inline const QHash *DataSplinePaths() const {return &splinePaths;} + /** + * @brief data container with dataSplinePathsModeling return container of spline paths modeling + * @return pointer on container of spline paths modeling + */ + inline const QHash *DataSplinePathsModeling() const {return &splinePathsModeling;} + /** + * @brief data container with dataDetails return container of details + * @return pointer on container of details + */ + inline const QHash *DataDetails() const {return &details;} + /** + * @brief UpdateId update id. If new id bigger when current save new like current. + * @param newId id + */ + static void UpdateId(qint64 newId); + /** + * @brief ContourPath create painter path for detail + * @param idDetail id of detail + * @return return painter path of contour detail + */ + QPainterPath ContourPath(qint64 idDetail) const; + /** + * @brief biasPoints bias point + * @param points vector of points + * @param mx offset respect to x + * @param my offset respect to y + * @return new vector biased points + */ + QVector biasPoints(const QVector &points, const qreal &mx, const qreal &my) const; + /** + * @brief Equidistant create equidistant painter path for detail + * @param points vector of points + * @param eqv type of equidistant + * @param width width of equidistant + * @return return painter path of equidistant + */ + QPainterPath Equidistant(QVector points, const Detail::Equidistant &eqv, const qreal &width)const; + /** + * @brief ParallelLine create parallel line + * @param line starting line + * @param width width to parallel line + * @return parallel line + */ + static QLineF ParallelLine(const QLineF &line, qreal width ); + /** + * @brief SingleParallelPoint return point of parallel line + * @param line starting line + * @param angle angle in degree + * @param width width to parallel line + * @return point of parallel line + */ + static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width); + /** + * @brief EkvPoint return vector of points of equidistant two lines. Last point of two lines must be equal. + * @param line1 first line + * @param line2 second line + * @param width width of equidistant + * @return vector of points + */ + QVector EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width)const; + /** + * @brief CheckLoops seek and delete loops in equidistant + * @param points vector of points of equidistant + * @return vector of points of equidistant + */ + QVector CheckLoops(const QVector &points) const; + /** + * @brief PrepareDetails prepare detail for creation layout + * @param list list of details + */ + void PrepareDetails(QVector & list) const; +private: + /** + * @brief _id current id. New object will have value +1. For full class equal 0. + */ + static qint64 _id; + /** + * @brief base container of base data (size and growth) + */ + QHash base; + /** + * @brief points container of points + */ + QHash points; + /** + * @brief pointsModeling container of points modeling + */ + QHash pointsModeling; + /** + * @brief standartTable container of standart table rows + */ + QHash standartTable; + /** + * @brief incrementTable + */ + QHash incrementTable; + /** + * @brief lengthLines container of lines lengths + */ + QHash lengthLines; + /** + * @brief lineAngles container of angles of lines + */ + QHash lineAngles; + /** + * @brief splines container of splines + */ + QHash splines; + /** + * @brief splinesModeling container of splines modeling + */ + QHash splinesModeling; + /** + * @brief lengthSplines container of splines length + */ + QHash lengthSplines; + /** + * @brief arcs container of arcs + */ + QHash arcs; + /** + * @brief arcsModeling container of arcs modeling + */ + QHash arcsModeling; + /** + * @brief lengthArcs container of arcs length + */ + QHash lengthArcs; + /** + * @brief splinePaths container of spline paths + */ + QHash splinePaths; + /** + * @brief splinePathsModeling container of spline paths modeling + */ + QHash splinePathsModeling; + /** + * @brief details container of details + */ + QHash details; + /** + * @brief CreateManTableIGroup generate man standart table of measurements + */ + void CreateManTableIGroup (); + /** + * @brief GetReversePoint return revers container of points + * @param points container with points + * @return reverced points + */ + QVector GetReversePoint(const QVector &points)const; + /** + * @brief GetLengthContour return length of contour + * @param contour container with points of contour + * @param newPoints point whos we try to add to contour + * @return length length of contour + */ + qreal GetLengthContour(const QVector &contour, const QVector &newPoints)const; + template + /** + * @brief GetObject return object from container + * @param obj container + * @param id id of object + * @return Object + */ + static val GetObject(const QHash &obj, key id); + template + /** + * @brief UpdateObject update object in container + * @param obj container + * @param id id of existing object + * @param point object + */ + static void UpdateObject(QHash &obj, const qint64 &id, const val& point); + template + /** + * @brief AddObject add object to container + * @param obj container + * @param value object + * @return id of object in container + */ + static qint64 AddObject(QHash &obj, const val& value); +}; + +#endif // VCONTAINER_H diff --git a/container/vincrementtablerow.cpp b/src/container/vincrementtablerow.cpp similarity index 100% rename from container/vincrementtablerow.cpp rename to src/container/vincrementtablerow.cpp diff --git a/container/vincrementtablerow.h b/src/container/vincrementtablerow.h similarity index 56% rename from container/vincrementtablerow.h rename to src/container/vincrementtablerow.h index 5aa643e7d..9b805ed2c 100644 --- a/container/vincrementtablerow.h +++ b/src/container/vincrementtablerow.h @@ -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; }; diff --git a/container/vpointf.cpp b/src/container/vpointf.cpp similarity index 100% rename from container/vpointf.cpp rename to src/container/vpointf.cpp diff --git a/container/vpointf.h b/src/container/vpointf.h similarity index 57% rename from container/vpointf.h rename to src/container/vpointf.h index b2396ce54..ae9188a43 100644 --- a/container/vpointf.h +++ b/src/container/vpointf.h @@ -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; }; diff --git a/container/vstandarttablecell.cpp b/src/container/vstandarttablerow.cpp similarity index 88% rename from container/vstandarttablecell.cpp rename to src/container/vstandarttablerow.cpp index 4a824bba9..668036804 100644 --- a/container/vstandarttablecell.cpp +++ b/src/container/vstandarttablerow.cpp @@ -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){} diff --git a/container/vstandarttablecell.h b/src/container/vstandarttablerow.h similarity index 52% rename from container/vstandarttablecell.h rename to src/container/vstandarttablerow.h index b0fe41bb0..0a2dd2231 100644 --- a/container/vstandarttablecell.h +++ b/src/container/vstandarttablerow.h @@ -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 diff --git a/dialogs/dialogalongline.cpp b/src/dialogs/dialogalongline.cpp similarity index 99% rename from dialogs/dialogalongline.cpp rename to src/dialogs/dialogalongline.cpp index adaa26647..a6d29a2f8 100644 --- a/dialogs/dialogalongline.cpp +++ b/src/dialogs/dialogalongline.cpp @@ -105,7 +105,7 @@ void DialogAlongLine::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } if (number == 0) { diff --git a/dialogs/dialogalongline.h b/src/dialogs/dialogalongline.h similarity index 56% rename from dialogs/dialogalongline.h rename to src/dialogs/dialogalongline.h index 819498b1d..67aa5f0a2 100644 --- a/dialogs/dialogalongline.h +++ b/src/dialogs/dialogalongline.h @@ -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; }; diff --git a/dialogs/dialogalongline.ui b/src/dialogs/dialogalongline.ui similarity index 100% rename from dialogs/dialogalongline.ui rename to src/dialogs/dialogalongline.ui diff --git a/dialogs/dialogarc.cpp b/src/dialogs/dialogarc.cpp similarity index 99% rename from dialogs/dialogarc.cpp rename to src/dialogs/dialogarc.cpp index ed4beb7a2..8ef73f743 100644 --- a/dialogs/dialogarc.cpp +++ b/src/dialogs/dialogarc.cpp @@ -140,7 +140,7 @@ void DialogArc::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } ChangeCurrentText(ui->comboBoxBasePoint, point.name()); emit ToolTip(""); diff --git a/src/dialogs/dialogarc.h b/src/dialogs/dialogarc.h new file mode 100644 index 000000000..27bf820bb --- /dev/null +++ b/src/dialogs/dialogarc.h @@ -0,0 +1,207 @@ +/************************************************************************ + ** + ** @file dialogarc.h + ** @author Roman Telezhinsky + ** @date November 15, 2013 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef DIALOGARC_H +#define DIALOGARC_H + +#include "dialogtool.h" + +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(); +}; + +#endif // DIALOGARC_H diff --git a/dialogs/dialogarc.ui b/src/dialogs/dialogarc.ui similarity index 100% rename from dialogs/dialogarc.ui rename to src/dialogs/dialogarc.ui diff --git a/dialogs/dialogbisector.cpp b/src/dialogs/dialogbisector.cpp similarity index 99% rename from dialogs/dialogbisector.cpp rename to src/dialogs/dialogbisector.cpp index 2eda284bc..c9c3ec23a 100644 --- a/dialogs/dialogbisector.cpp +++ b/src/dialogs/dialogbisector.cpp @@ -105,7 +105,7 @@ void DialogBisector::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } if (number == 0) { diff --git a/dialogs/dialogbisector.h b/src/dialogs/dialogbisector.h similarity index 52% rename from dialogs/dialogbisector.h rename to src/dialogs/dialogbisector.h index 99a665ce9..dbdb03280 100644 --- a/dialogs/dialogbisector.h +++ b/src/dialogs/dialogbisector.h @@ -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; }; diff --git a/dialogs/dialogbisector.ui b/src/dialogs/dialogbisector.ui similarity index 100% rename from dialogs/dialogbisector.ui rename to src/dialogs/dialogbisector.ui diff --git a/dialogs/dialogdetail.cpp b/src/dialogs/dialogdetail.cpp similarity index 97% rename from dialogs/dialogdetail.cpp rename to src/dialogs/dialogdetail.cpp index f7ab1e834..83aab4f27 100644 --- a/dialogs/dialogdetail.cpp +++ b/src/dialogs/dialogdetail.cpp @@ -122,7 +122,7 @@ void DialogDetail::NewItem(qint64 id, const Tool::Tools &typeTool, const Draw::D } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } name = point.name(); break; @@ -136,7 +136,7 @@ void DialogDetail::NewItem(qint64 id, const Tool::Tools &typeTool, const Draw::D } else { - arc = data->GetModelingArc(id); + arc = data->GetArcModeling(id); } name = arc.name(); break; @@ -150,7 +150,7 @@ void DialogDetail::NewItem(qint64 id, const Tool::Tools &typeTool, const Draw::D } else { - spl = data->GetModelingSpline(id); + spl = data->GetSplineModeling(id); } name = spl.GetName(); break; @@ -164,7 +164,7 @@ void DialogDetail::NewItem(qint64 id, const Tool::Tools &typeTool, const Draw::D } else { - splPath = data->GetModelingSplinePath(id); + splPath = data->GetSplinePathModeling(id); } name = splPath.name(); break; diff --git a/dialogs/dialogdetail.h b/src/dialogs/dialogdetail.h similarity index 52% rename from dialogs/dialogdetail.h rename to src/dialogs/dialogdetail.h index e4024f9f2..3253422cd 100644 --- a/dialogs/dialogdetail.h +++ b/src/dialogs/dialogdetail.h @@ -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); }; diff --git a/dialogs/dialogdetail.ui b/src/dialogs/dialogdetail.ui similarity index 100% rename from dialogs/dialogdetail.ui rename to src/dialogs/dialogdetail.ui diff --git a/dialogs/dialogendline.cpp b/src/dialogs/dialogendline.cpp similarity index 99% rename from dialogs/dialogendline.cpp rename to src/dialogs/dialogendline.cpp index 550ea4e0e..809dd4456 100644 --- a/dialogs/dialogendline.cpp +++ b/src/dialogs/dialogendline.cpp @@ -115,7 +115,7 @@ void DialogEndLine::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } ChangeCurrentText(ui->comboBoxBasePoint, point.name()); emit ToolTip(""); diff --git a/dialogs/dialogendline.h b/src/dialogs/dialogendline.h similarity index 56% rename from dialogs/dialogendline.h rename to src/dialogs/dialogendline.h index 0dfd06401..394ad7876 100644 --- a/dialogs/dialogendline.h +++ b/src/dialogs/dialogendline.h @@ -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; }; diff --git a/dialogs/dialogendline.ui b/src/dialogs/dialogendline.ui similarity index 100% rename from dialogs/dialogendline.ui rename to src/dialogs/dialogendline.ui diff --git a/dialogs/dialogheight.cpp b/src/dialogs/dialogheight.cpp similarity index 98% rename from dialogs/dialogheight.cpp rename to src/dialogs/dialogheight.cpp index 3ce7fb730..9c3bfb8e7 100644 --- a/dialogs/dialogheight.cpp +++ b/src/dialogs/dialogheight.cpp @@ -109,7 +109,7 @@ void DialogHeight::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } switch (number) { diff --git a/dialogs/dialogheight.h b/src/dialogs/dialogheight.h similarity index 55% rename from dialogs/dialogheight.h rename to src/dialogs/dialogheight.h index 186af6873..dfa360a9b 100644 --- a/dialogs/dialogheight.h +++ b/src/dialogs/dialogheight.h @@ -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; }; diff --git a/dialogs/dialogheight.ui b/src/dialogs/dialogheight.ui similarity index 100% rename from dialogs/dialogheight.ui rename to src/dialogs/dialogheight.ui diff --git a/dialogs/dialoghistory.cpp b/src/dialogs/dialoghistory.cpp similarity index 100% rename from dialogs/dialoghistory.cpp rename to src/dialogs/dialoghistory.cpp diff --git a/dialogs/dialoghistory.h b/src/dialogs/dialoghistory.h similarity index 57% rename from dialogs/dialoghistory.h rename to src/dialogs/dialoghistory.h index 692f265c3..120fff0ee 100644 --- a/dialogs/dialoghistory.h +++ b/src/dialogs/dialoghistory.h @@ -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(); }; diff --git a/dialogs/dialoghistory.ui b/src/dialogs/dialoghistory.ui similarity index 100% rename from dialogs/dialoghistory.ui rename to src/dialogs/dialoghistory.ui diff --git a/dialogs/dialogincrements.cpp b/src/dialogs/dialogincrements.cpp similarity index 99% rename from dialogs/dialogincrements.cpp rename to src/dialogs/dialogincrements.cpp index a50fd47dc..f22ac2614 100644 --- a/dialogs/dialogincrements.cpp +++ b/src/dialogs/dialogincrements.cpp @@ -67,14 +67,14 @@ DialogIncrements::DialogIncrements(VContainer *data, VDomDocument *doc, QWidget void DialogIncrements::FillStandartTable() { - const QHash *standartTable = data->DataStandartTable(); + const QHash *standartTable = data->DataStandartTable(); qint32 currentRow = -1; - QHashIterator i(*standartTable); + QHashIterator 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())); diff --git a/dialogs/dialogincrements.h b/src/dialogs/dialogincrements.h similarity index 53% rename from dialogs/dialogincrements.h rename to src/dialogs/dialogincrements.h index 58fa46611..d5c1e895e 100644 --- a/dialogs/dialogincrements.h +++ b/src/dialogs/dialogincrements.h @@ -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); }; diff --git a/dialogs/dialogincrements.ui b/src/dialogs/dialogincrements.ui similarity index 100% rename from dialogs/dialogincrements.ui rename to src/dialogs/dialogincrements.ui diff --git a/dialogs/dialogline.cpp b/src/dialogs/dialogline.cpp similarity index 98% rename from dialogs/dialogline.cpp rename to src/dialogs/dialogline.cpp index f14c311d8..8a829db8a 100644 --- a/dialogs/dialogline.cpp +++ b/src/dialogs/dialogline.cpp @@ -105,7 +105,7 @@ void DialogLine::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } if (number == 0) { diff --git a/dialogs/dialogline.h b/src/dialogs/dialogline.h similarity index 62% rename from dialogs/dialogline.h rename to src/dialogs/dialogline.h index d0e3c9d1c..74194b6fd 100644 --- a/dialogs/dialogline.h +++ b/src/dialogs/dialogline.h @@ -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; }; diff --git a/dialogs/dialogline.ui b/src/dialogs/dialogline.ui similarity index 100% rename from dialogs/dialogline.ui rename to src/dialogs/dialogline.ui diff --git a/dialogs/dialoglineintersect.cpp b/src/dialogs/dialoglineintersect.cpp similarity index 99% rename from dialogs/dialoglineintersect.cpp rename to src/dialogs/dialoglineintersect.cpp index 29ac3375f..2c291b9e4 100644 --- a/dialogs/dialoglineintersect.cpp +++ b/src/dialogs/dialoglineintersect.cpp @@ -80,7 +80,7 @@ void DialogLineIntersect::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } if (number == 0) { diff --git a/dialogs/dialoglineintersect.h b/src/dialogs/dialoglineintersect.h similarity index 52% rename from dialogs/dialoglineintersect.h rename to src/dialogs/dialoglineintersect.h index ff3183c3c..8fbbb410b 100644 --- a/dialogs/dialoglineintersect.h +++ b/src/dialogs/dialoglineintersect.h @@ -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(); }; diff --git a/dialogs/dialoglineintersect.ui b/src/dialogs/dialoglineintersect.ui similarity index 100% rename from dialogs/dialoglineintersect.ui rename to src/dialogs/dialoglineintersect.ui diff --git a/dialogs/dialognormal.cpp b/src/dialogs/dialognormal.cpp similarity index 99% rename from dialogs/dialognormal.cpp rename to src/dialogs/dialognormal.cpp index 4cf6e1d21..289459d98 100644 --- a/dialogs/dialognormal.cpp +++ b/src/dialogs/dialognormal.cpp @@ -121,7 +121,7 @@ void DialogNormal::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } if (number == 0) { diff --git a/dialogs/dialognormal.h b/src/dialogs/dialognormal.h similarity index 54% rename from dialogs/dialognormal.h rename to src/dialogs/dialognormal.h index b2a7329f5..4d8e97d56 100644 --- a/dialogs/dialognormal.h +++ b/src/dialogs/dialognormal.h @@ -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; }; diff --git a/dialogs/dialognormal.ui b/src/dialogs/dialognormal.ui similarity index 100% rename from dialogs/dialognormal.ui rename to src/dialogs/dialognormal.ui diff --git a/dialogs/dialogpointofcontact.cpp b/src/dialogs/dialogpointofcontact.cpp similarity index 99% rename from dialogs/dialogpointofcontact.cpp rename to src/dialogs/dialogpointofcontact.cpp index 115379648..66443ed3f 100644 --- a/dialogs/dialogpointofcontact.cpp +++ b/src/dialogs/dialogpointofcontact.cpp @@ -98,7 +98,7 @@ void DialogPointOfContact::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } if (number == 0) { diff --git a/dialogs/dialogpointofcontact.h b/src/dialogs/dialogpointofcontact.h similarity index 55% rename from dialogs/dialogpointofcontact.h rename to src/dialogs/dialogpointofcontact.h index 416e5adcf..c8076c74a 100644 --- a/dialogs/dialogpointofcontact.h +++ b/src/dialogs/dialogpointofcontact.h @@ -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; }; diff --git a/dialogs/dialogpointofcontact.ui b/src/dialogs/dialogpointofcontact.ui similarity index 100% rename from dialogs/dialogpointofcontact.ui rename to src/dialogs/dialogpointofcontact.ui diff --git a/dialogs/dialogpointofintersection.cpp b/src/dialogs/dialogpointofintersection.cpp similarity index 98% rename from dialogs/dialogpointofintersection.cpp rename to src/dialogs/dialogpointofintersection.cpp index abcd9a7da..391912f67 100644 --- a/dialogs/dialogpointofintersection.cpp +++ b/src/dialogs/dialogpointofintersection.cpp @@ -83,7 +83,7 @@ void DialogPointOfIntersection::ChoosedObject(qint64 id, const Scene::Scenes &ty } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } if (number == 0) { diff --git a/dialogs/dialogpointofintersection.h b/src/dialogs/dialogpointofintersection.h similarity index 60% rename from dialogs/dialogpointofintersection.h rename to src/dialogs/dialogpointofintersection.h index 9ea655f58..3c4041153 100644 --- a/dialogs/dialogpointofintersection.h +++ b/src/dialogs/dialogpointofintersection.h @@ -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; }; diff --git a/dialogs/dialogpointofintersection.ui b/src/dialogs/dialogpointofintersection.ui similarity index 100% rename from dialogs/dialogpointofintersection.ui rename to src/dialogs/dialogpointofintersection.ui diff --git a/dialogs/dialogs.h b/src/dialogs/dialogs.h similarity index 100% rename from dialogs/dialogs.h rename to src/dialogs/dialogs.h diff --git a/src/dialogs/dialogs.pri b/src/dialogs/dialogs.pri new file mode 100644 index 000000000..e6898dd39 --- /dev/null +++ b/src/dialogs/dialogs.pri @@ -0,0 +1,62 @@ +HEADERS += \ + src/dialogs/dialogtriangle.h \ + src/dialogs/dialogtool.h \ + src/dialogs/dialogsplinepath.h \ + src/dialogs/dialogspline.h \ + src/dialogs/dialogsinglepoint.h \ + src/dialogs/dialogshoulderpoint.h \ + src/dialogs/dialogs.h \ + src/dialogs/dialogpointofintersection.h \ + src/dialogs/dialogpointofcontact.h \ + src/dialogs/dialognormal.h \ + src/dialogs/dialoglineintersect.h \ + src/dialogs/dialogline.h \ + src/dialogs/dialogincrements.h \ + src/dialogs/dialoghistory.h \ + src/dialogs/dialogheight.h \ + src/dialogs/dialogendline.h \ + src/dialogs/dialogdetail.h \ + src/dialogs/dialogbisector.h \ + src/dialogs/dialogarc.h \ + src/dialogs/dialogalongline.h + +SOURCES += \ + src/dialogs/dialogtriangle.cpp \ + src/dialogs/dialogtool.cpp \ + src/dialogs/dialogsplinepath.cpp \ + src/dialogs/dialogspline.cpp \ + src/dialogs/dialogsinglepoint.cpp \ + src/dialogs/dialogshoulderpoint.cpp \ + src/dialogs/dialogpointofintersection.cpp \ + src/dialogs/dialogpointofcontact.cpp \ + src/dialogs/dialognormal.cpp \ + src/dialogs/dialoglineintersect.cpp \ + src/dialogs/dialogline.cpp \ + src/dialogs/dialogincrements.cpp \ + src/dialogs/dialoghistory.cpp \ + src/dialogs/dialogheight.cpp \ + src/dialogs/dialogendline.cpp \ + src/dialogs/dialogdetail.cpp \ + src/dialogs/dialogbisector.cpp \ + src/dialogs/dialogarc.cpp \ + src/dialogs/dialogalongline.cpp + +FORMS += \ + src/dialogs/dialogtriangle.ui \ + src/dialogs/dialogsplinepath.ui \ + src/dialogs/dialogspline.ui \ + src/dialogs/dialogsinglepoint.ui \ + src/dialogs/dialogshoulderpoint.ui \ + src/dialogs/dialogpointofintersection.ui \ + src/dialogs/dialogpointofcontact.ui \ + src/dialogs/dialognormal.ui \ + src/dialogs/dialoglineintersect.ui \ + src/dialogs/dialogline.ui \ + src/dialogs/dialogincrements.ui \ + src/dialogs/dialoghistory.ui \ + src/dialogs/dialogheight.ui \ + src/dialogs/dialogendline.ui \ + src/dialogs/dialogdetail.ui \ + src/dialogs/dialogbisector.ui \ + src/dialogs/dialogarc.ui \ + src/dialogs/dialogalongline.ui diff --git a/dialogs/dialogshoulderpoint.cpp b/src/dialogs/dialogshoulderpoint.cpp similarity index 99% rename from dialogs/dialogshoulderpoint.cpp rename to src/dialogs/dialogshoulderpoint.cpp index 92afa2a92..a182dd88e 100644 --- a/dialogs/dialogshoulderpoint.cpp +++ b/src/dialogs/dialogshoulderpoint.cpp @@ -106,7 +106,7 @@ void DialogShoulderPoint::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } if (number == 0) { diff --git a/dialogs/dialogshoulderpoint.h b/src/dialogs/dialogshoulderpoint.h similarity index 54% rename from dialogs/dialogshoulderpoint.h rename to src/dialogs/dialogshoulderpoint.h index b9c4df8c2..ce01f3235 100644 --- a/dialogs/dialogshoulderpoint.h +++ b/src/dialogs/dialogshoulderpoint.h @@ -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; }; diff --git a/dialogs/dialogshoulderpoint.ui b/src/dialogs/dialogshoulderpoint.ui similarity index 100% rename from dialogs/dialogshoulderpoint.ui rename to src/dialogs/dialogshoulderpoint.ui diff --git a/dialogs/dialogsinglepoint.cpp b/src/dialogs/dialogsinglepoint.cpp similarity index 100% rename from dialogs/dialogsinglepoint.cpp rename to src/dialogs/dialogsinglepoint.cpp diff --git a/dialogs/dialogsinglepoint.h b/src/dialogs/dialogsinglepoint.h similarity index 67% rename from dialogs/dialogsinglepoint.h rename to src/dialogs/dialogsinglepoint.h index 02c456bd4..ac667adc5 100644 --- a/dialogs/dialogsinglepoint.h +++ b/src/dialogs/dialogsinglepoint.h @@ -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; }; diff --git a/dialogs/dialogsinglepoint.ui b/src/dialogs/dialogsinglepoint.ui similarity index 100% rename from dialogs/dialogsinglepoint.ui rename to src/dialogs/dialogsinglepoint.ui diff --git a/dialogs/dialogspline.cpp b/src/dialogs/dialogspline.cpp similarity index 96% rename from dialogs/dialogspline.cpp rename to src/dialogs/dialogspline.cpp index 9d478f9ea..9e8849ae4 100644 --- a/dialogs/dialogspline.cpp +++ b/src/dialogs/dialogspline.cpp @@ -79,7 +79,7 @@ void DialogSpline::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } if (number == 0) { @@ -111,8 +111,8 @@ void DialogSpline::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - p1 = data->GetModelingPoint(p1Id).toQPointF(); - p4 = data->GetModelingPoint(id).toQPointF(); + p1 = data->GetPointModeling(p1Id).toQPointF(); + p4 = data->GetPointModeling(id).toQPointF(); } ui->spinBoxAngle1->setValue(static_cast(QLineF(p1, p4).angle())); ui->spinBoxAngle2->setValue(static_cast(QLineF(p4, p1).angle())); diff --git a/src/dialogs/dialogspline.h b/src/dialogs/dialogspline.h new file mode 100644 index 000000000..1df76c69e --- /dev/null +++ b/src/dialogs/dialogspline.h @@ -0,0 +1,175 @@ +/************************************************************************ + ** + ** @file dialogspline.h + ** @author Roman Telezhinsky + ** @date November 15, 2013 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef DIALOGSPLINE_H +#define DIALOGSPLINE_H + +#include "dialogtool.h" + +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; + /** + * @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; +}; + +#endif // DIALOGSPLINE_H diff --git a/dialogs/dialogspline.ui b/src/dialogs/dialogspline.ui similarity index 100% rename from dialogs/dialogspline.ui rename to src/dialogs/dialogspline.ui diff --git a/dialogs/dialogsplinepath.cpp b/src/dialogs/dialogsplinepath.cpp similarity index 99% rename from dialogs/dialogsplinepath.cpp rename to src/dialogs/dialogsplinepath.cpp index 1446f4f8b..f5984ed0c 100644 --- a/dialogs/dialogsplinepath.cpp +++ b/src/dialogs/dialogsplinepath.cpp @@ -173,7 +173,7 @@ void DialogSplinePath::NewItem(qint64 id, qreal kAsm1, qreal angle, qreal kAsm2) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } QListWidgetItem *item = new QListWidgetItem(point.name()); item->setFont(QFont("Times", 12, QFont::Bold)); diff --git a/dialogs/dialogsplinepath.h b/src/dialogs/dialogsplinepath.h similarity index 53% rename from dialogs/dialogsplinepath.h rename to src/dialogs/dialogsplinepath.h index 1ea4d587b..9cf20e16c 100644 --- a/dialogs/dialogsplinepath.h +++ b/src/dialogs/dialogsplinepath.h @@ -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); }; diff --git a/dialogs/dialogsplinepath.ui b/src/dialogs/dialogsplinepath.ui similarity index 100% rename from dialogs/dialogsplinepath.ui rename to src/dialogs/dialogsplinepath.ui diff --git a/dialogs/dialogtool.cpp b/src/dialogs/dialogtool.cpp similarity index 99% rename from dialogs/dialogtool.cpp rename to src/dialogs/dialogtool.cpp index d394b1967..6484785c1 100644 --- a/dialogs/dialogtool.cpp +++ b/src/dialogs/dialogtool.cpp @@ -99,7 +99,7 @@ void DialogTool::FillComboBoxPoints(QComboBox *box, const qint64 &id) const { if (det[i].getId() != id) { - VPointF point = data->GetModelingPoint(det[i].getId()); + VPointF point = data->GetPointModeling(det[i].getId()); box->addItem(point.name(), det[i].getId()); } } @@ -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); diff --git a/src/dialogs/dialogtool.h b/src/dialogs/dialogtool.h new file mode 100644 index 000000000..074570314 --- /dev/null +++ b/src/dialogs/dialogtool.h @@ -0,0 +1,356 @@ +/************************************************************************ + ** + ** @file dialogtool.h + ** @author Roman Telezhinsky + ** @date November 15, 2013 + ** + ** @brief + ** @copyright + ** This source code is part of the Valentine project, a pattern making + ** program, whose allow create and modeling patterns of clothing. + ** Copyright (C) 2013 Valentina project + ** All Rights Reserved. + ** + ** Valentina is free software: you can redistribute it and/or modify + ** it under the terms of the GNU General Public License as published by + ** the Free Software Foundation, either version 3 of the License, or + ** (at your option) any later version. + ** + ** Valentina is distributed in the hope that it will be useful, + ** but WITHOUT ANY WARRANTY; without even the implied warranty of + ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ** GNU General Public License for more details. + ** + ** You should have received a copy of the GNU General Public License + ** along with Valentina. If not, see . + ** + *************************************************************************/ + +#ifndef DIALOGTOOL_H +#define DIALOGTOOL_H + +#include +#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 + /** + * @brief ShowVariable show variables in list + * @param var container with variables + */ + void ShowVariable(const QHash *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; +}; + +#endif // DIALOGTOOL_H diff --git a/dialogs/dialogtriangle.cpp b/src/dialogs/dialogtriangle.cpp similarity index 99% rename from dialogs/dialogtriangle.cpp rename to src/dialogs/dialogtriangle.cpp index 49d607e38..1580251ae 100644 --- a/dialogs/dialogtriangle.cpp +++ b/src/dialogs/dialogtriangle.cpp @@ -79,7 +79,7 @@ void DialogTriangle::ChoosedObject(qint64 id, const Scene::Scenes &type) } else { - point = data->GetModelingPoint(id); + point = data->GetPointModeling(id); } switch (number) { diff --git a/dialogs/dialogtriangle.h b/src/dialogs/dialogtriangle.h similarity index 54% rename from dialogs/dialogtriangle.h rename to src/dialogs/dialogtriangle.h index a3aa2393d..68f9cbbcb 100644 --- a/dialogs/dialogtriangle.h +++ b/src/dialogs/dialogtriangle.h @@ -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; }; diff --git a/dialogs/dialogtriangle.ui b/src/dialogs/dialogtriangle.ui similarity index 100% rename from dialogs/dialogtriangle.ui rename to src/dialogs/dialogtriangle.ui diff --git a/src/exception/exception.pri b/src/exception/exception.pri new file mode 100644 index 000000000..3e0166be0 --- /dev/null +++ b/src/exception/exception.pri @@ -0,0 +1,17 @@ +HEADERS += \ + src/exception/vexceptionwrongparameterid.h \ + src/exception/vexceptionuniqueid.h \ + src/exception/vexceptionobjecterror.h \ + src/exception/vexceptionemptyparameter.h \ + src/exception/vexceptionconversionerror.h \ + src/exception/vexceptionbadid.h \ + src/exception/vexception.h + +SOURCES += \ + src/exception/vexceptionwrongparameterid.cpp \ + src/exception/vexceptionuniqueid.cpp \ + src/exception/vexceptionobjecterror.cpp \ + src/exception/vexceptionemptyparameter.cpp \ + src/exception/vexceptionconversionerror.cpp \ + src/exception/vexceptionbadid.cpp \ + src/exception/vexception.cpp diff --git a/exception/vexception.cpp b/src/exception/vexception.cpp similarity index 100% rename from exception/vexception.cpp rename to src/exception/vexception.cpp diff --git a/exception/vexception.h b/src/exception/vexception.h similarity index 66% rename from exception/vexception.h rename to src/exception/vexception.h index 426a2c4fb..50be5067e 100644 --- a/exception/vexception.h +++ b/src/exception/vexception.h @@ -32,18 +32,51 @@ #include +/** + * @brief The VException class parent for all exception. Could be use for abstract exception + */ class VException : public QException { public: + /** + * @brief VException constructor exception + * @param what string with error + */ VException(const QString &what); + /** + * @brief VException copy constructor + * @param e exception + */ VException(const VException &e):what(e.What()){} virtual ~VException() Q_DECL_NOEXCEPT_EXPR(true){} + /** + * @brief raise method raise for exception + */ inline void raise() const { throw *this; } + /** + * @brief clone clone exception + * @return new exception + */ inline VException *clone() const { return new VException(*this); } + /** + * @brief ErrorMessage return main error message + * @return error message + */ virtual QString ErrorMessage() const; + /** + * @brief DetailedInformation return detailed information about error + * @return detailed information + */ virtual QString DetailedInformation() const { return QString(); } + /** + * @brief What return string with error + * @return string with error + */ inline QString What() const {return what;} protected: + /** + * @brief what string with error + */ QString what; }; diff --git a/exception/vexceptionbadid.cpp b/src/exception/vexceptionbadid.cpp similarity index 100% rename from exception/vexceptionbadid.cpp rename to src/exception/vexceptionbadid.cpp diff --git a/exception/vexceptionbadid.h b/src/exception/vexceptionbadid.h similarity index 68% rename from exception/vexceptionbadid.h rename to src/exception/vexceptionbadid.h index d15c695e9..7facb2bc6 100644 --- a/exception/vexceptionbadid.h +++ b/src/exception/vexceptionbadid.h @@ -31,21 +31,56 @@ #include "vexception.h" +/** + * @brief The VExceptionBadId class for exception bad id + */ class VExceptionBadId : public VException { public: + /** + * @brief VExceptionBadId exception bad id + * @param what string with error + * @param id id + */ VExceptionBadId(const QString &what, const qint64 &id) :VException(what), id(id), key(QString()){} + /** + * @brief VExceptionBadId exception bad id + * @param what string with error + * @param key string key + */ VExceptionBadId(const QString &what, const QString &key) :VException(what), id(0), key(key){} + /** + * @brief VExceptionBadId copy constructor + * @param e exception + */ VExceptionBadId(const VExceptionBadId &e) :VException(e), id(e.BadId()), key(e.BadKey()){} virtual ~VExceptionBadId() Q_DECL_NOEXCEPT_EXPR(true){} + /** + * @brief ErrorMessage return main error message + * @return main error message + */ virtual QString ErrorMessage() const; + /** + * @brief BadId return bad id + * @return id + */ inline qint64 BadId() const {return id; } + /** + * @brief BadKey return bad key + * @return key + */ inline QString BadKey() const {return key; } protected: + /** + * @brief id id + */ qint64 id; + /** + * @brief key key + */ QString key; }; diff --git a/exception/vexceptionconversionerror.cpp b/src/exception/vexceptionconversionerror.cpp similarity index 100% rename from exception/vexceptionconversionerror.cpp rename to src/exception/vexceptionconversionerror.cpp diff --git a/exception/vexceptionconversionerror.h b/src/exception/vexceptionconversionerror.h similarity index 71% rename from exception/vexceptionconversionerror.h rename to src/exception/vexceptionconversionerror.h index a864fc98e..6af726bf1 100644 --- a/exception/vexceptionconversionerror.h +++ b/src/exception/vexceptionconversionerror.h @@ -31,16 +31,39 @@ #include "vexception.h" +/** + * @brief The VExceptionConversionError class for exception of conversion error + */ class VExceptionConversionError : public VException { public: + /** + * @brief VExceptionConversionError exception conversion error + * @param what string with error + * @param str string, where happend error + */ VExceptionConversionError(const QString &what, const QString &str); + /** + * @brief VExceptionConversionError copy constructor + * @param e exception + */ VExceptionConversionError(const VExceptionConversionError &e) :VException(e), str(e.String()){} virtual ~VExceptionConversionError() Q_DECL_NOEXCEPT_EXPR(true) {} + /** + * @brief ErrorMessage return main error message + * @return main error message + */ virtual QString ErrorMessage() const; + /** + * @brief String return string, where happend error + * @return string + */ inline QString String() const {return str;} protected: + /** + * @brief str string, where happend error + */ QString str; }; diff --git a/exception/vexceptionemptyparameter.cpp b/src/exception/vexceptionemptyparameter.cpp similarity index 100% rename from exception/vexceptionemptyparameter.cpp rename to src/exception/vexceptionemptyparameter.cpp diff --git a/exception/vexceptionemptyparameter.h b/src/exception/vexceptionemptyparameter.h similarity index 63% rename from exception/vexceptionemptyparameter.h rename to src/exception/vexceptionemptyparameter.h index e877f3220..042c89e40 100644 --- a/exception/vexceptionemptyparameter.h +++ b/src/exception/vexceptionemptyparameter.h @@ -31,24 +31,73 @@ #include "vexception.h" +/** + * @brief The VExceptionEmptyParameter class for exception empty parameter + */ class VExceptionEmptyParameter : public VException { public: + /** + * @brief VExceptionEmptyParameter exception empty parameter + * @param what string with error + * @param name name of attribute where error + * @param domElement dom element + */ VExceptionEmptyParameter(const QString &what, const QString &name, const QDomElement &domElement); + /** + * @brief VExceptionEmptyParameter copy constructor + * @param e exception + */ 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 main error message + * @return main error message + */ virtual QString ErrorMessage() const; + /** + * @brief DetailedInformation return detailed information about error + * @return detailed information + */ virtual QString DetailedInformation() const; + /** + * @brief Name return name of attribute where error + * @return name + */ inline QString Name() const {return name;} + /** + * @brief TagText return tag text + * @return tag text + */ inline QString TagText() const {return tagText;} + /** + * @brief TagName return tag name + * @return tag name + */ inline QString TagName() const {return tagName;} + /** + * @brief LineNumber return line number of tag + * @return line number + */ inline qint32 LineNumber() const {return lineNumber;} protected: + /** + * @brief name name attribute + */ QString name; + /** + * @brief tagText tag text + */ QString tagText; + /** + * @brief tagName tag name + */ QString tagName; + /** + * @brief lineNumber line number + */ qint32 lineNumber; }; diff --git a/exception/vexceptionobjecterror.cpp b/src/exception/vexceptionobjecterror.cpp similarity index 100% rename from exception/vexceptionobjecterror.cpp rename to src/exception/vexceptionobjecterror.cpp diff --git a/exception/vexceptionobjecterror.h b/src/exception/vexceptionobjecterror.h similarity index 62% rename from exception/vexceptionobjecterror.h rename to src/exception/vexceptionobjecterror.h index c0b3fbaf7..d1315596e 100644 --- a/exception/vexceptionobjecterror.h +++ b/src/exception/vexceptionobjecterror.h @@ -31,25 +31,77 @@ #include "vexception.h" +/** + * @brief The VExceptionObjectError class for exception object error + */ class VExceptionObjectError : public VException { public: + /** + * @brief VExceptionObjectError exception object error + * @param what string with error + * @param domElement dom element + */ VExceptionObjectError(const QString &what, const QDomElement &domElement); + /** + * @brief VExceptionObjectError copy constructor + * @param e exception + */ 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 main error message + * @return main error message + */ virtual QString ErrorMessage() const; + /** + * @brief DetailedInformation return detailed information about error + * @return detailed information + */ virtual QString DetailedInformation() const; + /** + * @brief TagText return tag text + * @return tag text + */ inline QString TagText() const {return tagText;} + /** + * @brief TagName return tag name + * @return tag name + */ inline QString TagName() const {return tagName;} + /** + * @brief LineNumber return line number in file + * @return line number + */ inline qint32 LineNumber() const {return lineNumber;} + /** + * @brief AddMoreInformation add more information for error + * @param info information + */ void AddMoreInformation(const QString &info); + /** + * @brief MoreInformation return more information for error + * @return information + */ inline QString MoreInformation() const {return moreInfo;} protected: + /** + * @brief tagText tag text + */ QString tagText; + /** + * @brief tagName tag name + */ QString tagName; + /** + * @brief lineNumber line number + */ qint32 lineNumber; + /** + * @brief moreInfo more information about error + */ QString moreInfo; }; diff --git a/exception/vexceptionuniqueid.cpp b/src/exception/vexceptionuniqueid.cpp similarity index 100% rename from exception/vexceptionuniqueid.cpp rename to src/exception/vexceptionuniqueid.cpp diff --git a/exception/vexceptionuniqueid.h b/src/exception/vexceptionuniqueid.h similarity index 66% rename from exception/vexceptionuniqueid.h rename to src/exception/vexceptionuniqueid.h index 2ca8b1be2..a1bb053ce 100644 --- a/exception/vexceptionuniqueid.h +++ b/src/exception/vexceptionuniqueid.h @@ -31,21 +31,62 @@ #include "vexception.h" +/** + * @brief The VExceptionUniqueId class for exception unique id + */ class VExceptionUniqueId : public VException { public: + /** + * @brief VExceptionUniqueId exception unique id + * @param what string with error + * @param domElement dom element + */ VExceptionUniqueId(const QString &what, const QDomElement &domElement); + /** + * @brief VExceptionUniqueId copy constructor + * @param e exception + */ 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 main error message + * @return main error message + */ virtual QString ErrorMessage() const; + /** + * @brief DetailedInformation return detailed information about error + * @return detailed information + */ virtual QString DetailedInformation() const; + /** + * @brief TagText return tag text + * @return tag text + */ inline QString TagText() const {return tagText;} + /** + * @brief TagName return tag name + * @return tag name + */ inline QString TagName() const {return tagName;} + /** + * @brief LineNumber return line number in file + * @return line number + */ inline qint32 LineNumber() const {return lineNumber;} protected: + /** + * @brief tagText tag text + */ QString tagText; + /** + * @brief tagName tag name + */ QString tagName; + /** + * @brief lineNumber line number + */ qint32 lineNumber; }; diff --git a/exception/vexceptionwrongparameterid.cpp b/src/exception/vexceptionwrongparameterid.cpp similarity index 100% rename from exception/vexceptionwrongparameterid.cpp rename to src/exception/vexceptionwrongparameterid.cpp diff --git a/exception/vexceptionwrongparameterid.h b/src/exception/vexceptionwrongparameterid.h similarity index 65% rename from exception/vexceptionwrongparameterid.h rename to src/exception/vexceptionwrongparameterid.h index ab5d2f2ee..0f9d55383 100644 --- a/exception/vexceptionwrongparameterid.h +++ b/src/exception/vexceptionwrongparameterid.h @@ -31,21 +31,62 @@ #include "vexception.h" +/** + * @brief The VExceptionWrongParameterId class for exception wrong parameter id + */ class VExceptionWrongParameterId : public VException { public: + /** + * @brief VExceptionWrongParameterId exception wrong parameter id + * @param what string with error + * @param domElement som element + */ VExceptionWrongParameterId(const QString &what, const QDomElement &domElement); + /** + * @brief VExceptionWrongParameterId copy constructor + * @param e exception + */ 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 main error message + * @return main error message + */ virtual QString ErrorMessage() const; + /** + * @brief DetailedInformation return detailed information about error + * @return detailed information + */ virtual QString DetailedInformation() const; + /** + * @brief TagText return tag text + * @return tag text + */ inline QString TagText() const {return tagText;} + /** + * @brief TagName return tag name + * @return tag name + */ inline QString TagName() const {return tagName;} + /** + * @brief LineNumber return line number in file + * @return line number + */ inline qint32 LineNumber() const {return lineNumber;} protected: + /** + * @brief tagText tag text + */ QString tagText; + /** + * @brief tagName tag name + */ QString tagName; + /** + * @brief lineNumber line number + */ qint32 lineNumber; }; diff --git a/src/geometry/geometry.pri b/src/geometry/geometry.pri new file mode 100644 index 000000000..e04865bed --- /dev/null +++ b/src/geometry/geometry.pri @@ -0,0 +1,15 @@ +HEADERS += \ + src/geometry/vsplinepoint.h \ + src/geometry/vsplinepath.h \ + src/geometry/vspline.h \ + src/geometry/vnodedetail.h \ + src/geometry/vdetail.h \ + src/geometry/varc.h + +SOURCES += \ + src/geometry/vsplinepoint.cpp \ + src/geometry/vsplinepath.cpp \ + src/geometry/vspline.cpp \ + src/geometry/vnodedetail.cpp \ + src/geometry/vdetail.cpp \ + src/geometry/varc.cpp diff --git a/geometry/varc.cpp b/src/geometry/varc.cpp similarity index 100% rename from geometry/varc.cpp rename to src/geometry/varc.cpp diff --git a/geometry/varc.h b/src/geometry/varc.h similarity index 72% rename from geometry/varc.h rename to src/geometry/varc.h index 5939e7bf4..caab908cf 100644 --- a/geometry/varc.h +++ b/src/geometry/varc.h @@ -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 *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 GetDataPoints() const; /** * @brief GetPath будує шлях по даній дузі. * @return повертає шлях. */ QPainterPath GetPath() const; + /** + * @brief AngleArc + * @return + */ qreal AngleArc() const; + /** + * @brief NumberSplOfArc + * @return + */ qint32 NumberSplOfArc () const; + /** + * @brief GetPoints + * @return + */ QVector GetPoints () const; + /** + * @brief SplOfArc + * @param number + * @return + */ QVector 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 points; + /** + * @brief mode + */ Draw::Draws mode; + /** + * @brief idObject + */ qint64 idObject; + /** + * @brief _name + */ QString _name; }; diff --git a/geometry/vdetail.cpp b/src/geometry/vdetail.cpp similarity index 100% rename from geometry/vdetail.cpp rename to src/geometry/vdetail.cpp diff --git a/geometry/vdetail.h b/src/geometry/vdetail.h similarity index 61% rename from geometry/vdetail.h rename to src/geometry/vdetail.h index 2b366c547..f80289efa 100644 --- a/geometry/vdetail.h +++ b/src/geometry/vdetail.h @@ -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 &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 getNodes() const {return nodes;} + /** + * @brief setNodes + * @param value + */ inline void setNodes(const QVector &value) {nodes = value;} private: + /** + * @brief nodes + */ QVector 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; }; diff --git a/geometry/vnodedetail.cpp b/src/geometry/vnodedetail.cpp similarity index 100% rename from geometry/vnodedetail.cpp rename to src/geometry/vnodedetail.cpp diff --git a/geometry/vnodedetail.h b/src/geometry/vnodedetail.h similarity index 63% rename from geometry/vnodedetail.h rename to src/geometry/vnodedetail.h index 799a355aa..14e3dbc31 100644 --- a/geometry/vnodedetail.h +++ b/src/geometry/vnodedetail.h @@ -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; }; diff --git a/geometry/vspline.cpp b/src/geometry/vspline.cpp similarity index 100% rename from geometry/vspline.cpp rename to src/geometry/vspline.cpp diff --git a/geometry/vspline.h b/src/geometry/vspline.h similarity index 92% rename from geometry/vspline.h rename to src/geometry/vspline.h index 644ff709d..9d0db6340 100644 --- a/geometry/vspline.h +++ b/src/geometry/vspline.h @@ -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 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 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 points; + /** + * @brief mode + */ Draw::Draws mode; + /** + * @brief idObject + */ qint64 idObject; + /** + * @brief _name + */ QString _name; /** * @brief LengthBezier повертає дожину сплайну за його чотирьма точками. diff --git a/geometry/vsplinepath.cpp b/src/geometry/vsplinepath.cpp similarity index 100% rename from geometry/vsplinepath.cpp rename to src/geometry/vsplinepath.cpp diff --git a/geometry/vsplinepath.h b/src/geometry/vsplinepath.h similarity index 65% rename from geometry/vsplinepath.h rename to src/geometry/vsplinepath.h index 212bda56c..446c0d7e4 100644 --- a/geometry/vsplinepath.h +++ b/src/geometry/vsplinepath.h @@ -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 *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 GetPathPoints() const; + /** + * @brief GetSplinePath + * @return + */ inline QVector GetSplinePath() const {return path;} + /** + * @brief GetLength + * @return + */ qreal GetLength() const; + /** + * @brief GetDataPoints + * @return + */ inline QHash 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 *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 path; + /** + * @brief kCurve + */ qreal kCurve; + /** + * @brief mode + */ Draw::Draws mode; + /** + * @brief points + */ QHash points; + /** + * @brief idObject + */ qint64 idObject; + /** + * @brief _name + */ QString _name; }; diff --git a/geometry/vsplinepoint.cpp b/src/geometry/vsplinepoint.cpp similarity index 100% rename from geometry/vsplinepoint.cpp rename to src/geometry/vsplinepoint.cpp diff --git a/geometry/vsplinepoint.h b/src/geometry/vsplinepoint.h similarity index 91% rename from geometry/vsplinepoint.h rename to src/geometry/vsplinepoint.h index d6f6ef6d5..9d3bd4667 100644 --- a/geometry/vsplinepoint.h +++ b/src/geometry/vsplinepoint.h @@ -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: /** diff --git a/main.cpp b/src/main.cpp similarity index 100% rename from main.cpp rename to src/main.cpp diff --git a/mainwindow.cpp b/src/mainwindow.cpp similarity index 100% rename from mainwindow.cpp rename to src/mainwindow.cpp diff --git a/mainwindow.h b/src/mainwindow.h similarity index 56% rename from mainwindow.h rename to src/mainwindow.h index 2c0f2c47e..bdd4fb190 100644 --- a/mainwindow.h +++ b/src/mainwindow.h @@ -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 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; + /** + * @brief dialogLine + */ QSharedPointer dialogLine; + /** + * @brief dialogAlongLine + */ QSharedPointer dialogAlongLine; + /** + * @brief dialogShoulderPoint + */ QSharedPointer dialogShoulderPoint; + /** + * @brief dialogNormal + */ QSharedPointer dialogNormal; + /** + * @brief dialogBisector + */ QSharedPointer dialogBisector; + /** + * @brief dialogLineIntersect + */ QSharedPointer dialogLineIntersect; + /** + * @brief dialogSpline + */ QSharedPointer dialogSpline; + /** + * @brief dialogArc + */ QSharedPointer dialogArc; + /** + * @brief dialogSplinePath + */ QSharedPointer dialogSplinePath; + /** + * @brief dialogPointOfContact + */ QSharedPointer dialogPointOfContact; + /** + * @brief dialogDetail + */ QSharedPointer dialogDetail; + /** + * @brief dialogHeight + */ QSharedPointer dialogHeight; + /** + * @brief dialogTriangle + */ QSharedPointer dialogTriangle; + /** + * @brief dialogPointOfIntersection + */ QSharedPointer 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 + /** + * @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, Func closeDialogSlot); + /** + * @brief MinimumScrollBar + */ void MinimumScrollBar(); template + /** + * @brief AddToolToDetail + * @param tool + * @param id + * @param typeTool + * @param idDetail + */ void AddToolToDetail(T *tool, const qint64 &id, Tool::Tools typeTool, const qint64 &idDetail); template + /** + * @brief ClosedDialog + * @param dialog + * @param result + */ void ClosedDialog(QSharedPointer &dialog, int result); + /** + * @brief SafeSaveing + * @param fileName + * @return + */ bool SafeSaveing(const QString &fileName)const; + /** + * @brief AutoSavePattern + */ void AutoSavePattern(); }; diff --git a/mainwindow.ui b/src/mainwindow.ui similarity index 100% rename from mainwindow.ui rename to src/mainwindow.ui diff --git a/options.h b/src/options.h similarity index 93% rename from options.h rename to src/options.h index beccd32d3..6f86d23d2 100644 --- a/options.h +++ b/src/options.h @@ -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) } diff --git a/stable.cpp b/src/stable.cpp similarity index 100% rename from stable.cpp rename to src/stable.cpp diff --git a/stable.h b/src/stable.h similarity index 100% rename from stable.h rename to src/stable.h diff --git a/tablewindow.cpp b/src/tablewindow.cpp similarity index 100% rename from tablewindow.cpp rename to src/tablewindow.cpp diff --git a/tablewindow.h b/src/tablewindow.h similarity index 94% rename from tablewindow.h rename to src/tablewindow.h index 8d3ca8801..d82380015 100644 --- a/tablewindow.h +++ b/src/tablewindow.h @@ -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; }; diff --git a/tablewindow.ui b/src/tablewindow.ui similarity index 100% rename from tablewindow.ui rename to src/tablewindow.ui diff --git a/tools/drawTools/drawtools.h b/src/tools/drawTools/drawtools.h similarity index 100% rename from tools/drawTools/drawtools.h rename to src/tools/drawTools/drawtools.h diff --git a/tools/drawTools/vdrawtool.cpp b/src/tools/drawTools/vdrawtool.cpp similarity index 100% rename from tools/drawTools/vdrawtool.cpp rename to src/tools/drawTools/vdrawtool.cpp diff --git a/tools/drawTools/vdrawtool.h b/src/tools/drawTools/vdrawtool.h similarity index 78% rename from tools/drawTools/vdrawtool.h rename to src/tools/drawTools/vdrawtool.h index 86632645c..fc0f1bea9 100644 --- a/tools/drawTools/vdrawtool.h +++ b/src/tools/drawTools/vdrawtool.h @@ -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 + /** + * @brief ContextMenu + * @param dialog + * @param tool + * @param event + * @param showRemove + */ void ContextMenu(QSharedPointer &dialog, Tool *tool, QGraphicsSceneContextMenuEvent *event, bool showRemove = true) { @@ -118,6 +187,13 @@ protected: } } template + /** + * @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); diff --git a/tools/drawTools/vtoolalongline.cpp b/src/tools/drawTools/vtoolalongline.cpp similarity index 100% rename from tools/drawTools/vtoolalongline.cpp rename to src/tools/drawTools/vtoolalongline.cpp diff --git a/tools/drawTools/vtoolalongline.h b/src/tools/drawTools/vtoolalongline.h similarity index 65% rename from tools/drawTools/vtoolalongline.h rename to src/tools/drawTools/vtoolalongline.h index 797383e95..99dd29f6c 100644 --- a/tools/drawTools/vtoolalongline.h +++ b/src/tools/drawTools/vtoolalongline.h @@ -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 &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; }; diff --git a/tools/drawTools/vtoolarc.cpp b/src/tools/drawTools/vtoolarc.cpp similarity index 100% rename from tools/drawTools/vtoolarc.cpp rename to src/tools/drawTools/vtoolarc.cpp diff --git a/tools/drawTools/vtoolarc.h b/src/tools/drawTools/vtoolarc.h similarity index 64% rename from tools/drawTools/vtoolarc.h rename to src/tools/drawTools/vtoolarc.h index 17a757f88..57b940c10 100644 --- a/tools/drawTools/vtoolarc.h +++ b/src/tools/drawTools/vtoolarc.h @@ -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 &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 ¢er, 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; + /** + * @brief RefreshGeometry + */ void RefreshGeometry(); }; diff --git a/tools/drawTools/vtoolbisector.cpp b/src/tools/drawTools/vtoolbisector.cpp similarity index 100% rename from tools/drawTools/vtoolbisector.cpp rename to src/tools/drawTools/vtoolbisector.cpp diff --git a/tools/drawTools/vtoolbisector.h b/src/tools/drawTools/vtoolbisector.h similarity index 64% rename from tools/drawTools/vtoolbisector.h rename to src/tools/drawTools/vtoolbisector.h index f449a462e..824e102aa 100644 --- a/tools/drawTools/vtoolbisector.h +++ b/src/tools/drawTools/vtoolbisector.h @@ -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 &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; }; diff --git a/tools/drawTools/vtoolendline.cpp b/src/tools/drawTools/vtoolendline.cpp similarity index 100% rename from tools/drawTools/vtoolendline.cpp rename to src/tools/drawTools/vtoolendline.cpp diff --git a/tools/drawTools/vtoolendline.h b/src/tools/drawTools/vtoolendline.h similarity index 67% rename from tools/drawTools/vtoolendline.h rename to src/tools/drawTools/vtoolendline.h index a9ce3fa14..35c802911 100644 --- a/tools/drawTools/vtoolendline.h +++ b/src/tools/drawTools/vtoolendline.h @@ -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 &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; }; diff --git a/tools/drawTools/vtoolheight.cpp b/src/tools/drawTools/vtoolheight.cpp similarity index 100% rename from tools/drawTools/vtoolheight.cpp rename to src/tools/drawTools/vtoolheight.cpp diff --git a/tools/drawTools/vtoolheight.h b/src/tools/drawTools/vtoolheight.h similarity index 65% rename from tools/drawTools/vtoolheight.h rename to src/tools/drawTools/vtoolheight.h index 1d070a225..3aa016801 100644 --- a/tools/drawTools/vtoolheight.h +++ b/src/tools/drawTools/vtoolheight.h @@ -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 &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; + /** + * @brief p1LineId + */ qint64 p1LineId; + /** + * @brief p2LineId + */ qint64 p2LineId; }; diff --git a/tools/drawTools/vtoolline.cpp b/src/tools/drawTools/vtoolline.cpp similarity index 100% rename from tools/drawTools/vtoolline.cpp rename to src/tools/drawTools/vtoolline.cpp diff --git a/tools/drawTools/vtoolline.h b/src/tools/drawTools/vtoolline.h similarity index 63% rename from tools/drawTools/vtoolline.h rename to src/tools/drawTools/vtoolline.h index bcc7ac170..80df5efcf 100644 --- a/tools/drawTools/vtoolline.h +++ b/src/tools/drawTools/vtoolline.h @@ -33,35 +33,123 @@ #include #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 &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; + /** + * @brief RefreshGeometry + */ void RefreshGeometry(); }; diff --git a/tools/drawTools/vtoollineintersect.cpp b/src/tools/drawTools/vtoollineintersect.cpp similarity index 100% rename from tools/drawTools/vtoollineintersect.cpp rename to src/tools/drawTools/vtoollineintersect.cpp diff --git a/tools/drawTools/vtoollineintersect.h b/src/tools/drawTools/vtoollineintersect.h similarity index 64% rename from tools/drawTools/vtoollineintersect.h rename to src/tools/drawTools/vtoollineintersect.h index aeb34b54d..1812d638f 100644 --- a/tools/drawTools/vtoollineintersect.h +++ b/src/tools/drawTools/vtoollineintersect.h @@ -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 &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; }; diff --git a/tools/drawTools/vtoollinepoint.cpp b/src/tools/drawTools/vtoollinepoint.cpp similarity index 100% rename from tools/drawTools/vtoollinepoint.cpp rename to src/tools/drawTools/vtoollinepoint.cpp diff --git a/tools/drawTools/vtoollinepoint.h b/src/tools/drawTools/vtoollinepoint.h similarity index 70% rename from tools/drawTools/vtoollinepoint.h rename to src/tools/drawTools/vtoollinepoint.h index dc10aeb17..0cfcfb093 100644 --- a/tools/drawTools/vtoollinepoint.h +++ b/src/tools/drawTools/vtoollinepoint.h @@ -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) diff --git a/tools/drawTools/vtoolnormal.cpp b/src/tools/drawTools/vtoolnormal.cpp similarity index 100% rename from tools/drawTools/vtoolnormal.cpp rename to src/tools/drawTools/vtoolnormal.cpp diff --git a/tools/drawTools/vtoolnormal.h b/src/tools/drawTools/vtoolnormal.h similarity index 64% rename from tools/drawTools/vtoolnormal.h rename to src/tools/drawTools/vtoolnormal.h index 0f2b1fd07..830eeff5a 100644 --- a/tools/drawTools/vtoolnormal.h +++ b/src/tools/drawTools/vtoolnormal.h @@ -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 &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; }; diff --git a/tools/drawTools/vtoolpoint.cpp b/src/tools/drawTools/vtoolpoint.cpp similarity index 100% rename from tools/drawTools/vtoolpoint.cpp rename to src/tools/drawTools/vtoolpoint.cpp diff --git a/tools/drawTools/vtoolpoint.h b/src/tools/drawTools/vtoolpoint.h similarity index 67% rename from tools/drawTools/vtoolpoint.h rename to src/tools/drawTools/vtoolpoint.h index c7e26939e..e902fce32 100644 --- a/tools/drawTools/vtoolpoint.h +++ b/src/tools/drawTools/vtoolpoint.h @@ -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) diff --git a/tools/drawTools/vtoolpointofcontact.cpp b/src/tools/drawTools/vtoolpointofcontact.cpp similarity index 100% rename from tools/drawTools/vtoolpointofcontact.cpp rename to src/tools/drawTools/vtoolpointofcontact.cpp diff --git a/tools/drawTools/vtoolpointofcontact.h b/src/tools/drawTools/vtoolpointofcontact.h similarity index 64% rename from tools/drawTools/vtoolpointofcontact.h rename to src/tools/drawTools/vtoolpointofcontact.h index 54025adde..d53113fa2 100644 --- a/tools/drawTools/vtoolpointofcontact.h +++ b/src/tools/drawTools/vtoolpointofcontact.h @@ -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 ¢er, 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 ¢er, const QPointF &firstPoint, const QPointF &secondPoint); + /** + * @brief Create + * @param dialog + * @param scene + * @param doc dom document container + * @param data + */ static void Create(QSharedPointer &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 ¢er, 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; }; diff --git a/tools/drawTools/vtoolpointofintersection.cpp b/src/tools/drawTools/vtoolpointofintersection.cpp similarity index 100% rename from tools/drawTools/vtoolpointofintersection.cpp rename to src/tools/drawTools/vtoolpointofintersection.cpp diff --git a/tools/drawTools/vtoolpointofintersection.h b/src/tools/drawTools/vtoolpointofintersection.h similarity index 67% rename from tools/drawTools/vtoolpointofintersection.h rename to src/tools/drawTools/vtoolpointofintersection.h index f311b5cbe..2aa964adc 100644 --- a/tools/drawTools/vtoolpointofintersection.h +++ b/src/tools/drawTools/vtoolpointofintersection.h @@ -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 &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; }; diff --git a/tools/drawTools/vtoolshoulderpoint.cpp b/src/tools/drawTools/vtoolshoulderpoint.cpp similarity index 100% rename from tools/drawTools/vtoolshoulderpoint.cpp rename to src/tools/drawTools/vtoolshoulderpoint.cpp diff --git a/tools/drawTools/vtoolshoulderpoint.h b/src/tools/drawTools/vtoolshoulderpoint.h similarity index 64% rename from tools/drawTools/vtoolshoulderpoint.h rename to src/tools/drawTools/vtoolshoulderpoint.h index efede5abd..a6f9faf1a 100644 --- a/tools/drawTools/vtoolshoulderpoint.h +++ b/src/tools/drawTools/vtoolshoulderpoint.h @@ -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 &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; }; diff --git a/tools/drawTools/vtoolsinglepoint.cpp b/src/tools/drawTools/vtoolsinglepoint.cpp similarity index 100% rename from tools/drawTools/vtoolsinglepoint.cpp rename to src/tools/drawTools/vtoolsinglepoint.cpp diff --git a/tools/drawTools/vtoolsinglepoint.h b/src/tools/drawTools/vtoolsinglepoint.h similarity index 69% rename from tools/drawTools/vtoolsinglepoint.h rename to src/tools/drawTools/vtoolsinglepoint.h index d0d482fd4..8079d2ce7 100644 --- a/tools/drawTools/vtoolsinglepoint.h +++ b/src/tools/drawTools/vtoolsinglepoint.h @@ -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; }; diff --git a/tools/drawTools/vtoolspline.cpp b/src/tools/drawTools/vtoolspline.cpp similarity index 100% rename from tools/drawTools/vtoolspline.cpp rename to src/tools/drawTools/vtoolspline.cpp diff --git a/tools/drawTools/vtoolspline.h b/src/tools/drawTools/vtoolspline.h similarity index 63% rename from tools/drawTools/vtoolspline.h rename to src/tools/drawTools/vtoolspline.h index d4277af40..cf0aeaf8e 100644 --- a/tools/drawTools/vtoolspline.h +++ b/src/tools/drawTools/vtoolspline.h @@ -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 &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; + /** + * @brief controlPoints + */ QVector controlPoints; + /** + * @brief RefreshGeometry + */ void RefreshGeometry (); }; diff --git a/tools/drawTools/vtoolsplinepath.cpp b/src/tools/drawTools/vtoolsplinepath.cpp similarity index 100% rename from tools/drawTools/vtoolsplinepath.cpp rename to src/tools/drawTools/vtoolsplinepath.cpp diff --git a/tools/drawTools/vtoolsplinepath.h b/src/tools/drawTools/vtoolsplinepath.h similarity index 62% rename from tools/drawTools/vtoolsplinepath.h rename to src/tools/drawTools/vtoolsplinepath.h index a58ddc2ee..5f20851c4 100644 --- a/tools/drawTools/vtoolsplinepath.h +++ b/src/tools/drawTools/vtoolsplinepath.h @@ -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 &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; + /** + * @brief controlPoints + */ QVector 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); }; diff --git a/tools/drawTools/vtooltriangle.cpp b/src/tools/drawTools/vtooltriangle.cpp similarity index 100% rename from tools/drawTools/vtooltriangle.cpp rename to src/tools/drawTools/vtooltriangle.cpp diff --git a/tools/drawTools/vtooltriangle.h b/src/tools/drawTools/vtooltriangle.h similarity index 64% rename from tools/drawTools/vtooltriangle.h rename to src/tools/drawTools/vtooltriangle.h index dc848c76b..5a9543cde 100644 --- a/tools/drawTools/vtooltriangle.h +++ b/src/tools/drawTools/vtooltriangle.h @@ -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 &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; }; diff --git a/tools/modelingTools/modelingtools.h b/src/tools/modelingTools/modelingtools.h similarity index 100% rename from tools/modelingTools/modelingtools.h rename to src/tools/modelingTools/modelingtools.h diff --git a/tools/modelingTools/vmodelingalongline.cpp b/src/tools/modelingTools/vmodelingalongline.cpp similarity index 94% rename from tools/modelingTools/vmodelingalongline.cpp rename to src/tools/modelingTools/vmodelingalongline.cpp index fce43cb07..2f38aa88a 100644 --- a/tools/modelingTools/vmodelingalongline.cpp +++ b/src/tools/modelingTools/vmodelingalongline.cpp @@ -83,7 +83,7 @@ void VModelingAlongLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) void VModelingAlongLine::AddToFile() { - VPointF point = VAbstractTool::data.GetModelingPoint(id); + VPointF point = VAbstractTool::data.GetPointModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); @@ -109,7 +109,7 @@ void VModelingAlongLine::RemoveReferens() void VModelingAlongLine::setDialog() { Q_ASSERT(dialogAlongLine.isNull() == false); - VPointF p = VAbstractTool::data.GetModelingPoint(id); + VPointF p = VAbstractTool::data.GetPointModeling(id); dialogAlongLine->setTypeLine(typeLine); dialogAlongLine->setFormula(formula); dialogAlongLine->setFirstPointId(basePointId, id); @@ -136,8 +136,8 @@ VModelingAlongLine *VModelingAlongLine::Create(const qint64 _id, const QString & const Tool::Sources &typeCreation) { VModelingAlongLine *point = 0; - VPointF firstPoint = data->GetModelingPoint(firstPointId); - VPointF secondPoint = data->GetModelingPoint(secondPointId); + VPointF firstPoint = data->GetPointModeling(firstPointId); + VPointF secondPoint = data->GetPointModeling(secondPointId); QLineF line = QLineF(firstPoint.toQPointF(), secondPoint.toQPointF()); Calculator cal(data); QString errorMsg; @@ -148,11 +148,11 @@ VModelingAlongLine *VModelingAlongLine::Create(const qint64 _id, const QString & qint64 id = _id; if (typeCreation == Tool::FromGui) { - id = data->AddModelingPoint(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); + id = data->AddPointModeling(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); } else { - data->UpdateModelingPoint(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); + data->UpdatePointModeling(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); if (parse != Document::FullParse) { doc->UpdateToolData(id, data); diff --git a/tools/modelingTools/vmodelingalongline.h b/src/tools/modelingTools/vmodelingalongline.h similarity index 65% rename from tools/modelingTools/vmodelingalongline.h rename to src/tools/modelingTools/vmodelingalongline.h index 7bdba7e28..b5ddd9f8c 100644 --- a/tools/modelingTools/vmodelingalongline.h +++ b/src/tools/modelingTools/vmodelingalongline.h @@ -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 &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; }; diff --git a/tools/modelingTools/vmodelingarc.cpp b/src/tools/modelingTools/vmodelingarc.cpp similarity index 94% rename from tools/modelingTools/vmodelingarc.cpp rename to src/tools/modelingTools/vmodelingarc.cpp index 49ece909d..676a3c151 100644 --- a/tools/modelingTools/vmodelingarc.cpp +++ b/src/tools/modelingTools/vmodelingarc.cpp @@ -50,7 +50,7 @@ VModelingArc::VModelingArc(VDomDocument *doc, VContainer *data, qint64 id, const void VModelingArc::setDialog() { Q_ASSERT(dialogArc.isNull() == false); - VArc arc = VAbstractTool::data.GetModelingArc(id); + VArc arc = VAbstractTool::data.GetArcModeling(id); dialogArc->SetCenter(arc.GetCenter()); dialogArc->SetRadius(arc.GetFormulaRadius()); dialogArc->SetF1(arc.GetFormulaF1()); @@ -95,15 +95,15 @@ VModelingArc* VModelingArc::Create(const qint64 _id, const qint64 ¢er, const calcF2 = result; } - VArc arc = VArc(data->DataModelingPoints(), center, calcRadius, radius, calcF1, f1, calcF2, f2 ); + VArc arc = VArc(data->DataPointsModeling(), center, calcRadius, radius, calcF1, f1, calcF2, f2 ); qint64 id = _id; if (typeCreation == Tool::FromGui) { - id = data->AddModelingArc(arc); + id = data->AddArcModeling(arc); } else { - data->UpdateModelingArc(id, arc); + data->UpdateArcModeling(id, arc); if (parse != Document::FullParse) { doc->UpdateToolData(id, data); @@ -148,7 +148,7 @@ void VModelingArc::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) void VModelingArc::AddToFile() { - VArc arc = VAbstractTool::data.GetModelingArc(id); + VArc arc = VAbstractTool::data.GetArcModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); @@ -184,13 +184,13 @@ void VModelingArc::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void VModelingArc::RemoveReferens() { - VArc arc = VAbstractTool::data.GetModelingArc(id); + VArc arc = VAbstractTool::data.GetArcModeling(id); doc->DecrementReferens(arc.GetCenter()); } void VModelingArc::RefreshGeometry() { - VArc arc = VAbstractTool::data.GetModelingArc(id); + VArc arc = VAbstractTool::data.GetArcModeling(id); QPainterPath path; path.addPath(arc.GetPath()); path.setFillRule( Qt::WindingFill ); diff --git a/tools/modelingTools/vmodelingarc.h b/src/tools/modelingTools/vmodelingarc.h similarity index 66% rename from tools/modelingTools/vmodelingarc.h rename to src/tools/modelingTools/vmodelingarc.h index 510ba9d07..e32f8f6cf 100644 --- a/tools/modelingTools/vmodelingarc.h +++ b/src/tools/modelingTools/vmodelingarc.h @@ -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 &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 ¢er, 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; + /** + * @brief RefreshGeometry + */ void RefreshGeometry(); }; diff --git a/tools/modelingTools/vmodelingbisector.cpp b/src/tools/modelingTools/vmodelingbisector.cpp similarity index 94% rename from tools/modelingTools/vmodelingbisector.cpp rename to src/tools/modelingTools/vmodelingbisector.cpp index 7cdf15366..ccb3266af 100644 --- a/tools/modelingTools/vmodelingbisector.cpp +++ b/src/tools/modelingTools/vmodelingbisector.cpp @@ -51,7 +51,7 @@ VModelingBisector::VModelingBisector(VDomDocument *doc, VContainer *data, const void VModelingBisector::setDialog() { Q_ASSERT(dialogBisector.isNull() == false); - VPointF p = VAbstractTool::data.GetModelingPoint(id); + VPointF p = VAbstractTool::data.GetPointModeling(id); dialogBisector->setTypeLine(typeLine); dialogBisector->setFormula(formula); dialogBisector->setFirstPointId(firstPointId, id); @@ -81,9 +81,9 @@ VModelingBisector *VModelingBisector::Create(const qint64 _id, const QString &fo const Tool::Sources &typeCreation) { VModelingBisector *point = 0; - VPointF firstPoint = data->GetModelingPoint(firstPointId); - VPointF secondPoint = data->GetModelingPoint(secondPointId); - VPointF thirdPoint = data->GetModelingPoint(thirdPointId); + VPointF firstPoint = data->GetPointModeling(firstPointId); + VPointF secondPoint = data->GetPointModeling(secondPointId); + VPointF thirdPoint = data->GetPointModeling(thirdPointId); Calculator cal(data); QString errorMsg; @@ -95,11 +95,11 @@ VModelingBisector *VModelingBisector::Create(const qint64 _id, const QString &fo qint64 id = _id; if (typeCreation == Tool::FromGui) { - id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); + id = data->AddPointModeling(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); } else { - data->UpdateModelingPoint(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); + data->UpdatePointModeling(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); if (parse != Document::FullParse) { doc->UpdateToolData(id, data); @@ -159,7 +159,7 @@ void VModelingBisector::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) void VModelingBisector::AddToFile() { - VPointF point = VAbstractTool::data.GetModelingPoint(id); + VPointF point = VAbstractTool::data.GetPointModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); diff --git a/tools/modelingTools/vmodelingbisector.h b/src/tools/modelingTools/vmodelingbisector.h similarity index 65% rename from tools/modelingTools/vmodelingbisector.h rename to src/tools/modelingTools/vmodelingbisector.h index cb5196cd2..21b83161e 100644 --- a/tools/modelingTools/vmodelingbisector.h +++ b/src/tools/modelingTools/vmodelingbisector.h @@ -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 &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; }; diff --git a/tools/modelingTools/vmodelingendline.cpp b/src/tools/modelingTools/vmodelingendline.cpp similarity index 95% rename from tools/modelingTools/vmodelingendline.cpp rename to src/tools/modelingTools/vmodelingendline.cpp index 1886c0672..26ae9ec22 100644 --- a/tools/modelingTools/vmodelingendline.cpp +++ b/src/tools/modelingTools/vmodelingendline.cpp @@ -46,7 +46,7 @@ VModelingEndLine::VModelingEndLine(VDomDocument *doc, VContainer *data, const qi void VModelingEndLine::setDialog() { Q_ASSERT(dialogEndLine.isNull() == false); - VPointF p = VAbstractTool::data.GetModelingPoint(id); + VPointF p = VAbstractTool::data.GetPointModeling(id); dialogEndLine->setTypeLine(typeLine); dialogEndLine->setFormula(formula); dialogEndLine->setAngle(angle); @@ -72,7 +72,7 @@ VModelingEndLine *VModelingEndLine::Create(const qint64 _id, const QString &poin const Document::Documents &parse, const Tool::Sources &typeCreation) { VModelingEndLine *point = 0; - VPointF basePoint = data->GetModelingPoint(basePointId); + VPointF basePoint = data->GetPointModeling(basePointId); QLineF line = QLineF(basePoint.toQPointF(), QPointF(basePoint.x()+100, basePoint.y())); Calculator cal(data); QString errorMsg; @@ -84,11 +84,11 @@ VModelingEndLine *VModelingEndLine::Create(const qint64 _id, const QString &poin qint64 id = _id; if (typeCreation == Tool::FromGui) { - id = data->AddModelingPoint(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); + id = data->AddPointModeling(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); } else { - data->UpdateModelingPoint(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); + data->UpdatePointModeling(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); if (parse != Document::FullParse) { doc->UpdateToolData(id, data); @@ -143,7 +143,7 @@ void VModelingEndLine::FullUpdateFromGui(int result) void VModelingEndLine::AddToFile() { - VPointF point = VAbstractTool::data.GetModelingPoint(id); + VPointF point = VAbstractTool::data.GetPointModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); diff --git a/tools/modelingTools/vmodelingendline.h b/src/tools/modelingTools/vmodelingendline.h similarity index 66% rename from tools/modelingTools/vmodelingendline.h rename to src/tools/modelingTools/vmodelingendline.h index 2bf52d30a..f22ab5bf5 100644 --- a/tools/modelingTools/vmodelingendline.h +++ b/src/tools/modelingTools/vmodelingendline.h @@ -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 &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; }; diff --git a/tools/modelingTools/vmodelingheight.cpp b/src/tools/modelingTools/vmodelingheight.cpp similarity index 93% rename from tools/modelingTools/vmodelingheight.cpp rename to src/tools/modelingTools/vmodelingheight.cpp index 53ae05ac1..99eeab418 100644 --- a/tools/modelingTools/vmodelingheight.cpp +++ b/src/tools/modelingTools/vmodelingheight.cpp @@ -48,7 +48,7 @@ VModelingHeight::VModelingHeight(VDomDocument *doc, VContainer *data, const qint void VModelingHeight::setDialog() { Q_ASSERT(dialogHeight.isNull() == false); - VPointF p = VAbstractTool::data.GetModelingPoint(id); + VPointF p = VAbstractTool::data.GetPointModeling(id); dialogHeight->setTypeLine(typeLine); dialogHeight->setBasePointId(basePointId, id); dialogHeight->setP1LineId(p1LineId, id); @@ -75,9 +75,9 @@ VModelingHeight *VModelingHeight::Create(const qint64 _id, const QString &pointN const Document::Documents &parse, const Tool::Sources &typeCreation) { VModelingHeight *point = 0; - VPointF basePoint = data->GetModelingPoint(basePointId); - VPointF p1Line = data->GetModelingPoint(p1LineId); - VPointF p2Line = data->GetModelingPoint(p2LineId); + VPointF basePoint = data->GetPointModeling(basePointId); + VPointF p1Line = data->GetPointModeling(p1LineId); + VPointF p2Line = data->GetPointModeling(p2LineId); QPointF pHeight = VToolHeight::FindPoint(QLineF(p1Line.toQPointF(), p2Line.toQPointF()), basePoint.toQPointF()); @@ -85,11 +85,11 @@ VModelingHeight *VModelingHeight::Create(const qint64 _id, const QString &pointN qint64 id = _id; if (typeCreation == Tool::FromGui) { - id = data->AddModelingPoint(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); + id = data->AddPointModeling(VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); } else { - data->UpdateModelingPoint(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); + data->UpdatePointModeling(id, VPointF(line.p2().x(), line.p2().y(), pointName, mx, my)); if (parse != Document::FullParse) { doc->UpdateToolData(id, data); @@ -145,7 +145,7 @@ void VModelingHeight::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) void VModelingHeight::AddToFile() { - VPointF point = VAbstractTool::data.GetModelingPoint(id); + VPointF point = VAbstractTool::data.GetPointModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); diff --git a/tools/modelingTools/vmodelingheight.h b/src/tools/modelingTools/vmodelingheight.h similarity index 65% rename from tools/modelingTools/vmodelingheight.h rename to src/tools/modelingTools/vmodelingheight.h index 791779e46..d89f5a4d9 100644 --- a/tools/modelingTools/vmodelingheight.h +++ b/src/tools/modelingTools/vmodelingheight.h @@ -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 &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; + /** + * @brief p1LineId + */ qint64 p1LineId; + /** + * @brief p2LineId + */ qint64 p2LineId; }; diff --git a/tools/modelingTools/vmodelingline.cpp b/src/tools/modelingTools/vmodelingline.cpp similarity index 95% rename from tools/modelingTools/vmodelingline.cpp rename to src/tools/modelingTools/vmodelingline.cpp index 619467dd5..3ae98a59f 100644 --- a/tools/modelingTools/vmodelingline.cpp +++ b/src/tools/modelingTools/vmodelingline.cpp @@ -37,8 +37,8 @@ VModelingLine::VModelingLine(VDomDocument *doc, VContainer *data, qint64 id, qin { ignoreFullUpdate = true; //Лінія - VPointF first = data->GetModelingPoint(firstPoint); - VPointF second = data->GetModelingPoint(secondPoint); + VPointF first = data->GetPointModeling(firstPoint); + VPointF second = data->GetPointModeling(secondPoint); this->setLine(QLineF(first.toQPointF(), second.toQPointF())); this->setFlag(QGraphicsItem::ItemStacksBehindParent, true); this->setFlag(QGraphicsItem::ItemIsSelectable, true); @@ -102,8 +102,8 @@ void VModelingLine::FullUpdateFromFile() firstPoint = domElement.attribute(AttrFirstPoint, "").toLongLong(); secondPoint = domElement.attribute(AttrSecondPoint, "").toLongLong(); } - VPointF first = VAbstractTool::data.GetModelingPoint(firstPoint); - VPointF second = VAbstractTool::data.GetModelingPoint(secondPoint); + VPointF first = VAbstractTool::data.GetPointModeling(firstPoint); + VPointF second = VAbstractTool::data.GetPointModeling(secondPoint); this->setLine(QLineF(first.toQPointF(), second.toQPointF())); } diff --git a/tools/modelingTools/vmodelingline.h b/src/tools/modelingTools/vmodelingline.h similarity index 65% rename from tools/modelingTools/vmodelingline.h rename to src/tools/modelingTools/vmodelingline.h index 2798eadb7..bf9729389 100644 --- a/tools/modelingTools/vmodelingline.h +++ b/src/tools/modelingTools/vmodelingline.h @@ -33,32 +33,106 @@ #include #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 &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; }; diff --git a/tools/modelingTools/vmodelinglineintersect.cpp b/src/tools/modelingTools/vmodelinglineintersect.cpp similarity index 92% rename from tools/modelingTools/vmodelinglineintersect.cpp rename to src/tools/modelingTools/vmodelinglineintersect.cpp index 4a3eec24b..dd15b7a09 100644 --- a/tools/modelingTools/vmodelinglineintersect.cpp +++ b/src/tools/modelingTools/vmodelinglineintersect.cpp @@ -46,7 +46,7 @@ VModelingLineIntersect::VModelingLineIntersect(VDomDocument *doc, VContainer *da void VModelingLineIntersect::setDialog() { Q_ASSERT(dialogLineIntersect.isNull() == false); - VPointF p = VAbstractTool::data.GetModelingPoint(id); + VPointF p = VAbstractTool::data.GetPointModeling(id); dialogLineIntersect->setP1Line1(p1Line1); dialogLineIntersect->setP2Line1(p2Line1); dialogLineIntersect->setP1Line2(p1Line2); @@ -74,10 +74,10 @@ VModelingLineIntersect *VModelingLineIntersect::Create(const qint64 _id, const q const Tool::Sources &typeCreation) { VModelingLineIntersect *point = 0; - VPointF p1Line1 = data->GetModelingPoint(p1Line1Id); - VPointF p2Line1 = data->GetModelingPoint(p2Line1Id); - VPointF p1Line2 = data->GetModelingPoint(p1Line2Id); - VPointF p2Line2 = data->GetModelingPoint(p2Line2Id); + VPointF p1Line1 = data->GetPointModeling(p1Line1Id); + VPointF p2Line1 = data->GetPointModeling(p2Line1Id); + VPointF p1Line2 = data->GetPointModeling(p1Line2Id); + VPointF p2Line2 = data->GetPointModeling(p2Line2Id); QLineF line1(p1Line1.toQPointF(), p2Line1.toQPointF()); QLineF line2(p1Line2.toQPointF(), p2Line2.toQPointF()); @@ -88,11 +88,11 @@ VModelingLineIntersect *VModelingLineIntersect::Create(const qint64 _id, const q qint64 id = _id; if (typeCreation == Tool::FromGui) { - id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); + id = data->AddPointModeling(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); } else { - data->UpdateModelingPoint(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); + data->UpdatePointModeling(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); if (parse != Document::FullParse) { doc->UpdateToolData(id, data); @@ -126,7 +126,7 @@ void VModelingLineIntersect::FullUpdateFromFile() p1Line2 = domElement.attribute(AttrP1Line2, "").toLongLong(); p2Line2 = domElement.attribute(AttrP2Line2, "").toLongLong(); } - RefreshPointGeometry(VAbstractTool::data.GetModelingPoint(id)); + RefreshPointGeometry(VAbstractTool::data.GetPointModeling(id)); } void VModelingLineIntersect::FullUpdateFromGui(int result) @@ -154,7 +154,7 @@ void VModelingLineIntersect::contextMenuEvent(QGraphicsSceneContextMenuEvent *ev void VModelingLineIntersect::AddToFile() { - VPointF point = VAbstractTool::data.GetModelingPoint(id); + VPointF point = VAbstractTool::data.GetPointModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); diff --git a/tools/modelingTools/vmodelinglineintersect.h b/src/tools/modelingTools/vmodelinglineintersect.h similarity index 65% rename from tools/modelingTools/vmodelinglineintersect.h rename to src/tools/modelingTools/vmodelinglineintersect.h index b8ca4d2eb..b0dfd515f 100644 --- a/tools/modelingTools/vmodelinglineintersect.h +++ b/src/tools/modelingTools/vmodelinglineintersect.h @@ -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 &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; }; diff --git a/tools/modelingTools/vmodelinglinepoint.cpp b/src/tools/modelingTools/vmodelinglinepoint.cpp similarity index 89% rename from tools/modelingTools/vmodelinglinepoint.cpp rename to src/tools/modelingTools/vmodelinglinepoint.cpp index 2c88505ad..b68231cfe 100644 --- a/tools/modelingTools/vmodelinglinepoint.cpp +++ b/src/tools/modelingTools/vmodelinglinepoint.cpp @@ -35,8 +35,8 @@ VModelingLinePoint::VModelingLinePoint(VDomDocument *doc, VContainer *data, cons basePointId(basePointId), mainLine(0) { //Лінія, що з'єднує дві точки - QPointF point1 = data->GetModelingPoint(basePointId).toQPointF(); - QPointF point2 = data->GetModelingPoint(id).toQPointF(); + QPointF point1 = data->GetPointModeling(basePointId).toQPointF(); + QPointF point2 = data->GetPointModeling(id).toQPointF(); mainLine = new QGraphicsLineItem(QLineF(point1 - point2, QPointF()), this); mainLine->setPen(QPen(Qt::black, widthHairLine)); mainLine->setFlag(QGraphicsItem::ItemStacksBehindParent, true); @@ -52,9 +52,9 @@ VModelingLinePoint::VModelingLinePoint(VDomDocument *doc, VContainer *data, cons void VModelingLinePoint::RefreshGeometry() { - VModelingPoint::RefreshPointGeometry(VModelingTool::data.GetModelingPoint(id)); - QPointF point = VModelingTool::data.GetModelingPoint(id).toQPointF(); - QPointF basePoint = VModelingTool::data.GetModelingPoint(basePointId).toQPointF(); + VModelingPoint::RefreshPointGeometry(VModelingTool::data.GetPointModeling(id)); + QPointF point = VModelingTool::data.GetPointModeling(id).toQPointF(); + QPointF basePoint = VModelingTool::data.GetPointModeling(basePointId).toQPointF(); mainLine->setLine(QLineF(basePoint - point, QPointF())); if (typeLine == TypeLineNone) { diff --git a/tools/modelingTools/vmodelinglinepoint.h b/src/tools/modelingTools/vmodelinglinepoint.h similarity index 72% rename from tools/modelingTools/vmodelinglinepoint.h rename to src/tools/modelingTools/vmodelinglinepoint.h index 4ca0e9ced..1ef7ee104 100644 --- a/tools/modelingTools/vmodelinglinepoint.h +++ b/src/tools/modelingTools/vmodelinglinepoint.h @@ -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) diff --git a/tools/modelingTools/vmodelingnormal.cpp b/src/tools/modelingTools/vmodelingnormal.cpp similarity index 94% rename from tools/modelingTools/vmodelingnormal.cpp rename to src/tools/modelingTools/vmodelingnormal.cpp index d0d662b1c..91daea902 100644 --- a/tools/modelingTools/vmodelingnormal.cpp +++ b/src/tools/modelingTools/vmodelingnormal.cpp @@ -47,7 +47,7 @@ VModelingNormal::VModelingNormal(VDomDocument *doc, VContainer *data, const qint void VModelingNormal::setDialog() { Q_ASSERT(dialogNormal.isNull() == false); - VPointF p = VAbstractTool::data.GetModelingPoint(id); + VPointF p = VAbstractTool::data.GetPointModeling(id); dialogNormal->setTypeLine(typeLine); dialogNormal->setFormula(formula); dialogNormal->setAngle(angle); @@ -75,8 +75,8 @@ VModelingNormal *VModelingNormal::Create(const qint64 _id, const QString &formul const Tool::Sources &typeCreation) { VModelingNormal *point = 0; - VPointF firstPoint = data->GetModelingPoint(firstPointId); - VPointF secondPoint = data->GetModelingPoint(secondPointId); + VPointF firstPoint = data->GetPointModeling(firstPointId); + VPointF secondPoint = data->GetPointModeling(secondPointId); Calculator cal(data); QString errorMsg; qreal result = cal.eval(formula, &errorMsg); @@ -87,11 +87,11 @@ VModelingNormal *VModelingNormal::Create(const qint64 _id, const QString &formul qint64 id = _id; if (typeCreation == Tool::FromGui) { - id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); + id = data->AddPointModeling(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); } else { - data->UpdateModelingPoint(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); + data->UpdatePointModeling(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); if (parse != Document::FullParse) { doc->UpdateToolData(id, data); @@ -150,7 +150,7 @@ void VModelingNormal::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) void VModelingNormal::AddToFile() { - VPointF point = VAbstractTool::data.GetModelingPoint(id); + VPointF point = VAbstractTool::data.GetPointModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); diff --git a/tools/modelingTools/vmodelingnormal.h b/src/tools/modelingTools/vmodelingnormal.h similarity index 65% rename from tools/modelingTools/vmodelingnormal.h rename to src/tools/modelingTools/vmodelingnormal.h index 3d9062a0e..362b4897d 100644 --- a/tools/modelingTools/vmodelingnormal.h +++ b/src/tools/modelingTools/vmodelingnormal.h @@ -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 &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; }; diff --git a/tools/modelingTools/vmodelingpoint.cpp b/src/tools/modelingTools/vmodelingpoint.cpp similarity index 97% rename from tools/modelingTools/vmodelingpoint.cpp rename to src/tools/modelingTools/vmodelingpoint.cpp index af97dd218..c13c3951d 100644 --- a/tools/modelingTools/vmodelingpoint.cpp +++ b/src/tools/modelingTools/vmodelingpoint.cpp @@ -42,12 +42,12 @@ VModelingPoint::VModelingPoint(VDomDocument *doc, VContainer *data, qint64 id, Q this->setBrush(QBrush(Qt::NoBrush)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setAcceptHoverEvents(true); - RefreshPointGeometry(VAbstractTool::data.GetModelingPoint(id)); + RefreshPointGeometry(VAbstractTool::data.GetPointModeling(id)); } void VModelingPoint::NameChangePosition(const QPointF &pos) { - VPointF point = VAbstractTool::data.GetModelingPoint(id); + VPointF point = VAbstractTool::data.GetPointModeling(id); QPointF p = pos - this->pos(); point.setMx(p.x()); point.setMy(p.y()); diff --git a/tools/modelingTools/vmodelingpoint.h b/src/tools/modelingTools/vmodelingpoint.h similarity index 69% rename from tools/modelingTools/vmodelingpoint.h rename to src/tools/modelingTools/vmodelingpoint.h index e03799136..4a1e88432 100644 --- a/tools/modelingTools/vmodelingpoint.h +++ b/src/tools/modelingTools/vmodelingpoint.h @@ -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) diff --git a/tools/modelingTools/vmodelingpointofcontact.cpp b/src/tools/modelingTools/vmodelingpointofcontact.cpp similarity index 93% rename from tools/modelingTools/vmodelingpointofcontact.cpp rename to src/tools/modelingTools/vmodelingpointofcontact.cpp index 9c4ba59b0..43dd485fd 100644 --- a/tools/modelingTools/vmodelingpointofcontact.cpp +++ b/src/tools/modelingTools/vmodelingpointofcontact.cpp @@ -48,7 +48,7 @@ VModelingPointOfContact::VModelingPointOfContact(VDomDocument *doc, VContainer * void VModelingPointOfContact::setDialog() { Q_ASSERT(dialogPointOfContact.isNull() == false); - VPointF p = VAbstractTool::data.GetModelingPoint(id); + VPointF p = VAbstractTool::data.GetPointModeling(id); dialogPointOfContact->setRadius(radius); dialogPointOfContact->setCenter(center, id); dialogPointOfContact->setFirstPoint(firstPointId, id); @@ -77,9 +77,9 @@ VModelingPointOfContact *VModelingPointOfContact::Create(const qint64 _id, const const Tool::Sources &typeCreation) { VModelingPointOfContact *point = 0; - VPointF centerP = data->GetModelingPoint(center); - VPointF firstP = data->GetModelingPoint(firstPointId); - VPointF secondP = data->GetModelingPoint(secondPointId); + VPointF centerP = data->GetPointModeling(center); + VPointF firstP = data->GetPointModeling(firstPointId); + VPointF secondP = data->GetPointModeling(secondPointId); Calculator cal(data); QString errorMsg; @@ -91,11 +91,11 @@ VModelingPointOfContact *VModelingPointOfContact::Create(const qint64 _id, const qint64 id = _id; if (typeCreation == Tool::FromGui) { - id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); + id = data->AddPointModeling(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); } else { - data->UpdateModelingPoint(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); + data->UpdatePointModeling(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); if (parse != Document::FullParse) { doc->UpdateToolData(id, data); @@ -124,7 +124,7 @@ void VModelingPointOfContact::FullUpdateFromFile() firstPointId = domElement.attribute(AttrFirstPoint, "").toLongLong(); secondPointId = domElement.attribute(AttrSecondPoint, "").toLongLong(); } - RefreshPointGeometry(VAbstractTool::data.GetModelingPoint(id)); + RefreshPointGeometry(VAbstractTool::data.GetPointModeling(id)); } void VModelingPointOfContact::FullUpdateFromGui(int result) @@ -152,7 +152,7 @@ void VModelingPointOfContact::contextMenuEvent(QGraphicsSceneContextMenuEvent *e void VModelingPointOfContact::AddToFile() { - VPointF point = VAbstractTool::data.GetModelingPoint(id); + VPointF point = VAbstractTool::data.GetPointModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); diff --git a/tools/modelingTools/vmodelingpointofcontact.h b/src/tools/modelingTools/vmodelingpointofcontact.h similarity index 66% rename from tools/modelingTools/vmodelingpointofcontact.h rename to src/tools/modelingTools/vmodelingpointofcontact.h index d9be2cda2..df58ee4f2 100644 --- a/tools/modelingTools/vmodelingpointofcontact.h +++ b/src/tools/modelingTools/vmodelingpointofcontact.h @@ -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 ¢er, 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 &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 ¢er, 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; }; diff --git a/tools/modelingTools/vmodelingpointofintersection.cpp b/src/tools/modelingTools/vmodelingpointofintersection.cpp similarity index 100% rename from tools/modelingTools/vmodelingpointofintersection.cpp rename to src/tools/modelingTools/vmodelingpointofintersection.cpp diff --git a/tools/modelingTools/vmodelingpointofintersection.h b/src/tools/modelingTools/vmodelingpointofintersection.h similarity index 69% rename from tools/modelingTools/vmodelingpointofintersection.h rename to src/tools/modelingTools/vmodelingpointofintersection.h index 4a859ea84..30a5b0d8f 100644 --- a/tools/modelingTools/vmodelingpointofintersection.h +++ b/src/tools/modelingTools/vmodelingpointofintersection.h @@ -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 &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; }; diff --git a/tools/modelingTools/vmodelingshoulderpoint.cpp b/src/tools/modelingTools/vmodelingshoulderpoint.cpp similarity index 94% rename from tools/modelingTools/vmodelingshoulderpoint.cpp rename to src/tools/modelingTools/vmodelingshoulderpoint.cpp index ceec80d1b..68320fdd2 100644 --- a/tools/modelingTools/vmodelingshoulderpoint.cpp +++ b/src/tools/modelingTools/vmodelingshoulderpoint.cpp @@ -48,7 +48,7 @@ VModelingShoulderPoint::VModelingShoulderPoint(VDomDocument *doc, VContainer *da void VModelingShoulderPoint::setDialog() { Q_ASSERT(dialogShoulderPoint.isNull() == false); - VPointF p = VAbstractTool::data.GetModelingPoint(id); + VPointF p = VAbstractTool::data.GetPointModeling(id); dialogShoulderPoint->setTypeLine(typeLine); dialogShoulderPoint->setFormula(formula); dialogShoulderPoint->setP1Line(basePointId, id); @@ -79,9 +79,9 @@ VModelingShoulderPoint *VModelingShoulderPoint::Create(const qint64 _id, const Q const Tool::Sources &typeCreation) { VModelingShoulderPoint *point = 0; - VPointF firstPoint = data->GetModelingPoint(p1Line); - VPointF secondPoint = data->GetModelingPoint(p2Line); - VPointF shoulderPoint = data->GetModelingPoint(pShoulder); + VPointF firstPoint = data->GetPointModeling(p1Line); + VPointF secondPoint = data->GetPointModeling(p2Line); + VPointF shoulderPoint = data->GetPointModeling(pShoulder); Calculator cal(data); QString errorMsg; @@ -93,11 +93,11 @@ VModelingShoulderPoint *VModelingShoulderPoint::Create(const qint64 _id, const Q qint64 id = _id; if (typeCreation == Tool::FromGui) { - id = data->AddModelingPoint(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); + id = data->AddPointModeling(VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); } else { - data->UpdateModelingPoint(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); + data->UpdatePointModeling(id, VPointF(fPoint.x(), fPoint.y(), pointName, mx, my)); if (parse != Document::FullParse) { doc->UpdateToolData(id, data); @@ -158,7 +158,7 @@ void VModelingShoulderPoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *ev void VModelingShoulderPoint::AddToFile() { - VPointF point = VAbstractTool::data.GetModelingPoint(id); + VPointF point = VAbstractTool::data.GetPointModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); diff --git a/tools/modelingTools/vmodelingshoulderpoint.h b/src/tools/modelingTools/vmodelingshoulderpoint.h similarity index 67% rename from tools/modelingTools/vmodelingshoulderpoint.h rename to src/tools/modelingTools/vmodelingshoulderpoint.h index 7b9d27027..5fe6f796e 100644 --- a/tools/modelingTools/vmodelingshoulderpoint.h +++ b/src/tools/modelingTools/vmodelingshoulderpoint.h @@ -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 &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; }; diff --git a/tools/modelingTools/vmodelingspline.cpp b/src/tools/modelingTools/vmodelingspline.cpp similarity index 93% rename from tools/modelingTools/vmodelingspline.cpp rename to src/tools/modelingTools/vmodelingspline.cpp index 951bc7efc..9c9be55ba 100644 --- a/tools/modelingTools/vmodelingspline.cpp +++ b/src/tools/modelingTools/vmodelingspline.cpp @@ -38,7 +38,7 @@ VModelingSpline::VModelingSpline(VDomDocument *doc, VContainer *data, qint64 id, dialogSpline(QSharedPointer()), controlPoints(QVector()) { ignoreFullUpdate = true; - VSpline spl = data->GetModelingSpline(id); + VSpline spl = data->GetSplineModeling(id); QPainterPath path; path.addPath(spl.GetPath()); path.setFillRule( Qt::WindingFill ); @@ -72,7 +72,7 @@ VModelingSpline::VModelingSpline(VDomDocument *doc, VContainer *data, qint64 id, void VModelingSpline::setDialog() { Q_ASSERT(dialogSpline.isNull() == false); - VSpline spl = VAbstractTool::data.GetModelingSpline(id); + VSpline spl = VAbstractTool::data.GetSplineModeling(id); dialogSpline->setP1(spl.GetP1()); dialogSpline->setP4(spl.GetP4()); dialogSpline->setAngle1(spl.GetAngle1()); @@ -102,15 +102,15 @@ VModelingSpline *VModelingSpline::Create(const qint64 _id, const qint64 &p1, con const Tool::Sources &typeCreation) { VModelingSpline *spl = 0; - VSpline spline = VSpline(data->DataModelingPoints(), p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve); + VSpline spline = VSpline(data->DataPointsModeling(), p1, p4, angle1, angle2, kAsm1, kAsm2, kCurve); qint64 id = _id; if (typeCreation == Tool::FromGui) { - id = data->AddModelingSpline(spline); + id = data->AddSplineModeling(spline); } else { - data->UpdateModelingSpline(id, spline); + data->UpdateSplineModeling(id, spline); if (parse != Document::FullParse) { doc->UpdateToolData(id, data); @@ -136,7 +136,7 @@ void VModelingSpline::FullUpdateFromGui(int result) { if (result == QDialog::Accepted) { - VSpline spl = VSpline (VAbstractTool::data.DataModelingPoints(), dialogSpline->getP1(), + VSpline spl = VSpline (VAbstractTool::data.DataPointsModeling(), dialogSpline->getP1(), dialogSpline->getP4(), dialogSpline->getAngle1(), dialogSpline->getAngle2(), dialogSpline->getKAsm1(), dialogSpline->getKAsm2(), dialogSpline->getKCurve()); @@ -151,7 +151,7 @@ void VModelingSpline::FullUpdateFromGui(int result) connect(controlPoints[1], &VControlPointSpline::ControlPointChangePosition, this, &VModelingSpline::ControlPointChangePosition); - spl = VSpline (VAbstractTool::data.DataModelingPoints(), dialogSpline->getP1(), + spl = VSpline (VAbstractTool::data.DataPointsModeling(), dialogSpline->getP1(), controlPoints[0]->pos(), controlPoints[1]->pos(), dialogSpline->getP4(), dialogSpline->getKCurve()); QDomElement domElement = doc->elementById(QString().setNum(id)); @@ -174,7 +174,7 @@ void VModelingSpline::ControlPointChangePosition(const qint32 &indexSpline, Spli const QPointF &pos) { Q_UNUSED(indexSpline); - VSpline spl = VAbstractTool::data.GetModelingSpline(id); + VSpline spl = VAbstractTool::data.GetSplineModeling(id); if (position == SplinePoint::FirstPoint) { spl.ModifiSpl (spl.GetP1(), pos, spl.GetP3(), spl.GetP4(), spl.GetKcurve()); @@ -202,7 +202,7 @@ void VModelingSpline::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) void VModelingSpline::AddToFile() { - VSpline spl = VAbstractTool::data.GetModelingSpline(id); + VSpline spl = VAbstractTool::data.GetSplineModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); @@ -241,22 +241,22 @@ void VModelingSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void VModelingSpline::RemoveReferens() { - VSpline spl = VAbstractTool::data.GetModelingSpline(id); + VSpline spl = VAbstractTool::data.GetSplineModeling(id); doc->DecrementReferens(spl.GetP1()); doc->DecrementReferens(spl.GetP4()); } void VModelingSpline::RefreshGeometry() { - VSpline spl = VAbstractTool::data.GetModelingSpline(id); + VSpline spl = VAbstractTool::data.GetSplineModeling(id); QPainterPath path; path.addPath(spl.GetPath()); path.setFillRule( Qt::WindingFill ); this->setPath(path); - QPointF splinePoint = VAbstractTool::data.GetModelingPoint(spl.GetP1()).toQPointF(); + QPointF splinePoint = VAbstractTool::data.GetPointModeling(spl.GetP1()).toQPointF(); QPointF controlPoint = spl.GetP2(); emit RefreshLine(1, SplinePoint::FirstPoint, controlPoint, splinePoint); - splinePoint = VAbstractTool::data.GetModelingPoint(spl.GetP4()).toQPointF(); + splinePoint = VAbstractTool::data.GetPointModeling(spl.GetP4()).toQPointF(); controlPoint = spl.GetP3(); emit RefreshLine(1, SplinePoint::LastPoint, controlPoint, splinePoint); diff --git a/tools/modelingTools/vmodelingspline.h b/src/tools/modelingTools/vmodelingspline.h similarity index 65% rename from tools/modelingTools/vmodelingspline.h rename to src/tools/modelingTools/vmodelingspline.h index 7173fc501..b55dbb005 100644 --- a/tools/modelingTools/vmodelingspline.h +++ b/src/tools/modelingTools/vmodelingspline.h @@ -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 &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; + /** + * @brief controlPoints + */ QVector controlPoints; + /** + * @brief RefreshGeometry + */ void RefreshGeometry (); }; diff --git a/tools/modelingTools/vmodelingsplinepath.cpp b/src/tools/modelingTools/vmodelingsplinepath.cpp similarity index 94% rename from tools/modelingTools/vmodelingsplinepath.cpp rename to src/tools/modelingTools/vmodelingsplinepath.cpp index 515e80a96..012713a78 100644 --- a/tools/modelingTools/vmodelingsplinepath.cpp +++ b/src/tools/modelingTools/vmodelingsplinepath.cpp @@ -37,7 +37,7 @@ VModelingSplinePath::VModelingSplinePath(VDomDocument *doc, VContainer *data, qi controlPoints(QVector()) { ignoreFullUpdate = true; - VSplinePath splPath = data->GetModelingSplinePath(id); + VSplinePath splPath = data->GetSplinePathModeling(id); QPainterPath path; path.addPath(splPath.GetPath()); path.setFillRule( Qt::WindingFill ); @@ -74,7 +74,7 @@ VModelingSplinePath::VModelingSplinePath(VDomDocument *doc, VContainer *data, qi void VModelingSplinePath::setDialog() { Q_ASSERT(dialogSplinePath.isNull() == false); - VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id); + VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id); dialogSplinePath->SetPath(splPath); } @@ -97,11 +97,11 @@ VModelingSplinePath * VModelingSplinePath::Create(const qint64 _id, const VSplin qint64 id = _id; if (typeCreation == Tool::FromGui) { - id = data->AddModelingSplinePath(path); + id = data->AddSplinePathModeling(path); } else { - data->UpdateModelingSplinePath(id, path); + data->UpdateSplinePathModeling(id, path); if (parse != Document::FullParse) { doc->UpdateToolData(id, data); @@ -141,7 +141,7 @@ void VModelingSplinePath::FullUpdateFromGui(int result) connect(controlPoints[j-1], &VControlPointSpline::ControlPointChangePosition, this, &VModelingSplinePath::ControlPointChangePosition); - spl = VSpline (VAbstractTool::data.DataModelingPoints(), spl.GetP1(), controlPoints[j-2]->pos(), + spl = VSpline (VAbstractTool::data.DataPointsModeling(), spl.GetP1(), controlPoints[j-2]->pos(), controlPoints[j-1]->pos(), spl.GetP4(), splPath.getKCurve()); CorectControlPoints(spl, splPath, i); CorectControlPoints(spl, splPath, i); @@ -162,7 +162,7 @@ void VModelingSplinePath::FullUpdateFromGui(int result) void VModelingSplinePath::ControlPointChangePosition(const qint32 &indexSpline, SplinePoint::Position position, const QPointF &pos) { - VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id); + VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id); VSpline spl = splPath.GetSpline(indexSpline); if (position == SplinePoint::FirstPoint) { @@ -221,7 +221,7 @@ void VModelingSplinePath::contextMenuEvent(QGraphicsSceneContextMenuEvent *event void VModelingSplinePath::AddToFile() { - VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id); + VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); @@ -271,7 +271,7 @@ void VModelingSplinePath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void VModelingSplinePath::RemoveReferens() { - VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id); + VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id); for (qint32 i = 0; i < splPath.Count(); ++i) { doc->DecrementReferens(splPath[i].P()); @@ -280,7 +280,7 @@ void VModelingSplinePath::RemoveReferens() void VModelingSplinePath::RefreshGeometry() { - VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id); + VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id); QPainterPath path; path.addPath(splPath.GetPath()); path.setFillRule( Qt::WindingFill ); diff --git a/tools/modelingTools/vmodelingsplinepath.h b/src/tools/modelingTools/vmodelingsplinepath.h similarity index 63% rename from tools/modelingTools/vmodelingsplinepath.h rename to src/tools/modelingTools/vmodelingsplinepath.h index 09d77d2ff..3a7ebc519 100644 --- a/tools/modelingTools/vmodelingsplinepath.h +++ b/src/tools/modelingTools/vmodelingsplinepath.h @@ -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 &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; + /** + * @brief controlPoints + */ QVector 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); }; diff --git a/tools/modelingTools/vmodelingtool.cpp b/src/tools/modelingTools/vmodelingtool.cpp similarity index 100% rename from tools/modelingTools/vmodelingtool.cpp rename to src/tools/modelingTools/vmodelingtool.cpp diff --git a/tools/modelingTools/vmodelingtool.h b/src/tools/modelingTools/vmodelingtool.h similarity index 84% rename from tools/modelingTools/vmodelingtool.h rename to src/tools/modelingTools/vmodelingtool.h index 53c57236c..2387104c0 100644 --- a/tools/modelingTools/vmodelingtool.h +++ b/src/tools/modelingTools/vmodelingtool.h @@ -32,22 +32,63 @@ #include "../vabstracttool.h" #include +/** + * @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 + /** + * @brief ContextMenu + * @param dialog + * @param tool + * @param event + * @param showRemove + */ void ContextMenu(QSharedPointer &dialog, Tool *tool, QGraphicsSceneContextMenuEvent *event, bool showRemove = true) { diff --git a/tools/modelingTools/vmodelingtriangle.cpp b/src/tools/modelingTools/vmodelingtriangle.cpp similarity index 100% rename from tools/modelingTools/vmodelingtriangle.cpp rename to src/tools/modelingTools/vmodelingtriangle.cpp diff --git a/tools/modelingTools/vmodelingtriangle.h b/src/tools/modelingTools/vmodelingtriangle.h similarity index 65% rename from tools/modelingTools/vmodelingtriangle.h rename to src/tools/modelingTools/vmodelingtriangle.h index 09dfdfb21..62ad4e844 100644 --- a/tools/modelingTools/vmodelingtriangle.h +++ b/src/tools/modelingTools/vmodelingtriangle.h @@ -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 &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; }; diff --git a/tools/nodeDetails/nodedetails.h b/src/tools/nodeDetails/nodedetails.h similarity index 100% rename from tools/nodeDetails/nodedetails.h rename to src/tools/nodeDetails/nodedetails.h diff --git a/tools/nodeDetails/vabstractnode.cpp b/src/tools/nodeDetails/vabstractnode.cpp similarity index 100% rename from tools/nodeDetails/vabstractnode.cpp rename to src/tools/nodeDetails/vabstractnode.cpp diff --git a/tools/nodeDetails/vabstractnode.h b/src/tools/nodeDetails/vabstractnode.h similarity index 72% rename from tools/nodeDetails/vabstractnode.h rename to src/tools/nodeDetails/vabstractnode.h index 7fff53e9e..b2190c760 100644 --- a/tools/nodeDetails/vabstractnode.h +++ b/src/tools/nodeDetails/vabstractnode.h @@ -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(); }; diff --git a/tools/nodeDetails/vnodearc.cpp b/src/tools/nodeDetails/vnodearc.cpp similarity index 98% rename from tools/nodeDetails/vnodearc.cpp rename to src/tools/nodeDetails/vnodearc.cpp index 826174a68..3ebf3808c 100644 --- a/tools/nodeDetails/vnodearc.cpp +++ b/src/tools/nodeDetails/vnodearc.cpp @@ -109,7 +109,7 @@ void VNodeArc::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void VNodeArc::RefreshGeometry() { - VArc arc = VAbstractTool::data.GetModelingArc(id); + VArc arc = VAbstractTool::data.GetArcModeling(id); QPainterPath path; path.addPath(arc.GetPath()); path.setFillRule( Qt::WindingFill ); diff --git a/tools/nodeDetails/vnodearc.h b/src/tools/nodeDetails/vnodearc.h similarity index 69% rename from tools/nodeDetails/vnodearc.h rename to src/tools/nodeDetails/vnodearc.h index f71096694..b99abd458 100644 --- a/tools/nodeDetails/vnodearc.h +++ b/src/tools/nodeDetails/vnodearc.h @@ -32,24 +32,74 @@ #include "vabstractnode.h" #include +/** + * @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(); }; diff --git a/tools/nodeDetails/vnodepoint.cpp b/src/tools/nodeDetails/vnodepoint.cpp similarity index 95% rename from tools/nodeDetails/vnodepoint.cpp rename to src/tools/nodeDetails/vnodepoint.cpp index e7495c3c3..b4bdfeb85 100644 --- a/tools/nodeDetails/vnodepoint.cpp +++ b/src/tools/nodeDetails/vnodepoint.cpp @@ -44,7 +44,7 @@ VNodePoint::VNodePoint(VDomDocument *doc, VContainer *data, qint64 id, qint64 id this->setBrush(QBrush(Qt::NoBrush)); this->setFlag(QGraphicsItem::ItemIsSelectable, true); this->setAcceptHoverEvents(true); - RefreshPointGeometry(VAbstractTool::data.GetModelingPoint(id)); + RefreshPointGeometry(VAbstractTool::data.GetPointModeling(id)); if (typeCreation == Tool::FromGui) { AddToFile(); @@ -69,12 +69,12 @@ void VNodePoint::Create(VDomDocument *doc, VContainer *data, qint64 id, qint64 i void VNodePoint::FullUpdateFromFile() { - RefreshPointGeometry(VAbstractTool::data.GetModelingPoint(id)); + RefreshPointGeometry(VAbstractTool::data.GetPointModeling(id)); } void VNodePoint::AddToFile() { - VPointF point = VAbstractTool::data.GetModelingPoint(id); + VPointF point = VAbstractTool::data.GetPointModeling(id); QDomElement domElement = doc->createElement(TagName); AddAttribute(domElement, AttrId, id); @@ -118,7 +118,7 @@ void VNodePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void VNodePoint::NameChangePosition(const QPointF &pos) { - VPointF point = VAbstractTool::data.GetModelingPoint(id); + VPointF point = VAbstractTool::data.GetPointModeling(id); QPointF p = pos - this->pos(); point.setMx(p.x()); point.setMy(p.y()); diff --git a/tools/nodeDetails/vnodepoint.h b/src/tools/nodeDetails/vnodepoint.h similarity index 66% rename from tools/nodeDetails/vnodepoint.h rename to src/tools/nodeDetails/vnodepoint.h index 7874715c6..fcc63b362 100644 --- a/tools/nodeDetails/vnodepoint.h +++ b/src/tools/nodeDetails/vnodepoint.h @@ -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) diff --git a/tools/nodeDetails/vnodespline.cpp b/src/tools/nodeDetails/vnodespline.cpp similarity index 98% rename from tools/nodeDetails/vnodespline.cpp rename to src/tools/nodeDetails/vnodespline.cpp index 26dd21a01..56ed8fc25 100644 --- a/tools/nodeDetails/vnodespline.cpp +++ b/src/tools/nodeDetails/vnodespline.cpp @@ -111,7 +111,7 @@ void VNodeSpline::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void VNodeSpline::RefreshGeometry() { - VSpline spl = VAbstractTool::data.GetModelingSpline(id); + VSpline spl = VAbstractTool::data.GetSplineModeling(id); QPainterPath path; path.addPath(spl.GetPath()); path.setFillRule( Qt::WindingFill ); diff --git a/tools/nodeDetails/vnodespline.h b/src/tools/nodeDetails/vnodespline.h similarity index 69% rename from tools/nodeDetails/vnodespline.h rename to src/tools/nodeDetails/vnodespline.h index fc8dcb202..016992a35 100644 --- a/tools/nodeDetails/vnodespline.h +++ b/src/tools/nodeDetails/vnodespline.h @@ -32,25 +32,76 @@ #include "vabstractnode.h" #include +/** + * @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 (); }; diff --git a/tools/nodeDetails/vnodesplinepath.cpp b/src/tools/nodeDetails/vnodesplinepath.cpp similarity index 96% rename from tools/nodeDetails/vnodesplinepath.cpp rename to src/tools/nodeDetails/vnodesplinepath.cpp index 8defab838..ebd70564f 100644 --- a/tools/nodeDetails/vnodesplinepath.cpp +++ b/src/tools/nodeDetails/vnodesplinepath.cpp @@ -55,7 +55,7 @@ void VNodeSplinePath::Create(VDomDocument *doc, VContainer *data, qint64 id, qin VNodeSplinePath *splPath = new VNodeSplinePath(doc, data, id, idSpline, typeobject, typeCreation); Q_ASSERT(splPath != 0); doc->AddTool(id, splPath); - VSplinePath path = data->GetModelingSplinePath(id); + VSplinePath path = data->GetSplinePathModeling(id); const QVector *points = path.GetPoint(); for (qint32 i = 0; isize(); ++i) { @@ -115,7 +115,7 @@ void VNodeSplinePath::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) void VNodeSplinePath::RefreshGeometry() { - VSplinePath splPath = VAbstractTool::data.GetModelingSplinePath(id); + VSplinePath splPath = VAbstractTool::data.GetSplinePathModeling(id); QPainterPath path; path.addPath(splPath.GetPath()); path.setFillRule( Qt::WindingFill ); diff --git a/tools/nodeDetails/vnodesplinepath.h b/src/tools/nodeDetails/vnodesplinepath.h similarity index 69% rename from tools/nodeDetails/vnodesplinepath.h rename to src/tools/nodeDetails/vnodesplinepath.h index f5b0c9cba..831e9860d 100644 --- a/tools/nodeDetails/vnodesplinepath.h +++ b/src/tools/nodeDetails/vnodesplinepath.h @@ -32,24 +32,74 @@ #include "vabstractnode.h" #include +/** + * @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(); }; diff --git a/tools/tools.h b/src/tools/tools.h similarity index 100% rename from tools/tools.h rename to src/tools/tools.h diff --git a/src/tools/tools.pri b/src/tools/tools.pri new file mode 100644 index 000000000..513853538 --- /dev/null +++ b/src/tools/tools.pri @@ -0,0 +1,93 @@ +HEADERS += \ + src/tools/vtooldetail.h \ + src/tools/vdatatool.h \ + src/tools/vabstracttool.h \ + src/tools/tools.h \ + src/tools/drawTools/vtooltriangle.h \ + src/tools/drawTools/vtoolsplinepath.h \ + src/tools/drawTools/vtoolspline.h \ + src/tools/drawTools/vtoolsinglepoint.h \ + src/tools/drawTools/vtoolshoulderpoint.h \ + src/tools/drawTools/vtoolpointofintersection.h \ + src/tools/drawTools/vtoolpointofcontact.h \ + src/tools/drawTools/vtoolpoint.h \ + src/tools/drawTools/vtoolnormal.h \ + src/tools/drawTools/vtoollinepoint.h \ + src/tools/drawTools/vtoollineintersect.h \ + src/tools/drawTools/vtoolline.h \ + src/tools/drawTools/vtoolheight.h \ + src/tools/drawTools/vtoolendline.h \ + src/tools/drawTools/vtoolbisector.h \ + src/tools/drawTools/vtoolarc.h \ + src/tools/drawTools/vtoolalongline.h \ + src/tools/drawTools/vdrawtool.h \ + src/tools/drawTools/drawtools.h \ + src/tools/modelingTools/vmodelingtriangle.h \ + src/tools/modelingTools/vmodelingtool.h \ + src/tools/modelingTools/vmodelingsplinepath.h \ + src/tools/modelingTools/vmodelingspline.h \ + src/tools/modelingTools/vmodelingshoulderpoint.h \ + src/tools/modelingTools/vmodelingpointofintersection.h \ + src/tools/modelingTools/vmodelingpointofcontact.h \ + src/tools/modelingTools/vmodelingpoint.h \ + src/tools/modelingTools/vmodelingnormal.h \ + src/tools/modelingTools/vmodelinglinepoint.h \ + src/tools/modelingTools/vmodelinglineintersect.h \ + src/tools/modelingTools/vmodelingline.h \ + src/tools/modelingTools/vmodelingheight.h \ + src/tools/modelingTools/vmodelingendline.h \ + src/tools/modelingTools/vmodelingbisector.h \ + src/tools/modelingTools/vmodelingarc.h \ + src/tools/modelingTools/vmodelingalongline.h \ + src/tools/modelingTools/modelingtools.h \ + src/tools/nodeDetails/vnodesplinepath.h \ + src/tools/nodeDetails/vnodespline.h \ + src/tools/nodeDetails/vnodepoint.h \ + src/tools/nodeDetails/vnodearc.h \ + src/tools/nodeDetails/vabstractnode.h \ + src/tools/nodeDetails/nodedetails.h + +SOURCES += \ + src/tools/vtooldetail.cpp \ + src/tools/vdatatool.cpp \ + src/tools/vabstracttool.cpp \ + src/tools/drawTools/vtooltriangle.cpp \ + src/tools/drawTools/vtoolsplinepath.cpp \ + src/tools/drawTools/vtoolspline.cpp \ + src/tools/drawTools/vtoolsinglepoint.cpp \ + src/tools/drawTools/vtoolshoulderpoint.cpp \ + src/tools/drawTools/vtoolpointofintersection.cpp \ + src/tools/drawTools/vtoolpointofcontact.cpp \ + src/tools/drawTools/vtoolpoint.cpp \ + src/tools/drawTools/vtoolnormal.cpp \ + src/tools/drawTools/vtoollinepoint.cpp \ + src/tools/drawTools/vtoollineintersect.cpp \ + src/tools/drawTools/vtoolline.cpp \ + src/tools/drawTools/vtoolheight.cpp \ + src/tools/drawTools/vtoolendline.cpp \ + src/tools/drawTools/vtoolbisector.cpp \ + src/tools/drawTools/vtoolarc.cpp \ + src/tools/drawTools/vtoolalongline.cpp \ + src/tools/drawTools/vdrawtool.cpp \ + src/tools/modelingTools/vmodelingtriangle.cpp \ + src/tools/modelingTools/vmodelingtool.cpp \ + src/tools/modelingTools/vmodelingsplinepath.cpp \ + src/tools/modelingTools/vmodelingspline.cpp \ + src/tools/modelingTools/vmodelingshoulderpoint.cpp \ + src/tools/modelingTools/vmodelingpointofintersection.cpp \ + src/tools/modelingTools/vmodelingpointofcontact.cpp \ + src/tools/modelingTools/vmodelingpoint.cpp \ + src/tools/modelingTools/vmodelingnormal.cpp \ + src/tools/modelingTools/vmodelinglinepoint.cpp \ + src/tools/modelingTools/vmodelinglineintersect.cpp \ + src/tools/modelingTools/vmodelingline.cpp \ + src/tools/modelingTools/vmodelingheight.cpp \ + src/tools/modelingTools/vmodelingendline.cpp \ + src/tools/modelingTools/vmodelingbisector.cpp \ + src/tools/modelingTools/vmodelingarc.cpp \ + src/tools/modelingTools/vmodelingalongline.cpp \ + src/tools/nodeDetails/vnodesplinepath.cpp \ + src/tools/nodeDetails/vnodespline.cpp \ + src/tools/nodeDetails/vnodepoint.cpp \ + src/tools/nodeDetails/vnodearc.cpp \ + src/tools/nodeDetails/vabstractnode.cpp diff --git a/tools/vabstracttool.cpp b/src/tools/vabstracttool.cpp similarity index 100% rename from tools/vabstracttool.cpp rename to src/tools/vabstracttool.cpp diff --git a/tools/vabstracttool.h b/src/tools/vabstracttool.h similarity index 60% rename from tools/vabstracttool.h rename to src/tools/vabstracttool.h index f3a2ea372..038b3e2d4 100644 --- a/tools/vabstracttool.h +++ b/src/tools/vabstracttool.h @@ -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 ¢er, 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 + /** + * @brief AddAttribute + * @param domElement + * @param name + * @param value + */ void AddAttribute(QDomElement &domElement, const QString &name, const T &value) { QDomAttr domAttr = doc->createAttribute(name); diff --git a/tools/vdatatool.cpp b/src/tools/vdatatool.cpp similarity index 100% rename from tools/vdatatool.cpp rename to src/tools/vdatatool.cpp diff --git a/tools/vdatatool.h b/src/tools/vdatatool.h similarity index 75% rename from tools/vdatatool.h rename to src/tools/vdatatool.h index 86d0b2927..a7b0cfcf5 100644 --- a/tools/vdatatool.h +++ b/src/tools/vdatatool.h @@ -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; }; diff --git a/tools/vtooldetail.cpp b/src/tools/vtooldetail.cpp similarity index 97% rename from tools/vtooldetail.cpp rename to src/tools/vtooldetail.cpp index 3556182cf..aeffdcee5 100644 --- a/tools/vtooldetail.cpp +++ b/src/tools/vtooldetail.cpp @@ -148,9 +148,9 @@ void VToolDetail::Create(QSharedPointer &dialog, VMainGraphicsScen } else { - point = data->GetModelingPoint(detail[i].getId()); + point = data->GetPointModeling(detail[i].getId()); } - id = data->AddModelingPoint(point); + id = data->AddPointModeling(point); VNodePoint::Create(doc, data, id, detail[i].getId(), detail[i].getMode(), Document::FullParse, Tool::FromGui); } @@ -164,9 +164,9 @@ void VToolDetail::Create(QSharedPointer &dialog, VMainGraphicsScen } else { - arc = data->GetModelingArc(detail[i].getId()); + arc = data->GetArcModeling(detail[i].getId()); } - id = data->AddModelingArc(arc); + id = data->AddArcModeling(arc); VNodeArc::Create(doc, data, id, detail[i].getId(), detail[i].getMode(), Document::FullParse, Tool::FromGui); } @@ -180,9 +180,9 @@ void VToolDetail::Create(QSharedPointer &dialog, VMainGraphicsScen } else { - spline = data->GetModelingSpline(detail[i].getId()); + spline = data->GetSplineModeling(detail[i].getId()); } - id = data->AddModelingSpline(spline); + id = data->AddSplineModeling(spline); VNodeSpline::Create(doc, data, id, detail[i].getId(), detail[i].getMode(), Document::FullParse, Tool::FromGui); } @@ -196,9 +196,9 @@ void VToolDetail::Create(QSharedPointer &dialog, VMainGraphicsScen } else { - splinePath = data->GetModelingSplinePath(detail[i].getId()); + splinePath = data->GetSplinePathModeling(detail[i].getId()); } - id = data->AddModelingSplinePath(splinePath); + id = data->AddSplinePathModeling(splinePath); VNodeSplinePath::Create(doc, data, id, detail[i].getId(), detail[i].getMode(), Document::FullParse, Tool::FromGui); } diff --git a/tools/vtooldetail.h b/src/tools/vtooldetail.h similarity index 66% rename from tools/vtooldetail.h rename to src/tools/vtooldetail.h index b0079d5b8..571d13c05 100644 --- a/tools/vtooldetail.h +++ b/src/tools/vtooldetail.h @@ -33,20 +33,58 @@ #include #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 &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 + /** + * @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; + /** + * @brief sceneDetails + */ VMainGraphicsScene *sceneDetails; + /** + * @brief RefreshGeometry + */ void RefreshGeometry (); + /** + * @brief AddNode + * @param domElement + * @param node + */ void AddNode(QDomElement &domElement, VNodeDetail &node); template + /** + * @brief InitTool + * @param scene + * @param node + */ void InitTool(VMainGraphicsScene *scene, const VNodeDetail &node); }; diff --git a/version.h b/src/version.h similarity index 100% rename from version.h rename to src/version.h diff --git a/widgets/doubledelegate.cpp b/src/widgets/doubledelegate.cpp similarity index 100% rename from widgets/doubledelegate.cpp rename to src/widgets/doubledelegate.cpp diff --git a/widgets/doubledelegate.h b/src/widgets/doubledelegate.h similarity index 76% rename from widgets/doubledelegate.h rename to src/widgets/doubledelegate.h index c4bc8ac49..c69a53e29 100644 --- a/widgets/doubledelegate.h +++ b/src/widgets/doubledelegate.h @@ -31,14 +31,45 @@ #include +/** + * @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; }; diff --git a/widgets/vapplication.cpp b/src/widgets/vapplication.cpp similarity index 100% rename from widgets/vapplication.cpp rename to src/widgets/vapplication.cpp diff --git a/widgets/vapplication.h b/src/widgets/vapplication.h similarity index 87% rename from widgets/vapplication.h rename to src/widgets/vapplication.h index 359dd1806..03a099690 100644 --- a/widgets/vapplication.h +++ b/src/widgets/vapplication.h @@ -31,12 +31,26 @@ #include +/** + * @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); }; diff --git a/widgets/vcontrolpointspline.cpp b/src/widgets/vcontrolpointspline.cpp similarity index 100% rename from widgets/vcontrolpointspline.cpp rename to src/widgets/vcontrolpointspline.cpp diff --git a/widgets/vcontrolpointspline.h b/src/widgets/vcontrolpointspline.h similarity index 67% rename from widgets/vcontrolpointspline.h rename to src/widgets/vcontrolpointspline.h index fddc4ccec..6b34f77a9 100644 --- a/widgets/vcontrolpointspline.h +++ b/src/widgets/vcontrolpointspline.h @@ -33,33 +33,110 @@ #include #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 ¢er, 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; }; diff --git a/widgets/vgraphicssimpletextitem.cpp b/src/widgets/vgraphicssimpletextitem.cpp similarity index 100% rename from widgets/vgraphicssimpletextitem.cpp rename to src/widgets/vgraphicssimpletextitem.cpp diff --git a/widgets/vgraphicssimpletextitem.h b/src/widgets/vgraphicssimpletextitem.h similarity index 73% rename from widgets/vgraphicssimpletextitem.h rename to src/widgets/vgraphicssimpletextitem.h index 3f3b2a2a8..753a68497 100644 --- a/widgets/vgraphicssimpletextitem.h +++ b/src/widgets/vgraphicssimpletextitem.h @@ -31,20 +31,57 @@ #include +/** + * @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; }; diff --git a/widgets/vitem.cpp b/src/widgets/vitem.cpp similarity index 100% rename from widgets/vitem.cpp rename to src/widgets/vitem.cpp diff --git a/widgets/vitem.h b/src/widgets/vitem.h similarity index 97% rename from widgets/vitem.h rename to src/widgets/vitem.h index 750b41305..6d1f01254 100644 --- a/widgets/vitem.h +++ b/src/widgets/vitem.h @@ -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: /** diff --git a/widgets/vmaingraphicsscene.cpp b/src/widgets/vmaingraphicsscene.cpp similarity index 100% rename from widgets/vmaingraphicsscene.cpp rename to src/widgets/vmaingraphicsscene.cpp diff --git a/widgets/vmaingraphicsscene.h b/src/widgets/vmaingraphicsscene.h similarity index 66% rename from widgets/vmaingraphicsscene.h rename to src/widgets/vmaingraphicsscene.h index 8d605d64d..ef8b99769 100644 --- a/widgets/vmaingraphicsscene.h +++ b/src/widgets/vmaingraphicsscene.h @@ -31,31 +31,105 @@ #include +/** + * @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; }; diff --git a/widgets/vmaingraphicsview.cpp b/src/widgets/vmaingraphicsview.cpp similarity index 100% rename from widgets/vmaingraphicsview.cpp rename to src/widgets/vmaingraphicsview.cpp diff --git a/widgets/vmaingraphicsview.h b/src/widgets/vmaingraphicsview.h similarity index 80% rename from widgets/vmaingraphicsview.h rename to src/widgets/vmaingraphicsview.h index c4bb43956..a42d53967 100644 --- a/widgets/vmaingraphicsview.h +++ b/src/widgets/vmaingraphicsview.h @@ -31,15 +31,33 @@ #include +/** + * @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; }; diff --git a/widgets/vtablegraphicsview.cpp b/src/widgets/vtablegraphicsview.cpp similarity index 100% rename from widgets/vtablegraphicsview.cpp rename to src/widgets/vtablegraphicsview.cpp diff --git a/widgets/vtablegraphicsview.h b/src/widgets/vtablegraphicsview.h similarity index 97% rename from widgets/vtablegraphicsview.h rename to src/widgets/vtablegraphicsview.h index da6f9a5fa..fc93206b9 100644 --- a/widgets/vtablegraphicsview.h +++ b/src/widgets/vtablegraphicsview.h @@ -31,10 +31,16 @@ #include +/** + * @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: diff --git a/src/widgets/widgets.pri b/src/widgets/widgets.pri new file mode 100644 index 000000000..6dbdb83e2 --- /dev/null +++ b/src/widgets/widgets.pri @@ -0,0 +1,19 @@ +HEADERS += \ + src/widgets/vtablegraphicsview.h \ + src/widgets/vmaingraphicsview.h \ + src/widgets/vmaingraphicsscene.h \ + src/widgets/vitem.h \ + src/widgets/vgraphicssimpletextitem.h \ + src/widgets/vcontrolpointspline.h \ + src/widgets/vapplication.h \ + src/widgets/doubledelegate.h + +SOURCES += \ + src/widgets/vtablegraphicsview.cpp \ + src/widgets/vmaingraphicsview.cpp \ + src/widgets/vmaingraphicsscene.cpp \ + src/widgets/vitem.cpp \ + src/widgets/vgraphicssimpletextitem.cpp \ + src/widgets/vcontrolpointspline.cpp \ + src/widgets/vapplication.cpp \ + src/widgets/doubledelegate.cpp diff --git a/xml/vdomdocument.cpp b/src/xml/vdomdocument.cpp similarity index 98% rename from xml/vdomdocument.cpp rename to src/xml/vdomdocument.cpp index 55071e861..a61dceb0d 100644 --- a/xml/vdomdocument.cpp +++ b/src/xml/vdomdocument.cpp @@ -591,28 +591,28 @@ void VDomDocument::ParseDetailElement(VMainGraphicsScene *sceneDetail, const QDo if (t == "NodePoint") { tool = Tool::NodePoint; - VPointF point = data->GetModelingPoint(id); + VPointF point = data->GetPointModeling(id); mode = point.getMode(); oldDetail.append(VNodeDetail(point.getIdObject(), tool, mode, NodeDetail::Contour)); } else if (t == "NodeArc") { tool = Tool::NodeArc; - VArc arc = data->GetModelingArc(id); + VArc arc = data->GetArcModeling(id); mode = arc.getMode(); oldDetail.append(VNodeDetail(arc.getIdObject(), tool, mode, NodeDetail::Contour)); } else if (t == "NodeSpline") { tool = Tool::NodeSpline; - VSpline spl = data->GetModelingSpline(id); + VSpline spl = data->GetSplineModeling(id); mode = spl.getMode(); oldDetail.append(VNodeDetail(spl.getIdObject(), tool, mode, NodeDetail::Contour)); } else if (t == "NodeSplinePath") { tool = Tool::NodeSplinePath; - VSplinePath splPath = data->GetModelingSplinePath(id); + VSplinePath splPath = data->GetSplinePathModeling(id); mode = splPath.getMode(); oldDetail.append(VNodeDetail(splPath.getIdObject(), tool, mode, NodeDetail::Contour)); } @@ -993,11 +993,11 @@ void VDomDocument::ParsePointElement(VMainGraphicsScene *scene, const QDomElemen else { typeObject = Draw::Modeling; - point = data->GetModelingPoint(idObject); + point = data->GetPointModeling(idObject); } qreal mx = toPixel(GetParametrDouble(domElement, "mx")); qreal my = toPixel(GetParametrDouble(domElement, "my")); - data->UpdateModelingPoint(id, VPointF(point.x(), point.y(), point.name(), mx, my, typeObject, + data->UpdatePointModeling(id, VPointF(point.x(), point.y(), point.name(), mx, my, typeObject, idObject )); VNodePoint::Create(this, data, id, idObject, mode, parse, Tool::FromFile); return; @@ -1236,11 +1236,11 @@ void VDomDocument::ParseSplineElement(VMainGraphicsScene *scene, const QDomEleme else { typeObject = Draw::Modeling; - spl = data->GetModelingSpline(idObject); + spl = data->GetSplineModeling(idObject); } spl.setMode(typeObject); spl.setIdObject(idObject); - data->UpdateModelingSpline(id, spl); + data->UpdateSplineModeling(id, spl); VNodeSpline::Create(this, data, id, idObject, mode, parse, Tool::FromFile); return; } @@ -1268,11 +1268,11 @@ void VDomDocument::ParseSplineElement(VMainGraphicsScene *scene, const QDomEleme else { typeObject = Draw::Modeling; - path = data->GetModelingSplinePath(idObject); + path = data->GetSplinePathModeling(idObject); } path.setMode(typeObject); path.setIdObject(idObject); - data->UpdateModelingSplinePath(id, path); + data->UpdateSplinePathModeling(id, path); VNodeSplinePath::Create(this, data, id, idObject, mode, parse, Tool::FromFile); return; } @@ -1336,11 +1336,11 @@ void VDomDocument::ParseArcElement(VMainGraphicsScene *scene, const QDomElement else { typeObject = Draw::Modeling; - arc = data->GetModelingArc(idObject); + arc = data->GetArcModeling(idObject); } arc.setMode(typeObject); arc.setIdObject(idObject); - data->UpdateModelingArc(id, arc); + data->UpdateArcModeling(id, arc); VNodeArc::Create(this, data, id, idObject, mode, parse, Tool::FromFile); return; } diff --git a/xml/vdomdocument.h b/src/xml/vdomdocument.h similarity index 56% rename from xml/vdomdocument.h rename to src/xml/vdomdocument.h index 1042beb9a..b13cf58c0 100644 --- a/xml/vdomdocument.h +++ b/src/xml/vdomdocument.h @@ -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* getTools() {return &tools;} + /** + * @brief getHistory + * @return + */ inline QVector *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 map; + /** + * @brief nameActivDraw + */ QString nameActivDraw; + /** + * @brief data container with data + */ VContainer *data; + /** + * @brief tools + */ QHash tools; + /** + * @brief history + */ QVector 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 &vector)const; }; diff --git a/xml/vtoolrecord.cpp b/src/xml/vtoolrecord.cpp similarity index 100% rename from xml/vtoolrecord.cpp rename to src/xml/vtoolrecord.cpp diff --git a/xml/vtoolrecord.h b/src/xml/vtoolrecord.h similarity index 70% rename from xml/vtoolrecord.h rename to src/xml/vtoolrecord.h index a2f964970..77ed466f3 100644 --- a/xml/vtoolrecord.h +++ b/src/xml/vtoolrecord.h @@ -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; }; diff --git a/src/xml/xml.pri b/src/xml/xml.pri new file mode 100644 index 000000000..0214e42b5 --- /dev/null +++ b/src/xml/xml.pri @@ -0,0 +1,7 @@ +HEADERS += \ + src/xml/vtoolrecord.h \ + src/xml/vdomdocument.h + +SOURCES += \ + src/xml/vtoolrecord.cpp \ + src/xml/vdomdocument.cpp diff --git a/tools/tools.pri b/tools/tools.pri deleted file mode 100644 index 818066245..000000000 --- a/tools/tools.pri +++ /dev/null @@ -1,93 +0,0 @@ -HEADERS += \ - tools/vtooldetail.h \ - tools/vdatatool.h \ - tools/vabstracttool.h \ - tools/tools.h \ - tools/drawTools/vtooltriangle.h \ - tools/drawTools/vtoolsplinepath.h \ - tools/drawTools/vtoolspline.h \ - tools/drawTools/vtoolsinglepoint.h \ - tools/drawTools/vtoolshoulderpoint.h \ - tools/drawTools/vtoolpointofintersection.h \ - tools/drawTools/vtoolpointofcontact.h \ - tools/drawTools/vtoolpoint.h \ - tools/drawTools/vtoolnormal.h \ - tools/drawTools/vtoollinepoint.h \ - tools/drawTools/vtoollineintersect.h \ - tools/drawTools/vtoolline.h \ - tools/drawTools/vtoolheight.h \ - tools/drawTools/vtoolendline.h \ - tools/drawTools/vtoolbisector.h \ - tools/drawTools/vtoolarc.h \ - tools/drawTools/vtoolalongline.h \ - tools/drawTools/vdrawtool.h \ - tools/drawTools/drawtools.h \ - tools/modelingTools/vmodelingtriangle.h \ - tools/modelingTools/vmodelingtool.h \ - tools/modelingTools/vmodelingsplinepath.h \ - tools/modelingTools/vmodelingspline.h \ - tools/modelingTools/vmodelingshoulderpoint.h \ - tools/modelingTools/vmodelingpointofintersection.h \ - tools/modelingTools/vmodelingpointofcontact.h \ - tools/modelingTools/vmodelingpoint.h \ - tools/modelingTools/vmodelingnormal.h \ - tools/modelingTools/vmodelinglinepoint.h \ - tools/modelingTools/vmodelinglineintersect.h \ - tools/modelingTools/vmodelingline.h \ - tools/modelingTools/vmodelingheight.h \ - tools/modelingTools/vmodelingendline.h \ - tools/modelingTools/vmodelingbisector.h \ - tools/modelingTools/vmodelingarc.h \ - tools/modelingTools/vmodelingalongline.h \ - tools/modelingTools/modelingtools.h \ - tools/nodeDetails/vnodesplinepath.h \ - tools/nodeDetails/vnodespline.h \ - tools/nodeDetails/vnodepoint.h \ - tools/nodeDetails/vnodearc.h \ - tools/nodeDetails/vabstractnode.h \ - tools/nodeDetails/nodedetails.h - -SOURCES += \ - tools/vtooldetail.cpp \ - tools/vdatatool.cpp \ - tools/vabstracttool.cpp \ - tools/drawTools/vtooltriangle.cpp \ - tools/drawTools/vtoolsplinepath.cpp \ - tools/drawTools/vtoolspline.cpp \ - tools/drawTools/vtoolsinglepoint.cpp \ - tools/drawTools/vtoolshoulderpoint.cpp \ - tools/drawTools/vtoolpointofintersection.cpp \ - tools/drawTools/vtoolpointofcontact.cpp \ - tools/drawTools/vtoolpoint.cpp \ - tools/drawTools/vtoolnormal.cpp \ - tools/drawTools/vtoollinepoint.cpp \ - tools/drawTools/vtoollineintersect.cpp \ - tools/drawTools/vtoolline.cpp \ - tools/drawTools/vtoolheight.cpp \ - tools/drawTools/vtoolendline.cpp \ - tools/drawTools/vtoolbisector.cpp \ - tools/drawTools/vtoolarc.cpp \ - tools/drawTools/vtoolalongline.cpp \ - tools/drawTools/vdrawtool.cpp \ - tools/modelingTools/vmodelingtriangle.cpp \ - tools/modelingTools/vmodelingtool.cpp \ - tools/modelingTools/vmodelingsplinepath.cpp \ - tools/modelingTools/vmodelingspline.cpp \ - tools/modelingTools/vmodelingshoulderpoint.cpp \ - tools/modelingTools/vmodelingpointofintersection.cpp \ - tools/modelingTools/vmodelingpointofcontact.cpp \ - tools/modelingTools/vmodelingpoint.cpp \ - tools/modelingTools/vmodelingnormal.cpp \ - tools/modelingTools/vmodelinglinepoint.cpp \ - tools/modelingTools/vmodelinglineintersect.cpp \ - tools/modelingTools/vmodelingline.cpp \ - tools/modelingTools/vmodelingheight.cpp \ - tools/modelingTools/vmodelingendline.cpp \ - tools/modelingTools/vmodelingbisector.cpp \ - tools/modelingTools/vmodelingarc.cpp \ - tools/modelingTools/vmodelingalongline.cpp \ - tools/nodeDetails/vnodesplinepath.cpp \ - tools/nodeDetails/vnodespline.cpp \ - tools/nodeDetails/vnodepoint.cpp \ - tools/nodeDetails/vnodearc.cpp \ - tools/nodeDetails/vabstractnode.cpp diff --git a/widgets/widgets.pri b/widgets/widgets.pri deleted file mode 100644 index 4b908b906..000000000 --- a/widgets/widgets.pri +++ /dev/null @@ -1,19 +0,0 @@ -HEADERS += \ - widgets/vtablegraphicsview.h \ - widgets/vmaingraphicsview.h \ - widgets/vmaingraphicsscene.h \ - widgets/vitem.h \ - widgets/vgraphicssimpletextitem.h \ - widgets/vcontrolpointspline.h \ - widgets/vapplication.h \ - widgets/doubledelegate.h - -SOURCES += \ - widgets/vtablegraphicsview.cpp \ - widgets/vmaingraphicsview.cpp \ - widgets/vmaingraphicsscene.cpp \ - widgets/vitem.cpp \ - widgets/vgraphicssimpletextitem.cpp \ - widgets/vcontrolpointspline.cpp \ - widgets/vapplication.cpp \ - widgets/doubledelegate.cpp diff --git a/xml/xml.pri b/xml/xml.pri deleted file mode 100644 index 71489d606..000000000 --- a/xml/xml.pri +++ /dev/null @@ -1,7 +0,0 @@ -HEADERS += \ - xml/vtoolrecord.h \ - xml/vdomdocument.h - -SOURCES += \ - xml/vtoolrecord.cpp \ - xml/vdomdocument.cpp