Seabreeze : add fonction build_branch(Contact* ct) to help build a branch and pass all the 'unecessary' contacts
This commit is contained in:
parent
d593683394
commit
e9147299b0
|
@ -136,6 +136,29 @@ namespace Seabreeze {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Contact* Elmore::build_branch ( Contact* ct ) {
|
||||||
|
int count = 0;
|
||||||
|
checker.insert(ct);
|
||||||
|
for ( Component* cp : ct->getSlaveComponents() ) {
|
||||||
|
count += (dynamic_cast<Segment*>(cp)) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( count == 0 )
|
||||||
|
cerr << "Something is not right here : Contact " << ct << " is isolated ?" << endl;
|
||||||
|
else if ( count != 2 )
|
||||||
|
return ct;
|
||||||
|
|
||||||
|
for ( Component* cp : ct->getSlaveComponents() ) {
|
||||||
|
Segment* sm = dynamic_cast<Segment*>(cp);
|
||||||
|
if ( not sm ) continue;
|
||||||
|
Contact* cct = dynamic_cast<Contact*>(sm->getOppositeAnchor(ct));
|
||||||
|
if ( not cct || find(checker.begin(), checker.end(), cct) != checker.end() )
|
||||||
|
continue;
|
||||||
|
else
|
||||||
|
build_branch(cct);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Elmore::clearTree ()
|
void Elmore::clearTree ()
|
||||||
{
|
{
|
||||||
_tree->clear();
|
_tree->clear();
|
||||||
|
|
|
@ -35,6 +35,7 @@ namespace Seabreeze {
|
||||||
void contFromNet ( Net* net );
|
void contFromNet ( Net* net );
|
||||||
void buildTree ( RoutingPad* rp );
|
void buildTree ( RoutingPad* rp );
|
||||||
void build_from_node ( Node* source );
|
void build_from_node ( Node* source );
|
||||||
|
Contact* build_branch ( Contact* ct );
|
||||||
void clearTree ();
|
void clearTree ();
|
||||||
Tree* getTree ();
|
Tree* getTree ();
|
||||||
inline const set<Contact*>& get_conts () const;
|
inline const set<Contact*>& get_conts () const;
|
||||||
|
|
Loading…
Reference in New Issue