Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
GrTriangulator::Poly Struct Reference

#include <GrTriangulator.h>

Public Member Functions

 Poly (Vertex *v, int winding)
 
PolyaddEdge (Edge *e, Side side, GrTriangulator *)
 
VertexlastVertex () const
 

Public Attributes

VertexfFirstVertex
 
int fWinding
 
MonotonePolyfHead
 
MonotonePolyfTail
 
PolyfNext
 
PolyfPartner
 
int fCount
 

Detailed Description

Definition at line 504 of file GrTriangulator.h.

Constructor & Destructor Documentation

◆ Poly()

GrTriangulator::Poly::Poly ( Vertex v,
int  winding 
)

Definition at line 396 of file GrTriangulator.cpp.

397 : fFirstVertex(v)
398 , fWinding(winding)
399 , fHead(nullptr)
400 , fTail(nullptr)
401 , fNext(nullptr)
402 , fPartner(nullptr)
403 , fCount(0)
404{
405#if TRIANGULATOR_LOGGING
406 static int gID = 0;
407 fID = gID++;
408 TESS_LOG("*** created Poly %d\n", fID);
409#endif
410}
#define TESS_LOG(...)
MonotonePoly * fTail
MonotonePoly * fHead

Member Function Documentation

◆ addEdge()

Poly * GrTriangulator::Poly::addEdge ( Edge e,
Side  side,
GrTriangulator tri 
)

Definition at line 412 of file GrTriangulator.cpp.

412 {
413 TESS_LOG("addEdge (%g -> %g) to poly %d, %s side\n",
414 e->fTop->fID, e->fBottom->fID, fID, side == kLeft_Side ? "left" : "right");
415 Poly* partner = fPartner;
416 Poly* poly = this;
417 if (side == kRight_Side) {
418 if (e->fUsedInRightPoly) {
419 return this;
420 }
421 } else {
422 if (e->fUsedInLeftPoly) {
423 return this;
424 }
425 }
426 if (partner) {
427 fPartner = partner->fPartner = nullptr;
428 }
429 if (!fTail) {
431 fCount += 2;
432 } else if (e->fBottom == fTail->fLastEdge->fBottom) {
433 return poly;
434 } else if (side == fTail->fSide) {
435 fTail->addEdge(e);
436 fCount++;
437 } else {
438 e = tri->allocateEdge(fTail->fLastEdge->fBottom, e->fBottom, 1, EdgeType::kInner);
439 fTail->addEdge(e);
440 fCount++;
441 if (partner) {
442 partner->addEdge(e, side, tri);
443 poly = partner;
444 } else {
446 m->fPrev = fTail;
447 fTail->fNext = m;
448 fTail = m;
449 }
450 }
451 return poly;
452}
static int side(double x)
Edge * allocateEdge(Vertex *top, Vertex *bottom, int winding, EdgeType type)
MonotonePoly * allocateMonotonePoly(Edge *edge, Side side, int winding)
Poly * addEdge(Edge *e, Side side, GrTriangulator *)

◆ lastVertex()

Vertex * GrTriangulator::Poly::lastVertex ( ) const
inline

Definition at line 508 of file GrTriangulator.h.

508{ return fTail ? fTail->fLastEdge->fBottom : fFirstVertex; }

Member Data Documentation

◆ fCount

int GrTriangulator::Poly::fCount

Definition at line 515 of file GrTriangulator.h.

◆ fFirstVertex

Vertex* GrTriangulator::Poly::fFirstVertex

Definition at line 509 of file GrTriangulator.h.

◆ fHead

MonotonePoly* GrTriangulator::Poly::fHead

Definition at line 511 of file GrTriangulator.h.

◆ fNext

Poly* GrTriangulator::Poly::fNext

Definition at line 513 of file GrTriangulator.h.

◆ fPartner

Poly* GrTriangulator::Poly::fPartner

Definition at line 514 of file GrTriangulator.h.

◆ fTail

MonotonePoly* GrTriangulator::Poly::fTail

Definition at line 512 of file GrTriangulator.h.

◆ fWinding

int GrTriangulator::Poly::fWinding

Definition at line 510 of file GrTriangulator.h.


The documentation for this struct was generated from the following files: