From b1f2273bc6c93bdef2a3a54c63fad96f5c6e78f4 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Mon, 12 Sep 2022 15:43:36 -0400 Subject: [PATCH] PNS: Add CurrentStart() to placers. --- pcbnew/router/pns_diff_pair_placer.h | 8 ++++++++ pcbnew/router/pns_dp_meander_placer.cpp | 6 ++++++ pcbnew/router/pns_dp_meander_placer.h | 4 ++++ pcbnew/router/pns_line_placer.h | 8 ++++++++ pcbnew/router/pns_meander_placer.cpp | 4 ++++ pcbnew/router/pns_meander_placer.h | 3 +++ pcbnew/router/pns_placement_algo.h | 9 +++++++-- 7 files changed, 40 insertions(+), 2 deletions(-) diff --git a/pcbnew/router/pns_diff_pair_placer.h b/pcbnew/router/pns_diff_pair_placer.h index a2a22a8b01..e6cd4ad500 100644 --- a/pcbnew/router/pns_diff_pair_placer.h +++ b/pcbnew/router/pns_diff_pair_placer.h @@ -103,6 +103,14 @@ public: */ const ITEM_SET Traces() override; + /** + * Return the current start of the line being placed. + */ + const VECTOR2I& CurrentStart() const override + { + return m_currentStart; + } + /** * Return the current end of the line being placed. It may not be equal to the cursor * position due to collisions. diff --git a/pcbnew/router/pns_dp_meander_placer.cpp b/pcbnew/router/pns_dp_meander_placer.cpp index 7b5bc3331b..4a442dba16 100644 --- a/pcbnew/router/pns_dp_meander_placer.cpp +++ b/pcbnew/router/pns_dp_meander_placer.cpp @@ -413,6 +413,12 @@ const ITEM_SET DP_MEANDER_PLACER::Traces() } +const VECTOR2I& DP_MEANDER_PLACER::CurrentStart() const +{ + return m_currentStart; +} + + const VECTOR2I& DP_MEANDER_PLACER::CurrentEnd() const { return m_currentEnd; diff --git a/pcbnew/router/pns_dp_meander_placer.h b/pcbnew/router/pns_dp_meander_placer.h index d290140e93..13371c5114 100644 --- a/pcbnew/router/pns_dp_meander_placer.h +++ b/pcbnew/router/pns_dp_meander_placer.h @@ -91,6 +91,10 @@ public: const ITEM_SET Traces() override; + /// @copydoc PLACEMENT_ALGO::CurrentStart() + const VECTOR2I& CurrentStart() const override; + + /// @copydoc PLACEMENT_ALGO::CurrentEnd() const VECTOR2I& CurrentEnd() const override; /// @copydoc PLACEMENT_ALGO::CurrentNets() diff --git a/pcbnew/router/pns_line_placer.h b/pcbnew/router/pns_line_placer.h index 8562602180..aa49a3b2c9 100644 --- a/pcbnew/router/pns_line_placer.h +++ b/pcbnew/router/pns_line_placer.h @@ -148,6 +148,14 @@ public: */ const ITEM_SET Traces() override; + /** + * Return the current start of the line being placed. + */ + const VECTOR2I& CurrentStart() const override + { + return m_currentStart; + } + /** * Return the current end of the line being placed. It may not be equal to the cursor * position due to collisions. diff --git a/pcbnew/router/pns_meander_placer.cpp b/pcbnew/router/pns_meander_placer.cpp index 2d2079aaaa..f79cd6a7ab 100644 --- a/pcbnew/router/pns_meander_placer.cpp +++ b/pcbnew/router/pns_meander_placer.cpp @@ -252,6 +252,10 @@ const ITEM_SET MEANDER_PLACER::Traces() return ITEM_SET( &m_currentTrace ); } +const VECTOR2I& MEANDER_PLACER::CurrentStart() const +{ + return m_currentStart; +} const VECTOR2I& MEANDER_PLACER::CurrentEnd() const { diff --git a/pcbnew/router/pns_meander_placer.h b/pcbnew/router/pns_meander_placer.h index 7fd319e641..a05c88df32 100644 --- a/pcbnew/router/pns_meander_placer.h +++ b/pcbnew/router/pns_meander_placer.h @@ -73,6 +73,9 @@ public: /// @copydoc PLACEMENT_ALGO::Traces() const ITEM_SET Traces() override; + /// @copydoc PLACEMENT_ALGO::CurrentStart() + const VECTOR2I& CurrentStart() const override; + /// @copydoc PLACEMENT_ALGO::CurrentEnd() const VECTOR2I& CurrentEnd() const override; diff --git a/pcbnew/router/pns_placement_algo.h b/pcbnew/router/pns_placement_algo.h index 1e33ab0053..f1aafa30f3 100644 --- a/pcbnew/router/pns_placement_algo.h +++ b/pcbnew/router/pns_placement_algo.h @@ -123,6 +123,13 @@ public: */ virtual const ITEM_SET Traces() = 0; + /** + * Function CurrentStart() + * + * Returns the current start of the line(s) being placed/tuned. + */ + virtual const VECTOR2I& CurrentStart() const = 0; + /** * Function CurrentEnd() * @@ -191,8 +198,6 @@ public: virtual void GetModifiedNets( std::vector &aNets ) const { } - - }; }