93 // If the radii are the same, there's no ring space to fill. Use a circle. |
93 // If the radii are the same, there's no ring space to fill. Use a circle. |
94 refFile = GetPrimitive (::Circle, segments, divisions, 0); |
94 refFile = GetPrimitive (::Circle, segments, divisions, 0); |
95 transform = getCircleDrawMatrix (dist0); |
95 transform = getCircleDrawMatrix (dist0); |
96 circleOrDisc = true; |
96 circleOrDisc = true; |
97 } |
97 } |
98 elif (dist0 == 0 or dist1 == 0) |
98 else if (dist0 == 0 or dist1 == 0) |
99 { |
99 { |
100 // If either radii is 0, use a disc. |
100 // If either radii is 0, use a disc. |
101 refFile = GetPrimitive (::Disc, segments, divisions, 0); |
101 refFile = GetPrimitive (::Disc, segments, divisions, 0); |
102 transform = getCircleDrawMatrix ((dist0 != 0) ? dist0 : dist1); |
102 transform = getCircleDrawMatrix ((dist0 != 0) ? dist0 : dist1); |
103 circleOrDisc = true; |
103 circleOrDisc = true; |
104 } |
104 } |
105 elif (g_RingFinder.findRings (dist0, dist1)) |
105 else if (g_RingFinder.findRings (dist0, dist1)) |
106 { |
106 { |
107 // The ring finder found a solution, use that. Add the component rings to the file. |
107 // The ring finder found a solution, use that. Add the component rings to the file. |
108 for (const RingFinder::Component& cmp : g_RingFinder.bestSolution()->getComponents()) |
108 for (const RingFinder::Component& cmp : g_RingFinder.bestSolution()->getComponents()) |
109 { |
109 { |
110 refFile = GetPrimitive (::Ring, segments, divisions, cmp.num); |
110 refFile = GetPrimitive (::Ring, segments, divisions, cmp.num); |
167 ref->setPosition (m_drawedVerts[0]); |
167 ref->setPosition (m_drawedVerts[0]); |
168 ref->setColor (MainColor); |
168 ref->setColor (MainColor); |
169 objs << ref; |
169 objs << ref; |
170 } |
170 } |
171 |
171 |
172 unless (objs.isEmpty()) |
172 if (not objs.isEmpty()) |
173 { |
173 { |
174 Axis relZ = renderer()->getRelativeZ();; |
174 Axis relZ = renderer()->getRelativeZ();; |
175 const int l (relZ == X ? 1 : 0); |
175 const int l (relZ == X ? 1 : 0); |
176 const int m (relZ == Y ? 1 : 0); |
176 const int m (relZ == Y ? 1 : 0); |
177 const int n (relZ == Z ? 1 : 0); |
177 const int n (relZ == Z ? 1 : 0); |