1305:31627acdd4b5 | 1306:be85306198a2 |
---|---|
219 } | 219 } |
220 | 220 |
221 return true; | 221 return true; |
222 } | 222 } |
223 | 223 |
224 static QString headerToString(const LDHeader& header) | 224 static QString headerToString(const Model& model, const LDHeader& header) |
225 { | 225 { |
226 QString result; | 226 QString result; |
227 | 227 |
228 if (header.type != LDHeader::NoHeader) | 228 if (header.type != LDHeader::NoHeader) |
229 { | 229 { |
274 result += "0 !HELP " + line + "\r\n"; | 274 result += "0 !HELP " + line + "\r\n"; |
275 } | 275 } |
276 | 276 |
277 result += "\r\n"; | 277 result += "\r\n"; |
278 | 278 |
279 switch (header.winding) | 279 switch (model.winding()) |
280 { | 280 { |
281 case CounterClockwise: | 281 case CounterClockwise: |
282 result += "0 BFC CERTIFY CCW\r\n"; | 282 result += "0 BFC CERTIFY CCW\r\n"; |
283 break; | 283 break; |
284 | 284 |
348 QByteArray data; | 348 QByteArray data; |
349 | 349 |
350 if (this->header.type != LDHeader::NoHeader) | 350 if (this->header.type != LDHeader::NoHeader) |
351 { | 351 { |
352 header.name = LDDocument::shortenName(path); | 352 header.name = LDDocument::shortenName(path); |
353 data += headerToString(this->header).toUtf8(); | 353 data += headerToString(*this, this->header).toUtf8(); |
354 } | 354 } |
355 | 355 |
356 // File is open, now save the model to it. Note that LDraw requires files to have DOS line endings. | 356 // File is open, now save the model to it. Note that LDraw requires files to have DOS line endings. |
357 for (LDObject* obj : objects()) | 357 for (LDObject* obj : objects()) |
358 { | 358 { |
529 if (deep and object->type() == LDObjectType::SubfileReference) | 529 if (deep and object->type() == LDObjectType::SubfileReference) |
530 { | 530 { |
531 LDSubfileReference* reference = static_cast<LDSubfileReference*>(object); | 531 LDSubfileReference* reference = static_cast<LDSubfileReference*>(object); |
532 reference->inlineContents( | 532 reference->inlineContents( |
533 documentManager(), | 533 documentManager(), |
534 this->header.winding, | 534 this->winding(), |
535 model, | 535 model, |
536 deep, | 536 deep, |
537 renderinline | 537 renderinline |
538 ); | 538 ); |
539 } | 539 } |