Merge branch 'maintenance/improvement2' into 'develop'
Code smell and performance See merge request smart-pattern/valentina!20
This commit is contained in:
commit
2c58867ed9
|
@ -310,7 +310,7 @@ void PuzzlePreferencesConfigurationPage::InitShortcuts(bool defaults)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void PuzzlePreferencesConfigurationPage::UpdateShortcutsTable()
|
void PuzzlePreferencesConfigurationPage::UpdateShortcutsTable() const
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_transientShortcuts.length(); i++)
|
for (int i = 0; i < m_transientShortcuts.length(); i++)
|
||||||
{
|
{
|
||||||
|
@ -320,7 +320,7 @@ void PuzzlePreferencesConfigurationPage::UpdateShortcutsTable()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void PuzzlePreferencesConfigurationPage::RetranslateShortcutsTable()
|
void PuzzlePreferencesConfigurationPage::RetranslateShortcutsTable() const
|
||||||
{
|
{
|
||||||
VAbstractShortcutManager *manager = VAbstractApplication::VApp()->GetShortcutManager();
|
VAbstractShortcutManager *manager = VAbstractApplication::VApp()->GetShortcutManager();
|
||||||
if (manager == nullptr)
|
if (manager == nullptr)
|
||||||
|
|
|
@ -61,8 +61,8 @@ private:
|
||||||
|
|
||||||
void SetThemeModeComboBox();
|
void SetThemeModeComboBox();
|
||||||
void InitShortcuts(bool defaults = false);
|
void InitShortcuts(bool defaults = false);
|
||||||
void UpdateShortcutsTable();
|
void UpdateShortcutsTable() const;
|
||||||
void RetranslateShortcutsTable();
|
void RetranslateShortcutsTable() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PUZZLEPREFERENCESCONFIGURATIONPAGE_H
|
#endif // PUZZLEPREFERENCESCONFIGURATIONPAGE_H
|
||||||
|
|
|
@ -680,7 +680,7 @@ void PuzzlePreferencesLayoutPage::ReadSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void PuzzlePreferencesLayoutPage::FindTemplate(QComboBox *box, qreal width, qreal height)
|
void PuzzlePreferencesLayoutPage::FindTemplate(QComboBox *box, qreal width, qreal height) const
|
||||||
{
|
{
|
||||||
SCASSERT(box != nullptr)
|
SCASSERT(box != nullptr)
|
||||||
const Unit paperUnit = LayoutUnit();
|
const Unit paperUnit = LayoutUnit();
|
||||||
|
|
|
@ -99,7 +99,7 @@ private:
|
||||||
|
|
||||||
void ReadSettings();
|
void ReadSettings();
|
||||||
|
|
||||||
void FindTemplate(QComboBox *box, qreal width, qreal height);
|
void FindTemplate(QComboBox *box, qreal width, qreal height) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PUZZLEPREFERENCESLAYOUTPAGE_H
|
#endif // PUZZLEPREFERENCESLAYOUTPAGE_H
|
||||||
|
|
|
@ -56,7 +56,7 @@ PuzzlePreferencesPathPage::PuzzlePreferencesPathPage(QWidget *parent)
|
||||||
PuzzlePreferencesPathPage::~PuzzlePreferencesPathPage() = default;
|
PuzzlePreferencesPathPage::~PuzzlePreferencesPathPage() = default;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void PuzzlePreferencesPathPage::Apply()
|
void PuzzlePreferencesPathPage::Apply() const
|
||||||
{
|
{
|
||||||
VPSettings *settings = VPApplication::VApp()->PuzzleSettings();
|
VPSettings *settings = VPApplication::VApp()->PuzzleSettings();
|
||||||
settings->SetPathSVGFonts(ui->pathTable->item(0, 1)->text());
|
settings->SetPathSVGFonts(ui->pathTable->item(0, 1)->text());
|
||||||
|
@ -78,7 +78,7 @@ void PuzzlePreferencesPathPage::changeEvent(QEvent *event)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void PuzzlePreferencesPathPage::DefaultPath()
|
void PuzzlePreferencesPathPage::DefaultPath() const
|
||||||
{
|
{
|
||||||
const int row = ui->pathTable->currentRow();
|
const int row = ui->pathTable->currentRow();
|
||||||
QTableWidgetItem *item = ui->pathTable->item(row, 1);
|
QTableWidgetItem *item = ui->pathTable->item(row, 1);
|
||||||
|
|
|
@ -44,13 +44,13 @@ public:
|
||||||
explicit PuzzlePreferencesPathPage(QWidget *parent = nullptr);
|
explicit PuzzlePreferencesPathPage(QWidget *parent = nullptr);
|
||||||
~PuzzlePreferencesPathPage() override;
|
~PuzzlePreferencesPathPage() override;
|
||||||
|
|
||||||
void Apply();
|
void Apply() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void changeEvent(QEvent *event) override;
|
void changeEvent(QEvent *event) override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void DefaultPath();
|
void DefaultPath() const;
|
||||||
void EditPath();
|
void EditPath();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -217,7 +217,7 @@ void VPPiece::ClearTransformations()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPPiece::SetPosition(QPointF point)
|
void VPPiece::SetPosition(QPointF point) const
|
||||||
{
|
{
|
||||||
QTransform matrix = GetMatrix();
|
QTransform matrix = GetMatrix();
|
||||||
const QPointF offset = MappedDetailBoundingRect().topLeft();
|
const QPointF offset = MappedDetailBoundingRect().topLeft();
|
||||||
|
@ -226,7 +226,7 @@ void VPPiece::SetPosition(QPointF point)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VPPiece::GetPosition() -> QPointF
|
auto VPPiece::GetPosition() const -> QPointF
|
||||||
{
|
{
|
||||||
QTransform const matrix = GetMatrix();
|
QTransform const matrix = GetMatrix();
|
||||||
return {matrix.dx(), matrix.dy()};
|
return {matrix.dx(), matrix.dy()};
|
||||||
|
|
|
@ -65,13 +65,13 @@ public:
|
||||||
* @brief SetPosition Sets the position of the piece, in relation to the origin of the scene
|
* @brief SetPosition Sets the position of the piece, in relation to the origin of the scene
|
||||||
* @param point the point where to set the piece
|
* @param point the point where to set the piece
|
||||||
*/
|
*/
|
||||||
void SetPosition(QPointF point);
|
void SetPosition(QPointF point) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief GetPosition Returns the position of the piece
|
* @brief GetPosition Returns the position of the piece
|
||||||
* @return the position of the piece
|
* @return the position of the piece
|
||||||
*/
|
*/
|
||||||
auto GetPosition() -> QPointF;
|
auto QPointF GetPosition() -> QPointF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief RotateToGrainline rotates the piece to follow the grainline
|
* @brief RotateToGrainline rotates the piece to follow the grainline
|
||||||
|
|
|
@ -310,7 +310,7 @@ void VPSheetSceneData::RefreshSheetSize()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPSheetSceneData::ConnectPiece(VPGraphicsPiece *piece)
|
void VPSheetSceneData::ConnectPiece(VPGraphicsPiece *piece) const
|
||||||
{
|
{
|
||||||
SCASSERT(piece != nullptr)
|
SCASSERT(piece != nullptr)
|
||||||
|
|
||||||
|
|
|
@ -129,7 +129,7 @@ private:
|
||||||
bool m_outOfBoundTmp{false};
|
bool m_outOfBoundTmp{false};
|
||||||
bool m_pieceSuperpositionTmp{false};
|
bool m_pieceSuperpositionTmp{false};
|
||||||
|
|
||||||
void ConnectPiece(VPGraphicsPiece *piece);
|
void ConnectPiece(VPGraphicsPiece *piece) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class VPSheet : public QObject
|
class VPSheet : public QObject
|
||||||
|
|
|
@ -205,7 +205,7 @@ VPGraphicsPiece::VPGraphicsPiece(const VPPiecePtr &piece, QGraphicsItem *parent)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VPGraphicsPiece::GetPiece() -> VPPiecePtr
|
auto VPGraphicsPiece::GetPiece() const -> VPPiecePtr
|
||||||
{
|
{
|
||||||
return m_piece.toStrongRef();
|
return m_piece.toStrongRef();
|
||||||
}
|
}
|
||||||
|
@ -809,7 +809,7 @@ void VPGraphicsPiece::PaintInternalPaths(QPainter *painter, const VPPiecePtr &pi
|
||||||
QVector<VLayoutPoint> points = piecePath.Points();
|
QVector<VLayoutPoint> points = piecePath.Points();
|
||||||
const QTransform matrix = VGObject::FlippingMatrix(piece->GetSeamMirrorLine());
|
const QTransform matrix = VGObject::FlippingMatrix(piece->GetSeamMirrorLine());
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
QVector<QPointF> casted;
|
QVector<QPointF> casted;
|
||||||
CastTo(points, casted);
|
CastTo(points, casted);
|
||||||
path.addPath(piece->GetMatrix().map(VPiecePath::MakePainterPath(casted)));
|
path.addPath(piece->GetMatrix().map(VPiecePath::MakePainterPath(casted)));
|
||||||
|
@ -893,7 +893,7 @@ void VPGraphicsPiece::PaintPlaceLabels(QPainter *painter, const VPPiecePtr &piec
|
||||||
for (auto &points : shape)
|
for (auto &points : shape)
|
||||||
{
|
{
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
}
|
}
|
||||||
|
|
||||||
path.addPath(VAbstractPiece::LabelShapePath(piece->MapPlaceLabelShape(shape)));
|
path.addPath(VAbstractPiece::LabelShapePath(piece->MapPlaceLabelShape(shape)));
|
||||||
|
@ -939,7 +939,7 @@ void VPGraphicsPiece::PaintStickyPath(QPainter *painter)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPGraphicsPiece::PaintMirrorLine(QPainter *painter, const VPPiecePtr &piece)
|
void VPGraphicsPiece::PaintMirrorLine(QPainter *painter, const VPPiecePtr &piece) const
|
||||||
{
|
{
|
||||||
if (piece->IsShowFullPiece())
|
if (piece->IsShowFullPiece())
|
||||||
{
|
{
|
||||||
|
|
|
@ -50,7 +50,7 @@ public:
|
||||||
* @brief GetPiece Returns the piece that corresponds to the graphics piece
|
* @brief GetPiece Returns the piece that corresponds to the graphics piece
|
||||||
* @return the piece
|
* @return the piece
|
||||||
*/
|
*/
|
||||||
auto GetPiece() -> VPPiecePtr;
|
auto GetPiece() const -> VPPiecePtr;
|
||||||
|
|
||||||
auto type() const -> int override { return Type; }
|
auto type() const -> int override { return Type; }
|
||||||
enum
|
enum
|
||||||
|
@ -133,7 +133,7 @@ private:
|
||||||
void PaintPassmarks(QPainter *painter, const VPPiecePtr &piece);
|
void PaintPassmarks(QPainter *painter, const VPPiecePtr &piece);
|
||||||
void PaintPlaceLabels(QPainter *painter, const VPPiecePtr &piece);
|
void PaintPlaceLabels(QPainter *painter, const VPPiecePtr &piece);
|
||||||
void PaintStickyPath(QPainter *painter);
|
void PaintStickyPath(QPainter *painter);
|
||||||
void PaintMirrorLine(QPainter *painter, const VPPiecePtr &piece);
|
void PaintMirrorLine(QPainter *painter, const VPPiecePtr &piece) const;
|
||||||
void PaintFoldLine(QPainter *painter, const VPPiecePtr &piece);
|
void PaintFoldLine(QPainter *painter, const VPPiecePtr &piece);
|
||||||
|
|
||||||
void GroupMove(const QPointF &pos);
|
void GroupMove(const QPointF &pos);
|
||||||
|
|
|
@ -167,7 +167,7 @@ void VPGraphicsTileGrid::paint(QPainter *painter, const QStyleOptionGraphicsItem
|
||||||
|
|
||||||
VWatermarkData const watermarkData = layout->TileFactory()->WatermarkData();
|
VWatermarkData const watermarkData = layout->TileFactory()->WatermarkData();
|
||||||
|
|
||||||
auto PaintWatermark = [painter, layout, xScale, yScale, watermarkData](const QRectF &img)
|
auto PaintWatermark = [painter, layout, xScale, yScale, &watermarkData](const QRectF &img)
|
||||||
{
|
{
|
||||||
if (not layout->LayoutSettings().WatermarkPath().isEmpty() && layout->LayoutSettings().GetShowWatermark() &&
|
if (not layout->LayoutSettings().WatermarkPath().isEmpty() && layout->LayoutSettings().GetShowWatermark() &&
|
||||||
watermarkData.opacity > 0)
|
watermarkData.opacity > 0)
|
||||||
|
|
|
@ -103,7 +103,7 @@ VPMainGraphicsView::VPMainGraphicsView(const VPLayoutPtr &layout, QWidget *paren
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPMainGraphicsView::RefreshLayout()
|
void VPMainGraphicsView::RefreshLayout() const
|
||||||
{
|
{
|
||||||
VPLayoutPtr const layout = m_layout.toStrongRef();
|
VPLayoutPtr const layout = m_layout.toStrongRef();
|
||||||
if (not layout.isNull())
|
if (not layout.isNull())
|
||||||
|
@ -117,7 +117,7 @@ void VPMainGraphicsView::RefreshLayout()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPMainGraphicsView::RefreshPieces()
|
void VPMainGraphicsView::RefreshPieces() const
|
||||||
{
|
{
|
||||||
VPLayoutPtr const layout = m_layout.toStrongRef();
|
VPLayoutPtr const layout = m_layout.toStrongRef();
|
||||||
if (not layout.isNull())
|
if (not layout.isNull())
|
||||||
|
@ -570,7 +570,7 @@ void VPMainGraphicsView::SwitchScene(const VPSheetPtr &sheet)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPMainGraphicsView::ClearSelection()
|
void VPMainGraphicsView::ClearSelection() const
|
||||||
{
|
{
|
||||||
VPLayoutPtr const layout = m_layout.toStrongRef();
|
VPLayoutPtr const layout = m_layout.toStrongRef();
|
||||||
if (layout.isNull())
|
if (layout.isNull())
|
||||||
|
@ -593,7 +593,7 @@ void VPMainGraphicsView::ClearSelection()
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VPMainGraphicsView::ZValueMove(int move)
|
void VPMainGraphicsView::ZValueMove(int move) const
|
||||||
{
|
{
|
||||||
VPLayoutPtr const layout = m_layout.toStrongRef();
|
VPLayoutPtr const layout = m_layout.toStrongRef();
|
||||||
if (layout.isNull())
|
if (layout.isNull())
|
||||||
|
|
|
@ -52,7 +52,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* @brief RefreshLayout Refreshes the rectangles for the layout border and the margin
|
* @brief RefreshLayout Refreshes the rectangles for the layout border and the margin
|
||||||
*/
|
*/
|
||||||
void RefreshLayout();
|
void RefreshLayout() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/**
|
/**
|
||||||
|
@ -64,7 +64,7 @@ public slots:
|
||||||
|
|
||||||
void on_ActiveSheetChanged(const VPSheetPtr &focusedSheet);
|
void on_ActiveSheetChanged(const VPSheetPtr &focusedSheet);
|
||||||
|
|
||||||
void RefreshPieces();
|
void RefreshPieces() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/**
|
/**
|
||||||
|
@ -108,9 +108,9 @@ private:
|
||||||
void TranslatePiecesOn(qreal dx, qreal dy);
|
void TranslatePiecesOn(qreal dx, qreal dy);
|
||||||
|
|
||||||
void SwitchScene(const VPSheetPtr &sheet);
|
void SwitchScene(const VPSheetPtr &sheet);
|
||||||
void ClearSelection();
|
void ClearSelection() const;
|
||||||
|
|
||||||
void ZValueMove(int move);
|
void ZValueMove(int move) const;
|
||||||
|
|
||||||
void RemovePiece() const;
|
void RemovePiece() const;
|
||||||
void MovePiece(QKeyEvent *event);
|
void MovePiece(QKeyEvent *event);
|
||||||
|
|
|
@ -689,7 +689,7 @@ void VPTileFactory::PaintWatermarkImage(QPainter *painter, const QRectF &img, co
|
||||||
SCASSERT(painter != nullptr)
|
SCASSERT(painter != nullptr)
|
||||||
|
|
||||||
const qreal opacity = watermarkData.opacity / 100.;
|
const qreal opacity = watermarkData.opacity / 100.;
|
||||||
auto BrokenImage = [img, watermarkData, watermarkPath, opacity, folowColorScheme]()
|
auto BrokenImage = [&img, &watermarkData, watermarkPath, opacity, folowColorScheme]()
|
||||||
{
|
{
|
||||||
QString colorScheme = QStringLiteral("light");
|
QString colorScheme = QStringLiteral("light");
|
||||||
|
|
||||||
|
|
|
@ -912,7 +912,7 @@ void VDxfEngine::ExportAAMADrawSewLine(const QSharedPointer<dx_ifaceBlock> &deta
|
||||||
const UTF8STRING &layer = not detail.IsSewLineOnDrawing() ? *layer14 : *layer8;
|
const UTF8STRING &layer = not detail.IsSewLineOnDrawing() ? *layer14 : *layer8;
|
||||||
QVector<VLayoutPoint> const points = detail.GetMappedFullContourPoints();
|
QVector<VLayoutPoint> const points = detail.GetMappedFullContourPoints();
|
||||||
|
|
||||||
auto DrawPolygon = [this, detailBlock, layer](const QVector<VLayoutPoint> &points, bool forceClosed)
|
auto DrawPolygon = [this, detailBlock, &layer](const QVector<VLayoutPoint> &points, bool forceClosed)
|
||||||
{
|
{
|
||||||
if (DRW_Entity *e = AAMAPolygon(points, layer, forceClosed))
|
if (DRW_Entity *e = AAMAPolygon(points, layer, forceClosed))
|
||||||
{
|
{
|
||||||
|
@ -977,7 +977,7 @@ void VDxfEngine::ExportAAMADrawInternalPaths(const QSharedPointer<dx_ifaceBlock>
|
||||||
{
|
{
|
||||||
const QTransform matrix = VGObject::FlippingMatrix(detail.GetMappedSeamMirrorLine());
|
const QTransform matrix = VGObject::FlippingMatrix(detail.GetMappedSeamMirrorLine());
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
DrawPolygon(points, iPath.PenStyle(), false);
|
DrawPolygon(points, iPath.PenStyle(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1015,7 +1015,7 @@ void VDxfEngine::ExportAAMADrawPlaceLabels(const QSharedPointer<dx_ifaceBlock> &
|
||||||
for (auto &points : shape)
|
for (auto &points : shape)
|
||||||
{
|
{
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point)
|
[&matrix](const VLayoutPoint &point)
|
||||||
{ return VAbstractPiece::MapPoint(point, matrix); });
|
{ return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1049,7 +1049,7 @@ void VDxfEngine::ExportAAMAIntcut(const QSharedPointer<dx_ifaceBlock> &detailBlo
|
||||||
{
|
{
|
||||||
const QTransform matrix = VGObject::FlippingMatrix(detail.GetMappedSeamMirrorLine());
|
const QTransform matrix = VGObject::FlippingMatrix(detail.GetMappedSeamMirrorLine());
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
DrawPolygon(points, false);
|
DrawPolygon(points, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1524,7 +1524,7 @@ void VDxfEngine::ExportASTMDrawInternalPaths(const QSharedPointer<dx_ifaceBlock>
|
||||||
{
|
{
|
||||||
const QTransform matrix = VGObject::FlippingMatrix(detail.GetMappedSeamMirrorLine());
|
const QTransform matrix = VGObject::FlippingMatrix(detail.GetMappedSeamMirrorLine());
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
DrawPolygon(points, iPath.PenStyle(), iPath.IsNotMirrored(), false);
|
DrawPolygon(points, iPath.PenStyle(), iPath.IsNotMirrored(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1576,7 +1576,7 @@ void VDxfEngine::ExportASTMDrawPlaceLabels(const QSharedPointer<dx_ifaceBlock> &
|
||||||
for (auto &points : shape)
|
for (auto &points : shape)
|
||||||
{
|
{
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point)
|
[&matrix](const VLayoutPoint &point)
|
||||||
{ return VAbstractPiece::MapPoint(point, matrix); });
|
{ return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1624,7 +1624,7 @@ void VDxfEngine::ExportASTMInternalCutout(const QSharedPointer<dx_ifaceBlock> &d
|
||||||
{
|
{
|
||||||
const QTransform matrix = VGObject::FlippingMatrix(detail.GetMappedSeamMirrorLine());
|
const QTransform matrix = VGObject::FlippingMatrix(detail.GetMappedSeamMirrorLine());
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
DrawPolygon(points, intCut.IsNotMirrored(), false);
|
DrawPolygon(points, intCut.IsNotMirrored(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1687,7 +1687,7 @@ void VDxfEngine::ExportASTMNotches(const QSharedPointer<dx_ifaceBlock> &detailBl
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ExportPassmark = [this, detailBlock, detail](const VLayoutPassmark &passmark)
|
auto ExportPassmark = [this, detailBlock, &detail](const VLayoutPassmark &passmark)
|
||||||
{
|
{
|
||||||
DRW_ASTMNotch *notch = ExportASTMNotch(passmark);
|
DRW_ASTMNotch *notch = ExportASTMNotch(passmark);
|
||||||
DRW_ATTDEF *attdef = ExportASTMNotchDataDependecy(passmark, notch->layer, detail);
|
DRW_ATTDEF *attdef = ExportASTMNotchDataDependecy(passmark, notch->layer, detail);
|
||||||
|
|
|
@ -516,7 +516,7 @@ auto VEllipticalArc::GetPoints() const -> QVector<QPointF>
|
||||||
t.rotate(-d->rotationAngle);
|
t.rotate(-d->rotationAngle);
|
||||||
t.translate(-center.x(), -center.y());
|
t.translate(-center.x(), -center.y());
|
||||||
|
|
||||||
std::transform(points.begin(), points.end(), points.begin(), [t](const QPointF &point) { return t.map(point); });
|
std::transform(points.begin(), points.end(), points.begin(), [&t](const QPointF &point) { return t.map(point); });
|
||||||
|
|
||||||
return IsFlipped() ? Reverse(points) : points;
|
return IsFlipped() ? Reverse(points) : points;
|
||||||
}
|
}
|
||||||
|
|
|
@ -502,7 +502,7 @@ void VHPGLEngine::PlotInternalPaths(QTextStream &out, const VLayoutPiece &detail
|
||||||
{
|
{
|
||||||
const QTransform matrix = VGObject::FlippingMatrix(detail.GetMappedSeamMirrorLine());
|
const QTransform matrix = VGObject::FlippingMatrix(detail.GetMappedSeamMirrorLine());
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
PlotPath(out, CastToPoint(ConvertPath(points)), path.PenStyle());
|
PlotPath(out, CastToPoint(ConvertPath(points)), path.PenStyle());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -531,7 +531,7 @@ void VHPGLEngine::PlotPlaceLabels(QTextStream &out, const VLayoutPiece &detail)
|
||||||
for (auto &points : shape)
|
for (auto &points : shape)
|
||||||
{
|
{
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
}
|
}
|
||||||
|
|
||||||
PlotShape(shape);
|
PlotShape(shape);
|
||||||
|
|
|
@ -1906,7 +1906,7 @@ auto VAbstractPiece::GrainlineMainLine(const VGrainlineData &geom, const VContai
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLabelImg
|
auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLabelImg
|
||||||
{
|
{
|
||||||
auto LayoutPoint = [label](QPointF p, bool turnPoint = false, bool curvePoint = false)
|
auto LayoutPoint = [&label](QPointF p, bool turnPoint = false, bool curvePoint = false)
|
||||||
{
|
{
|
||||||
VLayoutPoint point(label.RotationMatrix().map(p));
|
VLayoutPoint point(label.RotationMatrix().map(p));
|
||||||
point.SetTurnPoint(turnPoint);
|
point.SetTurnPoint(turnPoint);
|
||||||
|
@ -1917,7 +1917,7 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab
|
||||||
const QPointF pos = label.Center();
|
const QPointF pos = label.Center();
|
||||||
const QRectF box = label.Box();
|
const QRectF box = label.Box();
|
||||||
|
|
||||||
auto SegmentShape = [pos, box, LayoutPoint]()
|
auto SegmentShape = [pos, &box, &LayoutPoint]()
|
||||||
{
|
{
|
||||||
QVector<VLayoutPoint> const shape{LayoutPoint(QPointF(pos.x(), pos.y() - box.height() / 2.0), true),
|
QVector<VLayoutPoint> const shape{LayoutPoint(QPointF(pos.x(), pos.y() - box.height() / 2.0), true),
|
||||||
LayoutPoint(QPointF(pos.x(), pos.y() + box.height() / 2.0), true)};
|
LayoutPoint(QPointF(pos.x(), pos.y() + box.height() / 2.0), true)};
|
||||||
|
@ -1925,7 +1925,7 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab
|
||||||
return PlaceLabelImg{shape};
|
return PlaceLabelImg{shape};
|
||||||
};
|
};
|
||||||
|
|
||||||
auto RectangleShape = [pos, box, LayoutPoint]()
|
auto RectangleShape = [pos, &box, &LayoutPoint]()
|
||||||
{
|
{
|
||||||
QRectF const rect(QPointF(pos.x() - box.width() / 2.0, pos.y() - box.height() / 2.0),
|
QRectF const rect(QPointF(pos.x() - box.width() / 2.0, pos.y() - box.height() / 2.0),
|
||||||
QPointF(pos.x() + box.width() / 2.0, pos.y() + box.height() / 2.0));
|
QPointF(pos.x() + box.width() / 2.0, pos.y() + box.height() / 2.0));
|
||||||
|
@ -1937,7 +1937,7 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab
|
||||||
return PlaceLabelImg{shape};
|
return PlaceLabelImg{shape};
|
||||||
};
|
};
|
||||||
|
|
||||||
auto CrossShape = [pos, box, LayoutPoint]()
|
auto CrossShape = [pos, &box, &LayoutPoint]()
|
||||||
{
|
{
|
||||||
QVector<VLayoutPoint> const shape1{LayoutPoint(QPointF(pos.x(), pos.y() - box.height() / 2.0), true),
|
QVector<VLayoutPoint> const shape1{LayoutPoint(QPointF(pos.x(), pos.y() - box.height() / 2.0), true),
|
||||||
LayoutPoint(QPointF(pos.x(), pos.y() + box.height() / 2.0), true)};
|
LayoutPoint(QPointF(pos.x(), pos.y() + box.height() / 2.0), true)};
|
||||||
|
@ -1948,7 +1948,7 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab
|
||||||
return PlaceLabelImg{shape1, shape2};
|
return PlaceLabelImg{shape1, shape2};
|
||||||
};
|
};
|
||||||
|
|
||||||
auto TshapedShape = [pos, box, LayoutPoint]()
|
auto TshapedShape = [pos, &box, &LayoutPoint]()
|
||||||
{
|
{
|
||||||
QPointF const center2(pos.x(), pos.y() + box.height() / 2.0);
|
QPointF const center2(pos.x(), pos.y() + box.height() / 2.0);
|
||||||
|
|
||||||
|
@ -1960,7 +1960,7 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab
|
||||||
return PlaceLabelImg{shape1, shape2};
|
return PlaceLabelImg{shape1, shape2};
|
||||||
};
|
};
|
||||||
|
|
||||||
auto DoubletreeShape = [pos, box, LayoutPoint]()
|
auto DoubletreeShape = [pos, &box, &LayoutPoint]()
|
||||||
{
|
{
|
||||||
QRectF const rect(QPointF(pos.x() - box.width() / 2.0, pos.y() - box.height() / 2.0),
|
QRectF const rect(QPointF(pos.x() - box.width() / 2.0, pos.y() - box.height() / 2.0),
|
||||||
QPointF(pos.x() + box.width() / 2.0, pos.y() + box.height() / 2.0));
|
QPointF(pos.x() + box.width() / 2.0, pos.y() + box.height() / 2.0));
|
||||||
|
@ -1972,7 +1972,7 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab
|
||||||
return PlaceLabelImg{shape1, shape2};
|
return PlaceLabelImg{shape1, shape2};
|
||||||
};
|
};
|
||||||
|
|
||||||
auto CornerShape = [pos, box, LayoutPoint]()
|
auto CornerShape = [pos, &box, &LayoutPoint]()
|
||||||
{
|
{
|
||||||
QVector<VLayoutPoint> const shape1{LayoutPoint(QPointF(pos.x(), pos.y()), true),
|
QVector<VLayoutPoint> const shape1{LayoutPoint(QPointF(pos.x(), pos.y()), true),
|
||||||
LayoutPoint(QPointF(pos.x(), pos.y() + box.height() / 2.0), true)};
|
LayoutPoint(QPointF(pos.x(), pos.y() + box.height() / 2.0), true)};
|
||||||
|
@ -1983,7 +1983,7 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab
|
||||||
return PlaceLabelImg{shape1, shape2};
|
return PlaceLabelImg{shape1, shape2};
|
||||||
};
|
};
|
||||||
|
|
||||||
auto TriangleShape = [pos, box, LayoutPoint]()
|
auto TriangleShape = [pos, &box, &LayoutPoint]()
|
||||||
{
|
{
|
||||||
QRectF const rect(QPointF(pos.x() - box.width() / 2.0, pos.y() - box.height() / 2.0),
|
QRectF const rect(QPointF(pos.x() - box.width() / 2.0, pos.y() - box.height() / 2.0),
|
||||||
QPointF(pos.x() + box.width() / 2.0, pos.y() + box.height() / 2.0));
|
QPointF(pos.x() + box.width() / 2.0, pos.y() + box.height() / 2.0));
|
||||||
|
@ -1994,7 +1994,7 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab
|
||||||
return PlaceLabelImg{shape};
|
return PlaceLabelImg{shape};
|
||||||
};
|
};
|
||||||
|
|
||||||
auto HshapedShape = [pos, box, LayoutPoint]()
|
auto HshapedShape = [pos, &box, &LayoutPoint]()
|
||||||
{
|
{
|
||||||
const QPointF center1(pos.x(), pos.y() - box.height() / 2.0);
|
const QPointF center1(pos.x(), pos.y() - box.height() / 2.0);
|
||||||
const QPointF center2(pos.x(), pos.y() + box.height() / 2.0);
|
const QPointF center2(pos.x(), pos.y() + box.height() / 2.0);
|
||||||
|
@ -2010,7 +2010,7 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab
|
||||||
return PlaceLabelImg{shape1, shape2, shape3};
|
return PlaceLabelImg{shape1, shape2, shape3};
|
||||||
};
|
};
|
||||||
|
|
||||||
auto ButtonShape = [pos, box, LayoutPoint]()
|
auto ButtonShape = [pos, &box, &LayoutPoint]()
|
||||||
{
|
{
|
||||||
const qreal radius = qMin(box.width() / 2.0, box.height() / 2.0);
|
const qreal radius = qMin(box.width() / 2.0, box.height() / 2.0);
|
||||||
QVector<VLayoutPoint> const shape1{LayoutPoint(QPointF(pos.x(), pos.y() - radius), true),
|
QVector<VLayoutPoint> const shape1{LayoutPoint(QPointF(pos.x(), pos.y() - radius), true),
|
||||||
|
@ -2044,7 +2044,7 @@ auto VAbstractPiece::PlaceLabelShape(const VLayoutPlaceLabel &label) -> PlaceLab
|
||||||
return PlaceLabelImg{shape1, shape2, shape3};
|
return PlaceLabelImg{shape1, shape2, shape3};
|
||||||
};
|
};
|
||||||
|
|
||||||
auto CircleShape = [pos, box, LayoutPoint]()
|
auto CircleShape = [pos, &box, &LayoutPoint]()
|
||||||
{
|
{
|
||||||
const qreal radius = qMin(box.width() / 2.0, box.height() / 2.0);
|
const qreal radius = qMin(box.width() / 2.0, box.height() / 2.0);
|
||||||
VArc arc(VPointF(pos), radius, 0, 360);
|
VArc arc(VPointF(pos), radius, 0, 360);
|
||||||
|
|
|
@ -940,7 +940,7 @@ template <class T>
|
||||||
inline auto VAbstractPiece::MapVector(QVector<T> points, const QTransform &matrix, bool mirror) -> QVector<T>
|
inline auto VAbstractPiece::MapVector(QVector<T> points, const QTransform &matrix, bool mirror) -> QVector<T>
|
||||||
{
|
{
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const T &point) { return MapPoint(point, matrix); });
|
[&matrix](const T &point) { return MapPoint(point, matrix); });
|
||||||
if (mirror)
|
if (mirror)
|
||||||
{
|
{
|
||||||
std::reverse(points.begin(), points.end());
|
std::reverse(points.begin(), points.end());
|
||||||
|
|
|
@ -84,7 +84,7 @@ auto VBestSquare::operator=(VBestSquare &&res) noexcept -> VBestSquare &
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void VBestSquare::NewResult(const VBestSquareResData &data)
|
void VBestSquare::NewResult(const VBestSquareResData &data)
|
||||||
{
|
{
|
||||||
auto SaveResult = [this, data]()
|
auto SaveResult = [this, &data]()
|
||||||
{
|
{
|
||||||
d->valideResult = true;
|
d->valideResult = true;
|
||||||
d->data = data;
|
d->data = data;
|
||||||
|
|
|
@ -459,7 +459,7 @@ auto VFoldLine::FoldLineThreeDotsPath() const -> QVector<QPainterPath>
|
||||||
ThreeDotsPosData const data = ThreeDotsData();
|
ThreeDotsPosData const data = ThreeDotsData();
|
||||||
QPainterPath dots;
|
QPainterPath dots;
|
||||||
|
|
||||||
auto DrawCircle = [&dots, data](const QPointF ¢er)
|
auto DrawCircle = [&dots, &data](const QPointF ¢er)
|
||||||
{
|
{
|
||||||
qreal const diameter = 2 * data.radius;
|
qreal const diameter = 2 * data.radius;
|
||||||
qreal const x = center.x() - data.radius;
|
qreal const x = center.x() - data.radius;
|
||||||
|
|
|
@ -1693,7 +1693,7 @@ auto VLayoutPiece::GetItem(bool textAsPaths, bool togetherWithNotches, bool show
|
||||||
QVector<VLayoutPoint> points = path.Points();
|
QVector<VLayoutPoint> points = path.Points();
|
||||||
const QTransform matrix = VGObject::FlippingMatrix(d->m_seamMirrorLine);
|
const QTransform matrix = VGObject::FlippingMatrix(d->m_seamMirrorLine);
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
QVector<QPointF> casted;
|
QVector<QPointF> casted;
|
||||||
CastTo(points, casted);
|
CastTo(points, casted);
|
||||||
p.addPath(d->m_matrix.map(VPiecePath::MakePainterPath(casted)));
|
p.addPath(d->m_matrix.map(VPiecePath::MakePainterPath(casted)));
|
||||||
|
@ -1724,7 +1724,7 @@ auto VLayoutPiece::GetItem(bool textAsPaths, bool togetherWithNotches, bool show
|
||||||
for (auto &points : shape)
|
for (auto &points : shape)
|
||||||
{
|
{
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return MapPoint(point, matrix); });
|
||||||
}
|
}
|
||||||
|
|
||||||
path.addPath(d->m_matrix.map(LabelShapePath(shape)));
|
path.addPath(d->m_matrix.map(LabelShapePath(shape)));
|
||||||
|
@ -2382,7 +2382,7 @@ auto VLayoutPiece::ConvertPassmarks(const VPiece &piece, const VContainer *patte
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto AddPassmark = [passmark, piece, pattern, &layoutPassmarks](PassmarkSide side)
|
auto AddPassmark = [&passmark, &piece, pattern, &layoutPassmarks](PassmarkSide side)
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
VLayoutPassmark const layoutPassmark = PrepareSAPassmark(piece, pattern, passmark, side, ok);
|
VLayoutPassmark const layoutPassmark = PrepareSAPassmark(piece, pattern, passmark, side, ok);
|
||||||
|
@ -2392,7 +2392,7 @@ auto VLayoutPiece::ConvertPassmarks(const VPiece &piece, const VContainer *patte
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
auto AddBuiltInPassmark = [passmark, piece, pattern, &layoutPassmarks]()
|
auto AddBuiltInPassmark = [&passmark, &piece, pattern, &layoutPassmarks]()
|
||||||
{
|
{
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
VLayoutPassmark const layoutPassmark = PreapreBuiltInSAPassmark(piece, pattern, passmark, ok);
|
VLayoutPassmark const layoutPassmark = PreapreBuiltInSAPassmark(piece, pattern, passmark, ok);
|
||||||
|
|
|
@ -95,7 +95,7 @@ auto PointsToSegments(const QVector<QPointF> &points) -> QVector<QLineF>
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto PassmarkLength(const VPiecePassmarkData &passmarkData, qreal width, bool &ok) -> qreal
|
auto PassmarkLength(const VPiecePassmarkData &passmarkData, qreal width, bool &ok) -> qreal
|
||||||
{
|
{
|
||||||
auto ValidateLength = [passmarkData](qreal length)
|
auto ValidateLength = [&passmarkData](qreal length)
|
||||||
{
|
{
|
||||||
if (length <= accuracyPointOnLine)
|
if (length <= accuracyPointOnLine)
|
||||||
{
|
{
|
||||||
|
|
|
@ -404,7 +404,7 @@ auto VPiece::PlaceLabelPath(const VContainer *data) const -> QPainterPath
|
||||||
for (auto &points : shape)
|
for (auto &points : shape)
|
||||||
{
|
{
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return MapPoint(point, matrix); });
|
||||||
}
|
}
|
||||||
|
|
||||||
path.addPath(LabelShapePath(shape));
|
path.addPath(LabelShapePath(shape));
|
||||||
|
|
|
@ -271,7 +271,7 @@ void DialogArc::ShowDialog(bool click)
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetCenter());
|
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetCenter());
|
||||||
QLineF const line = QLineF(static_cast<QPointF>(*point), scene->getScenePos());
|
QLineF const line = QLineF(static_cast<QPointF>(*point), scene->getScenePos());
|
||||||
|
|
||||||
auto Angle = [line]()
|
auto Angle = [&line]()
|
||||||
{
|
{
|
||||||
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
||||||
{
|
{
|
||||||
|
|
|
@ -298,7 +298,7 @@ void DialogArcWithLength::ShowDialog(bool click)
|
||||||
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetCenter());
|
const QSharedPointer<VPointF> point = data->GeometricObject<VPointF>(GetCenter());
|
||||||
QLineF const line = QLineF(static_cast<QPointF>(*point), scene->getScenePos());
|
QLineF const line = QLineF(static_cast<QPointF>(*point), scene->getScenePos());
|
||||||
|
|
||||||
auto Angle = [line]()
|
auto Angle = [&line]()
|
||||||
{
|
{
|
||||||
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
||||||
{
|
{
|
||||||
|
|
|
@ -592,7 +592,7 @@ void DialogEllipticalArc::ShowDialog(bool click)
|
||||||
const QSharedPointer<VPointF> center = data->GeometricObject<VPointF>(GetCenter());
|
const QSharedPointer<VPointF> center = data->GeometricObject<VPointF>(GetCenter());
|
||||||
QLineF line = QLineF(static_cast<QPointF>(*center), scene->getScenePos());
|
QLineF line = QLineF(static_cast<QPointF>(*center), scene->getScenePos());
|
||||||
|
|
||||||
auto Angle = [line]()
|
auto Angle = [&line]()
|
||||||
{
|
{
|
||||||
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1318,7 +1318,7 @@ void DialogSeamAllowance::ShowPlaceLabelsContextMenu(const QPoint &pos)
|
||||||
|
|
||||||
QScopedPointer<QMenu> menu(new QMenu());
|
QScopedPointer<QMenu> menu(new QMenu());
|
||||||
|
|
||||||
auto InitAction = [currentLabel, &menu](const QString &text, PlaceLabelType type)
|
auto InitAction = [¤tLabel, &menu](const QString &text, PlaceLabelType type)
|
||||||
{
|
{
|
||||||
QAction *action = menu->addAction(text);
|
QAction *action = menu->addAction(text);
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
|
@ -1326,7 +1326,7 @@ void DialogSeamAllowance::ShowPlaceLabelsContextMenu(const QPoint &pos)
|
||||||
return action;
|
return action;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto SaveType = [this, currentLabel, labelId](PlaceLabelType type)
|
auto SaveType = [this, ¤tLabel, labelId](PlaceLabelType type)
|
||||||
{
|
{
|
||||||
VPlaceLabelItem newLabel = VPlaceLabelItem(currentLabel);
|
VPlaceLabelItem newLabel = VPlaceLabelItem(currentLabel);
|
||||||
newLabel.SetLabelType(type);
|
newLabel.SetLabelType(type);
|
||||||
|
|
|
@ -328,7 +328,7 @@ void VToolPiecePath::RefreshGeometry()
|
||||||
QVector<VLayoutPoint> points = path.PathPoints(this->getData(), cuttingPath);
|
QVector<VLayoutPoint> points = path.PathPoints(this->getData(), cuttingPath);
|
||||||
const QTransform matrix = VGObject::FlippingMatrix(mirrorLine);
|
const QTransform matrix = VGObject::FlippingMatrix(mirrorLine);
|
||||||
std::transform(points.begin(), points.end(), points.begin(),
|
std::transform(points.begin(), points.end(), points.begin(),
|
||||||
[matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
[&matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
|
||||||
QVector<QPointF> casted;
|
QVector<QPointF> casted;
|
||||||
CastTo(points, casted);
|
CastTo(points, casted);
|
||||||
p.addPath(VPiecePath::MakePainterPath(casted));
|
p.addPath(VPiecePath::MakePainterPath(casted));
|
||||||
|
|
|
@ -1559,7 +1559,7 @@ void CreateUnitedDetail(const VToolUnionDetailsInitData &initData, qreal dx, qre
|
||||||
piece->RefreshGeometry(true); // Refresh internal paths
|
piece->RefreshGeometry(true); // Refresh internal paths
|
||||||
}
|
}
|
||||||
|
|
||||||
auto DuplicateDetail = [initData](quint32 id)
|
auto DuplicateDetail = [&initData](quint32 id)
|
||||||
{
|
{
|
||||||
VToolSeamAllowanceInitData initPieceData;
|
VToolSeamAllowanceInitData initPieceData;
|
||||||
initPieceData.scene = initData.scene;
|
initPieceData.scene = initData.scene;
|
||||||
|
|
|
@ -67,7 +67,7 @@ void VisToolArc::RefreshGeometry()
|
||||||
{
|
{
|
||||||
QLineF const r = QLineF(static_cast<QPointF>(*first), ScenePos());
|
QLineF const r = QLineF(static_cast<QPointF>(*first), ScenePos());
|
||||||
|
|
||||||
auto Angle = [r]()
|
auto Angle = [&r]()
|
||||||
{
|
{
|
||||||
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,7 +65,7 @@ void VisToolArcWithLength::RefreshGeometry()
|
||||||
{
|
{
|
||||||
QLineF const r = QLineF(static_cast<QPointF>(*first), ScenePos());
|
QLineF const r = QLineF(static_cast<QPointF>(*first), ScenePos());
|
||||||
|
|
||||||
auto Angle = [r]()
|
auto Angle = [&r]()
|
||||||
{
|
{
|
||||||
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
if (QGuiApplication::keyboardModifiers() == Qt::ShiftModifier)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user