110 |
110 |
111 QString modelElementToString(const ModelElement &element) |
111 QString modelElementToString(const ModelElement &element) |
112 { |
112 { |
113 return std::visit(overloaded{ |
113 return std::visit(overloaded{ |
114 [](const Colored<SubfileReference>& ref) { |
114 [](const Colored<SubfileReference>& ref) { |
115 return QStringLiteral("1 %1 %2 %3") |
115 QString result; |
|
116 if (ref.inverted) { |
|
117 result += QStringLiteral("0 BFC INVERTNEXT\r\n"); |
|
118 } |
|
119 result += QStringLiteral("1 %1 %2 %3") |
116 .arg(ref.color.index) |
120 .arg(ref.color.index) |
117 .arg(transformToString(ref.transformation)) |
121 .arg(transformToString(ref.transformation)) |
118 .arg(ref.name); |
122 .arg(ref.name); |
|
123 return result; |
119 }, |
124 }, |
120 [](const Colored<LineSegment>& seg) { |
125 [](const Colored<LineSegment>& seg) { |
121 return QStringLiteral("2 %1 %2 %3") |
126 return QStringLiteral("2 %1 %2 %3") |
122 .arg(seg.color.index) |
127 .arg(seg.color.index) |
123 .arg(vertexToString(seg.p1)) |
128 .arg(vertexToString(seg.p1)) |