ReactOS 0.4.15-dev-6067-g0b695a6
Arc Class Reference

#include <arc.h>

Inheritance diagram for Arc:
Collaboration diagram for Arc:

Public Member Functions

 Arc (Arc *, PwlArc *)
 
 Arc (arc_side, long)
 
Arc_ptr append (Arc_ptr)
 
int check (void)
 
int isMonotone (void)
 
int isDisconnected (void)
 
int numpts (void)
 
void markverts (void)
 
void getextrema (Arc_ptr[4])
 
void print (void)
 
void show (void)
 
void makeSide (PwlArc *, arc_side)
 
int isTessellated ()
 
long isbezier ()
 
void setbezier ()
 
void clearbezier ()
 
long npts ()
 
TrimVertexpts ()
 
REALtail ()
 
REALhead ()
 
REALrhead ()
 
long ismarked ()
 
void setmark ()
 
void clearmark ()
 
void clearside ()
 
void setside (arc_side s)
 
arc_side getside ()
 
int getitail ()
 
void setitail ()
 
void clearitail ()
 
- Public Member Functions inherited from PooledObj
voidoperator new (size_t, Pool &)
 
voidoperator new (size_t, void *)
 
voidoperator new (size_t s)
 
void operator delete (void *)
 
void operator delete (void *, Pool &)
 
void deleteMe (Pool &)
 

Public Attributes

Arc_ptr prev
 
Arc_ptr next
 
Arc_ptr link
 
BezierArcbezierArc
 
PwlArcpwlArc
 
long type
 
long nuid
 

Static Public Attributes

static const int bezier_tag = (1<<13)
 
static const int arc_tag = (1<<3)
 
static const int tail_tag = (1<<6)
 

Detailed Description

Definition at line 55 of file arc.h.

Constructor & Destructor Documentation

◆ Arc() [1/2]

Arc::Arc ( Arc j,
PwlArc p 
)
inline

Definition at line 109 of file arc.h.

110{
111 prev = NULL;
112 next = NULL;
113 link = NULL;
114 bezierArc = NULL;
115 pwlArc = p;
116 type = j->type;
117 nuid = j->nuid;
118}
Arc_ptr link
Definition: arc.h:63
Arc_ptr prev
Definition: arc.h:61
long nuid
Definition: arc.h:67
BezierArc * bezierArc
Definition: arc.h:64
Arc_ptr next
Definition: arc.h:62
PwlArc * pwlArc
Definition: arc.h:65
#define NULL
Definition: types.h:112
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLfloat GLfloat p
Definition: glext.h:8902
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 GLint GLint j
Definition: glfuncs.h:250

◆ Arc() [2/2]

Arc::Arc ( arc_side  side,
long  _nuid 
)
inline

Definition at line 127 of file arc.h.

128{
129 prev = NULL;
130 next = NULL;
131 link = NULL;
132 bezierArc = NULL;
133 pwlArc = NULL;
134 type = 0;
135 setside( side );
136 nuid = _nuid;
137}
void setside(arc_side s)
Definition: arc.h:95

Member Function Documentation

◆ append()

Arc_ptr Arc::append ( Arc_ptr  jarc)

Definition at line 335 of file arc.cc.

336{
337 if( jarc != 0 ) {
338 next = jarc->next;
339 prev = jarc;
340 next->prev = prev->next = this;
341 } else {
342 next = prev = this;
343 }
344 return this;
345}

Referenced by Subdivider::addArc().

◆ check()

int Arc::check ( void  )

Definition at line 237 of file arc.cc.

