2
* Copyright 2010 Inalogic Inc.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU Lesser General Public License version 3, as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the applicable version of the GNU Lesser General Public
12
* License for more details.
14
* You should have received a copy of both the GNU Lesser General Public
15
* License version 3 along with this program. If not, see
16
* <http://www.gnu.org/licenses/>
18
* Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
23
#ifndef MATRIX3EDITOR_H
24
#define MATRIX3EDITOR_H
26
#include "EditTextBox.h"
27
#include "StaticTextBox.h"
32
#include "TimerProc.h"
39
class Matrix3DialogProxy
42
Matrix3DialogProxy(bool ModalWindow);
43
~Matrix3DialogProxy();
45
void RecvDialogOk(const weaksmptr(Matrix3Editor) matrixeditor);
46
void RecvDialogCancel(const weaksmptr(Matrix3Editor) matrixeditor);
47
void RecvDialogChange(const weaksmptr(Matrix3Editor) matrixeditor);
51
void StopThreadMonitoring();
53
Matrix3 GetMatrix() {return m_Matrix;}
54
void SetMatrix(Matrix3 matrix) {m_Matrix = matrix;}
58
bool m_bDialogRunning;
60
Matrix3 m_PreviousMatrix;
64
unsigned int m_DialogThreadID;
67
friend class Matrix3Preview;
72
//! A User Interface component hosting a 4x4 Matrix.
74
Matrix3Editor is a UI component representing a 4x4 matrix.
75
All elements of the matrix are writeable through the UI. The Matrix3Editor API provides access to the embeded matrix
76
through the member functions getMatrix() and setMatrix().
78
class Matrix3Editor : public ActiveInterfaceObject
81
Matrix3Editor(Matrix3 matrix = Matrix3::IDENTITY());
83
virtual long ProcessEvent(IEvent &ievent, long TraverseInfo, long ProcessEventInfo);
84
virtual void Draw(GraphicsContext& GfxContext, bool force_draw);
85
virtual void DrawContent(GraphicsContext& GfxContext, bool force_draw);
86
virtual void PostDraw(GraphicsContext& GfxContext, bool force_draw);
88
// virtual void setCaption(const char* s)
90
// m_ParameterName.setCaption(s);
92
void SetParameterName(const char* parameter_name);
94
void EmitButtonPress() {};
99
void EmitIncrementComponent(int index);
100
void EmitDecrementComponent(int index);
101
void EmitComponentValue(float f, int index);
107
//! Set the UI matrix.
109
Set each component of the 3x3 matrix UI to the ones provided by the input matrix.
110
\param matrix a 3x3 matrix of type Matrix3.
114
void SetMatrix(Matrix3 matrix);
116
//! Get the UI matrix.
118
Get the matrix hosted by the UI.
120
\return a Matrix3 object.
123
Matrix3 GetMatrix() const;
130
//sigc::signal<void> sigClick;
131
// sigc::signal<void, int> sigIncrementComponent;
132
// sigc::signal<void, int> sigDecrementComponent;
133
sigc::signal<void, int, char*> sigValidateKeyboarEntry;
135
sigc::signal<void, const weaksmptr(Matrix3Editor) > sigMatrixChanged;
140
void RecvIdentityMatrixCmd();
141
void RecvZeroMatrixCmd();
142
void RecvInverseMatrixCmd();
143
void RecvNegateMatrixCmd();
147
void RecvComponentInput(const weaksmptr(EditTextBox) textbox, const NString& text, int componentIndex);
150
smptr(VLayout) m_vlayout;
151
smptr(VLayout) mtx_layout;
152
smptr(HLayout) mtx_row_layout[3];
154
//smptr(StaticTextBox) m_ParameterName;
156
smptr(EditTextBox) m_MtxInput[3][3];
158
smptr(Button) m_IdentityMtxBtn;
159
smptr(Button) m_ZeroMtxBtn;
160
smptr(Button) m_InverseMtxBtn;
161
smptr(Button) m_NegateMtxBtn;
162
smptr(HLayout) m_MtxFunctionLayout;
164
Matrix3x3<float> m_Matrix;
169
#endif // MATRIX3EDITOR_H