1 #ifndef VOGLEDITOR_STATETREEARBPROGRAMITEM_H
2 #define VOGLEDITOR_STATETREEARBPROGRAMITEM_H
4 #include "vogleditor_statetreeitem.h"
5 #include "vogl_arb_program_state.h"
7 class vogleditor_stateTreeArbProgramDiffableItem : public vogleditor_stateTreeItem
10 vogleditor_stateTreeArbProgramDiffableItem(QString name, QString value, vogleditor_stateTreeItem* parent, const vogl_arb_program_state& state)
11 : vogleditor_stateTreeItem(name, value, parent),
13 m_pDiffBaseState(NULL)
17 virtual void set_diff_base_state(const vogl_arb_program_state* pBaseState) {
18 m_pDiffBaseState = pBaseState;
21 const vogl_arb_program_state* get_current_state() const { return m_pState; }
22 const vogl_arb_program_state* get_base_state() const { return m_pDiffBaseState; }
24 virtual bool hasChanged() const = 0;
27 const vogl_arb_program_state* m_pState;
28 const vogl_arb_program_state* m_pDiffBaseState;
31 class vogleditor_stateTreeArbProgramBoolItem : public vogleditor_stateTreeArbProgramDiffableItem
34 vogleditor_stateTreeArbProgramBoolItem(QString name, bool (vogl_arb_program_state::* func)(void) const, vogleditor_stateTreeItem* parent, const vogl_arb_program_state& state);
35 virtual ~vogleditor_stateTreeArbProgramBoolItem() { m_pState = NULL; }
37 virtual bool hasChanged() const;
38 virtual QString getDiffedValue() const;
41 bool (vogl_arb_program_state::* m_pFunc)(void) const;
44 class vogleditor_stateTreeArbProgramUIntItem : public vogleditor_stateTreeArbProgramDiffableItem
47 vogleditor_stateTreeArbProgramUIntItem(QString name, uint (vogl_arb_program_state::* func)(void) const, vogleditor_stateTreeItem* parent, const vogl_arb_program_state& state);
48 virtual ~vogleditor_stateTreeArbProgramUIntItem() { m_pState = NULL; }
50 virtual bool hasChanged() const;
51 virtual QString getDiffedValue() const;
54 uint (vogl_arb_program_state::* m_pFunc)(void) const;
57 class vogleditor_stateTreeArbProgramIntItem : public vogleditor_stateTreeArbProgramDiffableItem
60 vogleditor_stateTreeArbProgramIntItem(QString name, GLint (vogl_arb_program_state::* func)(void) const, vogleditor_stateTreeItem* parent, const vogl_arb_program_state& state);
61 virtual ~vogleditor_stateTreeArbProgramIntItem() { m_pState = NULL; }
63 virtual bool hasChanged() const;
64 virtual QString getDiffedValue() const;
67 GLint (vogl_arb_program_state::* m_pFunc)(void) const;
70 class vogleditor_stateTreeArbProgramEnumItem : public vogleditor_stateTreeArbProgramDiffableItem
73 vogleditor_stateTreeArbProgramEnumItem(QString name, GLenum (vogl_arb_program_state::* func)(void) const, vogleditor_stateTreeItem* parent, const vogl_arb_program_state& state);
74 virtual ~vogleditor_stateTreeArbProgramEnumItem() { m_pState = NULL; }
76 virtual bool hasChanged() const;
77 virtual QString getDiffedValue() const;
80 GLenum (vogl_arb_program_state::* m_pFunc)(void) const;
83 class vogleditor_stateTreeArbProgramStringItem : public vogleditor_stateTreeArbProgramDiffableItem
86 vogleditor_stateTreeArbProgramStringItem(QString name, const uint8_vec& (vogl_arb_program_state::* func)(void) const, vogleditor_stateTreeItem* parent, const vogl_arb_program_state& state);
87 virtual ~vogleditor_stateTreeArbProgramStringItem() { m_pState = NULL; }
89 virtual bool hasChanged() const;
90 virtual QString getDiffedValue() const;
93 const uint8_vec& (vogl_arb_program_state::* m_pFunc)(void) const;
96 class vogleditor_stateTreeArbProgramParamItem : public vogleditor_stateTreeArbProgramDiffableItem
99 vogleditor_stateTreeArbProgramParamItem(QString name, unsigned int paramIndex, vogleditor_stateTreeItem* parent, const vogl_arb_program_state& state);
100 virtual ~vogleditor_stateTreeArbProgramParamItem() { m_pState = NULL; }
102 virtual bool hasChanged() const;
103 virtual QString getDiffedValue() const;
106 unsigned int m_paramIndex;
109 class vogleditor_stateTreeArbProgramItem : public vogleditor_stateTreeItem
112 vogleditor_stateTreeArbProgramItem(QString name, QString value, vogleditor_stateTreeItem* parent, vogl_arb_program_state& state);
113 virtual ~vogleditor_stateTreeArbProgramItem() { m_pState = NULL; m_pDiffBaseState = NULL; }
115 vogl_arb_program_state* get_current_state() const { return m_pState; }
116 const vogl_arb_program_state* get_base_state() const { return m_pDiffBaseState; }
118 void set_diff_base_state(const vogl_arb_program_state* pBaseState)
120 m_pDiffBaseState = pBaseState;
121 for (vogleditor_stateTreeArbProgramDiffableItem** iter = m_diffableItems.begin(); iter != m_diffableItems.end(); iter++)
123 (*iter)->set_diff_base_state(pBaseState);
128 vogl_arb_program_state* m_pState;
129 const vogl_arb_program_state* m_pDiffBaseState;
130 vogl::vector<vogleditor_stateTreeArbProgramDiffableItem*> m_diffableItems;
133 #endif // VOGLEDITOR_STATETREEARBPROGRAMITEM_H