src/editmodes/circleMode.cpp

changeset 1339
1f342d5abc85
parent 1328
d68d1ce89d05
child 1344
d28f6ff1b1f0
equal deleted inserted replaced
1338:1152c9fefa3e 1339:1f342d5abc85
64 void CircleMode::endDraw() 64 void CircleMode::endDraw()
65 { 65 {
66 Model model {m_documents}; 66 Model model {m_documents};
67 PrimitiveModel primitiveModel; 67 PrimitiveModel primitiveModel;
68 primitiveModel.segments = m_window->ringToolSegments(); 68 primitiveModel.segments = m_window->ringToolSegments();
69 primitiveModel.divisions = m_window->ringToolHiRes() ? HighResolution : LowResolution; 69 primitiveModel.divisions = m_window->ringToolDivisions();
70 primitiveModel.ringNumber = 0; 70 primitiveModel.ringNumber = 0;
71 double dist0 (getCircleDrawDist (0)); 71 double dist0 (getCircleDrawDist (0));
72 double dist1 (getCircleDrawDist (1)); 72 double dist1 (getCircleDrawDist (1));
73 LDDocument* primitiveFile; 73 LDDocument* primitiveFile;
74 Matrix transform; 74 Matrix transform;
158 */ 158 */
159 double CircleMode::orientation() const 159 double CircleMode::orientation() const
160 { 160 {
161 if (not m_drawedVerts.isEmpty()) 161 if (not m_drawedVerts.isEmpty())
162 { 162 {
163 int divisions = m_window->ringToolHiRes() ? HighResolution : LowResolution; 163 int divisions = m_window->ringToolDivisions();
164 QPointF originSpot = renderer()->currentCamera().convert3dTo2d(m_drawedVerts.first()); 164 QPointF originSpot = renderer()->currentCamera().convert3dTo2d(m_drawedVerts.first());
165 // Line from the origin of the circle to current mouse position 165 // Line from the origin of the circle to current mouse position
166 QLineF hand1 = {originSpot, renderer()->mousePositionF()}; 166 QLineF hand1 = {originSpot, renderer()->mousePositionF()};
167 // Line from the origin spot to 167 // Line from the origin spot to
168 QLineF hand2 = {{0, 0}, {1, 0}}; 168 QLineF hand2 = {{0, 0}, {1, 0}};
194 194
195 QVector<Vertex> innerverts, outerverts; 195 QVector<Vertex> innerverts, outerverts;
196 QVector<QPointF> innerverts2d, outerverts2d; 196 QVector<QPointF> innerverts2d, outerverts2d;
197 double innerdistance = getCircleDrawDist(0); 197 double innerdistance = getCircleDrawDist(0);
198 double outerdistance = countof(m_drawedVerts) >= 2 ? getCircleDrawDist (1) : -1; 198 double outerdistance = countof(m_drawedVerts) >= 2 ? getCircleDrawDist (1) : -1;
199 int divisions = m_window->ringToolHiRes() ? HighResolution : LowResolution; 199 int divisions = m_window->ringToolDivisions();
200 int segments = m_window->ringToolSegments(); 200 int segments = m_window->ringToolSegments();
201 double angleUnit = 2 * pi / divisions; 201 double angleUnit = 2 * pi / divisions;
202 Axis relX, relY; 202 Axis relX, relY;
203 renderer()->getRelativeAxes(relX, relY); 203 renderer()->getRelativeAxes(relX, relY);
204 double angleoffset = (countof(m_drawedVerts) < 3 ? orientation() : m_angleOffset); 204 double angleoffset = (countof(m_drawedVerts) < 3 ? orientation() : m_angleOffset);

mercurial