ReactOS 0.4.15-dev-7918-g2a2556c
partitionX.h File Reference
#include "directedLine.h"
Include dependency graph for partitionX.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

Int isCuspX (directedLine *v)
 
Int isReflexX (directedLine *v)
 
Int cuspTypeX (directedLine *v)
 
void findInteriorCuspsX (directedLine *polygon, Int &ret_n_interior_cusps, directedLine **ret_interior_cusps)
 
Int numInteriorCuspsX (directedLine *polygon)
 
directedLinefindDiagonal_singleCuspX (directedLine *cusp)
 

Function Documentation

◆ cuspTypeX()

Int cuspTypeX ( directedLine v)

Definition at line 89 of file partitionX.cc.

90{
91 if(! isCuspX(v)) return 0;
92 else
93 {
94//printf("isCusp,%f,%f\n", v->head()[0], v->head()[1]);
95 if(isReflexX(v))
96 {
97// printf("isReflex\n");
98 return 1;
99 }
100 else
101 {
102// printf("not isReflex\n");
103 return 2;
104 }
105 }
106}
const GLdouble * v
Definition: gl.h:2040
Int isCuspX(directedLine *v)
Definition: partitionX.cc:47
Int isReflexX(directedLine *v)
Definition: partitionX.cc:67

Referenced by findInteriorCuspsX(), and numInteriorCuspsX().

◆ findDiagonal_singleCuspX()

directedLine * findDiagonal_singleCuspX ( directedLine cusp)

Definition at line 137 of file partitionX.cc.

138{
140 Int is_minimal = ((compV2InX(cusp->head(), cusp->tail()) == -1)? 1:0);
141
142 if(is_minimal)
143 for(temp = cusp->getNext(); temp != cusp; temp = temp->getNext())
144 {
145 if(compV2InX(cusp->head(), temp->head()) == 1)
146 {
147 return temp;
148 }
149 }
150 else //is maxmal
151 for(temp = cusp->getNext(); temp != cusp; temp = temp->getNext())
152 {
153 if(compV2InX(cusp->head(), temp->head()) == -1)
154 {
155 return temp;
156 }
157 }
158 return NULL;
159}
directedLine * getNext()
Definition: directedLine.h:74
Real * head()
Real * tail()
int Int
Definition: definitions.h:37
Int compV2InX(Real A[2], Real B[2])
#define NULL
Definition: types.h:112
static calc_node_t temp
Definition: rpn_ieee.c:38

Referenced by monoTriangulationOpt(), monoTriangulationRecGenOpt(), and sampleMonoPoly().

◆ findInteriorCuspsX()

void findInteriorCuspsX ( directedLine polygon,
Int ret_n_interior_cusps,
directedLine **  ret_interior_cusps 
)

Definition at line 121 of file partitionX.cc.

123{
125 ret_n_interior_cusps = 0;
126 if(cuspTypeX(polygon) == 1)
127 {
128 ret_interior_cusps[ret_n_interior_cusps++] = polygon;
129 }
130 for(temp = polygon->getNext(); temp != polygon; temp = temp->getNext())
131 if(cuspTypeX(temp) == 1)
132 {
133 ret_interior_cusps[ret_n_interior_cusps++] = temp;
134 }
135}
Int cuspTypeX(directedLine *v)
Definition: partitionX.cc:89

Referenced by monoTriangulationOpt(), monoTriangulationRecGenOpt(), and sampleMonoPoly().

◆ isCuspX()

Int isCuspX ( directedLine v)

Definition at line 47 of file partitionX.cc.

48{
49 //if v->prev <= v && v->next <= v
50 //|| v->prev >= v && v->next >= v
51 Real* T = v->head();
52 Real* P = v->getPrev()->head();
53 Real* N = v->getNext()->head();
54 if(
55 (compV2InX(T,P) != -1 &&
56 compV2InX(T,N) != -1
57 ) ||
58 (compV2InX(T,P) != 1 &&
59 compV2InX(T,N) != 1
60 )
61 )
62 return 1;
63 else
64 return 0;
65}
#define N
Definition: crc32.c:57
float Real
Definition: definitions.h:36
#define P(row, col)
#define T
Definition: mbstring.h:31

Referenced by cuspTypeX().

◆ isReflexX()

Int isReflexX ( directedLine v)

Definition at line 67 of file partitionX.cc.

68{
69 Real* A = v->getPrev()->head();
70 Real* B = v->head();
71 Real* C = v->tail();
72 Real Bx,By, Cx, Cy;
73 //scale them in case they are too small
74 Bx = 10*(B[0] - A[0]);
75 By = 10*(B[1] - A[1]);
76 Cx = 10*(C[0] - A[0]);
77 Cy = 10*(C[1] - A[1]);
78
79 if(Bx*Cy - Cx*By < -CONCAVITY_ZERO) return 1;
80 else return 0;
81}
Definition: ehthrow.cxx:93
Definition: ehthrow.cxx:54
Definition: terminate.cpp:24
#define CONCAVITY_ZERO
Definition: partitionX.cc:43

Referenced by cuspTypeX().

◆ numInteriorCuspsX()

Int numInteriorCuspsX ( directedLine polygon)

Definition at line 108 of file partitionX.cc.

109{
111 int ret = 0;
112 if(cuspTypeX(polygon) == 1)
113 ret++;
114 for(temp = polygon->getNext(); temp != polygon; temp = temp->getNext())
115 if(cuspTypeX(temp) == 1)
116 ret++;
117 return ret;
118}
int ret