src/editmodes/circleMode.cpp

changeset 967
eb586d3e1a6a
parent 962
a4b463a7ee82
child 968
4b93b7963456
equal deleted inserted replaced
966:a834e43a57da 967:eb586d3e1a6a
65 65
66 for (int i = 0; i < 9; ++i) 66 for (int i = 0; i < 9; ++i)
67 { 67 {
68 if (transform[i] == 2) 68 if (transform[i] == 2)
69 transform[i] = scale; 69 transform[i] = scale;
70 elif (transform[i] == 1 and renderer()->camera() >= 3) 70 else if (transform[i] == 1 and renderer()->camera() >= 3)
71 transform[i] = -1; 71 transform[i] = -1;
72 } 72 }
73 73
74 return transform; 74 return transform;
75 } 75 }
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);

mercurial