PeriDyno 1.0.0
Loading...
Searching...
No Matches
QComponent.h
Go to the documentation of this file.
1
19#pragma once
20#include "QFieldWidget.h"
22
23#include <QKeyEvent>
24#include <QEvent>
25
26#include "Field/Ramp.h"
27#include "PCustomWidgets.h"
28#include "QBoolFieldWidget.h"
29#include "qcheckbox.h"
30#include <algorithm>
31#include <QPainterPath>
32#include "qlayout.h"
33#include "Field.h"
34
35namespace dyno
36{
37
39 {
40 Q_OBJECT
41
42 public:
43
44 mQDoubleSlider(QWidget* pParent = NULL) {};
45
46 int id = -1;
47
48 public:
49 QLabel* nameLabel = nullptr;
50
51 public slots:
52
53 void setNewVisable(int s)
54 {
55 this->setVisible(bool(s));
56 if (this->nameLabel != nullptr)
57 {
58 this->nameLabel->setVisible(bool(s));
59 }
60 }
61 };
62
64 {
65 Q_OBJECT
66
67 public:
68
69 mQDoubleSpinner(QWidget* pParent = NULL)
70 {
71 connect(this, SIGNAL(valueChanged(double)), this, SLOT(setValue(double)));
72 }
73
74 signals:
75 void valueChangedAndID(double Value, int i);
76
77 public slots:
78
79 void setValue(double Value, bool BlockSignals = false)
80 {
81
82 if (!BlockSignals) { emit valueChangedAndID(Value, id); }
83 QDoubleSpinner::setValue(Value,BlockSignals);
84
85 }
86
87 void setNewVisable(int s)
88 {
89 this->setVisible(bool(s));
90 }
91
92
93 public:
94 int id = -1;
95 };
96
97 class mQCheckBox : public QCheckBox
98 {
99 Q_OBJECT
100
101 public:
102
103 mQCheckBox(QWidget* pParent = NULL)
104 {
105 connect(this, SIGNAL(stateChanged(int)), this, SLOT(findSignal(int)));
106
107 }
108
109 signals:
110
111 void mValueChanged(int);
112
113 public slots:
114
115 void findSignal(int i)
116 {
117 emit mValueChanged(i);
118
119 }
120
121 void setNewVisable(int s)
122 {
123 this->setVisible(!bool(s));
124 if (this->nameLabel != nullptr)
125 {
126 this->nameLabel->setVisible(!bool(s));
127 }
128 }
129
130 void updateChecked(int s)
131 {
132 if (s ==1 && this->checkState()== Qt::CheckState::Unchecked)
133 {
134 setCheckState(Qt::CheckState::Checked);
135 emit stateChanged(1);
136 }
137 }
138 void updateUnchecked(int s)
139 {
140 if (s == 0 && this->checkState() == Qt::CheckState::Checked)
141 {
142 setCheckState(Qt::CheckState::Unchecked);
143 emit stateChanged(0);
144 }
145 }
146
147
148 public:
149 QLabel* nameLabel = nullptr;
150 };
151
152 //******************************* DrawLabel ********************************//
153 class mDrawLabel : public QWidget
154 {
155 Q_OBJECT
156
157
158 public:
159 struct MyCoord
160 {
161 int x = 0;
162 int y = 0;
163 void set(int a, int b)
164 {
165 this->x = a;
166 this->y = b;
167 }
168 void set(MyCoord s)
169 {
170 this->x = s.x;
171 this->y = s.y;
172 }
173 MyCoord(int a, int b) {
174 this->x = a;
175 this->y = b;
176 }
177
179 this->x = s[0];
180 this->y = s[1];
181 }
183
185 {
186 if (this->x == s.x && this->y == s.y)
187 {
188 return true;
189 }
190 return false;
191 }
193 {
194 MyCoord a;
195 a.x = this->x -= s.x;
196 a.y = this->y -= s.y;
197 return a;
198 }
200 {
201 MyCoord a;
202 a.x = this->x += s.x;
203 a.y = this->y += s.y;
204 return a;
205 }
206
207 };
208 struct Coord0_1
209 {
210 double x = 0;
211 double y = 0;
212 void set(double a, double b)
213 {
214 this->x = a;
215 this->y = b;
216 }
217 };
218 struct EndPoint
219 {
220 int firstPoint = -1;
221 int secondPoint = -1;
223 EndPoint(int f, int s)
224 {
225 firstPoint = f;
226 secondPoint = s;
227 }
228 };
229
230 enum Dir
231 {
232 x = 0,
233 y = 1,
234 };
236 {
239 };
240
242 {
243 Open = 0,
244 Close = 1,
245 };
246
247
248 public:
249
251
253 {
254 //CurveCoord
255 mCoordArray.clear();
256 mReSortCoordArray.clear();
257 mHandlePoints.clear();
258 mFloatCoord.clear();
259 mHandleFloatCoord.clear();
260 mCurvePoint.clear();
261 mMultiSelectID.clear();
262
263 //Map
264 mCurvePointMapLength.clear();
265 mLengthMapEndPoint.clear();
268
269 };
270
271 virtual void updateDataToField() {};
272 Dir setMode(int s) { return Dir(s); }
274 {
275 if (isSquard)
276 {
277 this->setLabelSize(w, w, w, w);
281 }
282 else
283 {
284 this->setLabelSize(w, h, w, w);
288 }
289
290 //ForceUpdate = true;
291 this->update();
292 }
293
294
295 public slots:
296
298 {
300 this->mForceUpdate = true;
301 update();
302 }
304 {
305 if (!lockSize)
306 {
308
310 }
311 }
312
314 {
315 LineResample = s;
316 this->mForceUpdate = true;
317 update();
318 }
319
320 void SetValueToDrawLabel(double value, int id)
321 {
322 switch (id)
323 {
324 case 0: NminX = value;
325 break;
326 case 1: mNewMinY = value;
327 break;
328 case 2: NmaxX = value;
329 break;
330 case 3: NmaxY = value;
331 break;
332 }
333 mForceUpdate = true;
334 update();
335 }
336
337 void setSpacingToDrawLabel(double value, int id)
338 {
339 spacing = value;
340 mForceUpdate = true;
341 update();
342 }
343
344
345 protected:
346
347
348 void copyFromField(std::vector<Canvas::Coord2D> coord01, std::vector<MyCoord>& thisArray)
349 {
350 if (coord01.size())
351 {
352 for (auto it : coord01)
353 {
354 Coord0_1 s;
355 s.set(it.x, it.y);
356 thisArray.push_back(ZeroOneToCoord(s, minX, maxX, minY, maxY));
357 }
358 }
359 }
360 void copyFromField(std::vector<Canvas::OriginalCoord> coord01, std::vector<MyCoord>& thisArray)
361 {
362 if (coord01.size())
363 {
364 for (auto it : coord01)
365 {
366 MyCoord s;
367 s.set(it.x, it.y);
368 thisArray.push_back(s);
369 }
370 }
371 }
372
374 {
375 if (mode == x)
376 {
377 mCoordArray[0].x = minX;
378 mCoordArray[0].y = (maxY + minY) / 2;
379 mCoordArray[1].x = maxX;
380 mCoordArray[1].y = (maxY + minY) / 2;
381 }
382 if (mode == y)
383 {
384 mCoordArray[0].x = (maxX + minX) / 2;
385 mCoordArray[0].y = minY;
386 mCoordArray[1].x = (maxX + minX) / 2;
387 mCoordArray[1].y = maxY;
388 }
389 }
390
391 void setLabelSize(int minX, int minY, int maxX, int maxY)
392 {
393 this->setMinimumSize(minX, minY);
394 this->setMaximumSize(maxX, maxY);
395 }
396
397 void reSort(std::vector<MyCoord>& vector1)
398 {
399 if (useSort)
400 {
401 if (mMode == x)
402 {
403 std::sort(vector1.begin(), vector1.end(), sortx);
404 }
405
406 if (mMode == y)
407 {
408 sort(vector1.begin(), vector1.end(), sorty);
409 }
410 }
411 }
412
413 MyCoord ZeroOneToCoord(Coord0_1& value, int x0, int x1, int y0, int y1)
414 {
415 MyCoord s;
416 s.x = int(value.x * float(x1 - x0)) + x0;
417 s.y = int((1 - value.y) * float(y1 - y0)) + y0;
418
419 return s;
420 }
421
423 {
424 if (mMultiSelectID.size() <= 1)
425 {
426 mCoordArray.erase(mCoordArray.begin() + mSelectPointID);
427 mHandlePoints.erase(mHandlePoints.begin() + mSelectPointID * 2 + 1);
428 mHandlePoints.erase(mHandlePoints.begin() + mSelectPointID * 2);
429 mReSortCoordArray.clear();
430 mReSortCoordArray.assign(mCoordArray.begin(), mCoordArray.end());
433 }
434 else
435 {
436 std::sort(mMultiSelectID.begin(), mMultiSelectID.end());
437
438 for (size_t i = 0; i < mMultiSelectID.size(); i++)
439 {
441 mCoordArray.erase(mCoordArray.begin() + mSelectPointID);
442 mHandlePoints.erase(mHandlePoints.begin() + mSelectPointID * 2 + 1);
443 mHandlePoints.erase(mHandlePoints.begin() + mSelectPointID * 2);
444 mReSortCoordArray.clear();
445 mReSortCoordArray.assign(mCoordArray.begin(), mCoordArray.end());
448 }
449
450 }
451
452 mMultiSelectID.clear();
453
454 mSelectPointID = -1;
455 mHoverPoint = -1;
456 mIsHover = false;
457 mIsSelect = false;
458 mHandleParent = -1;
461 mIsHandleSelect = false;
462
463 }
464
465 virtual int addPointtoEnd()
466 {
467 if (!mInsertAtBegin)
468 {
469 mCoordArray.push_back(mPressCoord);
472
474 {
476 mSelectPointID = -1;
477 mIsSelect = false;
478 mHandleParent = mCoordArray.size() - 1;
481 mIsHandleSelect = true;
482 }
484 {
486 mSelectPointID = mCoordArray.size() - 1;
487 mIsSelect = true;
491 mIsHandleSelect = false;
493 }
494
495 mMultiSelectID.clear();
496 mMultiSelectID.push_back(mCoordArray.size() - 1);
497 }
498 else if (mInsertAtBegin)
499 {
500 mCoordArray.insert(mCoordArray.begin(), mPressCoord);
503
504
506 {
508 mSelectPointID = -1;
509 mIsSelect = false;
510 mHandleParent = 0;
513 mIsHandleSelect = true;
514 }
516 {
518 mSelectPointID = 0;
519 mIsSelect = true;
523 mIsHandleSelect = false;
525 }
526 }
527 return mHandleParent;
528 }
529
530 void insertHandlePoint(int fp, MyCoord pCoord)
531 {
532 dyno::Vec2f P(pCoord.x, pCoord.y);
533 int size = mReSortCoordArray.size();
534 dyno::Vec2f p1;
535 dyno::Vec2f p2;
536
537 dyno::Vec2f N = Vec2f(1, 0);
538 if (fp == 0)
539 {
540 if (mReSortCoordArray.size() == 1)
541 N = Vec2f(1, 0);
542 else
543 N = Vec2f(pCoord.x - mReSortCoordArray[1].x, pCoord.y - mReSortCoordArray[1].y);
544 }
545 else
546 {
547 N = Vec2f(pCoord.x - mReSortCoordArray[fp - 1].x, pCoord.y - mReSortCoordArray[fp - 1].y) * -1;
548 }
549
550 N.normalize();
551
552 int num = fp * 2;
553
554 p1 = P - N * mIniHandleLength;
555 p2 = P + N * mIniHandleLength;
556
557 mHandlePoints.insert(mHandlePoints.begin() + num, MyCoord(p1));
558 mHandlePoints.insert(mHandlePoints.begin() + num, MyCoord(p2));
559 }
560
562 {
563 int totalLength = mPath.length();
564 mCurvePoint.clear();
565 mCurvePointMapLength.clear();
566 for (size_t i = 0; i < 500; i++)
567 {
568 float length = i * spacing;
569 qreal perc = 0;
570 QPointF QP;
571 bool b = false;
572 if (length <= totalLength)
573 {
574 perc = mPath.percentAtLength(qreal(length));
575 }
576 else
577 {
578 perc = 1;
579 b = true;
580 }
581
582 QP = mPath.pointAtPercent(perc);
583 mCurvePoint.push_back(MyCoord(QP.x(), QP.y()));
584 mCurvePointMapLength[i] = length;
585
586 if (b) { break; }
587 }
588
589 }
590
592 {
593 mLengthMapEndPoint.clear();
594 QPainterPath tempPath;
595 for (size_t i = 1; i < mReSortCoordArray.size(); i++)
596 {
597
598 int ptnum = i - 1;
599 tempPath.moveTo(mReSortCoordArray[ptnum].x, mReSortCoordArray[ptnum].y);
600
601 auto it = mMapResortIDtoOriginalID.find(i);
602 int id = it->second;
603 int s = id * 2;
604
605 auto itf = mMapResortIDtoOriginalID.find(ptnum);
606 int idf = itf->second;
607 int f = idf * 2 + 1;
609 {
610 tempPath.cubicTo(QPointF(mHandlePoints[f].x, mHandlePoints[f].y), QPointF(mHandlePoints[s].x, mHandlePoints[s].y), QPointF(mReSortCoordArray[ptnum + 1].x, mReSortCoordArray[ptnum + 1].y));
611 }
613 {
614 tempPath.lineTo(QPointF(mReSortCoordArray[ptnum + 1].x, mReSortCoordArray[ptnum + 1].y));
615 }
616 float tempLength = tempPath.length();
617
618 EndPoint tempEP = EndPoint(id, idf);
619 mLengthMapEndPoint[tempLength] = tempEP;
620 }
621
622 int dis = 380;
623 int nearPoint = -1;
624 int temp;
625
626 for (size_t i = 0; i < mCurvePoint.size(); i++)
627 {
628 temp = sqrt(std::pow((pCoord.x - mCurvePoint[i].x), 2) + std::pow((pCoord.y - mCurvePoint[i].y), 2));
629
630 if (dis >= temp)
631 {
632 nearPoint = i;
633 dis = temp;
634 }
635 }
636
637 int fp = -1;
638 int searchRadius = 10;
639
640 if (isSquard) { searchRadius = 20; }
641 else { searchRadius = 10; }
642
643 if (dis < searchRadius)
644 {
645 float realLength = mCurvePointMapLength.find(nearPoint)->second;
646 float finalLength = -1;
647 for (auto it : mLengthMapEndPoint)
648 {
649 if (realLength <= it.first)
650 {
651 finalLength = it.first;
652 break;
653 }
654 }
655 if (finalLength == -1)
656 {
657 fp = addPointtoEnd();
658 }
659 else
660 {
661 fp = mLengthMapEndPoint.find(finalLength)->second.firstPoint;
662
663 mCoordArray.insert(mCoordArray.begin() + fp, pCoord);
664 mReSortCoordArray.clear();
665 mReSortCoordArray.assign(mCoordArray.begin(), mCoordArray.end());
668 insertHandlePoint(fp, pCoord);
669
670 mInitPosition.set(pCoord);
671 }
672 }
673 else
674 {
675 fp = addPointtoEnd();
676 }
677 return fp;
678
679 }
680
681
682 static bool sortx(MyCoord a, MyCoord b)
683 {
684 if (a.x < b.x) { return true; }
685 else { return false; }
686 };
687 static bool sorty(MyCoord a, MyCoord b)
688 {
689 if (a.y < b.y) { return true; }
690 else { return false; }
691 };
692
694 {
695 mReSortCoordArray.assign(mCoordArray.begin(), mCoordArray.end());
697
698 for (size_t i = 0; i < mReSortCoordArray.size(); i++)
699 {
700 for (size_t k = 0; k < mCoordArray.size(); k++)
701 {
702 if (mReSortCoordArray[i] == mCoordArray[k])
703 {
706 break;
707 }
708 }
709 }
710
711 };
712
713 void keyReleaseEvent(QKeyEvent* event)
714 {
715 QWidget::keyPressEvent(event);
716 parent()->event((QEvent*)event);
717 if (event->key() == Qt::Key_Alt)
718 {
719 mAltKey = false;
720 return;
721 }
722 if (event->key() == Qt::Key_Control)
723 {
724 mCtrlKey = false;
725 return;
726 }
727 if (event->key() == Qt::Key_Shift)
728 {
729 mShiftKey = false;
730 return;
731 }
732 }
733
734
735
737 {
739
740 dyno::Vec2f p1;
741 dyno::Vec2f p2;
743
744 auto it = mMapOriginalIDtoResortID.find(i);
745 int id = it->second;
746 int f;
747 int s;
748 if (mCoordArray.size() < 3)
749 {
750 N = Vec2f(1, 0);
751 }
752 else
753 {
754 f = id - 1;
755 s = id + 1;
756 if (id == 0)
757 {
758 N[0] = mReSortCoordArray[s].x - mReSortCoordArray[id].x;
759 N[1] = mReSortCoordArray[s].y - mReSortCoordArray[id].y;
760 }
761 else if (id == mReSortCoordArray.size() - 1)
762 {
763 N[0] = mReSortCoordArray[id].x - mReSortCoordArray[f].x;
764 N[1] = mReSortCoordArray[id].y - mReSortCoordArray[f].y;
765 }
766 else
767 {
768 N[0] = mReSortCoordArray[s].x - mReSortCoordArray[f].x;
769 N[1] = mReSortCoordArray[s].y - mReSortCoordArray[f].y;
770 }
771 }
772
773 N.normalize();
774
775 p1 = P - N * mIniHandleLength;
776 p2 = P + N * mIniHandleLength;
777
778 mHandlePoints.push_back(MyCoord(p1));
779 mHandlePoints.push_back(MyCoord(p2));
780
781 }
782
784 {
785 for (size_t i = 0; i < mCoordArray.size(); i++)
786 {
788 }
789 }
790
792 {
793 //ÇúÏß×ø±êת»»µ½0-1¸¡µãÖµ£¬²¢·´×ªYÖá
794 Coord0_1 s;
795
796 double x = double(coord.x);
797 double y = double(coord.y);
798 double fmaxX = double(maxX);
799 double fminX = double(minX);
800 double fmaxY = double(maxY);
801 double fminY = double(minY);
802
803 s.x = (x - fminX) / (fmaxX - fminX);
804 s.y = 1 - (y - fminY) / (fmaxY - fminY);
805
806 return s;
807 }
808
809 void leaveEvent(QEvent* event)
810 {
811 mShiftKey = false;
812 mAltKey = false;
813 this->releaseKeyboard();
814 }
815
816 void remapArrayToHeight(std::vector<MyCoord>& Array, int h)
817 {
818 double fmaxX = double(maxX);
819 double fminX = double(minX);
820 double fmaxY = double(maxY);
821 double fminY = double(minY);
822 for (size_t i = 0; i < Array.size(); i++)
823 {
824 int newMaxY = h - 1.5 * double(radius);
825 float k = (double(Array[i].y) - fminY) / (fmaxY - fminY);
826 Array[i].y = k * (newMaxY - fminY) + fminY;
827 }
828 }
829
830 void updateFloatCoordArray(std::vector<MyCoord> CoordArray, std::vector<Coord0_1>& myfloatCoord)
831 {
832 myfloatCoord.clear();
833 for (auto it : CoordArray)
834 {
835 myfloatCoord.push_back(CoordTo0_1Value(it));
836 }
837 }
838
839 void keyPressEvent(QKeyEvent* event)
840 {
841 QWidget::keyPressEvent(event);
842 parent()->event((QEvent*)event);
843 if (event->key() == Qt::Key_Alt)
844 {
845 mAltKey = true;
846 return;
847 }
848 if (event->key() == Qt::Key_Control)
849 {
850
851 mCtrlKey = true;
852 return;
853 }
854 if (event->key() == Qt::Key_Shift)
855 {
856 mShiftKey = true;
857 return;
858 }
859 }
860
861 void mouseReleaseEvent(QMouseEvent* event)
862 {
863 mSelectPointID = -1;
864 mIsSelect = false;
865 mIsHandleSelect = false;
869 mHandleConnection = true;
870
871 //°´ÕհٷֱȻ®Bezier·Öµã
874 update();
875 }
876
877
878 public:
879 //Setting
880 bool useBezier = false;
881 bool isSquard = false;
882 bool useSort = true;
883 bool lockSize = false;
884 bool curveClose = false;
885 bool LineResample = false;
886
887 double spacing = 10;
888
889 protected:
890
891 //Default Setting
892 int w = 380; //Default Width
893 int h = 100; //Default Height
894
895 int selectDistance = 10; //SelectDistanceThreshold
897 int radius = 4; //Point Radius
898 float mIniHandleLength = 15; //DefaultHandleLength
899
900 Dir mMode = x; //Direction for CloseMode
901 Interpolation InterpMode = Linear; //Interpolation
902
903 //reSize
904 int maxX = 0;
905 int maxY = 0;
906 int minX = 0;
907 int minY = 0;
908 double NmaxX = 0;
909 double NmaxY = 0;
910 double NminX = 0;
911 double mNewMinY = 0;
916
917 //Temp
918 int mMinIndex = 0;
919 int mMaxIndex = 0;
920
921 //KeyboardStatus
922 bool mAltKey = false;
923 bool mCtrlKey = false;
924 bool mShiftKey = false;
925
926 //CurrentStatus
927 int mHoverPoint = -1;
930 bool mIsSelect = false;
931 bool mIsHandleSelect = false;
934 bool mIsHover = false;
937 bool mForceUpdate = false;
939 bool mHandleConnection = true;
940 bool mInsertAtBegin = false;
941
942 //Coord
943 MyCoord mInitPosition; //initial position of the SelectedPoint
944 MyCoord mDtPosition; //delta position of th SelectedPoint
945 MyCoord mInitHandlePos; //initial position of the SelectedHandlePoint
946 MyCoord mPressCoord; //Current PressCoord
947
948
949 //CurveCoord
950 std::vector<MyCoord> mCoordArray; //CoordArray by Press
951 std::vector<MyCoord> mReSortCoordArray; //Reorder Coordarray
952 std::vector<MyCoord> mHandlePoints; //handlePoints by CoordArray
953 std::vector<Coord0_1> mFloatCoord; // updateFloatCoordArray(reSortCoordArray, floatCoord);
954 std::vector<Coord0_1> mHandleFloatCoord;
955 std::vector<MyCoord> mCurvePoint; // resample Path
956 std::vector<int> mMultiSelectID;
957
958 //Map
959 std::map<int, float> mCurvePointMapLength; //find Length by curvePoint
960 std::map<float, EndPoint> mLengthMapEndPoint; //find EndPoint by Length
961 std::map<int, int> mMapOriginalIDtoResortID; //find reSortArray id by CoordArray id
962 std::map<int, int> mMapResortIDtoOriginalID; //find CoordArray id by reSortArray id
963
964 //Path
965 QPainterPath mPath;
966 };
967
968
969}
This class is designed to be elegant, so it can be directly passed to GPU as parameters.
Definition Array.h:27
QDoubleSlider(QWidget *pParent=NULL)
void setValue(double Value, bool BlockSignals=false)
QDoubleSpinner(QWidget *pParent=NULL)
void updateLabelShape()
Definition QComponent.h:273
bool mInsertBezierOpenPoint
Definition QComponent.h:938
int insertCurvePoint(MyCoord pCoord)
Definition QComponent.h:591
virtual void updateDataToField()
Definition QComponent.h:271
void keyReleaseEvent(QKeyEvent *event)
Definition QComponent.h:713
std::vector< MyCoord > mCoordArray
Definition QComponent.h:950
static bool sortx(MyCoord a, MyCoord b)
Definition QComponent.h:682
Interpolation InterpMode
Definition QComponent.h:901
void buildHandlePointSet()
Definition QComponent.h:783
void updateFloatCoordArray(std::vector< MyCoord > CoordArray, std::vector< Coord0_1 > &myfloatCoord)
Definition QComponent.h:830
MyCoord mInitPosition
Definition QComponent.h:943
void reSort(std::vector< MyCoord > &vector1)
Definition QComponent.h:397
void leaveEvent(QEvent *event)
Definition QComponent.h:809
Dir setMode(int s)
Definition QComponent.h:272
void initializeLine(Dir mode)
Definition QComponent.h:373
Coord0_1 CoordTo0_1Value(MyCoord &coord)
Definition QComponent.h:791
void buildCoordToResortMap()
Definition QComponent.h:693
void changeLabelSize()
Definition QComponent.h:303
void copyFromField(std::vector< Canvas::OriginalCoord > coord01, std::vector< MyCoord > &thisArray)
Definition QComponent.h:360
std::map< int, int > mMapResortIDtoOriginalID
Definition QComponent.h:962
std::vector< Coord0_1 > mFloatCoord
Definition QComponent.h:953
std::vector< Coord0_1 > mHandleFloatCoord
Definition QComponent.h:954
MyCoord mPressCoord
Definition QComponent.h:946
std::vector< MyCoord > mReSortCoordArray
Definition QComponent.h:951
void setLinearResample(int s)
Definition QComponent.h:313
virtual int addPointtoEnd()
Definition QComponent.h:465
std::vector< MyCoord > mHandlePoints
Definition QComponent.h:952
std::vector< MyCoord > mCurvePoint
Definition QComponent.h:955
void mouseReleaseEvent(QMouseEvent *event)
Definition QComponent.h:861
void setSpacingToDrawLabel(double value, int id)
Definition QComponent.h:337
MyCoord mInitHandlePos
Definition QComponent.h:945
void setLabelSize(int minX, int minY, int maxX, int maxY)
Definition QComponent.h:391
QPainterPath mPath
Definition QComponent.h:965
void insertHandlePoint(int fp, MyCoord pCoord)
Definition QComponent.h:530
std::map< int, float > mCurvePointMapLength
Definition QComponent.h:959
void insertElementToHandlePointSet(int i)
Definition QComponent.h:736
static bool sorty(MyCoord a, MyCoord b)
Definition QComponent.h:687
void SetValueToDrawLabel(double value, int id)
Definition QComponent.h:320
void keyPressEvent(QKeyEvent *event)
Definition QComponent.h:839
std::vector< int > mMultiSelectID
Definition QComponent.h:956
MyCoord mDtPosition
Definition QComponent.h:944
void remapArrayToHeight(std::vector< MyCoord > &Array, int h)
Definition QComponent.h:816
void copyFromField(std::vector< Canvas::Coord2D > coord01, std::vector< MyCoord > &thisArray)
Definition QComponent.h:348
std::map< float, EndPoint > mLengthMapEndPoint
Definition QComponent.h:960
void buildBezierPoint()
Definition QComponent.h:561
MyCoord ZeroOneToCoord(Coord0_1 &value, int x0, int x1, int y0, int y1)
Definition QComponent.h:413
std::map< int, int > mMapOriginalIDtoResortID
Definition QComponent.h:961
mQCheckBox(QWidget *pParent=NULL)
Definition QComponent.h:103
void updateChecked(int s)
Definition QComponent.h:130
void setNewVisable(int s)
Definition QComponent.h:121
void findSignal(int i)
Definition QComponent.h:115
QLabel * nameLabel
Definition QComponent.h:149
void mValueChanged(int)
void updateUnchecked(int s)
Definition QComponent.h:138
mQDoubleSlider(QWidget *pParent=NULL)
Definition QComponent.h:44
void setNewVisable(int s)
Definition QComponent.h:53
void setValue(double Value, bool BlockSignals=false)
Definition QComponent.h:79
void setNewVisable(int s)
Definition QComponent.h:87
mQDoubleSpinner(QWidget *pParent=NULL)
Definition QComponent.h:69
void valueChangedAndID(double Value, int i)
#define N(x, y, z)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Vector< float, 2 > Vec2f
Definition Vector2D.h:81
DYN_FUNC Complex< Real > sqrt(const Complex< Real > &)
Definition Complex.inl:321
void set(double a, double b)
Definition QComponent.h:212
MyCoord operator+(MyCoord s)
Definition QComponent.h:199
MyCoord operator-(MyCoord s)
Definition QComponent.h:192
bool operator==(MyCoord s)
Definition QComponent.h:184
void set(int a, int b)
Definition QComponent.h:163