#include <math.h>
#include "polyDBG.h"
Go to the source code of this file.
|
static Real | area (Real A[2], Real B[2], Real C[2]) |
|
Int | DBG_isConvex (directedLine *poly) |
|
Int | DBG_is_U_monotone (directedLine *poly) |
|
Int | DBG_is_U_direction (directedLine *poly) |
|
Int | DBG_edgesIntersect (directedLine *l1, directedLine *l2) |
|
Int | DBG_edgesIntersectGen (Real A[2], Real B[2], Real C[2], Real D[2]) |
|
Int | DBG_intersectChain (vertexArray *chain, Int start, Int end, Real A[2], Real B[2]) |
|
Int | DBG_polygonSelfIntersect (directedLine *poly) |
|
Int | DBG_edgeIntersectPoly (directedLine *edge, directedLine *poly) |
|
Int | DBG_polygonsIntersect (directedLine *p1, directedLine *p2) |
|
Int | DBG_polygonListIntersect (directedLine *pList) |
|
Int | DBG_isCounterclockwise (directedLine *poly) |
|
Int | DBG_rayIntersectEdge (Real v0[2], Real dx, Real dy, Real v10[2], Real v1[2], Real v2[2]) |
|
Int | DBG_rayIntersectPoly (Real v0[2], Real dx, Real dy, directedLine *poly) |
|
Int | DBG_pointInsidePoly (Real v[2], directedLine *poly) |
|
Int | DBG_enclosingPolygons (directedLine *poly, directedLine *list) |
|
void | DBG_reverse (directedLine *poly) |
|
Int | DBG_checkConnectivity (directedLine *polygon) |
|
Int | DBG_check (directedLine *polyList) |
|
static directedLine * | DBG_edgeIntersectChainD (directedLine *e, directedLine *begin, directedLine *end) |
|
directedLine * | DBG_cutIntersectionPoly (directedLine *polygon, int &cutOccur) |
|
directedLine * | DBG_cutIntersectionAllPoly (directedLine *list) |
|
sampledLine * | DBG_collectSampledLinesAllPoly (directedLine *polygonList) |
|
void | DBG_collectSampledLinesPoly (directedLine *polygon, sampledLine *&retHead, sampledLine *&retTail) |
|
◆ area()
Definition at line 50 of file polyDBG.cc.
51{
57 return Bx*Cy - Cx*By;
58}
Referenced by _svcauth_des(), _svcauth_unix(), arcToMultDLines(), cdf_callback(), chainConcave(), chainConvex(), CheckOrientation(), DBG_edgesIntersect(), DBG_edgesIntersectGen(), DBG_isConvex(), DBG_rayIntersectEdge(), Subdivider::findIrregularS(), FT_Outline_Get_Orientation(), GdipCloneBitmapArea(), Patch::getstepsize(), gray_render_line(), gray_sweep(), Mesher::isCcw(), Mesher::isCw(), monoTriangulationRecGenOpt(), polygon_area(), reflexChain::processNewVertex(), render_clipped_polygon(), render_polygon(), scale_internal(), scale_internal_byte(), scale_internal_float(), scale_internal_int(), scale_internal_short(), scale_internal_ubyte(), scale_internal_uint(), scale_internal_ushort(), scaleInternalPackedPixel(), and test_SPI_SETWORKAREA().
◆ DBG_check()
Definition at line 482 of file polyDBG.cc.
483{
485 if(polyList ==
NULL)
return 0;
486
487
488
490 {
491 fprintf(
stderr,
"DBG_check: there are self intersections, don't know to modify the polygons\n");
492 return 1;
493 }
494
495
497 {
499 {
501 return 1;
502 }
503 }
504
505
507 {
508
509
511
513 correctDir = 1;
514 else
515 correctDir = 0;
516
518
519 if(correctDir != actualDir)
520 {
521 fprintf(
stderr,
"DBG_check: polygon with incorrect orientations. reversed\n");
522
524 }
525
526 }
527 return 0;
528}
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
void DBG_reverse(directedLine *poly)
Int DBG_checkConnectivity(directedLine *polygon)
Int DBG_enclosingPolygons(directedLine *poly, directedLine *list)
Int DBG_polygonListIntersect(directedLine *pList)
Int DBG_isCounterclockwise(directedLine *poly)
◆ DBG_checkConnectivity()
Definition at line 461 of file polyDBG.cc.
462{
463 if(polygon ==
NULL)
return 1;
467 return 0;
469 {
470 if(
temp->head()[0] !=
temp->getPrev()->tail()[0] ||
471 temp->head()[1] !=
temp->getPrev()->tail()[1])
472 return 0;
473 }
474 return 1;
475}
Referenced by DBG_check().
◆ DBG_collectSampledLinesAllPoly()
Definition at line 697 of file polyDBG.cc.
698{
704
705 if(polygonList ==
NULL)
707
709
713 {
716 cTail = tempTail;
717 }
718 return cHead;
719}
directedLine * getNextPolygon()
sampledLine * insert(sampledLine *nline)
void DBG_collectSampledLinesPoly(directedLine *polygon, sampledLine *&retHead, sampledLine *&retTail)
◆ DBG_collectSampledLinesPoly()
◆ DBG_cutIntersectionAllPoly()
Definition at line 679 of file polyDBG.cc.
680{
684 int cutOccur=0;
686 {
688 tempNext =
temp->getNextPolygon();
689
693 }
695}
directedLine * DBG_cutIntersectionPoly(directedLine *polygon, int &cutOccur)
◆ DBG_cutIntersectionPoly()
Definition at line 549 of file polyDBG.cc.
550{
554 cutOccur = 0;
556 {
559 {
562 {
563
569
571 {
579 break;
580 }
582 {
584
587 }
588 else
589 {
591 }
592 }
594 {
595 cutOccur = 1;
597
599 {
601 {
605 }
606 }
607 }
608 else
609 {
611 }
612 }
613 else
614 {
616 }
617 }
619}
ios_base &_STLP_CALL fixed(ios_base &__s)
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Int DBG_edgesIntersect(directedLine *l1, directedLine *l2)
Int DBG_polygonSelfIntersect(directedLine *poly)
static directedLine * DBG_edgeIntersectChainD(directedLine *e, directedLine *begin, directedLine *end)
static unsigned __int64 next
Referenced by directedLine::cutIntersectionAllPoly(), and DBG_cutIntersectionAllPoly().
◆ DBG_edgeIntersectChainD()
◆ DBG_edgeIntersectPoly()
◆ DBG_edgesIntersect()
◆ DBG_edgesIntersectGen()
Definition at line 198 of file polyDBG.cc.
199{
200 if(
201 (
203 )
204 &&
205 (
207 )
208 )
209 return 1;
210 else
211 return 0;
212}
Referenced by DBG_intersectChain().
◆ DBG_enclosingPolygons()
Definition at line 412 of file polyDBG.cc.
413{
416
417
418
419
420
421
422
423
424
426 {
430
431 }
433}
GLuint GLuint GLsizei count
Int DBG_pointInsidePoly(Real v[2], directedLine *poly)
Referenced by DBG_check().
◆ DBG_intersectChain()
◆ DBG_is_U_direction()
Definition at line 98 of file polyDBG.cc.
99{
100
101
102
103
109 else
111
112
113
114
116 {
118 V_count +=
temp->get_npoints();
119 else
120 U_count +=
temp->get_npoints();
121
122
123
124
125
126
127 }
128
129 if(U_count > V_count) return 1;
130 else return 0;
131}
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
Referenced by sampleMonoPoly(), and triangulateConvexPoly().
◆ DBG_is_U_monotone()
Definition at line 73 of file polyDBG.cc.
74{
80
82 != cur_sign);
83
85 {
86 prev_sign = cur_sign;
88
89 if(cur_sign != prev_sign)
90 n_changes++;
91 }
92
93 if(n_changes ==2) return 1;
94 else return 0;
95}
Int compV2InX(Real A[2], Real B[2])
◆ DBG_isConvex()
◆ DBG_isCounterclockwise()
◆ DBG_pointInsidePoly()
Definition at line 392 of file polyDBG.cc.
393{
394
395
396
397
398
399
402 );
404 return 1;
405 else
406 return 0;
407}
Int DBG_rayIntersectPoly(Real v0[2], Real dx, Real dy, directedLine *poly)
Referenced by DBG_enclosingPolygons().
◆ DBG_polygonListIntersect()
Definition at line 284 of file polyDBG.cc.
285{
289 return 1;
292 {
295 return 1;
296 }
297
298 return 0;
299}
Int DBG_polygonsIntersect(directedLine *p1, directedLine *p2)
Referenced by DBG_check().
◆ DBG_polygonSelfIntersect()
◆ DBG_polygonsIntersect()
Definition at line 270 of file polyDBG.cc.
271{
274 return 1;
277 return 1;
278 return 0;
279}
Int DBG_edgeIntersectPoly(directedLine *edge, directedLine *poly)
Referenced by DBG_polygonListIntersect().
◆ DBG_rayIntersectEdge()
Definition at line 321 of file polyDBG.cc.
322{
323
324
325
326
327
328
329
333
334
335
336 if(denom == 0.0)
337 return 0;
338
339
340 if(nomRay == 0.0)
341 return 0;
342
343
344
345
346 if(nomEdge == 0)
347 {
348
349
350
351
352
354 {
356 return 0;
357 else
358 return 1;
359 }
360 else
361 return 0;
362 }
363
364
365 if(nomEdge == denom) {
366
367 return 0;
368 }
369
370
371 if(denom*nomRay>0 && denom*nomEdge>0 && nomEdge/denom <=1.0)
372 return 1;
373 return 0;
374}
GLfloat GLfloat GLfloat v2
Referenced by DBG_rayIntersectPoly().
◆ DBG_rayIntersectPoly()
Definition at line 378 of file polyDBG.cc.
379{
384
388
390}
Int DBG_rayIntersectEdge(Real v0[2], Real dx, Real dy, Real v10[2], Real v1[2], Real v2[2])
Referenced by DBG_pointInsidePoly().
◆ DBG_reverse()
Definition at line 435 of file polyDBG.cc.
436{
439 else
441
445
448 {
451 else
453
454 oldNext =
temp->getNext();
456 temp->putPrev(oldNext);
457 }
459}
void putDirection(short dir)
void putPrev(directedLine *p)
void putNext(directedLine *p)
Referenced by DBG_check().