1 #ifndef VOGLEDITOR_STATETREEPOLYGONSTIPPLEITEM_H
2 #define VOGLEDITOR_STATETREEPOLYGONSTIPPLEITEM_H
4 #include "vogleditor_statetreeitem.h"
5 #include "vogl_general_context_state.h"
7 class vogleditor_stateTreePolygonStippleRowItem: public vogleditor_stateTreeItem
10 vogleditor_stateTreePolygonStippleRowItem(QString name, unsigned int rowIndex, vogleditor_stateTreeItem* parent, const vogl_polygon_stipple_state& state);
12 virtual ~vogleditor_stateTreePolygonStippleRowItem()
15 m_pDiffBaseState = NULL;
18 void set_diff_base_state(const vogl_polygon_stipple_state* pBaseState) { m_pDiffBaseState = pBaseState; }
20 virtual bool hasChanged() const;
21 virtual QString getDiffedValue() const;
24 unsigned int m_rowIndex;
25 const vogl_polygon_stipple_state* m_pState;
26 const vogl_polygon_stipple_state* m_pDiffBaseState;
28 QString uint32_to_bits(uint32 id) const
32 uint32 size = sizeof(uint32);
33 uint32 maxPow = 1<<(size*8-1);
34 for(uint32 i = 0; i < size * 8; ++i)
36 // print last bit and shift left.
37 tmp += tmp2.sprintf("%u", id & maxPow ? 1 : 0);
44 class vogleditor_stateTreePolygonStippleItem: public vogleditor_stateTreeItem
47 vogleditor_stateTreePolygonStippleItem(QString name, vogleditor_stateTreeItem* parent, const vogl_polygon_stipple_state& state);
49 virtual ~vogleditor_stateTreePolygonStippleItem()
52 m_pDiffBaseState = NULL;
55 void set_diff_base_state(const vogl_polygon_stipple_state* pBaseState)
57 m_pDiffBaseState = pBaseState;
59 for (vogleditor_stateTreePolygonStippleRowItem** iter = m_rowItems.begin(); iter != m_rowItems.end(); iter++)
61 (*iter)->set_diff_base_state(pBaseState);
66 const vogl_polygon_stipple_state* m_pState;
67 const vogl_polygon_stipple_state* m_pDiffBaseState;
68 vogl::vector<vogleditor_stateTreePolygonStippleRowItem*> m_rowItems;
71 #endif // VOGLEDITOR_STATETREEPOLYGONSTIPPLEITEM_H