Class: block | ./PlanarityTest.py | |||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The constructor takes an edge and a list of attachments and creates a block having the edge as the only segment in its left side. |flip| interchanges the two sides of a block. |head_of_Latt| and |head_of_Ratt| return the first elements on |Latt| and |Ratt| respectively and |Latt_empty| and |Ratt_empty| check these lists for emptyness. |left_interlace| checks whether the block interlaces with the left side of the topmost block of stack |S|. |right_interlace| does the same for the right side. |combine| combines the block with another block |Bprime| by simply concatenating all lists. |clean| removes the attachment |w| from the block |B| (it is guaranteed to be the first attachment of |B|). If the block becomes empty then it records the placement of all segments in the block in the array |alpha| and returns true. Otherwise it returns false. |add_to_Att| first makes sure that the right side has no attachment above |w0| (by flipping); when |add_to_Att| is called at least one side has no attachment above |w0|. |add_to_Att| then adds the lists |Ratt| and |Latt| to the output list |Att| and records the placement of all segments in the block in |alpha|.
|