Пример #1
0
QString vogleditor_stateTreeStateVecPtrItem::getDiffedValue() const
{
    static int baseValues[4];
    VOGL_ASSERT(m_numComponents <= 4);

    QString result = "";
    if (m_pDiffBaseState->get<int>(m_name, m_index, baseValues, m_numComponents, m_isIndexed))
    {
        result = getValueFromPtrs(baseValues, m_numComponents);
    }

    return result;
}
Пример #2
0
QString vogleditor_stateTreeItem::getValueFromPtrs(const int* values, uint count) const
{
    QString tmp;
    if (count == 0 || values == NULL)
    {
        return "";
    }
    else if (count == 1)
    {
        tmp = tmp.sprintf("0x%08x", *values);
    }
    else
    {
        tmp = tmp.sprintf("%s, %s", getValueFromPtrs(values, 1).toStdString().c_str(), getValueFromPtrs(&(values[1]), count-1).toStdString().c_str());
    }

    return tmp;
}
QString vogleditor_stateTreeVertexArrayPtrItem::getDiffedValue() const
{
    if (m_pDiffBaseState == NULL)
        return "";

    if (m_arrayIndex >= m_pDiffBaseState->get_vertex_attrib_count())
    {
        // the current node does not exist in the base snapshot, so it must be new and different.
        return "non-existent";
    }
    else
    {
        const vogl_vertex_attrib_desc& baseDesc = m_pDiffBaseState->get_vertex_attrib_desc(m_arrayIndex);

        vogl_trace_ptr_value value = baseDesc.*m_pVal;
        return getValueFromPtrs((int*)&value, 1);
    }

    return "";
}
Пример #4
0
vogleditor_stateTreeStateVecPtrItem::vogleditor_stateTreeStateVecPtrItem(QString glenumName, GLenum name, unsigned int index, const vogl_state_vector& stateVec, int* values, unsigned int numComponents, bool isIndexed, vogleditor_stateTreeItem* parent)
   : vogleditor_stateTreeDatatypeItem<int>(glenumName, name, index, stateVec, numComponents, isIndexed, parent)
{
    setValue(getValueFromPtrs(values, numComponents));
}