57 int findNode(QSize gradSize, QPoint ptPos, QSize ptSize)
const;
68 void findSegment(QSize gradSize, QPoint ptPos,
int& p1,
int& p2)
const;
83 _array.push_back(Coord(x, y));
104 _array[index]._x = x;
105 _array[index]._y = y;
115 _array.erase(_array.begin() + index);
125 _array.insert(_array.begin() + index, Coord());
136 return _array[index]._x;
147 return _array[index]._y;
160 return _array[index - 1]._x;
171 if (index == (
int)_array.size() - 1)
173 return _array[index + 1]._x;
210 Coord(
double x,
double y) : _x(x), _y(y)
217 typedef std::vector<Coord> CoordArray;
A spline used to store gradient components waveforms.
void clear()
Remove all spline nodes.
double getNodeX(int index) const
Get the x coordinate of the given node.
QString toString() const
Encode the spline data as a string.
double getLimitMin(int index) const
Get the minimum x coordinate of the given node.
double getLimitMax(int index) const
Get the maximum x coordinate of the given node.
void generateSpline(double *buffer, int count) const
Generate the spline waveform.
int getNodesCnt() const
Get the number of nodes in the spline.
void setNode(int index, double x, double y)
Change the position of a node.
void insertAt(int index)
Insert a node at the given position.
int findNode(QSize gradSize, QPoint ptPos, QSize ptSize) const
Find a node at the specified position.
int insertNode(double x, double y)
Insert a node into the spline.
void removeNode(int index)
Remove a node.
void addNode(double x, double y)
Add a node to the spline.
void invert()
Invert the nodes in the spline.
void fromString(const QString &string)
Decode the spline data from a string.
double getNodeY(int index) const
Get the y coordinate of the given node.
void findSegment(QSize gradSize, QPoint ptPos, int &p1, int &p2) const
Find a segment at the specified position.