238{
239 if( this == 0 ) return 1;
240 Arc_ptr jarc = this;
241 do {
242 assert( (jarc->pwlArc != 0) || (jarc->bezierArc != 0) );
243
244 if (jarc->prev == 0 || jarc->next == 0) {
245#ifndef NDEBUG
246 _glu_dprintf( "checkjarc:null next/prev pointer\n");
247 jarc->print( );
248#endif
249 return 0;
250 }
251
252 if (jarc->next->prev != jarc) {
253#ifndef NDEBUG
254 _glu_dprintf( "checkjarc: pointer linkage screwed up\n");
255 jarc->print( );
256#endif
257 return 0;
258 }
259
260 if( jarc->pwlArc ) {
261#ifndef NDEBUG
262 assert( jarc->pwlArc->npts >= 1 );
263 assert( jarc->pwlArc->npts < 100000 );
264/*
265 for( int i=0; i < jarc->pwlArc->npts-1; i++ )
266 assert( neq_vert( jarc->pwlArc->pts[i].param,
267 jarc->pwlArc->pts[i+1].param) );
268*/
269#endif
270 if( jarc->prev->pwlArc ) {
271 if( jarc->tail()[1] != jarc->prev->rhead()[1] ) {
272#ifndef NDEBUG
273 _glu_dprintf( "checkjarc: geometric linkage screwed up 1\n");
274 jarc->prev->show();
275 jarc->show();
276#endif
277 return 0;
278 }
279 if( jarc->tail()[0] != jarc->prev->rhead()[0] ) {
280
281#ifndef NDEBUG
282 _glu_dprintf( "checkjarc: geometric linkage screwed up 2\n");
283 jarc->prev->show();
284 jarc->show();
285#endif
286 return 0;
287 }
288 }
289 if( jarc->next->pwlArc ) {
290 if( jarc->next->tail()[0] != jarc->rhead()[0] ) {
291#ifndef NDEBUG
292 _glu_dprintf( "checkjarc: geometric linkage screwed up 3\n");
293 jarc->show();
294 jarc->next->show();
295#endif
296 return 0;
297 }
298 if( jarc->next->tail()[1] != jarc->rhead()[1] ) {
299#ifndef NDEBUG
300 _glu_dprintf( "checkjarc: geometric linkage screwed up 4\n");
301 jarc->show();
302 jarc->next->show();
303#endif
304 return 0;
305 }
306 }
307 if( jarc->isbezier() ) {
308 assert( jarc->pwlArc->npts == 2 );
309 assert( (jarc->pwlArc->pts[0].param[0] == \
310 jarc->pwlArc->pts[1].param[0]) ||\
311 (jarc->pwlArc->pts[0].param[1] == \
312 jarc->pwlArc->pts[1].param[1]) );
313 }
314 }
315 jarc = jarc->next;
316 } while (jarc != this);
317 return 1;
318}
class Arc * Arc_ptr
Definition: arc.h:50
#define assert(x)
Definition: debug.h:53

◆ clearbezier()

void Arc::clearbezier ( )
inline

Definition at line 85 of file arc.h.

85{ type &= ~bezier_tag; }

Referenced by makeSide(), and ArcTessellator::pwl().

◆ clearitail()

void Arc::clearitail ( )
inline

Definition at line 99 of file arc.h.

99{ type &= (~tail_tag); }

◆ clearmark()

void Arc::clearmark ( )
inline

Definition at line 93 of file arc.h.

93{ type &= (~arc_tag); }

◆ clearside()

void Arc::clearside ( )
inline

Definition at line 94 of file arc.h.

94{ type &= ~(0x7 << 8); }

Referenced by ArcTessellator::pwl(), and setside().

◆ getextrema()

void Arc::getextrema ( Arc_ptr  extrema[4])

Definition at line 115 of file arc.cc.

116{
117 REAL leftpt, botpt, rightpt, toppt;
118
119 extrema[0] = extrema[1] = extrema[2] = extrema[3] = this;
120
121 leftpt = rightpt = this->tail()[0];
122 botpt = toppt = this->tail()[1];
123
124 for( Arc_ptr jarc = this->next; jarc != this; jarc = jarc->next ) {
125 if ( jarc->tail()[0] < leftpt ||
126 (jarc->tail()[0] <= leftpt && jarc->rhead()[0]<=leftpt)) {
127 leftpt = jarc->pwlArc->pts->param[0];
128 extrema[1] = jarc;
129 }
130 if ( jarc->tail()[0] > rightpt ||
131 (jarc->tail()[0] >= rightpt && jarc->rhead()[0] >= rightpt)) {
132 rightpt = jarc->pwlArc->pts->param[0];
133 extrema[3] = jarc;
134 }
135 if ( jarc->tail()[1] < botpt ||
136 (jarc->tail()[1] <= botpt && jarc->rhead()[1] <= botpt )) {
137 botpt = jarc->pwlArc->pts->param[1];
138 extrema[2] = jarc;
139 }
140 if ( jarc->tail()[1] > toppt ||
141 (jarc->tail()[1] >= toppt && jarc->rhead()[1] >= toppt)) {
142 toppt = jarc->pwlArc->pts->param[1];
143 extrema[0] = jarc;
144 }
145 }
146}
REAL * tail()
Definition: arc.h:88
float REAL
Definition: types.h:41

