src/ldObject.cc

changeset 835
268413885cb1
parent 806
4240f47aa2d4
child 840
d077dd19bf9a
--- a/src/ldObject.cc	Mon Jul 07 18:52:10 2014 +0300
+++ b/src/ldObject.cc	Sun Jul 13 16:48:29 2014 +0300
@@ -811,6 +811,7 @@
 		{
 			obj->document().toStrongRef()->addToHistory (new EditHistory (idx, before, after));
 			g_win->R()->compileObject (obj);
+			getCurrentDocument()->redoVertices();
 		}
 	}
 	else
@@ -835,9 +836,6 @@
 //
 void LDObject::setVertex (int i, const Vertex& vert)
 {
-	if (document() != null)
-		document().toStrongRef()->vertexChanged (m_coords[i], vert);
-
 	changeProperty (self(), &m_coords[i], vert);
 }
 
@@ -846,14 +844,7 @@
 void LDMatrixObject::setPosition (const Vertex& a)
 {
 	LDObjectPtr ref = linkPointer().toStrongRef();
-
-	if (ref->document() != null)
-		ref->document().toStrongRef()->removeKnownVerticesOf (ref);
-
 	changeProperty (ref, &m_position, a);
-
-	if (ref->document() != null)
-		ref->document().toStrongRef()->addKnownVerticesOf (ref);
 }
 
 // =============================================================================
@@ -861,14 +852,7 @@
 void LDMatrixObject::setTransform (const Matrix& val)
 {
 	LDObjectPtr ref = linkPointer().toStrongRef();
-
-	if (ref->document() != null)
-		ref->document().toStrongRef()->removeKnownVerticesOf (ref);
-
 	changeProperty (ref, &m_transform, val);
-
-	if (ref->document() != null)
-		ref->document().toStrongRef()->addKnownVerticesOf (ref);
 }
 
 // =============================================================================
@@ -931,9 +915,6 @@
 //
 void LDSubfile::setFileInfo (const LDDocumentPtr& a)
 {
-	if (document() != null)
-		document().toStrongRef()->removeKnownVerticesOf (self());
-
 	m_fileInfo = a;
 
 	// If it's an immediate subfile reference (i.e. this subfile belongs in an
@@ -945,7 +926,20 @@
 	{
 		a->initializeCachedData();
 	}
+};
 
-	if (document() != null)
-		document().toStrongRef()->addKnownVerticesOf (self());
-};
+void LDObject::getVertices (QVector<Vertex>& verts) const
+{
+	for (int i = 0; i < numVertices(); ++i)
+		verts << vertex (i);
+}
+
+void LDSubfile::getVertices (QVector<Vertex>& verts) const
+{
+	verts << fileInfo()->inlineVertices();
+}
+
+void LDVertex::getVertices (QVector<Vertex>& verts) const
+{
+	verts.append (pos);
+}

mercurial