Skip to content

Commit e6ca9dd

Browse files
committed
gui: add bpin selection
Signed-off-by: Peter Gadfort <[email protected]>
1 parent d743d3e commit e6ca9dd

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

src/gui/src/displayControls.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ DisplayControls::DisplayControls(QWidget* parent)
462462
"Vias",
463463
shape_types_srouting,
464464
Qt::Checked);
465-
makeLeafItem(shape_types_.pins, "Pins", shape_types, Qt::Checked);
465+
makeLeafItem(shape_types_.pins, "Pins", shape_types, Qt::Checked, true);
466466
makeLeafItem(shape_types_.pin_names, "Pin Names", shape_types, Qt::Checked);
467467
shape_types_.pins.visible->setData(
468468
QVariant::fromValue(&shape_types_.pin_names), kDisableRowItemIdx);
@@ -1884,6 +1884,11 @@ bool DisplayControls::areIOPinsVisible() const
18841884
return isModelRowVisible(&shape_types_.pins);
18851885
}
18861886

1887+
bool DisplayControls::areIOPinsSelectable() const
1888+
{
1889+
return isModelRowSelectable(&shape_types_.pins);
1890+
}
1891+
18871892
bool DisplayControls::areIOPinNamesVisible() const
18881893
{
18891894
return isModelRowVisible(&shape_types_.pin_names);

src/gui/src/displayControls.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ class DisplayControls : public QDockWidget,
218218
bool areNonPrefTracksVisible() override;
219219

220220
bool areIOPinsVisible() const override;
221+
bool areIOPinsSelectable() const override;
221222
bool areIOPinNamesVisible() const override;
222223
QFont ioPinMarkersFont() const override;
223224

src/gui/src/layoutViewer.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,24 @@ void LayoutViewer::selectAt(odb::Rect region, std::vector<Selected>& selections)
984984
}
985985
}
986986
}
987+
988+
// Look for BPins
989+
if (options_->areIOPinsVisible() && options_->areIOPinsSelectable()) {
990+
for (auto* layer : block->getTech()->getLayers()) {
991+
if (!options_->isVisible(layer)) {
992+
continue;
993+
}
994+
for (const auto& [box, bpin] : search_.searchBPins(block,
995+
layer,
996+
region.xMin(),
997+
region.yMin(),
998+
region.xMax(),
999+
region.yMax(),
1000+
shape_limit)) {
1001+
selections.push_back(gui_->makeSelected(bpin));
1002+
}
1003+
}
1004+
}
9871005
}
9881006

9891007
if (options_->areRulersVisible() && options_->areRulersSelectable()) {

src/gui/src/options.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class Options
5656
virtual bool areNonPrefTracksVisible() = 0;
5757

5858
virtual bool areIOPinsVisible() const = 0;
59+
virtual bool areIOPinsSelectable() const = 0;
5960
virtual bool areIOPinNamesVisible() const = 0;
6061
virtual QFont ioPinMarkersFont() const = 0;
6162

0 commit comments

Comments
 (0)