◆ getitail()

int Arc::getitail ( )
inline

Definition at line 97 of file arc.h.

97{ return type & tail_tag; }
static const int tail_tag
Definition: arc.h:60

Referenced by ArcSdirSorter::qscmp(), and ArcTdirSorter::qscmp().

◆ getside()

arc_side Arc::getside ( )
inline

Definition at line 96 of file arc.h.

96{ return (arc_side) ((type>>8) & 0x7); }
arc_side
Definition: arc.h:52

Referenced by ArcTessellator::bezier().

◆ head()

REAL * Arc::head ( )
inline

Definition at line 89 of file arc.h.

89{ return next->pwlArc->pts[0].param; }

Referenced by ArcSdirSorter::qscmp(), and ArcTdirSorter::qscmp().

◆ isbezier()

long Arc::isbezier ( )
inline

Definition at line 83 of file arc.h.

83{ return type & bezier_tag; }
static const int bezier_tag
Definition: arc.h:58

◆ isDisconnected()

int Arc::isDisconnected ( void  )

Definition at line 194 of file arc.cc.

195{
196 if( pwlArc == 0 ) return 0;
197 if( prev->pwlArc == 0 ) return 0;
198
199 REAL *p0 = tail();
200 REAL *p1 = prev->rhead();
201
202 if( ((p0[0] - p1[0]) > ZERO) || ((p1[0] - p0[0]) > ZERO) ||
203 ((p0[1] - p1[1]) > ZERO) || ((p1[1] - p0[1]) > ZERO) ) {
204#ifndef NDEBUG
205 _glu_dprintf( "x coord = %f %f %f\n", p0[0], p1[0], p0[0] - p1[0] );
206 _glu_dprintf( "y coord = %f %f %f\n", p0[1], p1[1], p0[1] - p1[1] );
207#endif
208 return 1;
209 } else {
210 /* average two points together */
211 p0[0] = p1[0] = (p1[0] + p0[0]) * 0.5;
212 p0[1] = p1[1] = (p1[1] + p0[1]) * 0.5;
213 return 0;
214 }
215}
#define ZERO
Definition: arc.cc:50

◆ ismarked()

long Arc::ismarked ( )
inline

Definition at line 91 of file arc.h.

91{ return type & arc_tag; }
static const int arc_tag
Definition: arc.h:59

◆ isMonotone()

int Arc::isMonotone ( void  )

◆ isTessellated()

int Arc::isTessellated ( )
inline

Definition at line 82 of file arc.h.

82{ return pwlArc ? 1 : 0; }

Referenced by ArcTessellator::bezier().

◆ makeSide()

void Arc::makeSide ( PwlArc pwl,
arc_side  side 
)

Definition at line 62 of file arc.cc.

63{
64 assert( pwl != 0);
65 assert( pwlArc == 0 );
66 assert( pwl->npts > 0 );
67 assert( pwl->pts != 0);
68 pwlArc = pwl;
70 setside( side );
71}
void clearbezier()
Definition: arc.h:85
int npts
Definition: pwlarc.h:47
TrimVertex * pts
Definition: pwlarc.h:46

Referenced by ArcTessellator::pwl_bottom(), ArcTessellator::pwl_left(), ArcTessellator::pwl_right(), and ArcTessellator::pwl_top().

◆ markverts()

void Arc::markverts ( void  )

Definition at line 97 of file arc.cc.

98{
99 Arc_ptr jarc = this;
100
101 do {
102 TrimVertex *p = jarc->pwlArc->pts;
103 for( int i=0; i<jarc->pwlArc->npts; i++ )
104 p[i].nuid = jarc->nuid;
105 jarc = jarc->next;
106 } while( jarc != this );
107}
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
Definition: glfuncs.h:248

