44 // ============================================================================= |
44 // ============================================================================= |
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
46 // ============================================================================= |
46 // ============================================================================= |
47 void bbox::calcObject (LDObject* obj) { |
47 void bbox::calcObject (LDObject* obj) { |
48 switch (obj->getType ()) { |
48 switch (obj->getType ()) { |
49 case OBJ_Line: |
49 case LDObject::Line: |
50 { |
50 { |
51 LDLine* line = static_cast<LDLine*> (obj); |
51 LDLine* line = static_cast<LDLine*> (obj); |
52 for (short i = 0; i < 2; ++i) |
52 for (short i = 0; i < 2; ++i) |
53 calcVertex (line->vaCoords[i]); |
53 calcVertex (line->vaCoords[i]); |
54 } |
54 } |
55 break; |
55 break; |
56 |
56 |
57 case OBJ_Triangle: |
57 case LDObject::Triangle: |
58 { |
58 { |
59 LDTriangle* tri = static_cast<LDTriangle*> (obj); |
59 LDTriangle* tri = static_cast<LDTriangle*> (obj); |
60 for (short i = 0; i < 3; ++i) |
60 for (short i = 0; i < 3; ++i) |
61 calcVertex (tri->vaCoords[i]); |
61 calcVertex (tri->vaCoords[i]); |
62 } |
62 } |
63 break; |
63 break; |
64 |
64 |
65 case OBJ_Quad: |
65 case LDObject::Quad: |
66 { |
66 { |
67 LDQuad* quad = static_cast<LDQuad*> (obj); |
67 LDQuad* quad = static_cast<LDQuad*> (obj); |
68 for (short i = 0; i < 4; ++i) |
68 for (short i = 0; i < 4; ++i) |
69 calcVertex (quad->vaCoords[i]); |
69 calcVertex (quad->vaCoords[i]); |
70 } |
70 } |
71 break; |
71 break; |
72 |
72 |
73 case OBJ_CondLine: |
73 case LDObject::CondLine: |
74 { |
74 { |
75 LDCondLine* line = static_cast<LDCondLine*> (obj); |
75 LDCondLine* line = static_cast<LDCondLine*> (obj); |
76 for (short i = 0; i < 4; ++i) |
76 for (short i = 0; i < 4; ++i) |
77 calcVertex (line->vaCoords[i]); |
77 calcVertex (line->vaCoords[i]); |
78 } |
78 } |
79 break; |
79 break; |
80 |
80 |
81 case OBJ_Subfile: |
81 case LDObject::Subfile: |
82 { |
82 { |
83 LDSubfile* ref = static_cast<LDSubfile*> (obj); |
83 LDSubfile* ref = static_cast<LDSubfile*> (obj); |
84 vector<LDObject*> objs = ref->inlineContents (true, true); |
84 vector<LDObject*> objs = ref->inlineContents (true, true); |
85 |
85 |
86 for (LDObject* obj : objs) { |
86 for (LDObject* obj : objs) { |