コード例 #1
0
ファイル: Polygon.php プロジェクト: edewaele/yapafo
 function &del(Vertex &$v)
 {
     // $p <-> $v <-> $n				   Will delete $v and $ns
     //    $ps    $ns
     $p = $v->Prev();
     // Get ref to previous vertex
     $n = $v->Next();
     // Get ref to next vertex
     $p->setNext($n);
     // Link previous forward to next
     $n->setPrev($p);
     // Link next back to previous
     // Segments
     $ps = $p->Nseg();
     // Get ref to previous segment
     $ns = $v->Nseg();
     // Get ref to next segment
     $n->setPseg($ps);
     // Link next back to previous segment
     $ns = NULL;
     $v = NULL;
     // Free the memory
     $this->cnt--;
     // One less vertex
     return $n;
     // Return a ref to the next valid vertex
 }