◆ npts()

long Arc::npts ( )
inline

Definition at line 86 of file arc.h.

86{ return pwlArc->npts; }

Referenced by numpts().

◆ numpts()

int Arc::numpts ( void  )

Definition at line 80 of file arc.cc.

81{
82 Arc_ptr jarc = this;
83 int npts = 0;
84 do {
85 npts += jarc->pwlArc->npts;
86 jarc = jarc->next;
87 } while( jarc != this );
88 return npts;
89}
long npts()
Definition: arc.h:86

◆ print()

void Arc::print ( void  )

Definition at line 172 of file arc.cc.

173{
174 Arc_ptr jarc = this;
175
176#ifndef NDEBUG
177 _glu_dprintf( "BGNTRIM\n" );
178#endif
179 do {
180 jarc->show( );
181 jarc = jarc->next;
182 } while (jarc != this);
183#ifndef NDEBUG
184 _glu_dprintf("ENDTRIM\n" );
185#endif
186}

◆ pts()

TrimVertex * Arc::pts ( )
inline

Definition at line 87 of file arc.h.

87{ return pwlArc->pts; }

◆ rhead()

REAL * Arc::rhead ( )
inline

Definition at line 90 of file arc.h.

90{ return pwlArc->pts[pwlArc->npts-1].param; }
REAL param[2]
Definition: trimvertex.h:45

◆ setbezier()

void Arc::setbezier ( )
inline

Definition at line 84 of file arc.h.

84{ type |= bezier_tag; }

Referenced by ArcTessellator::bezier().

◆ setitail()

void Arc::setitail ( )
inline

Definition at line 98 of file arc.h.

98{ type |= tail_tag; }

◆ setmark()

void Arc::setmark ( )
inline

Definition at line 92 of file arc.h.

92{ type |= arc_tag; }

◆ setside()

void Arc::setside ( arc_side  s)
inline

Definition at line 95 of file arc.h.

95{ clearside(); type |= (((long)s)<<8); }
void clearside()
Definition: arc.h:94
GLdouble s
Definition: gl.h:2039
#define long
Definition: qsort.c:33

Referenced by Arc(), and makeSide().

◆ show()

void Arc::show ( void  )

Definition at line 155 of file arc.cc.

156{
157#ifndef NDEBUG
158 _glu_dprintf( "\tPWLARC NP: %d FL: 1\n", pwlArc->npts );
159 for( int i = 0; i < pwlArc->npts; i++ ) {
160 _glu_dprintf( "\t\tVERTEX %f %f\n", pwlArc->pts[i].param[0],
161 pwlArc->pts[i].param[1] );
162 }
163#endif
164}

◆ tail()

REAL * Arc::tail ( )
inline

Definition at line 88 of file arc.h.

88{ return pwlArc->pts[0].param; }

Referenced by getextrema(), isDisconnected(), ArcSdirSorter::qscmp(), and ArcTdirSorter::qscmp().

Member Data Documentation

◆ arc_tag

const int Arc::arc_tag = (1<<3)
static

Definition at line 59 of file arc.h.

Referenced by ismarked(), and setmark().

◆ bezier_tag

const int Arc::bezier_tag = (1<<13)
static

Definition at line 58 of file arc.h.

Referenced by isbezier(), and setbezier().

◆ bezierArc

◆ link

Arc_ptr Arc::link

Definition at line 63 of file arc.h.

Referenced by Arc().

◆ next

Arc_ptr Arc::next

Definition at line 62 of file arc.h.

Referenced by append(), Arc(), getextrema(), and head().

◆ nuid

long Arc::nuid

Definition at line 67 of file arc.h.

Referenced by Arc(), and markverts().

◆ prev

Arc_ptr Arc::prev

Definition at line 61 of file arc.h.

Referenced by append(), Arc(), and isDisconnected().

◆ pwlArc

◆ tail_tag

const int Arc::tail_tag = (1<<6)
static

Definition at line 60 of file arc.h.

Referenced by getitail(), and setitail().

◆ type

long Arc::type

Definition at line 66 of file arc.h.


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