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 * trimregion.h
33 *
34 */
35
36 #ifndef __glutrimregion_h_
37 #define __glutrimregion_h_
38
39 #include "trimline.h"
40 #include "gridline.h"
41 #include "uarray.h"
42
43 class Arc;
44 class Backend;
45
46 class TrimRegion {
47 public:
48 TrimRegion();
49 #if defined(__REACTOS__) && defined(__clang__)
50 /* FIXME: Inspect */
~TrimRegion(void)51 ~TrimRegion( void ) {}
52 #endif
53 Trimline left;
54 Trimline right;
55 Gridline top;
56 Gridline bot;
57 Uarray uarray;
58
59 void init( REAL );
60 void advance( REAL, REAL, REAL );
61 void setDu( REAL );
62 void init( long, Arc_ptr );
63 void getPts( Arc_ptr );
64 void getPts( Backend & );
65 void getGridExtent( TrimVertex *, TrimVertex * );
66 void getGridExtent( void );
67 int canTile( void );
68 private:
69 REAL oneOverDu;
70 };
71
72 inline void
init(REAL vval)73 TrimRegion::init( REAL vval )
74 {
75 bot.vval = vval;
76 }
77
78 inline void
advance(REAL topVindex,REAL botVindex,REAL botVval)79 TrimRegion::advance( REAL topVindex, REAL botVindex, REAL botVval )
80 {
81 top.vindex = (long) topVindex;
82 bot.vindex = (long) botVindex;
83 top.vval = bot.vval;
84 bot.vval = botVval;
85 top.ustart = bot.ustart;
86 top.uend = bot.uend;
87 }
88 #endif /* __glutrimregion_h_ */
89