2013-08-09 08:49:34 +02:00
|
|
|
|
#ifndef VSPLINEPATH_H
|
|
|
|
|
#define VSPLINEPATH_H
|
|
|
|
|
|
|
|
|
|
#include "vsplinepoint.h"
|
|
|
|
|
#include <QVector>
|
|
|
|
|
#include "vspline.h"
|
2013-08-28 10:55:11 +02:00
|
|
|
|
#include "options.h"
|
2013-08-09 08:49:34 +02:00
|
|
|
|
|
|
|
|
|
namespace SplinePoint{
|
|
|
|
|
enum Position
|
|
|
|
|
{
|
|
|
|
|
FirstPoint,
|
|
|
|
|
LastPoint
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief The VSplinePath клас, що розраховує шлях сплайнів.
|
|
|
|
|
*/
|
|
|
|
|
class VSplinePath{
|
|
|
|
|
public:
|
|
|
|
|
/**
|
|
|
|
|
* @brief VSplinePath конструктор по замовчуванню.
|
|
|
|
|
*/
|
|
|
|
|
VSplinePath();
|
|
|
|
|
/**
|
|
|
|
|
* @brief VSplinePath конструктор по замовчуванню.
|
|
|
|
|
*/
|
2013-08-28 10:55:11 +02:00
|
|
|
|
VSplinePath(const QMap<qint64, VPointF> *points, qreal kCurve = 1,
|
|
|
|
|
Draw::Mode mode = Draw::Calculation, qint64 idObject = 0);
|
2013-08-20 12:26:02 +02:00
|
|
|
|
VSplinePath(const VSplinePath& splPath);
|
2013-08-09 08:49:34 +02:00
|
|
|
|
/**
|
|
|
|
|
* @brief append додає точку сплайну до шляху.
|
|
|
|
|
* @param point точка.
|
|
|
|
|
*/
|
|
|
|
|
void append(VSplinePoint point);
|
|
|
|
|
qint32 Count() const;
|
|
|
|
|
qint32 CountPoint() const;
|
|
|
|
|
VSpline GetSpline(qint32 index) const;
|
|
|
|
|
QPainterPath GetPath() const;
|
2013-08-28 10:55:11 +02:00
|
|
|
|
QVector<QPointF> GetPathPoints() const;
|
2013-08-09 08:49:34 +02:00
|
|
|
|
QVector<VSplinePoint> GetSplinePath() const;
|
|
|
|
|
qreal GetLength() const;
|
|
|
|
|
const QMap<qint64, VPointF> *GetDataPoints() const;
|
|
|
|
|
void UpdatePoint(qint32 indexSpline, SplinePoint::Position pos, VSplinePoint point);
|
|
|
|
|
VSplinePoint GetSplinePoint(qint32 indexSpline, SplinePoint::Position pos);
|
|
|
|
|
/**
|
|
|
|
|
* @brief Clear очищає шлях сплайнів.
|
|
|
|
|
*/
|
|
|
|
|
void Clear();
|
|
|
|
|
qreal getKCurve() const;
|
|
|
|
|
void setKCurve(const qreal &value);
|
|
|
|
|
const QVector<VSplinePoint> *GetPoint() const;
|
|
|
|
|
VSplinePath& operator=(const VSplinePath &path);
|
|
|
|
|
VSplinePoint & operator[](int indx);
|
2013-08-28 10:55:11 +02:00
|
|
|
|
qint32 referens() const;
|
|
|
|
|
void incrementReferens();
|
|
|
|
|
void decrementReferens();
|
|
|
|
|
Draw::Mode getMode() const;
|
|
|
|
|
void setMode(const Draw::Mode &value);
|
|
|
|
|
|
|
|
|
|
qint64 getIdObject() const;
|
|
|
|
|
void setIdObject(const qint64 &value);
|
|
|
|
|
|
2013-08-09 08:49:34 +02:00
|
|
|
|
protected:
|
|
|
|
|
/**
|
|
|
|
|
* @brief path вектор з точок сплайна.
|
|
|
|
|
*/
|
|
|
|
|
QVector<VSplinePoint> path;
|
|
|
|
|
qreal kCurve;
|
2013-08-28 10:55:11 +02:00
|
|
|
|
Draw::Mode mode;
|
2013-08-09 08:49:34 +02:00
|
|
|
|
const QMap<qint64, VPointF> *points;
|
2013-08-28 10:55:11 +02:00
|
|
|
|
qint32 _referens;
|
|
|
|
|
qint64 idObject;
|
2013-08-09 08:49:34 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // VSPLINEPATH_H
|