Mercurial > hg > svgui
comparison layer/Layer.cpp @ 1459:42c87368287c
Merge from branch single-point
author | Chris Cannam |
---|---|
date | Fri, 17 May 2019 10:02:52 +0100 |
parents | 5554d5187494 |
children | 11a150e65ee1 |
comparison
equal
deleted
inserted
replaced
1441:8d5bf4ab98ef | 1459:42c87368287c |
---|---|
230 // doing that, would it be better to paste at 5s and 10s or at 10s | 230 // doing that, would it be better to paste at 5s and 10s or at 10s |
231 // and 20s? We probably don't ever want to do the former, do we? | 231 // and 20s? We probably don't ever want to do the former, do we? |
232 // We either want to be literal all the way through, or aligned | 232 // We either want to be literal all the way through, or aligned |
233 // all the way through. | 233 // all the way through. |
234 | 234 |
235 for (Clipboard::PointList::const_iterator i = clip.getPoints().begin(); | 235 for (EventVector::const_iterator i = clip.getPoints().begin(); |
236 i != clip.getPoints().end(); ++i) { | 236 i != clip.getPoints().end(); ++i) { |
237 | 237 |
238 // In principle, we want to know whether the aligned version | 238 // In principle, we want to know whether the aligned version |
239 // of the reference frame in our layer is the same as the | 239 // of the reference frame in our layer is the same as the |
240 // source frame contained in the clipboard point. However, | 240 // source frame contained in the clipboard point. However, |
250 // reference (i.e. having been copied from the reference | 250 // reference (i.e. having been copied from the reference |
251 // model). | 251 // model). |
252 | 252 |
253 sv_frame_t sourceFrame = i->getFrame(); | 253 sv_frame_t sourceFrame = i->getFrame(); |
254 sv_frame_t referenceFrame = sourceFrame; | 254 sv_frame_t referenceFrame = sourceFrame; |
255 if (i->haveReferenceFrame()) { | 255 if (i->hasReferenceFrame()) { |
256 referenceFrame = i->getReferenceFrame(); | 256 referenceFrame = i->getReferenceFrame(); |
257 } | 257 } |
258 sv_frame_t myMappedFrame = alignToReference(v, sourceFrame); | 258 sv_frame_t myMappedFrame = alignToReference(v, sourceFrame); |
259 | 259 |
260 // cerr << "sourceFrame = " << sourceFrame << ", referenceFrame = " << referenceFrame << " (have = " << i->haveReferenceFrame() << "), myMappedFrame = " << myMappedFrame << endl; | 260 // cerr << "sourceFrame = " << sourceFrame << ", referenceFrame = " << referenceFrame << " (have = " << i->hasReferenceFrame() << "), myMappedFrame = " << myMappedFrame << endl; |
261 | 261 |
262 if (myMappedFrame != referenceFrame) return true; | 262 if (myMappedFrame != referenceFrame) return true; |
263 } | 263 } |
264 | 264 |
265 return false; | 265 return false; |
645 } | 645 } |
646 | 646 |
647 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5") | 647 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5") |
648 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName | 648 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName |
649 (LayerFactory::getInstance()->getLayerType(this)))) | 649 (LayerFactory::getInstance()->getLayerType(this)))) |
650 .arg(getObjectExportId(this)) | 650 .arg(getExportId()) |
651 .arg(encodeEntities(objectName())) | 651 .arg(encodeEntities(objectName())) |
652 .arg(getObjectExportId(getModel())) | 652 .arg(getModel() ? getModel()->getExportId() : -1) |
653 .arg(extraAttributes); | 653 .arg(extraAttributes); |
654 | 654 |
655 if (m_measureRects.empty()) { | 655 if (m_measureRects.empty()) { |
656 stream << QString("/>\n"); | 656 stream << QString("/>\n"); |
657 return; | 657 return; |
679 } | 679 } |
680 | 680 |
681 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5/>\n") | 681 stream << QString("<layer id=\"%2\" type=\"%1\" name=\"%3\" model=\"%4\" %5/>\n") |
682 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName | 682 .arg(encodeEntities(LayerFactory::getInstance()->getLayerTypeName |
683 (LayerFactory::getInstance()->getLayerType(this)))) | 683 (LayerFactory::getInstance()->getLayerType(this)))) |
684 .arg(getObjectExportId(this)) | 684 .arg(getExportId()) |
685 .arg(encodeEntities(objectName())) | 685 .arg(encodeEntities(objectName())) |
686 .arg(getObjectExportId(getModel())) | 686 .arg(getModel() ? getModel()->getExportId() : -1) |
687 .arg(extraAttributes); | 687 .arg(extraAttributes); |
688 } | 688 } |
689 | 689 |