MCPcopy Create free account
hub / github.com/BIMCoderLiang/LNLib / PQinsert

Method PQinsert

src/LNLib/Algorithm/Voronoi.cpp:565–582  ·  view source on GitHub ↗

push the HalfEdge into the ordered linked list of vertices

Source from the content-addressed store, hash-verified

563
564//push the HalfEdge into the ordered linked list of vertices
565void LNLib::VoronoiDiagramGenerator::PQinsert(struct Halfedge* he, struct Site* v, float offset)
566{
567 struct Halfedge* last, * next;
568
569 he->vertex = v;
570 ref(v);
571 he->ystar = (float)(v->coord.y + offset);
572 last = &PQhash[PQbucket(he)];
573 while ((next = last->PQnext) != (struct Halfedge*)NULL &&
574 (he->ystar > next->ystar ||
575 (he->ystar == next->ystar && v->coord.x > next->vertex->coord.x)))
576 {
577 last = next;
578 };
579 he->PQnext = last->PQnext;
580 last->PQnext = he;
581 PQcount += 1;
582}
583
584//remove the HalfEdge from the list of vertices
585void LNLib::VoronoiDiagramGenerator::PQdelete(struct Halfedge* he)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected