From 0fba4695b8e21a2128bb6e34d3288e3b4cb4162a Mon Sep 17 00:00:00 2001 From: EricLaoGitHub Date: Mon, 5 Feb 2018 15:41:42 +0100 Subject: [PATCH] Correction de la position des GContacts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit *BUG: Ajouts méthodes de correction de position de GContacts. --- anabatic/src/GCell.cpp | 34 ++++++++++++++++++++++++++-------- anabatic/src/anabatic/GCell.h | 1 + 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/anabatic/src/GCell.cpp b/anabatic/src/GCell.cpp index f67fbdcf..b8b8866c 100644 --- a/anabatic/src/GCell.cpp +++ b/anabatic/src/GCell.cpp @@ -933,24 +933,24 @@ namespace Anabatic { void GCell::setSouthWestCorner ( DbU::Unit x, DbU::Unit y ) { - DbU::Unit dx = x - _xmin; - DbU::Unit dy = y - _ymin; + //DbU::Unit dx = x - _xmin; + //DbU::Unit dy = y - _ymin; - for ( Contact* contact : _gcontacts ) { - Point position = contact->getPosition().translate( dx, dy ); + /*for ( Contact* contact : _gcontacts ) { + Point position = contact->getPosition().translate( dx, dy ); for ( Component* component : contact->getSlaveComponents() ) { Horizontal* horizontal = dynamic_cast( component ); if (horizontal) { - horizontal->setY( position.getY() ); + horizontal->setY( position.getY() ); } else { Vertical* vertical = dynamic_cast( component ); - vertical->setX( position.getX() ); + vertical->setX( position.getX() ); } } - if (not contact->getAnchor()) contact->setPosition( position ); - } + if (not contact->getAnchor()) contact->setPosition( Point(x,y) ); + }*/ _xmin = x; _ymin = y; @@ -959,6 +959,24 @@ namespace Anabatic { } + void GCell::updateGContacts () + { + for ( Contact* contact : _gcontacts ) { + + for ( Component* component : contact->getSlaveComponents() ) { + Horizontal* horizontal = dynamic_cast( component ); + if (horizontal) { + horizontal->setY( _ymin+getHeight()/2 ); + } else { + Vertical* vertical = dynamic_cast( component ); + vertical->setX( _xmin+getWidth()/2 ); + } + } + if (not contact->getAnchor()) contact->setPosition( Point( _xmin+getWidth()/2, _ymin+getHeight()/2 ) ); + } + } + + Contact* GCell::getGContact ( Net* net ) { for ( Contact* contact : _gcontacts ) { diff --git a/anabatic/src/anabatic/GCell.h b/anabatic/src/anabatic/GCell.h index f9eafb1e..236122d6 100644 --- a/anabatic/src/anabatic/GCell.h +++ b/anabatic/src/anabatic/GCell.h @@ -201,6 +201,7 @@ namespace Anabatic { Contact* breakGoThrough ( Net* net ); bool unrefContact ( Contact* ); void setSouthWestCorner ( DbU::Unit x, DbU::Unit y ); + void updateGContacts (); void cleanupGlobal (); inline DbU::Unit getWidth () const; inline DbU::Unit getHeight () const;