To perform modifications, the \fBKatabatic\fP data structure uses a session mechanism built on top of the \fBHurricane::UpdateSession\fP one\&. Sessions obeys very simples rules:
.IP"\(bu"2
Only one \fBSession\fP can be opened at a time with \fBSession::open()\fP\&.
.IP"\(bu"2
Subsequent calls to \fBSession::open()\fP returns the currently opened session until \fBSession::close()\fP is called\&.
.IP"\(bu"2
Revalidation can take place whithout closing the \fBSession\fP by calling \fBSession::revalidate()\fP\&.
.PP
.PP
The task of a \fBSession\fP is to keep track of the \fBAutoContact\fP and \fBAutoSegment\fP that have been modificateds (i\&.e\&. invalidated) and, to restore connexity and/or topology when closed\&.
.PP
Two kinds of revalidation could be performed:
.PD0
.IP"\(bu"2
\fBGeometrical\fP : only positions of AutoContacts and AutoSegments extensions are recomputed\&.
.IP"\(bu"2
\fBTopological\fP : a whole net have been invalidated because of a dogleg creation or a move up/move down of a segment\&.
.PD0
.IP" \(bu"4
\fBDogleg\fP : needs to insert the newly created AutoSegments and AutoContacts\&.
.IP" \(bu"4
\fBMove up/Move down\fP : may needs to create additional dogleg to restore connexity (gaps), and then insert them like above\&.
.PP
After a topological mofication has been done, the net needs to be re-canonized then the geometrical step takes place\&.
.PP
.PP
The kind of revalidation needed is automatically detected by the \fBSession\fP\&.
.PP
In addition to it's main purpose, \fBSession\fP also provides cached access to frequently needed variables either from Hurricane or \fBKatabatic\fP Configuration and access to the \fBAutoContact\fP & \fBAutoSegment\fP LUTs of \fBKatabaticEngine\fP\&.
.PP
From a software point of view, \fBSession\fP is a singleton object\&.
.SH"Session Algorithm"
.PP
Main attributes of a \fBSession\fP:
.IP"\(bu"2
\fC_netInvalidateds\fP, nets on which topology has changed\&.
.IP"\(bu"2
\fC_autoSegments\fP, that have been moved or createds\&.
.IP"\(bu"2
\fC_autoContacts\fP, that have been created or one of their slave segment has moved\&.
.IP"\(bu"2
\fC_revalidateds\fP, the list of AutoSegments that have just been revalidated (after calling \fC\fBrevalidate()\fP\fP)\&.
.PP
.PP
Schematic description of how a \fBSession\fP works:
.PP
.PD0
.IP"\(bu"2
If at least one net has been invalidated, meaning that it's topology has changed, perform \fC_revalidateTopology()\fP\&.
.PD0
.IP" \(bu"4
Update net topology: correct the topology of each contacts, making dogleg when needed\&. The \fBAutoContact\fP segment caching is updated at this point\&.
.IP" \(bu"4
Compute net constraints (on AutoContacts & AutoSegments)\&.
.IP" \(bu"4
Compute net optimal positions (on AutoSegments)\&.
.IP" \(bu"4
Compute the state of the segments regarding to terminals\&.
.IP" \(bu"4
Canonize sets of aligneds segments\&. The canonical segment is the one with the lowest \fCid\fP\&.
.IP" \(bu"4
If the segments has just been created, put it on its optimal axis\&.
.PP
This stage can add itself more invalidated AutoSegments and AutoContacts as it create doglegs\&.
.PP
.IP"\(bu"2
Revalidate geometry of AutoContacts\&. That is, expand or shrink the extremities of the invalidated AutoSegments\&. Note that AutoSegments are already at on their final axis position\&.
.PP
.IP"\(bu"2
Revalidate AutoSegments\&. Just before this stage, they are on the correct axis and their extensions are also correct, so we may update the caching of their characteristics (mostly the extension)\&.
Referenced by AutoSegment::create(), GCellTopology::doRp_AccessPad(), GCellTopology::doRp_AutoContacts(), AutoSegment::makeDogleg(), and Session::open()\&.
Referenced by AutoHorizontal::checkPositions(), AutoVertical::checkPositions(), AutoHorizontal::updatePositions(), and AutoVertical::updatePositions()\&.
References Session::getRoutingGauge(), and RoutingGauge::getRoutingLayer()\&.
.PP
Referenced by GCellTopology::_do_xG_1M1_1M2(), GCellTopology::_do_xG_xM1_xM3(), AutoSegment::create(), GCellTopology::doRp_AccessPad(), AutoSegment::reduceDoglegLayer(), and GCell::rpDesaturate()\&.
\fBReturns:\fP The vector of AutoSegments part of a newly created dogleg\&. The dogleg creation functions in \fBAutoHorizontal\fP and \fBAutoVertical\fP put a triplet (for example in horizontal direction \fC\fP(h1,v1,h2) ) for each dogleg composed of:
.IP"\(bu"2
\fBh1\fP the segment \fIbefore\fP the dogleg (which is also the original one)\&.
Lookup the \fBAutoContact\fP associated with \fCcontact\fP\&. \fCNULL\fP if not found\&.
.PP
Referenced by AutoSegment::AutoSegment(), GCell::checkEdgeSaturation(), AutoSegment::create(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoSegment::getOppositeAnchor(), and AutoSegment::getPerpandicularsBound()\&.