mirror of
https://gitlab.com/smart-pattern/valentina.git
synced 2024-09-18 23:04:03 +02:00
Compare commits
2 commits
69397c1404
...
b1470053f7
Author | SHA1 | Date | |
---|---|---|---|
b1470053f7 | |||
e1e3a5106e |
|
@ -711,8 +711,17 @@ auto VDxfEngine::ExportToAAMA(const QVector<VLayoutPiece> &details) -> bool
|
|||
|
||||
for(auto detail : details)
|
||||
{
|
||||
// Use custom deleter function to lose ownership after adding the block
|
||||
bool deleteBlock = true;
|
||||
auto NoOpDeleter =[&deleteBlock](dx_ifaceBlock* block)
|
||||
{
|
||||
if (deleteBlock)
|
||||
{
|
||||
delete block;
|
||||
}
|
||||
};
|
||||
|
||||
auto detailBlock = QSharedPointer<dx_ifaceBlock>::create();
|
||||
auto detailBlock = QSharedPointer<dx_ifaceBlock>(new dx_ifaceBlock, NoOpDeleter);
|
||||
|
||||
QString blockName = detail.GetName();
|
||||
if (m_version <= DRW::AC1009)
|
||||
|
@ -740,6 +749,8 @@ auto VDxfEngine::ExportToAAMA(const QVector<VLayoutPiece> &details) -> bool
|
|||
insert->layer = *layer1;
|
||||
|
||||
m_input->AddEntity(insert.take());
|
||||
|
||||
deleteBlock = false; // lose ownership
|
||||
}
|
||||
|
||||
return m_input->fileExport(m_binary);
|
||||
|
@ -929,7 +940,16 @@ auto VDxfEngine::ExportToASTM(const QVector<VLayoutPiece> &details) -> bool
|
|||
|
||||
for(auto detail : details)
|
||||
{
|
||||
auto detailBlock = QSharedPointer<dx_ifaceBlock>::create();
|
||||
// Use custom deleter function to lose ownership after adding the block
|
||||
bool deleteBlock = true;
|
||||
auto NoOpDeleter =[&deleteBlock](dx_ifaceBlock* block)
|
||||
{
|
||||
if (deleteBlock)
|
||||
{
|
||||
delete block;
|
||||
}
|
||||
};
|
||||
auto detailBlock = QSharedPointer<dx_ifaceBlock>(new dx_ifaceBlock, NoOpDeleter);
|
||||
|
||||
QString blockName = detail.GetName();
|
||||
if (m_version <= DRW::AC1009)
|
||||
|
@ -959,6 +979,8 @@ auto VDxfEngine::ExportToASTM(const QVector<VLayoutPiece> &details) -> bool
|
|||
insert->layer = *layer1;
|
||||
|
||||
m_input->AddEntity(insert.take());
|
||||
|
||||
deleteBlock = false; // lose ownership
|
||||
}
|
||||
|
||||
return m_input->fileExport(m_binary);
|
||||
|
|
|
@ -27,8 +27,9 @@
|
|||
*************************************************************************/
|
||||
#include "vpiecearea.h"
|
||||
#include "vpiecearea_p.h"
|
||||
#include "../vpatterndb/vpiece.h"
|
||||
#include "../vpatterndb/vcontainer.h"
|
||||
#include "../vpiece.h"
|
||||
#include "../vcontainer.h"
|
||||
#include "vincrement.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
|
||||
|
@ -48,17 +49,23 @@ VPieceArea::VPieceArea(PieceAreaType type, quint32 pieceId, const VPiece &piece,
|
|||
|
||||
QString shortName = PieceShortName(piece);
|
||||
|
||||
VContainer tempData = *data;
|
||||
auto currentSA = new VIncrement(&tempData, currentSeamAllowance);
|
||||
currentSA->SetFormula(piece.GetSAWidth(), QString().setNum(piece.GetSAWidth()), true);
|
||||
|
||||
tempData.AddVariable(currentSA);
|
||||
|
||||
if (type == PieceAreaType::External)
|
||||
{
|
||||
SetType(VarType::PieceExternalArea);
|
||||
SetName(pieceArea_ + shortName);
|
||||
VInternalVariable::SetValue(FromPixel2(piece.ExternalArea(data), unit));
|
||||
VInternalVariable::SetValue(FromPixel2(piece.ExternalArea(&tempData), unit));
|
||||
}
|
||||
else
|
||||
{
|
||||
SetType(VarType::PieceSeamLineArea);
|
||||
SetName(pieceSeamLineArea_ + shortName);
|
||||
VInternalVariable::SetValue(FromPixel2(piece.SeamLineArea(data), unit));
|
||||
VInternalVariable::SetValue(FromPixel2(piece.SeamLineArea(&tempData), unit));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue