Refactoring.

--HG--
branch : develop
This commit is contained in:
dismine 2013-10-27 12:22:44 +02:00
parent 3b908ae328
commit 61be0a0a93
10 changed files with 228 additions and 461 deletions

View File

@ -20,7 +20,6 @@
****************************************************************************/ ****************************************************************************/
#include "calculator.h" #include "calculator.h"
#include <QDebug>
#define DELIMITER 1 #define DELIMITER 1
#define VARIABLE 2 #define VARIABLE 2

View File

@ -22,15 +22,13 @@
#ifndef CALCULATOR_H #ifndef CALCULATOR_H
#define CALCULATOR_H #define CALCULATOR_H
#include <QString>
#include "vcontainer.h" #include "vcontainer.h"
/** /**
* @brief The Calculator клас калькулятора формул лекал. Виконує розрахунок формул з підставлянням * @brief The Calculator клас калькулятора формул лекал. Виконує розрахунок формул з підставлянням
* значеннь зміних. * значеннь зміних.
*/ */
class Calculator class Calculator{
{
public: public:
/** /**
* @brief Calculator конструктор класу. Використовується при розрахунку лекала. * @brief Calculator конструктор класу. Використовується при розрахунку лекала.

View File

@ -20,8 +20,6 @@
****************************************************************************/ ****************************************************************************/
#include "vcontainer.h" #include "vcontainer.h"
#include <QDebug>
#include "options.h"
#include <exception/vexceptionbadid.h> #include <exception/vexceptionbadid.h>
qint64 VContainer::_id = 0; qint64 VContainer::_id = 0;
@ -85,14 +83,6 @@ val VContainer::GetObject(const QHash<key, val> &obj, key id){
} }
} }
VPointF VContainer::GetPoint(qint64 id) const{
return GetObject(points, id);
}
VPointF VContainer::GetModelingPoint(qint64 id) const{
return GetObject(modelingPoints, id);
}
VStandartTableCell VContainer::GetStandartTableCell(const QString &name) const{ VStandartTableCell VContainer::GetStandartTableCell(const QString &name) const{
Q_ASSERT(!name.isEmpty()); Q_ASSERT(!name.isEmpty());
return GetObject(standartTable, name); return GetObject(standartTable, name);
@ -123,44 +113,16 @@ qreal VContainer::GetLineAngle(const QString &name) const{
return GetObject(lineAngles, name); return GetObject(lineAngles, name);
} }
VSpline VContainer::GetSpline(qint64 id) const{ qint64 VContainer::AddPoint(const VPointF &point){
return GetObject(splines, id); return AddObject(points, point);
} }
VSpline VContainer::GetModelingSpline(qint64 id) const{ qint64 VContainer::AddModelingPoint(const VPointF &point){
return GetObject(modelingSplines, id); return AddObject(modelingPoints, point);
} }
VArc VContainer::GetArc(qint64 id) const{ qint64 VContainer::AddDetail(const VDetail &detail){
return GetObject(arcs, id); return AddObject(details, detail);
}
VArc VContainer::GetModelingArc(qint64 id) const{
return GetObject(modelingArcs, id);
}
VSplinePath VContainer::GetSplinePath(qint64 id) const{
return GetObject(splinePaths, id);
}
VSplinePath VContainer::GetModelingSplinePath(qint64 id) const{
return GetObject(modelingSplinePaths, id);
}
VDetail VContainer::GetDetail(qint64 id) const{
return GetObject(details, id);
}
void VContainer::AddStandartTableCell(const QString& name, const VStandartTableCell& cell){
standartTable[name] = cell;
}
void VContainer::AddIncrementTableRow(const QString& name, const VIncrementTableRow& cell){
incrementTable[name] = cell;
}
qint64 VContainer::getId(){
return _id;
} }
qint64 VContainer::getNextId(){ qint64 VContainer::getNextId(){
@ -444,10 +406,6 @@ void VContainer::PrepareDetails(QVector<VItem *> &list) const{
} }
} }
void VContainer::RemoveIncrementTableRow(const QString& name){
incrementTable.remove(name);
}
template <typename val> template <typename val>
void VContainer::UpdateObject(QHash<qint64, val> &obj, const qint64 &id, const val& point){ void VContainer::UpdateObject(QHash<qint64, val> &obj, const qint64 &id, const val& point){
Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0"); Q_ASSERT_X(id > 0, Q_FUNC_INFO, "id <= 0");
@ -455,50 +413,6 @@ void VContainer::UpdateObject(QHash<qint64, val> &obj, const qint64 &id, const v
UpdateId(id); UpdateId(id);
} }
void VContainer::UpdatePoint(qint64 id, const VPointF& point){
UpdateObject(points, id, point);
}
void VContainer::UpdateModelingPoint(qint64 id, const VPointF &point){
UpdateObject(modelingPoints, id, point);
}
void VContainer::UpdateDetail(qint64 id, const VDetail &detail){
UpdateObject(details, id, detail);
}
void VContainer::UpdateSpline(qint64 id, const VSpline &spl){
UpdateObject(splines, id, spl);
}
void VContainer::UpdateModelingSpline(qint64 id, const VSpline &spl){
UpdateObject(modelingSplines, id, spl);
}
void VContainer::UpdateSplinePath(qint64 id, const VSplinePath &splPath){
UpdateObject(splinePaths, id, splPath);
}
void VContainer::UpdateModelingSplinePath(qint64 id, const VSplinePath &splPath){
UpdateObject(modelingSplinePaths, id, splPath);
}
void VContainer::UpdateArc(qint64 id, const VArc &arc){
UpdateObject(arcs, id, arc);
}
void VContainer::UpdateModelingArc(qint64 id, const VArc &arc){
UpdateObject(modelingArcs, id, arc);
}
void VContainer::UpdateStandartTableCell(const QString& name, const VStandartTableCell& cell){
standartTable[name] = cell;
}
void VContainer::UpdateIncrementTableRow(const QString& name, const VIncrementTableRow& cell){
incrementTable[name] = cell;
}
void VContainer::AddLengthSpline(const QString &name, const qreal &value){ void VContainer::AddLengthSpline(const QString &name, const qreal &value){
Q_ASSERT(!name.isEmpty()); Q_ASSERT(!name.isEmpty());
lengthSplines[name] = value; lengthSplines[name] = value;
@ -557,46 +471,6 @@ void VContainer::ClearObject(){
splinePaths.clear(); splinePaths.clear();
} }
void VContainer::ClearIncrementTable(){
incrementTable.clear();
}
void VContainer::ClearLengthLines(){
lengthLines.clear();
}
void VContainer::ClearLengthSplines(){
lengthSplines.clear();
}
void VContainer::ClearLengthArcs(){
lengthArcs.clear();
}
void VContainer::ClearLineAngles(){
lineAngles.clear();
}
void VContainer::SetSize(qint32 size){
base["Сг"] = size;
}
void VContainer::SetGrowth(qint32 growth){
base["Р"] = growth;
}
qint32 VContainer::size() const{
return base.value("Сг");
}
qint32 VContainer::growth() const{
return base.value("Р");
}
bool VContainer::IncrementTableContains(const QString& name){
return incrementTable.contains(name);
}
qreal VContainer::FindVar(const QString &name, bool *ok)const{ qreal VContainer::FindVar(const QString &name, bool *ok)const{
if(base.contains(name)){ if(base.contains(name)){
*ok = true; *ok = true;
@ -631,70 +505,6 @@ qreal VContainer::FindVar(const QString &name, bool *ok)const{
return 0; return 0;
} }
const QHash<qint64, VPointF> *VContainer::DataPoints() const{
return &points;
}
const QHash<qint64, VPointF> *VContainer::DataModelingPoints() const{
return &modelingPoints;
}
const QHash<qint64, VSpline> *VContainer::DataSplines() const{
return &splines;
}
const QHash<qint64, VSpline> *VContainer::DataModelingSplines() const{
return &modelingSplines;
}
const QHash<qint64, VArc> *VContainer::DataArcs() const{
return &arcs;
}
const QHash<qint64, VArc> *VContainer::DataModelingArcs() const{
return &modelingArcs;
}
const QHash<QString, qint32> *VContainer::DataBase() const{
return &base;
}
const QHash<QString, VStandartTableCell> *VContainer::DataStandartTable() const{
return &standartTable;
}
const QHash<QString, VIncrementTableRow> *VContainer::DataIncrementTable() const{
return &incrementTable;
}
const QHash<QString, qreal> *VContainer::DataLengthLines() const{
return &lengthLines;
}
const QHash<QString, qreal> *VContainer::DataLengthSplines() const{
return &lengthSplines;
}
const QHash<QString, qreal> *VContainer::DataLengthArcs() const{
return &lengthArcs;
}
const QHash<QString, qreal> *VContainer::DataLineAngles() const{
return &lineAngles;
}
const QHash<qint64, VSplinePath> *VContainer::DataSplinePaths() const{
return &splinePaths;
}
const QHash<qint64, VSplinePath> *VContainer::DataModelingSplinePaths() const{
return &modelingSplinePaths;
}
const QHash<qint64, VDetail> *VContainer::DataDetails() const{
return &details;
}
void VContainer::AddLine(const qint64 &firstPointId, const qint64 &secondPointId, Draw::Draws mode){ void VContainer::AddLine(const qint64 &firstPointId, const qint64 &secondPointId, Draw::Draws mode){
QString nameLine = GetNameLine(firstPointId, secondPointId, mode); QString nameLine = GetNameLine(firstPointId, secondPointId, mode);
VPointF first; VPointF first;
@ -711,25 +521,6 @@ void VContainer::AddLine(const qint64 &firstPointId, const qint64 &secondPointId
AddLineAngle(nameLine, QLineF(first.toQPointF(), second.toQPointF()).angle()); AddLineAngle(nameLine, QLineF(first.toQPointF(), second.toQPointF()).angle());
} }
template <typename key, typename val>
qint64 VContainer::AddObject(QHash<key, val> &obj, const val& value){
qint64 id = getNextId();
obj[id] = value;
return id;
}
qint64 VContainer::AddPoint(const VPointF& point){
return AddObject(points, point);
}
qint64 VContainer::AddModelingPoint(const VPointF &point){
return AddObject(modelingPoints, point);
}
qint64 VContainer::AddDetail(const VDetail &detail){
return AddObject(details, detail);
}
qint64 VContainer::AddSpline(const VSpline &spl){ qint64 VContainer::AddSpline(const VSpline &spl){
return AddObject(splines, spl); return AddObject(splines, spl);
} }
@ -754,6 +545,13 @@ qint64 VContainer::AddModelingArc(const VArc &arc){
return AddObject(modelingArcs, arc); return AddObject(modelingArcs, arc);
} }
template <typename key, typename val>
qint64 VContainer::AddObject(QHash<key, val> &obj, const val& value){
qint64 id = getNextId();
obj[id] = value;
return id;
}
QString VContainer::GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint, Draw::Draws mode) const{ QString VContainer::GetNameLine(const qint64 &firstPoint, const qint64 &secondPoint, Draw::Draws mode) const{
VPointF first; VPointF first;
VPointF second; VPointF second;
@ -827,6 +625,42 @@ QString VContainer::GetNameArc(const qint64 &center, const qint64 &id, Draw::Dra
return QString ("Arc_%1_%2").arg(centerPoint.name()).arg(id); return QString ("Arc_%1_%2").arg(centerPoint.name()).arg(id);
} }
void VContainer::UpdatePoint(qint64 id, const VPointF &point){
UpdateObject(points, id, point);
}
void VContainer::UpdateModelingPoint(qint64 id, const VPointF &point){
UpdateObject(modelingPoints, id, point);
}
void VContainer::UpdateDetail(qint64 id, const VDetail &detail){
UpdateObject(details, id, detail);
}
void VContainer::UpdateSpline(qint64 id, const VSpline &spl){
UpdateObject(splines, id, spl);
}
void VContainer::UpdateModelingSpline(qint64 id, const VSpline &spl){
UpdateObject(modelingSplines, id, spl);
}
void VContainer::UpdateSplinePath(qint64 id, const VSplinePath &splPath){
UpdateObject(splinePaths, id, splPath);
}
void VContainer::UpdateModelingSplinePath(qint64 id, const VSplinePath &splPath){
UpdateObject(modelingSplinePaths, id, splPath);
}
void VContainer::UpdateArc(qint64 id, const VArc &arc){
UpdateObject(arcs, id, arc);
}
void VContainer::UpdateModelingArc(qint64 id, const VArc &arc){
UpdateObject(modelingArcs, id, arc);
}
void VContainer::AddLengthLine(const QString &name, const qreal &value){ void VContainer::AddLengthLine(const QString &name, const qreal &value){
Q_ASSERT(!name.isEmpty()); Q_ASSERT(!name.isEmpty());
lengthLines[name] = value; lengthLines[name] = value;

View File

@ -22,20 +22,17 @@
#ifndef VCONTAINER_H #ifndef VCONTAINER_H
#define VCONTAINER_H #define VCONTAINER_H
#include <QTableWidget>
#include "vstandarttablecell.h" #include "vstandarttablecell.h"
#include "vincrementtablerow.h" #include "vincrementtablerow.h"
#include "geometry/varc.h" #include "geometry/varc.h"
#include "geometry/vsplinepath.h" #include "geometry/vsplinepath.h"
#include "geometry/vdetail.h" #include "geometry/vdetail.h"
#include "widgets/vitem.h" #include "widgets/vitem.h"
#include <QCoreApplication>
/** /**
* @brief The VContainer class * @brief The VContainer class
*/ */
class VContainer class VContainer{
{
Q_DECLARE_TR_FUNCTIONS(VContainer) Q_DECLARE_TR_FUNCTIONS(VContainer)
public: public:
/** /**
@ -50,27 +47,29 @@ public:
* @param id * @param id
* @return * @return
*/ */
VPointF GetPoint(qint64 id) const; inline VPointF GetPoint(qint64 id) const {return GetObject(points, id);}
VPointF GetModelingPoint(qint64 id) const; inline VPointF GetModelingPoint(qint64 id) const {return GetObject(modelingPoints, id);}
VStandartTableCell GetStandartTableCell(const QString& name) const; VStandartTableCell GetStandartTableCell(const QString& name) const;
VIncrementTableRow GetIncrementTableRow(const QString& name) const; VIncrementTableRow GetIncrementTableRow(const QString& name) const;
qreal GetLine(const QString &name) const; qreal GetLine(const QString &name) const;
qreal GetLengthArc(const QString &name) const; qreal GetLengthArc(const QString &name) const;
qreal GetLengthSpline(const QString &name) const; qreal GetLengthSpline(const QString &name) const;
qreal GetLineAngle(const QString &name) const; qreal GetLineAngle(const QString &name) const;
VSpline GetSpline(qint64 id) const; inline VSpline GetSpline(qint64 id) const {return GetObject(splines, id);}
VSpline GetModelingSpline(qint64 id) const; inline VSpline GetModelingSpline(qint64 id) const {return GetObject(modelingSplines, id);}
VArc GetArc(qint64 id) const; inline VArc GetArc(qint64 id) const {return GetObject(arcs, id);}
VArc GetModelingArc(qint64 id) const; inline VArc GetModelingArc(qint64 id) const {return GetObject(modelingArcs, id);}
VSplinePath GetSplinePath(qint64 id) const; inline VSplinePath GetSplinePath(qint64 id) const {return GetObject(splinePaths, id);}
VSplinePath GetModelingSplinePath(qint64 id) const; inline VSplinePath GetModelingSplinePath(qint64 id) const {return GetObject(modelingSplinePaths, id);}
VDetail GetDetail(qint64 id) const; inline VDetail GetDetail(qint64 id) const {return GetObject(details, id);}
static qint64 getId(); static qint64 getId() {return _id;}
qint64 AddPoint(const VPointF& point); qint64 AddPoint(const VPointF& point);
qint64 AddModelingPoint(const VPointF& point); qint64 AddModelingPoint(const VPointF& point);
qint64 AddDetail(const VDetail& detail); qint64 AddDetail(const VDetail& detail);
void AddStandartTableCell(const QString& name, const VStandartTableCell& cell); inline void AddStandartTableCell(const QString& name, const VStandartTableCell& cell)
void AddIncrementTableRow(const QString& name, const VIncrementTableRow &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 AddLengthLine(const QString &name, const qreal &value);
void AddLengthSpline(const QString &name, const qreal &value); void AddLengthSpline(const QString &name, const qreal &value);
void AddLengthArc(const qint64 &center, const qint64 &id); void AddLengthArc(const qint64 &center, const qint64 &id);
@ -92,8 +91,7 @@ public:
Draw::Draws mode = Draw::Calculation) const; Draw::Draws mode = Draw::Calculation) const;
QString GetNameSplinePath(const VSplinePath &path, QString GetNameSplinePath(const VSplinePath &path,
Draw::Draws mode = Draw::Calculation) const; Draw::Draws mode = Draw::Calculation) const;
QString GetNameArc(const qint64 &center, const qint64 &id, QString GetNameArc(const qint64 &center, const qint64 &id, Draw::Draws mode = Draw::Calculation) const;
Draw::Draws mode = Draw::Calculation) const;
void UpdatePoint(qint64 id, const VPointF& point); void UpdatePoint(qint64 id, const VPointF& point);
void UpdateModelingPoint(qint64 id, const VPointF& point); void UpdateModelingPoint(qint64 id, const VPointF& point);
void UpdateDetail(qint64 id, const VDetail& detail); void UpdateDetail(qint64 id, const VDetail& detail);
@ -103,51 +101,52 @@ public:
void UpdateModelingSplinePath(qint64 id, const VSplinePath& splPath); void UpdateModelingSplinePath(qint64 id, const VSplinePath& splPath);
void UpdateArc(qint64 id, const VArc& arc); void UpdateArc(qint64 id, const VArc& arc);
void UpdateModelingArc(qint64 id, const VArc& arc); void UpdateModelingArc(qint64 id, const VArc& arc);
void UpdateStandartTableCell(const QString& name, const VStandartTableCell& cell); inline void UpdateStandartTableCell(const QString& name, const VStandartTableCell& cell)
void UpdateIncrementTableRow(const QString& name, const VIncrementTableRow& cell); {standartTable[name] = cell;}
inline void UpdateIncrementTableRow(const QString& name, const VIncrementTableRow& cell)
{incrementTable[name] = cell;}
qreal GetValueStandartTableCell(const QString& name) const; qreal GetValueStandartTableCell(const QString& name) const;
qreal GetValueIncrementTableRow(const QString& name) const; qreal GetValueIncrementTableRow(const QString& name) const;
void Clear(); void Clear();
void ClearObject(); void ClearObject();
void ClearIncrementTable(); inline void ClearIncrementTable() {incrementTable.clear();}
void ClearLengthLines(); inline void ClearLengthLines() {lengthLines.clear();}
void ClearLengthSplines(); inline void ClearLengthSplines() {lengthSplines.clear();}
void ClearLengthArcs(); inline void ClearLengthArcs() {lengthArcs.clear();}
void ClearLineAngles(); inline void ClearLineAngles() {lineAngles.clear();}
void SetSize(qint32 size); inline void SetSize(qint32 size) {base["Сг"] = size;}
void SetGrowth(qint32 growth); inline void SetGrowth(qint32 growth) {base["Р"] = growth;}
qint32 size() const; inline qint32 size() const {return base.value("Сг");}
qint32 growth() const; inline qint32 growth() const {return base.value("Р");}
qreal FindVar(const QString& name, bool *ok)const; qreal FindVar(const QString& name, bool *ok)const;
bool IncrementTableContains(const QString& name); inline bool IncrementTableContains(const QString& name) {return incrementTable.contains(name);}
static qint64 getNextId(); static qint64 getNextId();
void RemoveIncrementTableRow(const QString& name); inline void RemoveIncrementTableRow(const QString& name) {incrementTable.remove(name);}
const QHash<qint64, VPointF> *DataPoints() const; inline const QHash<qint64, VPointF> *DataPoints() const {return &points;}
const QHash<qint64, VPointF> *DataModelingPoints() const; inline const QHash<qint64, VPointF> *DataModelingPoints() const {return &modelingPoints;}
const QHash<qint64, VSpline> *DataSplines() const; inline const QHash<qint64, VSpline> *DataSplines() const {return &splines;}
const QHash<qint64, VSpline> *DataModelingSplines() const; inline const QHash<qint64, VSpline> *DataModelingSplines() const {return &modelingSplines;}
const QHash<qint64, VArc> *DataArcs() const; inline const QHash<qint64, VArc> *DataArcs() const {return &arcs;}
const QHash<qint64, VArc> *DataModelingArcs() const; inline const QHash<qint64, VArc> *DataModelingArcs() const {return &modelingArcs;}
const QHash<QString, qint32> *DataBase() const; inline const QHash<QString, qint32> *DataBase() const {return &base;}
const QHash<QString, VStandartTableCell> *DataStandartTable() const; inline const QHash<QString, VStandartTableCell> *DataStandartTable() const {return &standartTable;}
const QHash<QString, VIncrementTableRow> *DataIncrementTable() const; inline const QHash<QString, VIncrementTableRow> *DataIncrementTable() const {return &incrementTable;}
const QHash<QString, qreal> *DataLengthLines() const; inline const QHash<QString, qreal> *DataLengthLines() const {return &lengthLines;}
const QHash<QString, qreal> *DataLengthSplines() const; inline const QHash<QString, qreal> *DataLengthSplines() const {return &lengthSplines;}
const QHash<QString, qreal> *DataLengthArcs() const; inline const QHash<QString, qreal> *DataLengthArcs() const {return &lengthArcs;}
const QHash<QString, qreal> *DataLineAngles() const; inline const QHash<QString, qreal> *DataLineAngles() const {return &lineAngles;}
const QHash<qint64, VSplinePath> *DataSplinePaths() const; inline const QHash<qint64, VSplinePath> *DataSplinePaths() const {return &splinePaths;}
const QHash<qint64, VSplinePath> *DataModelingSplinePaths() const; inline const QHash<qint64, VSplinePath> *DataModelingSplinePaths() const {return &modelingSplinePaths;}
const QHash<qint64, VDetail> *DataDetails() const; inline const QHash<qint64, VDetail> *DataDetails() const {return &details;}
static void UpdateId(qint64 newId); static void UpdateId(qint64 newId);
QPainterPath ContourPath(qint64 idDetail) const; QPainterPath ContourPath(qint64 idDetail) const;
QVector<QPointF> biasPoints(const QVector<QPointF> &points, const qreal &mx, const qreal &my) const; QVector<QPointF> biasPoints(const QVector<QPointF> &points, const qreal &mx, const qreal &my) const;
QPainterPath Equidistant(QVector<QPointF> points, const Detail::Equidistant &eqv, QPainterPath Equidistant(QVector<QPointF> points, const Detail::Equidistant &eqv, const qreal &width)const;
const qreal &width)const;
static QLineF ParallelLine(const QLineF &line, qreal width ); static QLineF ParallelLine(const QLineF &line, qreal width );
static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width); static QPointF SingleParallelPoint(const QLineF &line, const qreal &angle, const qreal &width);
QVector<QPointF> EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width)const; QVector<QPointF> EkvPoint(const QLineF &line1, const QLineF &line2, const qreal &width)const;
QVector<QPointF> CheckLoops(const QVector<QPointF> &points) const; QVector<QPointF> CheckLoops(const QVector<QPointF> &points) const;
void PrepareDetails(QVector<VItem*> & list)const; void PrepareDetails(QVector<VItem *> & list) const;
private: private:
static qint64 _id; static qint64 _id;
QHash<QString, qint32> base; QHash<QString, qint32> base;
@ -166,13 +165,12 @@ private:
QHash<qint64, VSplinePath> splinePaths; QHash<qint64, VSplinePath> splinePaths;
QHash<qint64, VSplinePath> modelingSplinePaths; QHash<qint64, VSplinePath> modelingSplinePaths;
QHash<qint64, VDetail> details; QHash<qint64, VDetail> details;
template <typename key, typename val> static val GetObject(const QHash<key,val> &obj, key id);
template <typename val> static void UpdateObject(QHash<qint64, val> &obj, const qint64 &id,
const val& point);
template <typename key, typename val> static qint64 AddObject(QHash<key, val> &obj, const val& value);
void CreateManTableIGroup (); void CreateManTableIGroup ();
QVector<QPointF> GetReversePoint(const QVector<QPointF> &points)const; QVector<QPointF> GetReversePoint(const QVector<QPointF> &points)const;
qreal GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints)const; qreal GetLengthContour(const QVector<QPointF> &contour, const QVector<QPointF> &newPoints)const;
template <typename key, typename val> static val GetObject(const QHash<key,val> &obj, key id);
template <typename val> static void UpdateObject(QHash<qint64, val> &obj, const qint64 &id, const val& point);
template <typename key, typename val> static qint64 AddObject(QHash<key, val> &obj, const val& value);
}; };
#endif // VCONTAINER_H #endif // VCONTAINER_H

View File

@ -29,42 +29,4 @@ VIncrementTableRow::VIncrementTableRow(qint64 id, qreal base, qreal ksize, qreal
kgrowth(kgrowth), description(description){ kgrowth(kgrowth), description(description){
} }
QString VIncrementTableRow::getDescription() const{
return description;
}
void VIncrementTableRow::setDescription(const QString &value){
description = value;
}
qreal VIncrementTableRow::getKgrowth() const{
return kgrowth;
}
void VIncrementTableRow::setKgrowth(const qreal &value){
kgrowth = value;
}
qreal VIncrementTableRow::getKsize() const{
return ksize;
}
void VIncrementTableRow::setKsize(const qreal &value){
ksize = value;
}
qreal VIncrementTableRow::getBase() const{
return base;
}
void VIncrementTableRow::setBase(const qreal &value){
base = value;
}
qint64 VIncrementTableRow::getId() const{
return id;
}
void VIncrementTableRow::setId(const qint64 &value){
id = value;
}

View File

@ -22,23 +22,21 @@
#ifndef VINCREMENTTABLEROW_H #ifndef VINCREMENTTABLEROW_H
#define VINCREMENTTABLEROW_H #define VINCREMENTTABLEROW_H
#include <QString>
class VIncrementTableRow{ class VIncrementTableRow{
public: public:
VIncrementTableRow(); VIncrementTableRow();
VIncrementTableRow(qint64 id, qreal base, qreal ksize, qreal kgrowth, VIncrementTableRow(qint64 id, qreal base, qreal ksize, qreal kgrowth,
QString description = QString()); QString description = QString());
qint64 getId() const; inline qint64 getId() const {return id;}
void setId(const qint64 &value); inline void setId(const qint64 &value) {id = value;}
qreal getBase() const; inline qreal getBase() const {return base;}
void setBase(const qreal &value); inline void setBase(const qreal &value) {base = value;}
qreal getKsize() const; inline qreal getKsize() const {return ksize;}
void setKsize(const qreal &value); inline void setKsize(const qreal &value) {ksize = value;}
qreal getKgrowth() const; inline qreal getKgrowth() const {return kgrowth;}
void setKgrowth(const qreal &value); inline void setKgrowth(const qreal &value) {kgrowth = value;}
QString getDescription() const; inline QString getDescription() const {return description;}
void setDescription(const QString &value); inline void setDescription(const QString &value) {description = value;}
private: private:
qint64 id; qint64 id;
qreal base; qreal base;

View File

@ -22,10 +22,6 @@
#ifndef VPOINTF_H #ifndef VPOINTF_H
#define VPOINTF_H #define VPOINTF_H
#include <QPointF>
#include <QString>
#include "options.h"
class VPointF{ class VPointF{
public: public:
inline VPointF () inline VPointF ()

View File

@ -27,19 +27,3 @@ VStandartTableCell::VStandartTableCell():base(0), ksize(0), kgrowth(0), descript
VStandartTableCell::VStandartTableCell(qint32 base, qreal ksize, qreal kgrowth, QString description):base(base), VStandartTableCell::VStandartTableCell(qint32 base, qreal ksize, qreal kgrowth, QString description):base(base),
ksize(ksize), kgrowth(kgrowth), description(description){ ksize(ksize), kgrowth(kgrowth), description(description){
} }
qint32 VStandartTableCell::GetBase() const{
return base;
}
qreal VStandartTableCell::GetKsize() const{
return ksize;
}
qreal VStandartTableCell::GetKgrowth() const{
return kgrowth;
}
QString VStandartTableCell::GetDescription() const{
return description;
}

View File

@ -22,16 +22,14 @@
#ifndef VSTANDARTTABLECELL_H #ifndef VSTANDARTTABLECELL_H
#define VSTANDARTTABLECELL_H #define VSTANDARTTABLECELL_H
#include <QString>
class VStandartTableCell{ class VStandartTableCell{
public: public:
VStandartTableCell(); VStandartTableCell();
VStandartTableCell(qint32 base, qreal ksize, qreal kgrowth, QString description = QString()); VStandartTableCell(qint32 base, qreal ksize, qreal kgrowth, QString description = QString());
qint32 GetBase() const; inline qint32 GetBase() const {return base;}
qreal GetKsize() const; inline qreal GetKsize() const {return ksize;}
qreal GetKgrowth() const; inline qreal GetKgrowth() const {return kgrowth;}
QString GetDescription() const; inline QString GetDescription() const {return description;}
private: private:
qint32 base; qint32 base;
qreal ksize; qreal ksize;