aboutsummaryrefslogtreecommitdiffstats
path: root/gui/fpgaviewwidget.cc
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2019-12-20 15:25:10 +0100
committerMiodrag Milanovic <mmicko@gmail.com>2019-12-20 15:25:10 +0100
commitd399346de0f258a4871ce6e5162481586175f76d (patch)
tree3265f14b3ee0a397091347799635a42188474b16 /gui/fpgaviewwidget.cc
parenta05954249a46f87a218aad7db6db28f2a02444ec (diff)
downloadnextpnr-d399346de0f258a4871ce6e5162481586175f76d.tar.gz
nextpnr-d399346de0f258a4871ce6e5162481586175f76d.tar.bz2
nextpnr-d399346de0f258a4871ce6e5162481586175f76d.zip
Add options to enable/disable displayed elements
Diffstat (limited to 'gui/fpgaviewwidget.cc')
-rw-r--r--gui/fpgaviewwidget.cc61
1 files changed, 45 insertions, 16 deletions
diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc
index f2929d6e..2e1bbf63 100644
--- a/gui/fpgaviewwidget.cc
+++ b/gui/fpgaviewwidget.cc
@@ -66,6 +66,11 @@ FPGAViewWidget::FPGAViewWidget(QWidget *parent)
renderRunner_->start();
renderRunner_->startTimer(1000 / 2); // render lines 2 times per second
setMouseTracking(true);
+
+ displayBel_ = false;
+ displayWire_ = false;
+ displayPip_ = false;
+ displayGroup_ = false;
}
FPGAViewWidget::~FPGAViewWidget() {}
@@ -333,6 +338,14 @@ void FPGAViewWidget::paintGL()
void FPGAViewWidget::pokeRenderer(void) { renderRunner_->poke(); }
+void FPGAViewWidget::enableDisableDecals(bool bels, bool wires, bool pips, bool groups)
+{
+ displayBel_ = bels;
+ displayWire_ = wires;
+ displayPip_ = pips;
+ displayGroup_ = groups;
+}
+
void FPGAViewWidget::renderLines(void)
{
if (ctx_ == nullptr)
@@ -379,17 +392,25 @@ void FPGAViewWidget::renderLines(void)
// Local copy of decals, taken as fast as possible to not block the P&R.
if (decalsChanged) {
- for (auto bel : ctx_->getBels()) {
- belDecals.push_back({ctx_->getBelDecal(bel), bel});
+ if (displayBel_) {
+ for (auto bel : ctx_->getBels()) {
+ belDecals.push_back({ctx_->getBelDecal(bel), bel});
+ }
}
- for (auto wire : ctx_->getWires()) {
- wireDecals.push_back({ctx_->getWireDecal(wire), wire});
+ if (displayWire_) {
+ for (auto wire : ctx_->getWires()) {
+ wireDecals.push_back({ctx_->getWireDecal(wire), wire});
+ }
}
- for (auto pip : ctx_->getPips()) {
- pipDecals.push_back({ctx_->getPipDecal(pip), pip});
+ if (displayPip_) {
+ for (auto pip : ctx_->getPips()) {
+ pipDecals.push_back({ctx_->getPipDecal(pip), pip});
+ }
}
- for (auto group : ctx_->getGroups()) {
- groupDecals.push_back({ctx_->getGroupDecal(group), group});
+ if (displayGroup_) {
+ for (auto group : ctx_->getGroups()) {
+ groupDecals.push_back({ctx_->getGroupDecal(group), group});
+ }
}
}
}
@@ -430,20 +451,28 @@ void FPGAViewWidget::renderLines(void)
data->bbGlobal.clear();
// Draw Bels.
- for (auto const &decal : belDecals) {
- renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ if (displayBel_) {
+ for (auto const &decal : belDecals) {
+ renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ }
}
// Draw Wires.
- for (auto const &decal : wireDecals) {
- renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ if (displayWire_) {
+ for (auto const &decal : wireDecals) {
+ renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ }
}
// Draw Pips.
- for (auto const &decal : pipDecals) {
- renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ if (displayPip_) {
+ for (auto const &decal : pipDecals) {
+ renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ }
}
// Draw Groups.
- for (auto const &decal : groupDecals) {
- renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ if (displayGroup_) {
+ for (auto const &decal : groupDecals) {
+ renderArchDecal(data->gfxByStyle, data->bbGlobal, decal.first);
+ }
}
// Bounding box should be calculated by now.