PeriDyno 1.2.1
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
273 void updateLabelShape(bool squard)
274 {
275 if (squard)
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 }
303
304
306 {
307 LineResample = s;
308 this->mForceUpdate = true;
309 update();
310 }
311
312 void setSpacingToDrawLabel(double value, int id)
313 {
314 spacing = value;
315 mForceUpdate = true;
316 update();
317 }
318
319
320 protected:
321
322
323 void copyFromField(std::vector<Canvas::Coord2D> coord01, std::vector<MyCoord>& thisArray)
324 {
325 if (coord01.size())
326 {
327 for (auto it : coord01)
328 {
329 Coord0_1 s;
330 s.set(it.x, it.y);
331 thisArray.push_back(ZeroOneToCoord(s, minX, maxX, minY, maxY));
332 }
333 }
334 }
335 void copyFromField(std::vector<Canvas::OriginalCoord> coord01, std::vector<MyCoord>& thisArray)
336 {
337 if (coord01.size())
338 {
339 for (auto it : coord01)
340 {
341 MyCoord s;
342 s.set(it.x, it.y);
343 thisArray.push_back(s);
344 }
345 }
346 }
347
349 {
350 if (mode == x)
351 {
352 mCoordArray[0].x = minX;
353 mCoordArray[0].y = (maxY + minY) / 2;
354 mCoordArray[1].x = maxX;
355 mCoordArray[1].y = (maxY + minY) / 2;
356 }
357 if (mode == y)
358 {
359 mCoordArray[0].x = (maxX + minX) / 2;
360 mCoordArray[0].y = minY;
361 mCoordArray[1].x = (maxX + minX) / 2;
362 mCoordArray[1].y = maxY;
363 }
364 }
365
366 void setLabelSize(int minX, int minY, int maxX, int maxY)
367 {
368 this->setMinimumSize(minX, minY);
369 this->setMaximumSize(maxX, maxY);
370 }
371
372 void reSort(std::vector<MyCoord>& vector1)
373 {
374 if (useSort)
375 {
376 if (mMode == x)
377 {
378 std::sort(vector1.begin(), vector1.end(), sortx);
379 }
380
381 if (mMode == y)
382 {
383 sort(vector1.begin(), vector1.end(), sorty);
384 }
385 }
386 }
387
388 MyCoord ZeroOneToCoord(Coord0_1& value, int x0, int x1, int y0, int y1)
389 {
390 MyCoord s;
391 s.x = int(value.x * float(x1 - x0)) + x0;
392 s.y = int((1 - value.y) * float(y1 - y0)) + y0;
393
394 return s;
395 }
396
398 {
399 if (mMultiSelectID.size() <= 1)
400 {
401 mCoordArray.erase(mCoordArray.begin() + mSelectPointID);
402 mHandlePoints.erase(mHandlePoints.begin() + mSelectPointID * 2 + 1);
403 mHandlePoints.erase(mHandlePoints.begin() + mSelectPointID * 2);
404 mReSortCoordArray.clear();
405 mReSortCoordArray.assign(mCoordArray.begin(), mCoordArray.end());
408 }
409 else
410 {
411 std::sort(mMultiSelectID.begin(), mMultiSelectID.end());
412
413 for (size_t i = 0; i < mMultiSelectID.size(); i++)
414 {
416 mCoordArray.erase(mCoordArray.begin() + mSelectPointID);
417 mHandlePoints.erase(mHandlePoints.begin() + mSelectPointID * 2 + 1);
418 mHandlePoints.erase(mHandlePoints.begin() + mSelectPointID * 2);
419 mReSortCoordArray.clear();
420 mReSortCoordArray.assign(mCoordArray.begin(), mCoordArray.end());
423 }
424
425 }
426
427 mMultiSelectID.clear();
428
429 mSelectPointID = -1;
430 mHoverPoint = -1;
431 mIsHover = false;
432 mIsSelect = false;
433 mHandleParent = -1;
436 mIsHandleSelect = false;
437
438 }
439
440 virtual int addPointtoEnd()
441 {
442 if (!mInsertAtBegin)
443 {
444 mCoordArray.push_back(mPressCoord);
447
449 {
451 mSelectPointID = -1;
452 mIsSelect = false;
453 mHandleParent = mCoordArray.size() - 1;
456 mIsHandleSelect = true;
457 }
459 {
461 mSelectPointID = mCoordArray.size() - 1;
462 mIsSelect = true;
466 mIsHandleSelect = false;
468 }
469
470 mMultiSelectID.clear();
471 mMultiSelectID.push_back(mCoordArray.size() - 1);
472 }
473 else if (mInsertAtBegin)
474 {
475 mCoordArray.insert(mCoordArray.begin(), mPressCoord);
478
479
481 {
483 mSelectPointID = -1;
484 mIsSelect = false;
485 mHandleParent = 0;
488 mIsHandleSelect = true;
489 }
491 {
493 mSelectPointID = 0;
494 mIsSelect = true;
498 mIsHandleSelect = false;
500 }
501 }
502 return mHandleParent;
503 }
504
505 void insertHandlePoint(int fp, MyCoord pCoord)
506 {
507 dyno::Vec2f P(pCoord.x, pCoord.y);
508 int size = mReSortCoordArray.size();
509 dyno::Vec2f p1;
510 dyno::Vec2f p2;
511
512 dyno::Vec2f N = Vec2f(1, 0);
513 if (fp == 0)
514 {
515 if (mReSortCoordArray.size() == 1)
516 N = Vec2f(1, 0);
517 else
518 N = Vec2f(pCoord.x - mReSortCoordArray[1].x, pCoord.y - mReSortCoordArray[1].y);
519 }
520 else
521 {
522 N = Vec2f(pCoord.x - mReSortCoordArray[fp - 1].x, pCoord.y - mReSortCoordArray[fp - 1].y) * -1;
523 }
524
525 N.normalize();
526
527 int num = fp * 2;
528
529 p1 = P - N * mIniHandleLength;
530 p2 = P + N * mIniHandleLength;
531
532 mHandlePoints.insert(mHandlePoints.begin() + num, MyCoord(p1));
533 mHandlePoints.insert(mHandlePoints.begin() + num, MyCoord(p2));
534 }
535
537 {
538 int totalLength = mPath.length();
539 mCurvePoint.clear();
540 mCurvePointMapLength.clear();
541 for (size_t i = 0; i < 500; i++)
542 {
543 float length = i * spacing;
544 qreal perc = 0;
545 QPointF QP;
546 bool b = false;
547 if (length <= totalLength)
548 {
549 perc = mPath.percentAtLength(qreal(length));
550 }
551 else
552 {
553 perc = 1;
554 b = true;
555 }
556
557 QP = mPath.pointAtPercent(perc);
558 mCurvePoint.push_back(MyCoord(QP.x(), QP.y()));
559 mCurvePointMapLength[i] = length;
560
561 if (b) { break; }
562 }
563
564 }
565
567 {
568 mLengthMapEndPoint.clear();
569 QPainterPath tempPath;
570 for (size_t i = 1; i < mReSortCoordArray.size(); i++)
571 {
572
573 int ptnum = i - 1;
574 tempPath.moveTo(mReSortCoordArray[ptnum].x, mReSortCoordArray[ptnum].y);
575
576 auto it = mMapResortIDtoOriginalID.find(i);
577 int id = it->second;
578 int s = id * 2;
579
580 auto itf = mMapResortIDtoOriginalID.find(ptnum);
581 int idf = itf->second;
582 int f = idf * 2 + 1;
584 {
585 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));
586 }
588 {
589 tempPath.lineTo(QPointF(mReSortCoordArray[ptnum + 1].x, mReSortCoordArray[ptnum + 1].y));
590 }
591 float tempLength = tempPath.length();
592
593 EndPoint tempEP = EndPoint(id, idf);
594 mLengthMapEndPoint[tempLength] = tempEP;
595 }
596
597 int dis = 380;
598 int nearPoint = -1;
599 int temp;
600
601 for (size_t i = 0; i < mCurvePoint.size(); i++)
602 {
603 temp = sqrt(std::pow((pCoord.x - mCurvePoint[i].x), 2) + std::pow((pCoord.y - mCurvePoint[i].y), 2));
604
605 if (dis >= temp)
606 {
607 nearPoint = i;
608 dis = temp;
609 }
610 }
611
612 int fp = -1;
613 int searchRadius = 20;
614
615 if (dis < searchRadius)
616 {
617 float realLength = mCurvePointMapLength.find(nearPoint)->second;
618 float finalLength = -1;
619 for (auto it : mLengthMapEndPoint)
620 {
621 if (realLength <= it.first)
622 {
623 finalLength = it.first;
624 break;
625 }
626 }
627 if (finalLength == -1)
628 {
629 fp = addPointtoEnd();
630 }
631 else
632 {
633 fp = mLengthMapEndPoint.find(finalLength)->second.firstPoint;
634
635 mCoordArray.insert(mCoordArray.begin() + fp, pCoord);
636 mReSortCoordArray.clear();
637 mReSortCoordArray.assign(mCoordArray.begin(), mCoordArray.end());
640 insertHandlePoint(fp, pCoord);
641
642 mInitPosition.set(pCoord);
643 }
644 }
645 else
646 {
647 fp = addPointtoEnd();
648 }
649 return fp;
650
651 }
652
653
654 static bool sortx(MyCoord a, MyCoord b)
655 {
656 if (a.x < b.x) { return true; }
657 else { return false; }
658 };
659 static bool sorty(MyCoord a, MyCoord b)
660 {
661 if (a.y < b.y) { return true; }
662 else { return false; }
663 };
664
666 {
667 mReSortCoordArray.assign(mCoordArray.begin(), mCoordArray.end());
669
670 for (size_t i = 0; i < mReSortCoordArray.size(); i++)
671 {
672 for (size_t k = 0; k < mCoordArray.size(); k++)
673 {
674 if (mReSortCoordArray[i] == mCoordArray[k])
675 {
678 break;
679 }
680 }
681 }
682
683 };
684
685 void keyReleaseEvent(QKeyEvent* event)
686 {
687 QWidget::keyPressEvent(event);
688 parent()->event((QEvent*)event);
689 if (event->key() == Qt::Key_Alt)
690 {
691 mAltKey = false;
692 return;
693 }
694 if (event->key() == Qt::Key_Control)
695 {
696 mCtrlKey = false;
697 return;
698 }
699 if (event->key() == Qt::Key_Shift)
700 {
701 mShiftKey = false;
702 return;
703 }
704 }
705
706
707
709 {
711
712 dyno::Vec2f p1;
713 dyno::Vec2f p2;
715
716 auto it = mMapOriginalIDtoResortID.find(i);
717 int id = it->second;
718 int f;
719 int s;
720 if (mCoordArray.size() < 3)
721 {
722 N = Vec2f(1, 0);
723 }
724 else
725 {
726 f = id - 1;
727 s = id + 1;
728 if (id == 0)
729 {
730 N[0] = mReSortCoordArray[s].x - mReSortCoordArray[id].x;
731 N[1] = mReSortCoordArray[s].y - mReSortCoordArray[id].y;
732 }
733 else if (id == mReSortCoordArray.size() - 1)
734 {
735 N[0] = mReSortCoordArray[id].x - mReSortCoordArray[f].x;
736 N[1] = mReSortCoordArray[id].y - mReSortCoordArray[f].y;
737 }
738 else
739 {
740 N[0] = mReSortCoordArray[s].x - mReSortCoordArray[f].x;
741 N[1] = mReSortCoordArray[s].y - mReSortCoordArray[f].y;
742 }
743 }
744
745 N.normalize();
746
747 p1 = P - N * mIniHandleLength;
748 p2 = P + N * mIniHandleLength;
749
750 mHandlePoints.push_back(MyCoord(p1));
751 mHandlePoints.push_back(MyCoord(p2));
752
753 }
754
756 {
757 for (size_t i = 0; i < mCoordArray.size(); i++)
758 {
760 }
761 }
762
764 {
765 //ÇúÏß×ø±êת»»µ½0-1¸¡µãÖµ£¬²¢·´×ªYÖá
766 Coord0_1 s;
767
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);
774
775 s.x = (x - fminX) / (fmaxX - fminX);
776 s.y = 1 - (y - fminY) / (fmaxY - fminY);
777
778 return s;
779 }
780
781 void leaveEvent(QEvent* event)
782 {
783 mShiftKey = false;
784 mAltKey = false;
785 this->releaseKeyboard();
786 }
787
788 void remapArrayToHeight(std::vector<MyCoord>& Array, int h)
789 {
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++)
795 {
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;
799 }
800 }
801
802 void updateFloatCoordArray(std::vector<MyCoord> CoordArray, std::vector<Coord0_1>& myfloatCoord)
803 {
804 myfloatCoord.clear();
805 for (auto it : CoordArray)
806 {
807 myfloatCoord.push_back(CoordTo0_1Value(it));
808 }
809 }
810
811 void keyPressEvent(QKeyEvent* event)
812 {
813 QWidget::keyPressEvent(event);
814 parent()->event((QEvent*)event);
815 if (event->key() == Qt::Key_Alt)
816 {
817 mAltKey = true;
818 return;
819 }
820 if (event->key() == Qt::Key_Control)
821 {
822
823 mCtrlKey = true;
824 return;
825 }
826 if (event->key() == Qt::Key_Shift)
827 {
828 mShiftKey = true;
829 return;
830 }
831 }
832
833 void mouseReleaseEvent(QMouseEvent* event)
834 {
835 mSelectPointID = -1;
836 mIsSelect = false;
837 mIsHandleSelect = false;
841 mHandleConnection = true;
842
843 //°´ÕհٷֱȻ®Bezier·Öµã
846 update();
847 }
848
849
850 public:
851 //Setting
852 bool useBezier = false;
853
854 bool useSort = true;
855 bool lockSize = false;
856 bool curveClose = false;
857 bool LineResample = false;
858
859 double spacing = 10;
860
861 protected:
862
863 //Default Setting
864 int w = 380; //Default Width
865 int h = 100; //Default Height
866
867 int selectDistance = 10; //SelectDistanceThreshold
869 int radius = 4; //Point Radius
870 float mIniHandleLength = 15; //DefaultHandleLength
871
872 Dir mMode = x; //Direction for CloseMode
873 Interpolation InterpMode = Linear; //Interpolation
874
875 //reSize
876 int maxX = 0;
877 int maxY = 0;
878 int minX = 0;
879 int minY = 0;
880
885
886 //Temp
887 int mMinIndex = 0;
888 int mMaxIndex = 0;
889
890 //KeyboardStatus
891 bool mAltKey = false;
892 bool mCtrlKey = false;
893 bool mShiftKey = false;
894
895 //CurrentStatus
896 int mHoverPoint = -1;
899 bool mIsSelect = false;
900 bool mIsHandleSelect = false;
903 bool mIsHover = false;
906 bool mForceUpdate = false;
908 bool mHandleConnection = true;
909 bool mInsertAtBegin = false;
910
911 //Coord
912 MyCoord mInitPosition; //initial position of the SelectedPoint
913 MyCoord mDtPosition; //delta position of th SelectedPoint
914 MyCoord mInitHandlePos; //initial position of the SelectedHandlePoint
915 MyCoord mPressCoord; //Current PressCoord
916
917
918 //CurveCoord
919 std::vector<MyCoord> mCoordArray; //CoordArray by Press
920 std::vector<MyCoord> mReSortCoordArray; //Reorder Coordarray
921 std::vector<MyCoord> mHandlePoints; //handlePoints by CoordArray
922 std::vector<Coord0_1> mFloatCoord; // updateFloatCoordArray(reSortCoordArray, floatCoord);
923 std::vector<Coord0_1> mHandleFloatCoord;
924 std::vector<MyCoord> mCurvePoint; // resample Path
925 std::vector<int> mMultiSelectID;
926
927 //Map
928 std::map<int, float> mCurvePointMapLength; //find Length by curvePoint
929 std::map<float, EndPoint> mLengthMapEndPoint; //find EndPoint by Length
930 std::map<int, int> mMapOriginalIDtoResortID; //find reSortArray id by CoordArray id
931 std::map<int, int> mMapResortIDtoOriginalID; //find CoordArray id by reSortArray id
932
933 //Path
934 QPainterPath mPath;
935 };
936
937
938}
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)
bool mInsertBezierOpenPoint
Definition QComponent.h:907
int insertCurvePoint(MyCoord pCoord)
Definition QComponent.h:566
virtual void updateDataToField()
Definition QComponent.h:271
void keyReleaseEvent(QKeyEvent *event)
Definition QComponent.h:685
std::vector< MyCoord > mCoordArray
Definition QComponent.h:919
static bool sortx(MyCoord a, MyCoord b)
Definition QComponent.h:654
Interpolation InterpMode
Definition QComponent.h:873
void buildHandlePointSet()
Definition QComponent.h:755
void updateFloatCoordArray(std::vector< MyCoord > CoordArray, std::vector< Coord0_1 > &myfloatCoord)
Definition QComponent.h:802
MyCoord mInitPosition
Definition QComponent.h:912
void reSort(std::vector< MyCoord > &vector1)
Definition QComponent.h:372
void leaveEvent(QEvent *event)
Definition QComponent.h:781
void updateLabelShape(bool squard)
Definition QComponent.h:273
void initializeLine(Dir mode)
Definition QComponent.h:348
Coord0_1 CoordTo0_1Value(MyCoord &coord)
Definition QComponent.h:763
void buildCoordToResortMap()
Definition QComponent.h:665
void copyFromField(std::vector< Canvas::OriginalCoord > coord01, std::vector< MyCoord > &thisArray)
Definition QComponent.h:335
std::map< int, int > mMapResortIDtoOriginalID
Definition QComponent.h:931
std::vector< Coord0_1 > mFloatCoord
Definition QComponent.h:922
std::vector< Coord0_1 > mHandleFloatCoord
Definition QComponent.h:923
MyCoord mPressCoord
Definition QComponent.h:915
std::vector< MyCoord > mReSortCoordArray
Definition QComponent.h:920
void setLinearResample(int s)
Definition QComponent.h:305
virtual int addPointtoEnd()
Definition QComponent.h:440
std::vector< MyCoord > mHandlePoints
Definition QComponent.h:921
std::vector< MyCoord > mCurvePoint
Definition QComponent.h:924
void mouseReleaseEvent(QMouseEvent *event)
Definition QComponent.h:833
void setSpacingToDrawLabel(double value, int id)
Definition QComponent.h:312
MyCoord mInitHandlePos
Definition QComponent.h:914
void setLabelSize(int minX, int minY, int maxX, int maxY)
Definition QComponent.h:366
QPainterPath mPath
Definition QComponent.h:934
void insertHandlePoint(int fp, MyCoord pCoord)
Definition QComponent.h:505
std::map< int, float > mCurvePointMapLength
Definition QComponent.h:928
void insertElementToHandlePointSet(int i)
Definition QComponent.h:708
static bool sorty(MyCoord a, MyCoord b)
Definition QComponent.h:659
void keyPressEvent(QKeyEvent *event)
Definition QComponent.h:811
std::vector< int > mMultiSelectID
Definition QComponent.h:925
MyCoord mDtPosition
Definition QComponent.h:913
void remapArrayToHeight(std::vector< MyCoord > &Array, int h)
Definition QComponent.h:788
void copyFromField(std::vector< Canvas::Coord2D > coord01, std::vector< MyCoord > &thisArray)
Definition QComponent.h:323
std::map< float, EndPoint > mLengthMapEndPoint
Definition QComponent.h:929
void buildBezierPoint()
Definition QComponent.h:536
MyCoord ZeroOneToCoord(Coord0_1 &value, int x0, int x1, int y0, int y1)
Definition QComponent.h:388
std::map< int, int > mMapOriginalIDtoResortID
Definition QComponent.h:930
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