31#include <QPainterPath>
55 this->setVisible(
bool(s));
56 if (this->nameLabel !=
nullptr)
58 this->nameLabel->setVisible(
bool(s));
71 connect(
this, SIGNAL(valueChanged(
double)),
this, SLOT(
setValue(
double)));
79 void setValue(
double Value,
bool BlockSignals =
false)
89 this->setVisible(
bool(s));
105 connect(
this, SIGNAL(stateChanged(
int)),
this, SLOT(
findSignal(
int)));
123 this->setVisible(!
bool(s));
132 if (s ==1 && this->checkState()== Qt::CheckState::Unchecked)
134 setCheckState(Qt::CheckState::Checked);
135 emit stateChanged(1);
140 if (s == 0 && this->checkState() == Qt::CheckState::Checked)
142 setCheckState(Qt::CheckState::Unchecked);
143 emit stateChanged(0);
186 if (this->x == s.
x && this->y == s.
y)
195 a.
x = this->x -= s.
x;
196 a.
y = this->y -= s.
y;
202 a.
x = this->x += s.
x;
203 a.
y = this->y += s.
y;
212 void set(
double a,
double b)
323 void copyFromField(std::vector<Canvas::Coord2D> coord01, std::vector<MyCoord>& thisArray)
327 for (
auto it : coord01)
335 void copyFromField(std::vector<Canvas::OriginalCoord> coord01, std::vector<MyCoord>& thisArray)
339 for (
auto it : coord01)
343 thisArray.push_back(s);
372 void reSort(std::vector<MyCoord>& vector1)
378 std::sort(vector1.begin(), vector1.end(),
sortx);
383 sort(vector1.begin(), vector1.end(),
sorty);
391 s.
x = int(value.x *
float(x1 - x0)) + x0;
392 s.
y = int((1 - value.y) *
float(y1 - y0)) + y0;
538 int totalLength =
mPath.length();
541 for (
size_t i = 0; i < 500; i++)
547 if (length <= totalLength)
549 perc =
mPath.percentAtLength(qreal(length));
557 QP =
mPath.pointAtPercent(perc);
569 QPainterPath tempPath;
581 int idf = itf->second;
591 float tempLength = tempPath.length();
613 int searchRadius = 20;
615 if (dis < searchRadius)
618 float finalLength = -1;
621 if (realLength <= it.first)
623 finalLength = it.first;
627 if (finalLength == -1)
656 if (a.
x < b.
x) {
return true; }
657 else {
return false; }
661 if (a.
y < b.
y) {
return true; }
662 else {
return false; }
687 QWidget::keyPressEvent(event);
688 parent()->event((QEvent*)event);
689 if (event->key() == Qt::Key_Alt)
694 if (event->key() == Qt::Key_Control)
699 if (event->key() == Qt::Key_Shift)
768 double x = double(coord.
x);
769 double y = double(coord.
y);
770 double fmaxX = double(
maxX);
771 double fminX = double(
minX);
772 double fmaxY = double(
maxY);
773 double fminY = double(
minY);
775 s.
x = (
x - fminX) / (fmaxX - fminX);
776 s.
y = 1 - (
y - fminY) / (fmaxY - fminY);
785 this->releaseKeyboard();
790 double fmaxX = double(
maxX);
791 double fminX = double(
minX);
792 double fmaxY = double(
maxY);
793 double fminY = double(
minY);
794 for (
size_t i = 0; i <
Array.size(); i++)
796 int newMaxY =
h - 1.5 * double(
radius);
797 float k = (double(
Array[i].
y) - fminY) / (fmaxY - fminY);
798 Array[i].y = k * (newMaxY - fminY) + fminY;
804 myfloatCoord.clear();
805 for (
auto it : CoordArray)
813 QWidget::keyPressEvent(event);
814 parent()->event((QEvent*)event);
815 if (event->key() == Qt::Key_Alt)
820 if (event->key() == Qt::Key_Control)
826 if (event->key() == Qt::Key_Shift)
This class is designed to be elegant, so it can be directly passed to GPU as parameters.
QDoubleSlider(QWidget *pParent=NULL)
void setValue(double Value, bool BlockSignals=false)
QDoubleSpinner(QWidget *pParent=NULL)
bool mInsertBezierOpenPoint
int insertCurvePoint(MyCoord pCoord)
virtual void updateDataToField()
void keyReleaseEvent(QKeyEvent *event)
std::vector< MyCoord > mCoordArray
static bool sortx(MyCoord a, MyCoord b)
void buildHandlePointSet()
void updateFloatCoordArray(std::vector< MyCoord > CoordArray, std::vector< Coord0_1 > &myfloatCoord)
void reSort(std::vector< MyCoord > &vector1)
void leaveEvent(QEvent *event)
void updateLabelShape(bool squard)
void initializeLine(Dir mode)
Coord0_1 CoordTo0_1Value(MyCoord &coord)
void buildCoordToResortMap()
void copyFromField(std::vector< Canvas::OriginalCoord > coord01, std::vector< MyCoord > &thisArray)
std::map< int, int > mMapResortIDtoOriginalID
std::vector< Coord0_1 > mFloatCoord
std::vector< Coord0_1 > mHandleFloatCoord
std::vector< MyCoord > mReSortCoordArray
void setLinearResample(int s)
virtual int addPointtoEnd()
std::vector< MyCoord > mHandlePoints
std::vector< MyCoord > mCurvePoint
void mouseReleaseEvent(QMouseEvent *event)
void setSpacingToDrawLabel(double value, int id)
void setLabelSize(int minX, int minY, int maxX, int maxY)
void insertHandlePoint(int fp, MyCoord pCoord)
std::map< int, float > mCurvePointMapLength
void insertElementToHandlePointSet(int i)
static bool sorty(MyCoord a, MyCoord b)
void keyPressEvent(QKeyEvent *event)
std::vector< int > mMultiSelectID
void remapArrayToHeight(std::vector< MyCoord > &Array, int h)
void copyFromField(std::vector< Canvas::Coord2D > coord01, std::vector< MyCoord > &thisArray)
std::map< float, EndPoint > mLengthMapEndPoint
MyCoord ZeroOneToCoord(Coord0_1 &value, int x0, int x1, int y0, int y1)
std::map< int, int > mMapOriginalIDtoResortID
mQCheckBox(QWidget *pParent=NULL)
void updateChecked(int s)
void setNewVisable(int s)
void updateUnchecked(int s)
mQDoubleSlider(QWidget *pParent=NULL)
void setNewVisable(int s)
void setValue(double Value, bool BlockSignals=false)
void setNewVisable(int s)
mQDoubleSpinner(QWidget *pParent=NULL)
void valueChangedAndID(double Value, int i)
This is an implementation of AdditiveCCD based on peridyno.
DYN_FUNC Complex< Real > sqrt(const Complex< Real > &)
void set(double a, double b)
MyCoord operator+(MyCoord s)
MyCoord operator-(MyCoord s)
bool operator==(MyCoord s)