24
#include "Matrix3Editor.h"
28
static void ThreadMatrix3EditorDialog(NThread* thread, void* InitData)
30
smptr(VLayout) MainLayout(new VLayout());
31
smptr(Matrix3Editor) matrixeditor(new Matrix3Editor());
32
matrixeditor->ComputeChildLayout(); // necessary so all element of the widget get their rightful size.
33
Matrix3DialogProxy* matrixeditorproxy = static_cast<Matrix3DialogProxy*>(InitData);
36
matrixeditor->SetMatrix(matrixeditorproxy->GetMatrix());
37
matrixeditor->sigMatrixChanged.connect(sigc::mem_fun(matrixeditorproxy, &Matrix3DialogProxy::RecvDialogChange));
40
smptr(HLayout) ButtonLayout(new HLayout(TEXT("Dialog Buttons")));
42
smptr(Button) OkButton(new Button(TEXT("OK")));
43
OkButton->SetMinimumWidth(60);
44
OkButton->SetMinimumHeight(20);
46
smptr(Button) CancelButton(new Button(TEXT("Cancel")));
47
CancelButton->SetMinimumWidth(60);
48
CancelButton->SetMinimumHeight(20);
50
OkButton->sigClick.connect(sigc::mem_fun(static_cast<WindowThread*>(thread), &WindowThread::TerminateThread));
51
OkButton->sigClick.connect(sigc::bind(sigc::mem_fun(matrixeditorproxy, &Matrix3DialogProxy::RecvDialogOk), weaksmptr(Matrix3Editor)(matrixeditor)));
52
CancelButton->sigClick.connect(sigc::bind(sigc::mem_fun(matrixeditorproxy, &Matrix3DialogProxy::RecvDialogCancel), weaksmptr(Matrix3Editor)(matrixeditor)));
53
CancelButton->sigClick.connect(sigc::mem_fun(static_cast<WindowThread*>(thread), &WindowThread::TerminateThread));
55
ButtonLayout->SetHorizontalInternalMargin(6);
56
ButtonLayout->SetVerticalExternalMargin(2);
57
ButtonLayout->AddActiveInterfaceObject(OkButton, 0);
58
ButtonLayout->AddActiveInterfaceObject(CancelButton, 0);
60
MainLayout->AddActiveInterfaceObject(matrixeditor);
61
MainLayout->AddLayout(ButtonLayout, 0);
62
static_cast<WindowThread*>(thread)->SetLayout(MainLayout);
64
MainLayout->SetBaseWidth(1);
65
MainLayout->SetBaseHeight(1);
66
MainLayout->ComputeLayout2();
68
static_cast<WindowThread*>(thread)->SetWindowSize(MainLayout->GetBaseWidth(), MainLayout->GetBaseHeight());
70
// Call StopThreadMonitoring in case the dialog was close by clicking the window close button.
71
matrixeditorproxy->StopThreadMonitoring();
72
//delete CancelButton;
74
//delete matrixeditor;
77
Matrix3DialogProxy::Matrix3DialogProxy(bool ModalWindow)
78
: m_bDialogChange(false)
79
, m_bDialogRunning(false)
80
, m_ModalWindow(ModalWindow)
85
Matrix3DialogProxy::~Matrix3DialogProxy()
89
void Matrix3DialogProxy::Start()
91
m_PreviousMatrix = m_Matrix;
92
m_Thread = CreateModalWindowThread(WINDOWSTYLE_TOOL, TEXT("Matrix Editor"), 290, 230, GetGraphicsThread(),
93
ThreadMatrix3EditorDialog,
98
m_DialogThreadID = m_Thread->GetThreadId();
102
m_bDialogRunning = true;
105
bool Matrix3DialogProxy::IsActive()
107
return (m_Thread && (m_Thread->GetThreadState() != THREADSTOP) && m_bDialogRunning);
110
void Matrix3DialogProxy::RecvDialogOk(const weaksmptr(Matrix3Editor) matrixeditor)
112
m_Matrix = matrixeditor->GetMatrix();
113
m_PreviousMatrix = m_Matrix;
114
m_bDialogChange = true;
115
m_bDialogRunning = false;
118
void Matrix3DialogProxy::RecvDialogCancel(const weaksmptr(Matrix3Editor) matrixeditor)
120
m_Matrix = m_PreviousMatrix;
121
m_bDialogChange = true;
122
m_bDialogRunning = false;
125
void Matrix3DialogProxy::RecvDialogChange(const weaksmptr(Matrix3Editor) matrixeditor)
127
m_Matrix = matrixeditor->GetMatrix();
128
m_bDialogChange = true;
131
void Matrix3DialogProxy::StopThreadMonitoring()
133
m_Matrix = m_PreviousMatrix;
134
m_bDialogChange = true;
135
m_bDialogRunning = false;
136
m_DialogThreadID = 0;
140
Matrix3Editor::Matrix3Editor(Matrix3 matrix)
143
m_vlayout = smptr(VLayout)(new VLayout());
144
mtx_layout = smptr(VLayout)(new VLayout());
145
m_MtxFunctionLayout = smptr(HLayout)(new HLayout());
147
mtx_row_layout[0] = smptr(HLayout)(new HLayout());
148
mtx_row_layout[1] = smptr(HLayout)(new HLayout());
149
mtx_row_layout[2] = smptr(HLayout)(new HLayout());
151
m_IdentityMtxBtn = smptr(Button)(new Button());
152
m_ZeroMtxBtn = smptr(Button)(new Button());
153
m_InverseMtxBtn = smptr(Button)(new Button());
154
m_NegateMtxBtn = smptr(Button)(new Button());
156
m_IdentityMtxBtn->sigClick.connect(sigc::mem_fun(this, &Matrix3Editor::RecvIdentityMatrixCmd));
157
m_ZeroMtxBtn->sigClick.connect(sigc::mem_fun(this, &Matrix3Editor::RecvZeroMatrixCmd));
158
m_InverseMtxBtn->sigClick.connect(sigc::mem_fun(this, &Matrix3Editor::RecvInverseMatrixCmd));
159
m_NegateMtxBtn->sigClick.connect(sigc::mem_fun(this, &Matrix3Editor::RecvNegateMatrixCmd));
161
for(int i = 0; i < 3; i++)
163
for(int j = 0; j < 3; j++)
165
m_MtxInput[i][j] = smptr(EditTextBox)(new EditTextBox());
166
m_MtxInput[i][j]->SetMinimumSize(DEFAULT_WIDGET_WIDTH + 5, PRACTICAL_WIDGET_HEIGHT);
167
m_MtxInput[i][j]->setGeometry(Geometry(0, 0, DEFAULT_WIDGET_WIDTH, DEFAULT_WIDGET_HEIGHT));
168
m_MtxInput[i][j]->sigValidateKeyboardEntry.connect(
169
sigc::bind(sigc::mem_fun(this, &Matrix3Editor::RecvComponentInput), i*3+j));
174
for(int i = 0; i < 3; i++)
176
mtx_row_layout[i]->SetHorizontalInternalMargin(4);
177
//mtx_row_layout[i]->SetHorizontalExternalMargin(4);
178
//mtx_row_layout[i]->SetVerticalExternalMargin(2);
179
mtx_row_layout[i]->SetContentStacking(eStackLeft);
182
for(int i = 0; i < 3; i++)
184
for(int j = 0; j < 3; j++)
186
mtx_row_layout[i]->AddActiveInterfaceObject(m_MtxInput[i][j], 0, eCenter, eFull);
190
for(int i = 0; i < 3; i++)
192
mtx_layout->AddLayout(mtx_row_layout[i], 0, eCenter);
194
mtx_layout->SetContentStacking(eStackExpand);
196
m_IdentityMtxBtn->SetCaption(TEXT("Id"));
197
m_ZeroMtxBtn->SetCaption(TEXT("Zero"));
198
m_InverseMtxBtn->SetCaption(TEXT("Inv"));
199
m_NegateMtxBtn->SetCaption(TEXT("+/-"));
201
m_MtxFunctionLayout->AddActiveInterfaceObject(m_IdentityMtxBtn, 0, eAbove, eMatchContent);
202
m_MtxFunctionLayout->AddActiveInterfaceObject(m_ZeroMtxBtn, 0, eAbove, eMatchContent);
203
m_MtxFunctionLayout->AddActiveInterfaceObject(m_InverseMtxBtn, 0, eAbove, eMatchContent);
204
m_MtxFunctionLayout->AddActiveInterfaceObject(m_NegateMtxBtn, 0, eAbove, eMatchContent);
205
m_MtxFunctionLayout->SetVerticalExternalMargin(4);
206
m_MtxFunctionLayout->SetHorizontalExternalMargin(4);
207
m_MtxFunctionLayout->SetHorizontalInternalMargin(2);
208
m_MtxFunctionLayout->SetContentStacking(eStackLeft);
209
//mtx_layout->AddLayout(&m_MtxFunctionLayout, 1, eCenter, eMatchContent);
210
mtx_layout->SetContentStacking(eStackCenter);
211
mtx_layout->SetHorizontalExternalMargin(4);
212
mtx_layout->SetVerticalExternalMargin(4);
213
mtx_layout->SetVerticalInternalMargin(4);
215
m_vlayout->AddLayout(mtx_layout, 0, eCenter, eMatchContent);
216
m_vlayout->AddLayout(m_MtxFunctionLayout, 0, eCenter, eMatchContent);
217
m_vlayout->SetContentStacking(eStackCenter);
219
SetCompositionLayout(m_vlayout);
223
Matrix3Editor::~Matrix3Editor()
227
void Matrix3Editor::SetMatrix(Matrix3 matrix)
230
for(int i = 0; i < 3; i++)
232
for(int j = 0; j < 3; j++)
234
m_MtxInput[i][j]->SetText(inlPrintf(TEXT("%.3f"), m_Matrix.m[i][j]));
239
Matrix3 Matrix3Editor::GetMatrix() const
244
void Matrix3Editor::RecvComponentInput(const weaksmptr(EditTextBox) textbox, const NString& text, int componentIndex)
246
int i = componentIndex / 3;
247
int j = componentIndex - 3*i;
250
CharToFloat(text.GetTCharPtr(), f);
251
m_MtxInput[i][j]->SetText(inlPrintf(TEXT("%.3f"), f));
252
m_Matrix.m[i][j] = f;
254
sigMatrixChanged.emit(smptr(Matrix3Editor)(this, false));
257
void Matrix3Editor::WriteMatrix()
259
for(int i = 0; i < 3; i++)
261
for(int j = 0; j < 3; j++)
263
m_MtxInput[i][j]->SetText(inlPrintf(TEXT("%.3f"), m_Matrix.m[i][j]));
268
long Matrix3Editor::ProcessEvent(IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
270
long ret = TraverseInfo;
271
for(int i = 0; i < 3; i++)
273
for(int j = 0; j < 3; j++)
275
ret = m_MtxInput[i][j]->ProcessEvent(ievent, ret, ProcessEventInfo);
278
ret = m_IdentityMtxBtn->ProcessEvent(ievent, ret, ProcessEventInfo);
279
ret = m_ZeroMtxBtn->ProcessEvent(ievent, ret, ProcessEventInfo);
280
ret = m_InverseMtxBtn->ProcessEvent(ievent, ret, ProcessEventInfo);
281
ret = m_NegateMtxBtn->ProcessEvent(ievent, ret, ProcessEventInfo);
283
ret = PostProcessEvent2(ievent, ret, ProcessEventInfo);
287
void Matrix3Editor::Draw(GraphicsContext& GfxContext, bool force_draw)
289
Geometry base = GetGeometry();
291
for(int i = 0; i < 3; i++)
293
for(int j = 0; j < 3; j++)
295
m_MtxInput[i][j]->NeedRedraw();
299
m_IdentityMtxBtn->NeedRedraw();
300
m_ZeroMtxBtn->NeedRedraw();
301
m_InverseMtxBtn->NeedRedraw();
302
m_NegateMtxBtn->NeedRedraw();
303
//gPainter.PopBackground();
305
//gPainter.PopBackground();
308
void Matrix3Editor::DrawContent(GraphicsContext& GfxContext, bool force_draw)
310
Geometry base = GetGeometry();
312
gPainter.PushDrawShapeLayer(GfxContext, mtx_layout->GetGeometry(), eSHAPE_CORNER_ROUND4, Color(0xFF000000), eAllCorners);
314
gPainter.PushShapeLayer(GfxContext, mtx_layout->GetGeometry(), eSHAPE_CORNER_ROUND4, Color(0xFF000000), eAllCorners);
316
for(int i = 0; i < 3; i++)
318
for(int j = 0; j < 3; j++)
320
m_MtxInput[i][j]->ProcessDraw(GfxContext, force_draw);
324
m_IdentityMtxBtn->ProcessDraw(GfxContext, force_draw);
325
m_ZeroMtxBtn->ProcessDraw(GfxContext, force_draw);
326
m_InverseMtxBtn->ProcessDraw(GfxContext, force_draw);
327
m_NegateMtxBtn->ProcessDraw(GfxContext, force_draw);
328
gPainter.PopBackground();
331
void Matrix3Editor::PostDraw(GraphicsContext& GfxContext, bool force_draw)
336
void Matrix3Editor::SetParameterName(const char* parameter_name)
344
void Matrix3Editor::EmitIncrementComponent(int index)
347
//sigSetVector.emit(m_x, m_y, m_z, m_w);
350
void Matrix3Editor::EmitDecrementComponent(int index)
353
//sigSetVector.emit(m_x, m_y, m_z, m_w);
356
void Matrix3Editor::EmitComponentValue(float f, int index)
359
//sigSetVector.emit(m_x, m_y, m_z, m_w);
363
void Matrix3Editor::RecvIdentityMatrixCmd()
367
sigMatrixChanged.emit(smptr(Matrix3Editor)(this, false));
372
void Matrix3Editor::RecvZeroMatrixCmd()
376
sigMatrixChanged.emit(smptr(Matrix3Editor)(this, false));
381
void Matrix3Editor::RecvInverseMatrixCmd()
385
sigMatrixChanged.emit(smptr(Matrix3Editor)(this, false));
390
void Matrix3Editor::RecvNegateMatrixCmd()
392
m_Matrix = -m_Matrix;
394
sigMatrixChanged.emit(smptr(Matrix3Editor)(this, false));
24
#include "Matrix3Editor.h"
28
static void ThreadMatrix3EditorDialog(NThread* thread, void* InitData)
30
smptr(VLayout) MainLayout(new VLayout());
31
smptr(Matrix3Editor) matrixeditor(new Matrix3Editor());
32
matrixeditor->ComputeChildLayout(); // necessary so all element of the widget get their rightful size.
33
Matrix3DialogProxy* matrixeditorproxy = static_cast<Matrix3DialogProxy*>(InitData);
36
matrixeditor->SetMatrix(matrixeditorproxy->GetMatrix());
37
matrixeditor->sigMatrixChanged.connect(sigc::mem_fun(matrixeditorproxy, &Matrix3DialogProxy::RecvDialogChange));
40
smptr(HLayout) ButtonLayout(new HLayout(TEXT("Dialog Buttons")));
42
smptr(Button) OkButton(new Button(TEXT("OK")));
43
OkButton->SetMinimumWidth(60);
44
OkButton->SetMinimumHeight(20);
46
smptr(Button) CancelButton(new Button(TEXT("Cancel")));
47
CancelButton->SetMinimumWidth(60);
48
CancelButton->SetMinimumHeight(20);
50
OkButton->sigClick.connect(sigc::mem_fun(static_cast<WindowThread*>(thread), &WindowThread::TerminateThread));
51
OkButton->sigClick.connect(sigc::bind(sigc::mem_fun(matrixeditorproxy, &Matrix3DialogProxy::RecvDialogOk), weaksmptr(Matrix3Editor)(matrixeditor)));
52
CancelButton->sigClick.connect(sigc::bind(sigc::mem_fun(matrixeditorproxy, &Matrix3DialogProxy::RecvDialogCancel), weaksmptr(Matrix3Editor)(matrixeditor)));
53
CancelButton->sigClick.connect(sigc::mem_fun(static_cast<WindowThread*>(thread), &WindowThread::TerminateThread));
55
ButtonLayout->SetHorizontalInternalMargin(6);
56
ButtonLayout->SetVerticalExternalMargin(2);
57
ButtonLayout->AddActiveInterfaceObject(OkButton, 0);
58
ButtonLayout->AddActiveInterfaceObject(CancelButton, 0);
60
MainLayout->AddActiveInterfaceObject(matrixeditor);
61
MainLayout->AddLayout(ButtonLayout, 0);
62
static_cast<WindowThread*>(thread)->SetLayout(MainLayout);
64
MainLayout->SetBaseWidth(1);
65
MainLayout->SetBaseHeight(1);
66
MainLayout->ComputeLayout2();
68
static_cast<WindowThread*>(thread)->SetWindowSize(MainLayout->GetBaseWidth(), MainLayout->GetBaseHeight());
70
// Call StopThreadMonitoring in case the dialog was close by clicking the window close button.
71
matrixeditorproxy->StopThreadMonitoring();
72
//delete CancelButton;
74
//delete matrixeditor;
77
Matrix3DialogProxy::Matrix3DialogProxy(bool ModalWindow)
78
: m_bDialogChange(false)
79
, m_bDialogRunning(false)
80
, m_ModalWindow(ModalWindow)
85
Matrix3DialogProxy::~Matrix3DialogProxy()
89
void Matrix3DialogProxy::Start()
91
m_PreviousMatrix = m_Matrix;
92
m_Thread = CreateModalWindowThread(WINDOWSTYLE_TOOL, TEXT("Matrix Editor"), 290, 230, GetGraphicsThread(),
93
ThreadMatrix3EditorDialog,
98
m_DialogThreadID = m_Thread->GetThreadId();
102
m_bDialogRunning = true;
105
bool Matrix3DialogProxy::IsActive()
107
return (m_Thread && (m_Thread->GetThreadState() != THREADSTOP) && m_bDialogRunning);
110
void Matrix3DialogProxy::RecvDialogOk(const weaksmptr(Matrix3Editor) matrixeditor)
112
m_Matrix = matrixeditor->GetMatrix();
113
m_PreviousMatrix = m_Matrix;
114
m_bDialogChange = true;
115
m_bDialogRunning = false;
118
void Matrix3DialogProxy::RecvDialogCancel(const weaksmptr(Matrix3Editor) matrixeditor)
120
m_Matrix = m_PreviousMatrix;
121
m_bDialogChange = true;
122
m_bDialogRunning = false;
125
void Matrix3DialogProxy::RecvDialogChange(const weaksmptr(Matrix3Editor) matrixeditor)
127
m_Matrix = matrixeditor->GetMatrix();
128
m_bDialogChange = true;
131
void Matrix3DialogProxy::StopThreadMonitoring()
133
m_Matrix = m_PreviousMatrix;
134
m_bDialogChange = true;
135
m_bDialogRunning = false;
136
m_DialogThreadID = 0;
140
Matrix3Editor::Matrix3Editor(Matrix3 matrix)
143
m_vlayout = smptr(VLayout)(new VLayout());
144
mtx_layout = smptr(VLayout)(new VLayout());
145
m_MtxFunctionLayout = smptr(HLayout)(new HLayout());
147
mtx_row_layout[0] = smptr(HLayout)(new HLayout());
148
mtx_row_layout[1] = smptr(HLayout)(new HLayout());
149
mtx_row_layout[2] = smptr(HLayout)(new HLayout());
151
m_IdentityMtxBtn = smptr(Button)(new Button());
152
m_ZeroMtxBtn = smptr(Button)(new Button());
153
m_InverseMtxBtn = smptr(Button)(new Button());
154
m_NegateMtxBtn = smptr(Button)(new Button());
156
m_IdentityMtxBtn->sigClick.connect(sigc::mem_fun(this, &Matrix3Editor::RecvIdentityMatrixCmd));
157
m_ZeroMtxBtn->sigClick.connect(sigc::mem_fun(this, &Matrix3Editor::RecvZeroMatrixCmd));
158
m_InverseMtxBtn->sigClick.connect(sigc::mem_fun(this, &Matrix3Editor::RecvInverseMatrixCmd));
159
m_NegateMtxBtn->sigClick.connect(sigc::mem_fun(this, &Matrix3Editor::RecvNegateMatrixCmd));
161
for(int i = 0; i < 3; i++)
163
for(int j = 0; j < 3; j++)
165
m_MtxInput[i][j] = smptr(EditTextBox)(new EditTextBox());
166
m_MtxInput[i][j]->SetMinimumSize(DEFAULT_WIDGET_WIDTH + 5, PRACTICAL_WIDGET_HEIGHT);
167
m_MtxInput[i][j]->setGeometry(Geometry(0, 0, DEFAULT_WIDGET_WIDTH, DEFAULT_WIDGET_HEIGHT));
168
m_MtxInput[i][j]->sigValidateKeyboardEntry.connect(
169
sigc::bind(sigc::mem_fun(this, &Matrix3Editor::RecvComponentInput), i*3+j));
174
for(int i = 0; i < 3; i++)
176
mtx_row_layout[i]->SetHorizontalInternalMargin(4);
177
//mtx_row_layout[i]->SetHorizontalExternalMargin(4);
178
//mtx_row_layout[i]->SetVerticalExternalMargin(2);
179
mtx_row_layout[i]->SetContentStacking(eStackLeft);
182
for(int i = 0; i < 3; i++)
184
for(int j = 0; j < 3; j++)
186
mtx_row_layout[i]->AddActiveInterfaceObject(m_MtxInput[i][j], 0, eCenter, eFull);
190
for(int i = 0; i < 3; i++)
192
mtx_layout->AddLayout(mtx_row_layout[i], 0, eCenter);
194
mtx_layout->SetContentStacking(eStackExpand);
196
m_IdentityMtxBtn->SetCaption(TEXT("Id"));
197
m_ZeroMtxBtn->SetCaption(TEXT("Zero"));
198
m_InverseMtxBtn->SetCaption(TEXT("Inv"));
199
m_NegateMtxBtn->SetCaption(TEXT("+/-"));
201
m_MtxFunctionLayout->AddActiveInterfaceObject(m_IdentityMtxBtn, 0, eAbove, eMatchContent);
202
m_MtxFunctionLayout->AddActiveInterfaceObject(m_ZeroMtxBtn, 0, eAbove, eMatchContent);
203
m_MtxFunctionLayout->AddActiveInterfaceObject(m_InverseMtxBtn, 0, eAbove, eMatchContent);
204
m_MtxFunctionLayout->AddActiveInterfaceObject(m_NegateMtxBtn, 0, eAbove, eMatchContent);
205
m_MtxFunctionLayout->SetVerticalExternalMargin(4);
206
m_MtxFunctionLayout->SetHorizontalExternalMargin(4);
207
m_MtxFunctionLayout->SetHorizontalInternalMargin(2);
208
m_MtxFunctionLayout->SetContentStacking(eStackLeft);
209
//mtx_layout->AddLayout(&m_MtxFunctionLayout, 1, eCenter, eMatchContent);
210
mtx_layout->SetContentStacking(eStackCenter);
211
mtx_layout->SetHorizontalExternalMargin(4);
212
mtx_layout->SetVerticalExternalMargin(4);
213
mtx_layout->SetVerticalInternalMargin(4);
215
m_vlayout->AddLayout(mtx_layout, 0, eCenter, eMatchContent);
216
m_vlayout->AddLayout(m_MtxFunctionLayout, 0, eCenter, eMatchContent);
217
m_vlayout->SetContentStacking(eStackCenter);
219
SetCompositionLayout(m_vlayout);
223
Matrix3Editor::~Matrix3Editor()
227
void Matrix3Editor::SetMatrix(Matrix3 matrix)
230
for(int i = 0; i < 3; i++)
232
for(int j = 0; j < 3; j++)
234
m_MtxInput[i][j]->SetText(inlPrintf(TEXT("%.3f"), m_Matrix.m[i][j]));
239
Matrix3 Matrix3Editor::GetMatrix() const
244
void Matrix3Editor::RecvComponentInput(const weaksmptr(EditTextBox) textbox, const NString& text, int componentIndex)
246
int i = componentIndex / 3;
247
int j = componentIndex - 3*i;
250
CharToFloat(text.GetTCharPtr(), f);
251
m_MtxInput[i][j]->SetText(inlPrintf(TEXT("%.3f"), f));
252
m_Matrix.m[i][j] = f;
254
sigMatrixChanged.emit(smptr(Matrix3Editor)(this, false));
257
void Matrix3Editor::WriteMatrix()
259
for(int i = 0; i < 3; i++)
261
for(int j = 0; j < 3; j++)
263
m_MtxInput[i][j]->SetText(inlPrintf(TEXT("%.3f"), m_Matrix.m[i][j]));
268
long Matrix3Editor::ProcessEvent(IEvent &ievent, long TraverseInfo, long ProcessEventInfo)
270
long ret = TraverseInfo;
271
for(int i = 0; i < 3; i++)
273
for(int j = 0; j < 3; j++)
275
ret = m_MtxInput[i][j]->ProcessEvent(ievent, ret, ProcessEventInfo);
278
ret = m_IdentityMtxBtn->ProcessEvent(ievent, ret, ProcessEventInfo);
279
ret = m_ZeroMtxBtn->ProcessEvent(ievent, ret, ProcessEventInfo);
280
ret = m_InverseMtxBtn->ProcessEvent(ievent, ret, ProcessEventInfo);
281
ret = m_NegateMtxBtn->ProcessEvent(ievent, ret, ProcessEventInfo);
283
ret = PostProcessEvent2(ievent, ret, ProcessEventInfo);
287
void Matrix3Editor::Draw(GraphicsContext& GfxContext, bool force_draw)
289
Geometry base = GetGeometry();
291
for(int i = 0; i < 3; i++)
293
for(int j = 0; j < 3; j++)
295
m_MtxInput[i][j]->NeedRedraw();
299
m_IdentityMtxBtn->NeedRedraw();
300
m_ZeroMtxBtn->NeedRedraw();
301
m_InverseMtxBtn->NeedRedraw();
302
m_NegateMtxBtn->NeedRedraw();
303
//gPainter.PopBackground();
305
//gPainter.PopBackground();
308
void Matrix3Editor::DrawContent(GraphicsContext& GfxContext, bool force_draw)
310
Geometry base = GetGeometry();
312
gPainter.PushDrawShapeLayer(GfxContext, mtx_layout->GetGeometry(), eSHAPE_CORNER_ROUND4, Color(0xFF000000), eAllCorners);
314
gPainter.PushShapeLayer(GfxContext, mtx_layout->GetGeometry(), eSHAPE_CORNER_ROUND4, Color(0xFF000000), eAllCorners);
316
for(int i = 0; i < 3; i++)
318
for(int j = 0; j < 3; j++)
320
m_MtxInput[i][j]->ProcessDraw(GfxContext, force_draw);
324
m_IdentityMtxBtn->ProcessDraw(GfxContext, force_draw);
325
m_ZeroMtxBtn->ProcessDraw(GfxContext, force_draw);
326
m_InverseMtxBtn->ProcessDraw(GfxContext, force_draw);
327
m_NegateMtxBtn->ProcessDraw(GfxContext, force_draw);
328
gPainter.PopBackground();
331
void Matrix3Editor::PostDraw(GraphicsContext& GfxContext, bool force_draw)
336
void Matrix3Editor::SetParameterName(const char* parameter_name)
344
void Matrix3Editor::EmitIncrementComponent(int index)
347
//sigSetVector.emit(m_x, m_y, m_z, m_w);
350
void Matrix3Editor::EmitDecrementComponent(int index)
353
//sigSetVector.emit(m_x, m_y, m_z, m_w);
356
void Matrix3Editor::EmitComponentValue(float f, int index)
359
//sigSetVector.emit(m_x, m_y, m_z, m_w);
363
void Matrix3Editor::RecvIdentityMatrixCmd()
367
sigMatrixChanged.emit(smptr(Matrix3Editor)(this, false));
372
void Matrix3Editor::RecvZeroMatrixCmd()
376
sigMatrixChanged.emit(smptr(Matrix3Editor)(this, false));
381
void Matrix3Editor::RecvInverseMatrixCmd()
385
sigMatrixChanged.emit(smptr(Matrix3Editor)(this, false));
390
void Matrix3Editor::RecvNegateMatrixCmd()
392
m_Matrix = -m_Matrix;
394
sigMatrixChanged.emit(smptr(Matrix3Editor)(this, false));