Ejemplo n.º 1
0
        bool SplitEdgesCommand::performDo() {
            if (!canDo())
                return false;
            
            m_vertices.clear();
            makeSnapshots(m_brushes);
            document().brushesWillChange(m_brushes);

            BrushEdgeMap::const_iterator it, end;
            for (it = m_brushEdges.begin(), end = m_brushEdges.end(); it != end; ++it) {
                Model::Brush* brush = it->first;
                const Model::EdgeInfo& edgeInfo = it->second;
                Vec3f newVertexPosition = brush->splitEdge(edgeInfo, m_delta);
                m_vertices.insert(newVertexPosition);
            }

            document().brushesDidChange(m_brushes);
            return true;
        }
        bool SplitEdgesCommand::performDo() {
            if (!canDo())
                return false;
            
            m_vertices.clear();
            makeSnapshots(m_brushes);
            document().brushesWillChange(m_brushes);

            Model::EdgeList::const_iterator eIt, eEnd;
            for (eIt = m_edges.begin(), eEnd = m_edges.end(); eIt != eEnd; ++eIt) {
                Model::Edge* edge = *eIt;
                Model::Brush* brush = edge->left->face->brush();
                Vec3f newVertexPosition = brush->splitEdge(edge, m_delta);
                m_vertices.insert(newVertexPosition);
            }

            document().brushesDidChange(m_brushes);
            return true;
        }