1 #ifndef VOGLEDITOR_STATETREEMATRIXITEM_H
2 #define VOGLEDITOR_STATETREEMATRIXITEM_H
4 #include "vogleditor_statetreeitem.h"
5 #include "vogl_matrix_state.h"
7 class vogleditor_stateTreeMatrixRowItem: public vogleditor_stateTreeItem
10 vogleditor_stateTreeMatrixRowItem(QString name, unsigned int rowIndex, vogleditor_stateTreeItem* parent, const matrix44D& matrix);
12 virtual ~vogleditor_stateTreeMatrixRowItem()
15 m_pDiffBaseState = NULL;
18 void set_diff_base_state(const matrix44D* pBaseState) { m_pDiffBaseState = pBaseState; }
20 virtual bool hasChanged() const;
21 virtual QString getDiffedValue() const;
24 unsigned int m_rowIndex;
25 const matrix44D* m_pState;
26 const matrix44D* m_pDiffBaseState;
29 class vogleditor_stateTreeMatrixItem: public vogleditor_stateTreeItem
32 vogleditor_stateTreeMatrixItem(QString name, vogleditor_stateTreeItem* parent, const matrix44D& matrix, unsigned int stackIndex);
34 virtual ~vogleditor_stateTreeMatrixItem()
37 m_pDiffBaseState = NULL;
40 void set_diff_base_state(const matrix44D* pBaseState)
42 m_pDiffBaseState = pBaseState;
44 for (vogleditor_stateTreeMatrixRowItem** iter = m_rowItems.begin(); iter != m_rowItems.end(); iter++)
46 (*iter)->set_diff_base_state(pBaseState);
50 unsigned int get_stack_index() const { return m_stackIndex; }
53 unsigned int m_stackIndex;
54 const matrix44D* m_pState;
55 const matrix44D* m_pDiffBaseState;
56 vogl::vector<vogleditor_stateTreeMatrixRowItem*> m_rowItems;
59 class vogleditor_stateTreeMatrixStackItem: public vogleditor_stateTreeItem
62 vogleditor_stateTreeMatrixStackItem(QString name, GLenum target, unsigned int index, vogleditor_stateTreeItem* parent, const vogl_matrix_state& state);
64 virtual ~vogleditor_stateTreeMatrixStackItem()
67 m_pDiffBaseState = NULL;
70 void set_diff_base_state(const vogl_matrix_state* pBaseState)
72 m_pDiffBaseState = pBaseState;
74 for (vogleditor_stateTreeMatrixItem** iter = m_matrixItems.begin(); iter != m_matrixItems.end(); iter++)
76 const matrix44D* pMatrix = m_pDiffBaseState->get_matrix(m_target, m_index, (*iter)->get_stack_index());
77 (*iter)->set_diff_base_state(pMatrix);
81 GLenum get_target() const { return m_target; }
86 const vogl_matrix_state* m_pState;
87 const vogl_matrix_state* m_pDiffBaseState;
88 vogl::vector<vogleditor_stateTreeMatrixItem*> m_matrixItems;
91 #endif // VOGLEDITOR_STATETREEMATRIXITEM_H