src/basics.cc

changeset 944
1a6f1997fcbe
parent 861
83426c5fa732
child 946
9cbd658b63f9
equal deleted inserted replaced
943:af81220741d9 944:1a6f1997fcbe
225 reset(); 225 reset();
226 226
227 if (CurrentDocument() == null) 227 if (CurrentDocument() == null)
228 return; 228 return;
229 229
230 for (LDObjectPtr obj : CurrentDocument()->objects()) 230 for (LDObject* obj : CurrentDocument()->objects())
231 calcObject (obj); 231 calcObject (obj);
232 } 232 }
233 233
234 // ============================================================================= 234 // =============================================================================
235 // 235 //
236 void LDBoundingBox::calcObject (LDObjectPtr obj) 236 void LDBoundingBox::calcObject (LDObject* obj)
237 { 237 {
238 switch (obj->type()) 238 switch (obj->type())
239 { 239 {
240 case OBJ_Line: 240 case OBJ_Line:
241 case OBJ_Triangle: 241 case OBJ_Triangle:
242 case OBJ_Quad: 242 case OBJ_Quad:
243 case OBJ_CondLine: 243 case OBJ_CondLine:
244 {
245 for (int i = 0; i < obj->numVertices(); ++i) 244 for (int i = 0; i < obj->numVertices(); ++i)
246 calcVertex (obj->vertex (i)); 245 calcVertex (obj->vertex (i));
247 } break; 246 break;
248 247
249 case OBJ_Subfile: 248 case OBJ_Subfile:
250 { 249 for (LDObject* obj : static_cast<LDSubfile*> (obj)->inlineContents (true, false))
251 LDSubfilePtr ref = obj.staticCast<LDSubfile>();
252 LDObjectList objs = ref->inlineContents (true, false);
253
254 for (LDObjectPtr obj : objs)
255 { 250 {
256 calcObject (obj); 251 calcObject (obj);
257 obj->destroy(); 252 obj->destroy();
258 } 253 }
259 } 254 break;
260 break;
261 255
262 default: 256 default:
263 break; 257 break;
264 } 258 }
265 } 259 }
272 return *this; 266 return *this;
273 } 267 }
274 268
275 // ============================================================================= 269 // =============================================================================
276 // 270 //
277 LDBoundingBox& LDBoundingBox::operator<< (LDObjectPtr obj) 271 LDBoundingBox& LDBoundingBox::operator<< (LDObject* obj)
278 { 272 {
279 calcObject (obj); 273 calcObject (obj);
280 return *this; 274 return *this;
281 } 275 }
282 276

mercurial