diff -r c5791a3aa1ba -r 7dc2c981937e src/ldObject.cpp --- a/src/ldObject.cpp Tue Feb 14 13:02:05 2017 +0200 +++ b/src/ldObject.cpp Tue Feb 14 13:25:43 2017 +0200 @@ -26,6 +26,7 @@ #include "canvas.h" #include "colors.h" #include "glCompiler.h" +#include "linetypes/edgeline.h" // List of all LDObjects QMap g_allObjects; @@ -64,9 +65,7 @@ LDMatrixObject (model) {} LDOBJ_DEFAULT_CTOR (LDError, LDObject) -LDOBJ_DEFAULT_CTOR (LDEdgeLine, LDObject) LDOBJ_DEFAULT_CTOR (LDTriangle, LDObject) -LDOBJ_DEFAULT_CTOR (LDConditionalEdge, LDEdgeLine) LDOBJ_DEFAULT_CTOR (LDQuadrilateral, LDObject) LDOBJ_DEFAULT_CTOR (LDBfc, LDObject) LDOBJ_DEFAULT_CTOR (LDBezierCurve, LDObject) @@ -94,18 +93,6 @@ // ============================================================================= // -QString LDEdgeLine::asText() const -{ - QString val = format ("2 %1", color()); - - for (int i = 0; i < 2; ++i) - val += format (" %1", vertex (i)); - - return val; -} - -// ============================================================================= -// QString LDTriangle::asText() const { QString val = format ("3 %1", color()); @@ -128,19 +115,6 @@ return val; } -// ============================================================================= -// -QString LDConditionalEdge::asText() const -{ - QString val = format ("5 %1", color()); - - // Add the coordinates - for (int i = 0; i < 4; ++i) - val += format (" %1", vertex (i)); - - return val; -} - QString LDBezierCurve::asText() const { QString result = format ("0 !LDFORGE BEZIER_CURVE %1", color()); @@ -203,15 +177,6 @@ // ============================================================================= // -LDEdgeLine::LDEdgeLine (Vertex v1, Vertex v2, Model* model) : - LDObject {model} -{ - setVertex (0, v1); - setVertex (1, v2); -} - -// ============================================================================= -// LDTriangle::LDTriangle (const Vertex& v1, const Vertex& v2, const Vertex& v3, Model* model) : LDObject {model} { @@ -233,17 +198,6 @@ // ============================================================================= // -LDConditionalEdge::LDConditionalEdge (const Vertex& v0, const Vertex& v1, const Vertex& v2, const Vertex& v3, Model* model) : - LDEdgeLine {model} -{ - setVertex (0, v0); - setVertex (1, v1); - setVertex (2, v2); - setVertex (3, v3); -} - -// ============================================================================= -// LDBezierCurve::LDBezierCurve(const Vertex& v0, const Vertex& v1, const Vertex& v2, const Vertex& v3, Model* model) : LDObject {model} { @@ -580,26 +534,6 @@ // ============================================================================= // -void LDEdgeLine::invert() -{ - // For lines, we swap the vertices. - Vertex tmp = vertex (0); - setVertex (0, vertex (1)); - setVertex (1, tmp); -} - -// ============================================================================= -// -void LDConditionalEdge::invert() -{ - // I don't think that a conditional line's control points need to be swapped, do they? - Vertex tmp = vertex (0); - setVertex (0, vertex (1)); - setVertex (1, tmp); -} - -// ============================================================================= -// void LDBezierCurve::invert() { // A Bézier curve's control points probably need to be, though. @@ -613,19 +547,6 @@ // ============================================================================= // -LDEdgeLine* LDConditionalEdge::becomeEdgeLine() -{ - LDEdgeLine* replacement = model()->emplaceReplacement(this); - - for (int i = 0; i < replacement->numVertices(); ++i) - replacement->setVertex (i, vertex (i)); - - replacement->setColor (color()); - return replacement; -} - -// ============================================================================= -// LDObject* LDObject::fromID(qint32 id) { return g_allObjects.value(id);