ReactOS 0.4.15-dev-7907-g95bf896
arc.h
Go to the documentation of this file.
1/*
2 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice including the dates of first publication and
13 * either this permission notice or a reference to
14 * http://oss.sgi.com/projects/FreeB/
15 * shall be included in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
22 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 *
25 * Except as contained in this notice, the name of Silicon Graphics, Inc.
26 * shall not be used in advertising or otherwise to promote the sale, use or
27 * other dealings in this Software without prior written authorization from
28 * Silicon Graphics, Inc.
29 */
30
31/*
32 * arc.h
33 *
34 */
35
36#ifndef __gluarc_h_
37#define __gluarc_h_
38
39//#include "myassert.h"
40#include "bufpool.h"
41#include "mystdio.h"
42//#include "types.h"
43#include "pwlarc.h"
44#include "trimvertex.h"
45
46class Bin;
47class Arc;
48struct BezierArc;
49
50typedef class Arc *Arc_ptr;
51
53
54
55class Arc: public PooledObj { /* an arc, in two list, the trim list and bin */
56
57public:
58 static const int bezier_tag;
59 static const int arc_tag;
60 static const int tail_tag;
61 Arc_ptr prev; /* trim list pointer */
62 Arc_ptr next; /* trim list pointer */
63 Arc_ptr link; /* bin pointers */
64 BezierArc * bezierArc; /* associated bezier arc */
65 PwlArc * pwlArc; /* associated pwl arc */
66 long type; /* curve type */
67 long nuid;
68
69 inline Arc( Arc *, PwlArc * );
70 inline Arc( arc_side, long );
71
73 int check( void );
74 int isMonotone( void );
75 int isDisconnected( void );
76 int numpts( void );
77 void markverts( void );
78 void getextrema( Arc_ptr[4] );
79 void print( void );
80 void show( void );
81 void makeSide( PwlArc *, arc_side );
82 inline int isTessellated() { return pwlArc ? 1 : 0; }
83 inline long isbezier() { return type & bezier_tag; }
84 inline void setbezier() { type |= bezier_tag; }
85 inline void clearbezier() { type &= ~bezier_tag; }
86 inline long npts() { return pwlArc->npts; }
87 inline TrimVertex * pts() { return pwlArc->pts; }
88 inline REAL * tail() { return pwlArc->pts[0].param; }
89 inline REAL * head() { return next->pwlArc->pts[0].param; }
90 inline REAL * rhead() { return pwlArc->pts[pwlArc->npts-1].param; }
91 inline long ismarked() { return type & arc_tag; }
92 inline void setmark() { type |= arc_tag; }
93 inline void clearmark() { type &= (~arc_tag); }
94 inline void clearside() { type &= ~(0x7 << 8); }
95 inline void setside( arc_side s ) { clearside(); type |= (((long)s)<<8); }
96 inline arc_side getside() { return (arc_side) ((type>>8) & 0x7); }
97 inline int getitail() { return type & tail_tag; }
98 inline void setitail() { type |= tail_tag; }
99 inline void clearitail() { type &= (~tail_tag); }
100};
101
102/*--------------------------------------------------------------------------
103 * Arc - initialize a new Arc with the same type and uid of
104 * a given Arc and a given pwl arc
105 *--------------------------------------------------------------------------
106 */
107
108inline
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}
119
120/*--------------------------------------------------------------------------
121 * Arc - initialize a new Arc with the same type and uid of
122 * a given Arc and a given pwl arc
123 *--------------------------------------------------------------------------
124 */
125
126inline
127Arc::Arc( arc_side side, long _nuid )
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}
138
139#endif /* __gluarc_h_ */
Definition: arc.h:55
REAL * rhead()
Definition: arc.h:90
void clearside()
Definition: arc.h:94
Arc_ptr link
Definition: arc.h:63
Arc_ptr prev
Definition: arc.h:61
int isDisconnected(void)
Definition: arc.cc:194
void setitail()
Definition: arc.h:98
Arc_ptr append(Arc_ptr)
Definition: arc.cc:335
static const int arc_tag
Definition: arc.h:59
int isTessellated()
Definition: arc.h:82
long nuid
Definition: arc.h:67
void clearmark()
Definition: arc.h:93
void clearbezier()
Definition: arc.h:85
Arc(Arc *, PwlArc *)
Definition: arc.h:109
int getitail()
Definition: arc.h:97
int isMonotone(void)
arc_side getside()
Definition: arc.h:96
long isbezier()
Definition: arc.h:83
static const int tail_tag
Definition: arc.h:60
static const int bezier_tag
Definition: arc.h:58
long type
Definition: arc.h:66
void setside(arc_side s)
Definition: arc.h:95
TrimVertex * pts()
Definition: arc.h:87
int numpts(void)
Definition: arc.cc:80
long npts()
Definition: arc.h:86
void getextrema(Arc_ptr[4])
Definition: arc.cc:115
BezierArc * bezierArc
Definition: arc.h:64
void print(void)
Definition: arc.cc:172
void show(void)
Definition: arc.cc:155
REAL * tail()
Definition: arc.h:88
Arc_ptr next
Definition: arc.h:62
void markverts(void)
Definition: arc.cc:97
int check(void)
Definition: arc.cc:237
void setmark()
Definition: arc.h:92
void setbezier()
Definition: arc.h:84
long ismarked()
Definition: arc.h:91
void clearitail()
Definition: arc.h:99
void makeSide(PwlArc *, arc_side)
Definition: arc.cc:62
REAL * head()
Definition: arc.h:89
PwlArc * pwlArc
Definition: arc.h:65
Definition: bin.h:44
Definition: pwlarc.h:44
int npts
Definition: pwlarc.h:47
TrimVertex * pts
Definition: pwlarc.h:46
REAL param[2]
Definition: trimvertex.h:45
#define NULL
Definition: types.h:112
class Arc * Arc_ptr
Definition: arc.h:50
arc_side
Definition: arc.h:52
@ arc_left
Definition: arc.h:52
@ arc_none
Definition: arc.h:52
@ arc_bottom
Definition: arc.h:52
@ arc_top
Definition: arc.h:52
@ arc_right
Definition: arc.h:52
float REAL
Definition: types.h:41
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
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
#define long
Definition: qsort.c:33