263 |
263 |
264 if (type == LDObject::Subfile || type == LDObject::Radial) { |
264 if (type == LDObject::Subfile || type == LDObject::Radial) { |
265 QLabel* lb_matrix = new QLabel ("Matrix:"); |
265 QLabel* lb_matrix = new QLabel ("Matrix:"); |
266 le_matrix = new QLineEdit; |
266 le_matrix = new QLineEdit; |
267 // le_matrix->setValidator (new QDoubleValidator); |
267 // le_matrix->setValidator (new QDoubleValidator); |
268 matrix<3> defval = g_identity; |
268 matrix defval = g_identity; |
269 |
269 |
270 if (obj) { |
270 if (obj) { |
271 if (obj->getType () == LDObject::Subfile) |
271 if (obj->getType () == LDObject::Subfile) |
272 defval = static_cast<LDSubfile*> (obj)->transform; |
272 defval = static_cast<LDSubfile*> (obj)->transform; |
273 else |
273 else |
383 |
383 |
384 LDObject* backup = null; |
384 LDObject* backup = null; |
385 if (!newObject) |
385 if (!newObject) |
386 backup = obj->clone (); |
386 backup = obj->clone (); |
387 |
387 |
388 matrix<3> transform = g_identity; |
388 matrix transform = g_identity; |
389 if (type == LDObject::Subfile || type == LDObject::Radial) { |
389 if (type == LDObject::Subfile || type == LDObject::Radial) { |
390 vector<str> matrixstrvals = str (dlg.le_matrix->text ()).split (" "); |
390 vector<str> matrixstrvals = str (dlg.le_matrix->text ()).split (" "); |
391 |
391 |
392 if (matrixstrvals.size () == 9) { |
392 if (matrixstrvals.size () == 9) { |
393 double matrixvals[9]; |
393 double matrixvals[9]; |
394 int i = 0; |
394 int i = 0; |
395 |
395 |
396 for (str val : matrixstrvals) |
396 for (str val : matrixstrvals) |
397 matrixvals[i++] = atof (val); |
397 matrixvals[i++] = atof (val); |
398 |
398 |
399 transform = matrix<3> (matrixvals); |
399 transform = matrix (matrixvals); |
400 } |
400 } |
401 } |
401 } |
402 |
402 |
403 switch (type) { |
403 switch (type) { |
404 case LDObject::Comment: |
404 case LDObject::Comment: |