src/ldtypes.cpp

changeset 252
3f9067022d74
parent 251
c4b96bc41298
child 265
955c0aabfebf
equal deleted inserted replaced
251:c4b96bc41298 252:3f9067022d74
172 172
173 // The triangles also inherit the quad's color 173 // The triangles also inherit the quad's color
174 tri1->color = tri2->color = color; 174 tri1->color = tri2->color = color;
175 175
176 vector<LDTriangle*> triangles; 176 vector<LDTriangle*> triangles;
177 triangles.push_back (tri1); 177 triangles << tri1;
178 triangles.push_back (tri2); 178 triangles << tri2;
179 return triangles; 179 return triangles;
180 } 180 }
181 181
182 // ============================================================================= 182 // =============================================================================
183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
260 vector<LDObject*> objs, objcache; 260 vector<LDObject*> objs, objcache;
261 261
262 // If we have this cached, just clone that 262 // If we have this cached, just clone that
263 if (deep && fileInfo->cache ().size ()) { 263 if (deep && fileInfo->cache ().size ()) {
264 for (LDObject* obj : fileInfo->cache ()) 264 for (LDObject* obj : fileInfo->cache ())
265 objs.push_back (obj->clone ()); 265 objs << obj->clone ();
266 } else { 266 } else {
267 if (!deep) 267 if (!deep)
268 cache = false; 268 cache = false;
269 269
270 for (LDObject* obj : fileInfo->objs ()) { 270 for (LDObject* obj : fileInfo->objs ()) {
296 vector<LDObject*> otherobjs = ref->inlineContents (true, false); 296 vector<LDObject*> otherobjs = ref->inlineContents (true, false);
297 297
298 for (LDObject* otherobj : otherobjs) { 298 for (LDObject* otherobj : otherobjs) {
299 // Cache this object, if desired 299 // Cache this object, if desired
300 if (cache) 300 if (cache)
301 objcache.push_back (otherobj->clone ()); 301 objcache << otherobj->clone ();
302 302
303 objs.push_back (otherobj); 303 objs << otherobj;
304 } 304 }
305 } else { 305 } else {
306 if (cache) 306 if (cache)
307 objcache.push_back (obj->clone ()); 307 objcache << obj->clone ();
308 308
309 objs.push_back (obj->clone ()); 309 objs << obj->clone ();
310 } 310 }
311 } 311 }
312 312
313 if (cache) 313 if (cache)
314 fileInfo->setCache (objcache); 314 fileInfo->setCache (objcache);
361 // abort the entire operation. 361 // abort the entire operation.
362 assert (i == start); 362 assert (i == start);
363 return; 363 return;
364 } 364 }
365 365
366 objsToCompile.push_back (obj); 366 objsToCompile << obj;
367 objsToCompile.push_back (g_curfile->obj (target)); 367 objsToCompile << g_curfile->obj (target);
368 368
369 obj->swap (g_curfile->obj (target)); 369 obj->swap (g_curfile->obj (target));
370 } 370 }
371 371
372 // The objects need to be recompiled, otherwise their pick lists are left with 372 // The objects need to be recompiled, otherwise their pick lists are left with
536 pLine->coords[0] = v0; 536 pLine->coords[0] = v0;
537 pLine->coords[1] = v1; 537 pLine->coords[1] = v1;
538 pLine->color = edgecolor; 538 pLine->color = edgecolor;
539 pLine->parent = this; 539 pLine->parent = this;
540 540
541 paObjects.push_back (pLine); 541 paObjects << pLine;
542 } 542 }
543 break; 543 break;
544 544
545 case LDRadial::Cylinder: 545 case LDRadial::Cylinder:
546 case LDRadial::Ring: 546 case LDRadial::Ring:
594 pQuad->coords[2] = v2; 594 pQuad->coords[2] = v2;
595 pQuad->coords[3] = v3; 595 pQuad->coords[3] = v3;
596 pQuad->color = color; 596 pQuad->color = color;
597 pQuad->parent = this; 597 pQuad->parent = this;
598 598
599 paObjects.push_back (pQuad); 599 paObjects << pQuad;
600 } 600 }
601 break; 601 break;
602 602
603 case LDRadial::Disc: 603 case LDRadial::Disc:
604 case LDRadial::DiscNeg: 604 case LDRadial::DiscNeg:
627 pSeg->coords[1] = v1; 627 pSeg->coords[1] = v1;
628 pSeg->coords[2] = v2; 628 pSeg->coords[2] = v2;
629 pSeg->color = color; 629 pSeg->color = color;
630 pSeg->parent = this; 630 pSeg->parent = this;
631 631
632 paObjects.push_back (pSeg); 632 paObjects << pSeg;
633 } 633 }
634 break; 634 break;
635 635
636 default: 636 default:
637 break; 637 break;

mercurial