From c7b2c1737054159d84c214440bb6149ac0376042 Mon Sep 17 00:00:00 2001 From: The Coriolis Project Date: Mon, 7 Jan 2008 16:34:48 +0000 Subject: [PATCH] adding contacts --- hurricane/src/viewer/CellWidget.cpp | 9 ++++++++- hurricane/src/viewer/CellWidget.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hurricane/src/viewer/CellWidget.cpp b/hurricane/src/viewer/CellWidget.cpp index afe4874d..4cc0cf02 100644 --- a/hurricane/src/viewer/CellWidget.cpp +++ b/hurricane/src/viewer/CellWidget.cpp @@ -173,14 +173,21 @@ void CellWidget::drawGo(const Go* go, const BasicLayer* basicLayer, const Box& u const Segment* segment = dynamic_cast(go); if (segment) { drawSegment(segment, basicLayer, updateArea, transformation); + return; + } + const Contact* contact = dynamic_cast(go); + if (contact) { + drawContact(contact, basicLayer, updateArea, transformation); } } - void CellWidget::drawSegment(const Segment* segment, const BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation) const { drawRectangle(transformation.getBox(segment->GetBoundingBox(basicLayer))); } +void CellWidget::drawContact(const Contact* contact, const BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation) const { + drawRectangle(transformation.getBox(contact->GetBoundingBox(basicLayer))); +} void CellWidget::drawPhantoms(const Cell* cell, const H::Box& updateArea, const Transformation& transformation) const { for_each_instance(instance, cell->GetInstancesUnder(updateArea)) { diff --git a/hurricane/src/viewer/CellWidget.h b/hurricane/src/viewer/CellWidget.h index 3708a173..156e4f9a 100644 --- a/hurricane/src/viewer/CellWidget.h +++ b/hurricane/src/viewer/CellWidget.h @@ -40,6 +40,7 @@ class CellWidget : public QWidget { void drawBoundaries(const Instance* instance, const Box& updateArea, const Transformation& transformation) const; void drawGo(const Go* go, const BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation) const; void drawSegment(const Segment* segment, const BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation) const; + void drawContact(const Contact* contact, const BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation) const; void drawRectangle(const Box& box) const; Unit getX(int screenX) const; Unit getY(int screenY) const;