1 #include "vogleditor_statetreepolygonstippleitem.h"
3 vogleditor_stateTreePolygonStippleRowItem::vogleditor_stateTreePolygonStippleRowItem(QString name, unsigned int rowIndex, vogleditor_stateTreeItem* parent, const vogl_polygon_stipple_state& state)
4 : vogleditor_stateTreeItem(name, "", parent),
9 setValue(uint32_to_bits(m_pState->get_pattern_row(m_rowIndex)));
12 bool vogleditor_stateTreePolygonStippleRowItem::hasChanged() const
14 if (m_pDiffBaseState == NULL)
19 if (m_rowIndex >= m_pDiffBaseState->get_num_pattern_rows())
22 uint32 curRow = m_pState->get_pattern_row(m_rowIndex);
23 uint32 baseRow = m_pDiffBaseState->get_pattern_row(m_rowIndex);
25 return curRow != baseRow;
28 QString vogleditor_stateTreePolygonStippleRowItem::getDiffedValue() const
30 if (m_pDiffBaseState == NULL)
35 if (m_rowIndex >= m_pDiffBaseState->get_num_pattern_rows())
36 return "non-existent";
38 uint32 baseRow = m_pDiffBaseState->get_pattern_row(m_rowIndex);
40 return uint32_to_bits(baseRow);
43 vogleditor_stateTreePolygonStippleItem::vogleditor_stateTreePolygonStippleItem(QString name, vogleditor_stateTreeItem* parent, const vogl_polygon_stipple_state& state)
44 : vogleditor_stateTreeItem(name, "", parent),
46 m_pDiffBaseState(NULL)
49 for (uint i = 0; i < m_pState->get_num_pattern_rows(); i++)
51 vogleditor_stateTreePolygonStippleRowItem* pRowNode = new vogleditor_stateTreePolygonStippleRowItem(tmp.sprintf("Row %u", i), i, this, state);
52 m_rowItems.push_back(pRowNode);
53 this->appendChild(pRowNode);