371 compilePolygon (*poly, index, info); |
371 compilePolygon (*poly, index, info); |
372 delete poly; |
372 delete poly; |
373 break; |
373 break; |
374 } |
374 } |
375 |
375 |
376 // TODO: try use interfaces to remove these special treatments? |
|
377 case LDObjectType::SubfileReference: |
|
378 { |
|
379 LDSubfileReference* subfileReference = static_cast<LDSubfileReference*>(object); |
|
380 auto data = subfileReference->inlinePolygons( |
|
381 m_documents, |
|
382 m_renderer->model()->winding() |
|
383 ); |
|
384 |
|
385 for (LDPolygon& poly : data) |
|
386 compilePolygon (poly, index, info); |
|
387 break; |
|
388 } |
|
389 |
|
390 case LDObjectType::BezierCurve: |
376 case LDObjectType::BezierCurve: |
391 { |
377 { |
392 LDBezierCurve* curve = static_cast<LDBezierCurve*>(object); |
378 LDBezierCurve* curve = static_cast<LDBezierCurve*>(object); |
393 for (LDPolygon& polygon : curve->rasterizePolygons(grid()->bezierCurveSegments())) |
379 for (LDPolygon& polygon : curve->rasterizePolygons(grid()->bezierCurveSegments())) |
394 compilePolygon (polygon, index, info); |
380 compilePolygon (polygon, index, info); |
395 } |
381 } |
396 break; |
382 break; |
397 |
383 |
398 default: |
384 default: |
|
385 if (object->isRasterizable()) |
|
386 { |
|
387 auto data = object->rasterizePolygons(m_documents, m_renderer->model()->winding()); |
|
388 |
|
389 for (LDPolygon& poly : data) |
|
390 compilePolygon(poly, index, info); |
|
391 } |
399 break; |
392 break; |
400 } |
393 } |
401 |
394 |
402 m_objectInfo[index] = info; |
395 m_objectInfo[index] = info; |
403 needMerge(); |
396 needMerge(); |