647 void LDDocument::addKnownVertices (LDObject* obj) |
647 void LDDocument::addKnownVertices (LDObject* obj) |
648 { |
648 { |
649 auto it = m_objectVertices.find (obj); |
649 auto it = m_objectVertices.find (obj); |
650 |
650 |
651 if (it == m_objectVertices.end()) |
651 if (it == m_objectVertices.end()) |
652 it = m_objectVertices.insert (obj, QVector<Vertex>()); |
652 it = m_objectVertices.insert (obj, QSet<Vertex>()); |
653 else |
653 else |
654 it->clear(); |
654 it->clear(); |
655 |
655 |
656 obj->getVertices (*it); |
656 obj->getVertices (*it); |
657 needVertexMerge(); |
657 needVertexMerge(); |
790 // |
790 // |
791 void LDDocument::mergeVertices() |
791 void LDDocument::mergeVertices() |
792 { |
792 { |
793 m_vertices.clear(); |
793 m_vertices.clear(); |
794 |
794 |
795 for (QVector<Vertex> const& verts : m_objectVertices) |
795 for (const QSet<Vertex>& vertices : m_objectVertices) |
796 m_vertices << verts; |
796 m_vertices.unite(vertices); |
797 |
797 |
798 removeDuplicates (m_vertices); |
|
799 unsetFlag(NeedsVertexMerge); |
798 unsetFlag(NeedsVertexMerge); |
800 } |
799 } |
801 |
800 |
802 // ============================================================================= |
801 // ============================================================================= |
803 // |
802 // |