]> git.cworth.org Git - vogl/blob - src/vogleditor/vogleditor_statetreequeryitem.cpp
Initial vogl checkin
[vogl] / src / vogleditor / vogleditor_statetreequeryitem.cpp
1 #include "vogleditor_statetreequeryitem.h"
2
3 #include "vogl_query_state.h"
4 #include <inttypes.h>
5
6 vogleditor_stateTreeQueryItem::vogleditor_stateTreeQueryItem(QString name, GLuint64 handle, vogleditor_stateTreeItem* parent, const vogl_query_state* pState)
7     : vogleditor_stateTreeItem(name, "", parent),
8       m_handle(handle),
9       m_pState(pState),
10       m_pDiffBaseState(NULL)
11 {
12     static QString tmp;
13     tmp = tmp.sprintf("%s (%" PRIi64 ")", enum_to_string(pState->get_target()).toStdString().c_str(), pState->get_prev_result());
14     setValue(tmp);
15 }
16
17 void vogleditor_stateTreeQueryItem::set_diff_base_state(const vogl_query_state* pBaseState)
18 {
19     m_pDiffBaseState = pBaseState;
20 }
21
22 bool vogleditor_stateTreeQueryItem::hasChanged() const
23 {
24     if (m_pDiffBaseState == NULL)
25         return false;
26
27     if (m_pState->get_target() != m_pDiffBaseState->get_target())
28         return true;
29
30     if (m_pState->get_prev_result() != m_pDiffBaseState->get_prev_result())
31         return true;
32
33     return false;
34 }