PeriDyno 1.0.0
Loading...
Searching...
No Matches
QVectorTransform3FieldWidget.h
Go to the documentation of this file.
1
19#pragma once
20#include "QFieldWidget.h"
22#include "Field.h"
23#include <QHBoxLayout>
24#include <QVBoxLayout>
26#include "qgroupbox.h"
27
28namespace dyno
29{
30 class mVectorTransformItemLayout : public QHBoxLayout
31 {
32 Q_OBJECT
33 public:
35
37
39
40 void setValue(Transform3f v);
41
42 void setId(int id) { mId = id; index->setText(std::to_string(id).c_str()); };
43
44 signals:
45
49 void removeById(int);
50
54 void valueChange(double);
55
56 public slots:
57 void emitSignal() { emit removeById(mId); }
58
59 void emitChange(double v) { emit valueChange(v); }
60
61
62 private:
63
64 private:
65 int mId = -1;
66
67 QGroupBox* mGroup = NULL;
68
72
76
80
81 QLabel* mTLabel = NULL;
82 QLabel* mRLabel = NULL;
83 QLabel* mSLabel = NULL;
84
85 QPushButton* removeButton = nullptr;
86 QLabel* index = nullptr;
87 };
88
90 {
91 Q_OBJECT
92 public:
94
96
98
99 signals:
101
102 public slots:
106 void updateField();
110 void updateWidget();
111
112 void updateVector(int) { updateVector(); }
116 void updateVector();
120 void addItemWidget();
124 void removeItemWidgetById(int id);
125
126 private:
131
132
133 private:
134
135 std::vector<Transform3f> mVec;
136
137 QVBoxLayout* mMainLayout = NULL;
138
139 std::vector<mVectorTransformItemLayout*> mItems;
140
141 };
142
143
144
145
146}
#define DECLARE_FIELD_WIDGET
QFieldWidget(FBase *field)
void createItemWidget(Transform3f v)
Creating Vector Elements(std::vector<mVectorTransformItemLayout*>) from fields.
void updateWidget()
Called when the field is updated.
void updateField()
Called when the widget is updated.
DECLARE_FIELD_WIDGET QVectorTransform3FieldWidget(FBase *field)
void removeItemWidgetById(int id)
Called when the "mVectorTransformItemLayout::QPushButton* removeButton" is clicked.
void updateVector()
Update "std::vector<Transform3f> mVec".
void addItemWidget()
Called when the QPushButton* addItembutton is clicked.
std::vector< mVectorTransformItemLayout * > mItems
void valueChange(double)
Called when the Widget changed.
void removeById(int)
Called When the RemoveButton is clicked.
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Transform< float, 3 > Transform3f