コード例 #1
0
SimplifTrian<PFP>::SimplifTrian(MAP& the_map, unsigned int idPos, CRIT* cr):
    m_map(the_map),
    m_crit(cr),
    m_positions(the_map, idPos),
    m_edgeEmb(the_map, EDGE),
    m_valences(the_map, VERTEX),
    m_edgeMarkers(the_map, EDGE << 24),
    m_protectMarker(the_map, EDGE),
    m_passe(0)
{
    computeVerticesValences(false);

    // mesh of triangle, we can compute the number function of number of dart
    m_nbTriangles = the_map.getNbDarts() / the_map.getDartsPerTriangle();

    // local marker to ensure that edges only once in structure
    DartMarker m(m_map);

    for (Dart d = m_map.begin(); d != m_map.end(); m_map.next(d))
    {
        if (!m.isMarked(d))
        {
            // creation of a criteria for the edge
            CRIT* cr = m_crit->create(d);

            // store it in the map
            float key = cr->computeKey(m_map, m_positions);
            CRIT_IT it = m_edgeCrit.insert(std::make_pair(key, cr));
            m_edgeEmb[d] = it;

            // mark cell for traversal
            m.markOrbit<EDGE>(d);
        }
    }
}