src/ldObject.cpp

changeset 1079
67c6e5d32e68
parent 1078
c72e3115a297
child 1080
6dac2d52bd9a
equal deleted inserted replaced
1078:c72e3115a297 1079:67c6e5d32e68
345 345
346 // ============================================================================= 346 // =============================================================================
347 // ----------------------------------------------------------------------------- 347 // -----------------------------------------------------------------------------
348 void LDSubfileReference::inlineContents(Model& model, bool deep, bool render) 348 void LDSubfileReference::inlineContents(Model& model, bool deep, bool render)
349 { 349 {
350 Model inlined; 350 Model inlined {this->model()->documentManager()};
351 fileInfo()->inlineContents(inlined, deep, render); 351 fileInfo()->inlineContents(inlined, deep, render);
352 352
353 // Transform the objects 353 // Transform the objects
354 for (LDObject* object : inlined) 354 for (LDObject* object : inlined)
355 TransformObject(object, transformationMatrix(), position(), color()); 355 TransformObject(object, transformationMatrix(), position(), color());
543 if (model() == nullptr) 543 if (model() == nullptr)
544 return; 544 return;
545 545
546 // Check whether subfile is flat 546 // Check whether subfile is flat
547 int axisSet = (1 << X) | (1 << Y) | (1 << Z); 547 int axisSet = (1 << X) | (1 << Y) | (1 << Z);
548 Model model; 548 Model model {this->model()->documentManager()};
549 fileInfo()->inlineContents(model, true, false); 549 fileInfo()->inlineContents(model, true, false);
550 550
551 for (LDObject* obj : model.objects()) 551 for (LDObject* obj : model.objects())
552 { 552 {
553 for (int i = 0; i < obj->numVertices(); ++i) 553 for (int i = 0; i < obj->numVertices(); ++i)
958 } 958 }
959 959
960 return result; 960 return result;
961 } 961 }
962 962
963 // =============================================================================
964 //
965 LDObject* LDObject::createCopy() const
966 {
967 LDObject* copy = ParseLine (asText());
968 return copy;
969 }
970
971 LDSubfileReference::LDSubfileReference(LDDocument* reference, const Matrix& transformationMatrix, 963 LDSubfileReference::LDSubfileReference(LDDocument* reference, const Matrix& transformationMatrix,
972 const Vertex& position, Model* model) : 964 const Vertex& position, Model* model) :
973 LDMatrixObject {transformationMatrix, position, model}, 965 LDMatrixObject {transformationMatrix, position, model},
974 m_fileInfo {reference} {} 966 m_fileInfo {reference} {}
975 967

mercurial