Lines Matching refs:poly

60 Int DBG_isConvex(directedLine *poly)
63 if(area(poly->head(), poly->tail(), poly->getNext()->tail()) < 0.00000)
65 for(temp = poly->getNext(); temp != poly; temp = temp->getNext())
73 Int DBG_is_U_monotone(directedLine* poly)
79 cur_sign = compV2InX(poly->tail(), poly->head());
81 n_changes = (compV2InX(poly->getPrev()->tail(), poly->getPrev()->head())
84 for(temp = poly->getNext(); temp != poly; temp = temp->getNext())
98 Int DBG_is_U_direction(directedLine* poly)
101 if(! DBG_is_U_monotone(poly))
107 if( fabs(poly->head()[0] - poly->tail()[0]) <= fabs(poly->head()[1]-poly->tail()[1]))
108 V_count += poly->get_npoints();
110 U_count += poly->get_npoints();
112 else if(poly->head()[1] == poly->tail()[1])
113 U_count += poly->get_npoints();
115 for(temp = poly->getNext(); temp != poly; temp = temp->getNext())
230 Int DBG_polygonSelfIntersect(directedLine* poly)
234 temp1=poly;
244 for(temp1=poly->getNext(); temp1 != poly; temp1 = temp1->getNext())
257 Int DBG_edgeIntersectPoly(directedLine* edge, directedLine* poly)
260 if(DBG_edgesIntersect(edge, poly))
262 for(temp=poly->getNext(); temp != poly; temp=temp->getNext())
302 Int DBG_isCounterclockwise(directedLine* poly)
304 return (poly->polyArea() > 0);
378 Int DBG_rayIntersectPoly(Real v0[2], Real dx, Real dy, directedLine* poly)
382 if(DBG_rayIntersectEdge(v0, dx, dy, poly->getPrev()->head(), poly->head(), poly->tail()))
385 for(temp=poly->getNext(); temp != poly; temp = temp->getNext())
388 /*printf("ray intersect poly: count=%i\n", count);*/
392 Int DBG_pointInsidePoly(Real v[2], directedLine* poly)
397 poly->printList();
400 assert( (DBG_rayIntersectPoly(v,1,0,poly) % 2 )
401 == (DBG_rayIntersectPoly(v,1,Real(0.1234), poly) % 2 )
403 if(DBG_rayIntersectPoly(v, 1, 0, poly) % 2 == 1)
412 Int DBG_enclosingPolygons(directedLine* poly, directedLine* list)
417 printf("%i\n", DBG_pointInsidePoly(poly->head(),
427 if(poly != temp)
428 if(DBG_pointInsidePoly(poly->head(), temp))
435 void DBG_reverse(directedLine* poly)
437 if(poly->getDirection() == INCREASING)
438 poly->putDirection(DECREASING);
440 poly->putDirection(INCREASING);
442 directedLine* oldNext = poly->getNext();
443 poly->putNext(poly->getPrev());
444 poly->putPrev(oldNext);
447 for(temp=oldNext; temp!=poly; temp = oldNext)