Problem of merging for GCell::updateGContacts(), again.

This commit is contained in:
Jean-Paul Chaput 2018-02-21 17:33:01 +01:00
parent 97d5a1f583
commit b664eee731
2 changed files with 27 additions and 8 deletions

View File

@ -941,24 +941,24 @@ namespace Anabatic {
void GCell::setSouthWestCorner ( DbU::Unit x, DbU::Unit y ) void GCell::setSouthWestCorner ( DbU::Unit x, DbU::Unit y )
{ {
DbU::Unit dx = x - _xmin; //DbU::Unit dx = x - _xmin;
DbU::Unit dy = y - _ymin; //DbU::Unit dy = y - _ymin;
for ( Contact* contact : _gcontacts ) { /*for ( Contact* contact : _gcontacts ) {
Point position = contact->getPosition().translate( dx, dy ); Point position = contact->getPosition().translate( dx, dy );
for ( Component* component : contact->getSlaveComponents() ) { for ( Component* component : contact->getSlaveComponents() ) {
Horizontal* horizontal = dynamic_cast<Horizontal*>( component ); Horizontal* horizontal = dynamic_cast<Horizontal*>( component );
if (horizontal) { if (horizontal) {
horizontal->setY( position.getY() ); horizontal->setY( position.getY() );
} else { } else {
Vertical* vertical = dynamic_cast<Vertical*>( component ); Vertical* vertical = dynamic_cast<Vertical*>( 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; _xmin = x;
_ymin = y; _ymin = y;
@ -967,6 +967,24 @@ namespace Anabatic {
} }
void GCell::updateGContacts ()
{
for ( Contact* contact : _gcontacts ) {
for ( Component* component : contact->getSlaveComponents() ) {
Horizontal* horizontal = dynamic_cast<Horizontal*>( component );
if (horizontal) {
horizontal->setY( _ymin+getHeight()/2 );
} else {
Vertical* vertical = dynamic_cast<Vertical*>( component );
vertical->setX( _xmin+getWidth()/2 );
}
}
if (not contact->getAnchor()) contact->setPosition( Point( _xmin+getWidth()/2, _ymin+getHeight()/2 ) );
}
}
Contact* GCell::getGContact ( Net* net ) Contact* GCell::getGContact ( Net* net )
{ {
for ( Contact* contact : _gcontacts ) { for ( Contact* contact : _gcontacts ) {

View File

@ -246,6 +246,7 @@ namespace Anabatic {
void removeVSegment ( AutoSegment* ); void removeVSegment ( AutoSegment* );
void removeHSegment ( AutoSegment* ); void removeHSegment ( AutoSegment* );
void removeContact ( AutoContact* ); void removeContact ( AutoContact* );
void updateGContacts ();
void updateContacts (); void updateContacts ();
size_t updateDensity (); size_t updateDensity ();
inline void updateKey ( size_t depth ); inline void updateKey ( size_t depth );