ca397f3b1fdea7214c366978e31ce20202f6e3cb
2 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
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:
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.
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
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.
44 #include "trimvertex.h"
50 typedef class Arc
*Arc_ptr
;
52 enum arc_side
{ arc_none
= 0, arc_right
, arc_top
, arc_left
, arc_bottom
};
55 class Arc
: public PooledObj
{ /* an arc, in two list, the trim list and bin */
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 */
69 inline Arc( Arc
*, PwlArc
* );
70 inline Arc( arc_side
, long );
72 Arc_ptr
append( Arc_ptr
);
74 int isMonotone( void );
75 int isDisconnected( void );
77 void markverts( void );
78 void getextrema( Arc_ptr
[4] );
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
); }
102 /*--------------------------------------------------------------------------
103 * Arc - initialize a new Arc with the same type and uid of
104 * a given Arc and a given pwl arc
105 *--------------------------------------------------------------------------
109 Arc::Arc( Arc
*j
, PwlArc
*p
)
120 /*--------------------------------------------------------------------------
121 * Arc - initialize a new Arc with the same type and uid of
122 * a given Arc and a given pwl arc
123 *--------------------------------------------------------------------------
127 Arc::Arc( arc_side side
, long _nuid
)
139 #endif /* __gluarc_h_ */