예제 #1
0
Dimension::Id::Enum PointLayout::assignDim(const std::string& name,
    Dimension::Type::Enum type)
{
    Dimension::Id::Enum id = (Dimension::Id::Enum)m_nextFree;

    auto di = m_propIds.find(name);
    if (di != m_propIds.end())
        id = di->second;
    Dimension::Detail dd = m_detail[id];
    dd.setType(resolveType(type, dd.type()));
    if (update(dd, name))
    {
        if (di == m_propIds.end())
        {
            m_nextFree++;
            m_propIds[name] = id;
        }
        return id;
    }
    return Dimension::Id::Unknown;
}
예제 #2
0
void PointLayout::registerDim(Dimension::Id::Enum id, Dimension::Type::Enum type)
{
    Dimension::Detail dd = m_detail[id];
    dd.setType(resolveType(type, dd.type()));
    update(dd, Dimension::name(id));
}