Refactor names to avoid confusion.

This commit is contained in:
Roman Telezhynskyi 2021-08-14 15:18:15 +03:00
parent d6fe9508a6
commit 718ff2056a
4 changed files with 19 additions and 12 deletions

View File

@ -317,7 +317,7 @@ void VPGraphicsPiece::PaintPiece(QPainter *painter)
} }
// initialises the place labels (buttons etc) // initialises the place labels (buttons etc)
QVector<VLayoutPlaceLabel> placeLabels = m_piece->GetPlaceLabels(); QVector<VLayoutPlaceLabel> placeLabels = m_piece->GetMappedPlaceLabels();
for(auto &placeLabel : placeLabels) for(auto &placeLabel : placeLabels)
{ {
QPainterPath path = VPlaceLabelItem::LabelShapePath(placeLabel.shape); QPainterPath path = VPlaceLabelItem::LabelShapePath(placeLabel.shape);

View File

@ -727,7 +727,7 @@ void VDxfEngine::ExportAAMADraw(dx_ifaceBlock *detailBlock, const VLayoutPiece &
} }
} }
const QVector<QVector<QPointF>> drawIntCut = detail.InternalPathsForCut(false); const QVector<QVector<QPointF>> drawIntCut = detail.MappedInternalPathsForCut(false);
for(auto &intCut : drawIntCut) for(auto &intCut : drawIntCut)
{ {
if (DRW_Entity *e = AAMAPolygon(intCut, QChar('8'), false)) if (DRW_Entity *e = AAMAPolygon(intCut, QChar('8'), false))
@ -736,7 +736,7 @@ void VDxfEngine::ExportAAMADraw(dx_ifaceBlock *detailBlock, const VLayoutPiece &
} }
} }
const QVector<VLayoutPlaceLabel> labels = detail.GetPlaceLabels(); const QVector<VLayoutPlaceLabel> labels = detail.GetMappedPlaceLabels();
for(auto &label : labels) for(auto &label : labels)
{ {
if (label.type != PlaceLabelType::Doubletree && label.type != PlaceLabelType::Button if (label.type != PlaceLabelType::Doubletree && label.type != PlaceLabelType::Button
@ -756,7 +756,7 @@ void VDxfEngine::ExportAAMADraw(dx_ifaceBlock *detailBlock, const VLayoutPiece &
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VDxfEngine::ExportAAMAIntcut(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) void VDxfEngine::ExportAAMAIntcut(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail)
{ {
QVector<QVector<QPointF>> drawIntCut = detail.InternalPathsForCut(true); QVector<QVector<QPointF>> drawIntCut = detail.MappedInternalPathsForCut(true);
for(auto &intCut : drawIntCut) for(auto &intCut : drawIntCut)
{ {
if (DRW_Entity *e = AAMAPolygon(intCut, "11", false)) if (DRW_Entity *e = AAMAPolygon(intCut, "11", false))
@ -833,7 +833,7 @@ void VDxfEngine::ExportStyleSystemText(const QSharedPointer<dx_iface> &input, co
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VDxfEngine::ExportAAMADrill(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) void VDxfEngine::ExportAAMADrill(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail)
{ {
const QVector<VLayoutPlaceLabel> labels = detail.GetPlaceLabels(); const QVector<VLayoutPlaceLabel> labels = detail.GetMappedPlaceLabels();
for(auto &label : labels) for(auto &label : labels)
{ {
@ -953,7 +953,7 @@ void VDxfEngine::ExportASTMSewLine(dx_ifaceBlock *detailBlock, const VLayoutPiec
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VDxfEngine::ExportASTMInternalLine(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) void VDxfEngine::ExportASTMInternalLine(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail)
{ {
const QVector<QVector<QPointF>> drawIntCut = detail.InternalPathsForCut(false); const QVector<QVector<QPointF>> drawIntCut = detail.MappedInternalPathsForCut(false);
for(auto &intCut : drawIntCut) for(auto &intCut : drawIntCut)
{ {
// Internal line // Internal line
@ -969,7 +969,7 @@ void VDxfEngine::ExportASTMInternalLine(dx_ifaceBlock *detailBlock, const VLayou
} }
} }
const QVector<VLayoutPlaceLabel> labels = detail.GetPlaceLabels(); const QVector<VLayoutPlaceLabel> labels = detail.GetMappedPlaceLabels();
for(auto &label : labels) for(auto &label : labels)
{ {
if (label.type != PlaceLabelType::Doubletree && label.type != PlaceLabelType::Button if (label.type != PlaceLabelType::Doubletree && label.type != PlaceLabelType::Button
@ -996,7 +996,7 @@ void VDxfEngine::ExportASTMInternalLine(dx_ifaceBlock *detailBlock, const VLayou
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VDxfEngine::ExportASTMInternalCutout(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) void VDxfEngine::ExportASTMInternalCutout(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail)
{ {
QVector<QVector<QPointF>> drawIntCut = detail.InternalPathsForCut(true); QVector<QVector<QPointF>> drawIntCut = detail.MappedInternalPathsForCut(true);
for(auto &intCut : drawIntCut) for(auto &intCut : drawIntCut)
{ {
// Internal cutout // Internal cutout
@ -1026,7 +1026,7 @@ void VDxfEngine::ExportASTMAnnotationText(dx_ifaceBlock *detailBlock, const VLay
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VDxfEngine::ExportASTMDrill(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail) void VDxfEngine::ExportASTMDrill(dx_ifaceBlock *detailBlock, const VLayoutPiece &detail)
{ {
const QVector<VLayoutPlaceLabel> labels = detail.GetPlaceLabels(); const QVector<VLayoutPlaceLabel> labels = detail.GetMappedPlaceLabels();
for(auto &label : labels) for(auto &label : labels)
{ {

View File

@ -1083,11 +1083,17 @@ void VLayoutPiece::SetPassmarks(const QVector<VLayoutPassmark> &passmarks)
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QVector<VLayoutPlaceLabel> VLayoutPiece::GetPlaceLabels() const QVector<VLayoutPlaceLabel> VLayoutPiece::GetMappedPlaceLabels() const
{ {
return Map(d->m_placeLabels); return Map(d->m_placeLabels);
} }
//---------------------------------------------------------------------------------------------------------------------
QVector<VLayoutPlaceLabel> VLayoutPiece::GetPlaceLabels() const
{
return d->m_placeLabels;
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void VLayoutPiece::SetPlaceLabels(const QVector<VLayoutPlaceLabel> &labels) void VLayoutPiece::SetPlaceLabels(const QVector<VLayoutPlaceLabel> &labels)
{ {
@ -1095,7 +1101,7 @@ void VLayoutPiece::SetPlaceLabels(const QVector<VLayoutPlaceLabel> &labels)
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QVector<QVector<QPointF> > VLayoutPiece::InternalPathsForCut(bool cut) const QVector<QVector<QPointF> > VLayoutPiece::MappedInternalPathsForCut(bool cut) const
{ {
QVector<QVector<QPointF> > paths; QVector<QVector<QPointF> > paths;

View File

@ -90,10 +90,11 @@ public:
QVector<VLayoutPassmark> GetPassmarks() const; QVector<VLayoutPassmark> GetPassmarks() const;
void SetPassmarks(const QVector<VLayoutPassmark> &passmarks); void SetPassmarks(const QVector<VLayoutPassmark> &passmarks);
QVector<VLayoutPlaceLabel> GetMappedPlaceLabels() const;
QVector<VLayoutPlaceLabel> GetPlaceLabels() const; QVector<VLayoutPlaceLabel> GetPlaceLabels() const;
void SetPlaceLabels(const QVector<VLayoutPlaceLabel> &labels); void SetPlaceLabels(const QVector<VLayoutPlaceLabel> &labels);
QVector<QVector<QPointF>> InternalPathsForCut(bool cut) const; QVector<QVector<QPointF>> MappedInternalPathsForCut(bool cut) const;
QVector<VLayoutPiecePath> GetInternalPaths() const; QVector<VLayoutPiecePath> GetInternalPaths() const;
void SetInternalPaths(const QVector<VLayoutPiecePath> &internalPaths); void SetInternalPaths(const QVector<VLayoutPiecePath> &internalPaths);