Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygensubdivider.h
Go to the documentation of this file.
00001 /* 00002 ** License Applicability. Except to the extent portions of this file are 00003 ** made subject to an alternative license as permitted in the SGI Free 00004 ** Software License B, Version 1.1 (the "License"), the contents of this 00005 ** file are subject only to the provisions of the License. You may not use 00006 ** this file except in compliance with the License. You may obtain a copy 00007 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 00008 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: 00009 ** 00010 ** http://oss.sgi.com/projects/FreeB 00011 ** 00012 ** Note that, as provided in the License, the Software is distributed on an 00013 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS 00014 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND 00015 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A 00016 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. 00017 ** 00018 ** Original Code. The Original Code is: OpenGL Sample Implementation, 00019 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, 00020 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. 00021 ** Copyright in any portions created by third parties is as indicated 00022 ** elsewhere herein. All Rights Reserved. 00023 ** 00024 ** Additional Notice Provisions: The application programming interfaces 00025 ** established by SGI in conjunction with the Original Code are The 00026 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released 00027 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version 00028 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X 00029 ** Window System(R) (Version 1.3), released October 19, 1998. This software 00030 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation 00031 ** published by SGI, but has not been independently verified as being 00032 ** compliant with the OpenGL(R) version 1.2.1 Specification. 00033 */ 00034 00035 /* 00036 * subdivider.h 00037 * 00038 * $Date: 2007-10-19 23:21:45 +0000 (Fri, 19 Oct 2007) $ $Revision: 1.1 $ 00039 * $Header: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/glu32/libnurbs/internals/subdivider.h,v 1.1 2004/02/02 16:39:12 navaraf Exp $ 00040 */ 00041 00042 #ifndef __glusubdivider_h_ 00043 #define __glusubdivider_h_ 00044 00045 #include "mysetjmp.h" 00046 #include "bin.h" 00047 #include "flist.h" 00048 #include "slicer.h" 00049 #include "arctess.h" 00050 #include "trimvertex.h" 00051 #include "trimvertpool.h" 00052 00053 class Arc; 00054 class Pool; 00055 class Renderhints; 00056 class Quilt; 00057 class Patchlist; 00058 class Curvelist; 00059 struct JumpBuffer; 00060 00061 class Subdivider { 00062 public: 00063 Subdivider( Renderhints&, Backend& ); 00064 ~Subdivider( void ); 00065 void clear( void ); 00066 00067 void beginTrims( void ) {} 00068 void beginLoop( void ); 00069 void addArc( REAL *, Quilt *, long ); 00070 void addArc( int, TrimVertex *, long ); 00071 void endLoop( void ) {} 00072 void endTrims( void ) {} 00073 00074 void beginQuilts( void ); 00075 void addQuilt( Quilt * ); 00076 void endQuilts( void ) {} 00077 00078 void drawCurves( void ); 00079 void drawSurfaces( long ); 00080 00081 int ccwTurn_sl( Arc_ptr, Arc_ptr ); 00082 int ccwTurn_sr( Arc_ptr , Arc_ptr ); 00083 int ccwTurn_tl( Arc_ptr , Arc_ptr ); 00084 int ccwTurn_tr( Arc_ptr , Arc_ptr ); 00085 00086 void setJumpbuffer( JumpBuffer * ); 00087 00088 void set_domain_distance_u_rate(REAL u_rate) 00089 { 00090 domain_distance_u_rate = u_rate; 00091 } 00092 void set_domain_distance_v_rate(REAL v_rate) 00093 { 00094 domain_distance_v_rate = v_rate; 00095 } 00096 void set_is_domain_distance_sampling(int flag) 00097 { 00098 is_domain_distance_sampling = flag; 00099 } 00100 00101 private: 00102 void classify_headonleft_s( Bin &, Bin &, Bin &, REAL ); 00103 void classify_tailonleft_s( Bin &, Bin &, Bin &, REAL ); 00104 void classify_headonright_s( Bin &, Bin &, Bin &, REAL ); 00105 void classify_tailonright_s( Bin &, Bin &, Bin &, REAL ); 00106 void classify_headonleft_t( Bin &, Bin &, Bin &, REAL ); 00107 void classify_tailonleft_t( Bin &, Bin &, Bin &, REAL ); 00108 void classify_headonright_t( Bin &, Bin &, Bin &, REAL ); 00109 void classify_tailonright_t( Bin &, Bin &, Bin &, REAL ); 00110 00111 enum dir { down, same, up, none }; 00112 void tessellate( Arc_ptr, REAL ); 00113 void monotonize( Arc_ptr , Bin & ); 00114 int isMonotone( Arc_ptr ); 00115 int decompose( Bin &, REAL ); 00116 00117 00118 Slicer slicer; 00119 ArcTessellator arctessellator; 00120 Pool arcpool; 00121 Pool bezierarcpool; 00122 Pool pwlarcpool; 00123 TrimVertexPool trimvertexpool; 00124 00125 JumpBuffer* jumpbuffer; 00126 Renderhints& renderhints; 00127 Backend& backend; 00128 00129 Bin initialbin; 00130 Arc_ptr pjarc; 00131 int s_index; 00132 int t_index; 00133 Quilt * qlist; 00134 Flist spbrkpts; 00135 Flist tpbrkpts; 00136 Flist smbrkpts; 00137 Flist tmbrkpts; 00138 REAL stepsizes[4]; 00139 int showDegenerate; 00140 int isArcTypeBezier; 00141 00142 void samplingSplit( Curvelist&, int ); 00143 00144 void subdivideInS( Bin& ); 00145 void splitInS( Bin&, int, int ); 00146 void splitInT( Bin&, int, int ); 00147 void samplingSplit( Bin&, Patchlist&, int, int ); 00148 void nonSamplingSplit( Bin&, Patchlist&, int, int ); 00149 void tessellation( Bin&, Patchlist& ); 00150 void monosplitInS( Bin&, int, int ); 00151 void monosplitInT( Bin&, int, int ); 00152 00153 void outline( Bin & ); 00154 void freejarcs( Bin & ); 00155 void render( Bin & ); 00156 void split( Bin &, Bin &, Bin &, int, REAL ); 00157 void tessellate( Bin &, REAL, REAL, REAL, REAL ); 00158 00159 inline void setDegenerate( void ) { showDegenerate = 1; } 00160 inline void setNonDegenerate( void ) { showDegenerate = 0; } 00161 inline int showingDegenerate( void ) { return showDegenerate; } 00162 inline void setArcTypeBezier( void ) { isArcTypeBezier = 1; } 00163 inline void setArcTypePwl( void ) { isArcTypeBezier = 0; } 00164 inline int isBezierArcType( void ) { return isArcTypeBezier; } 00165 00166 void makeBorderTrim( const REAL *, const REAL * ); 00167 void split( Bin &, int, const REAL *, int, int ); 00168 void partition( Bin &, Bin &, Bin &, Bin &, Bin &, int, REAL ); 00169 void findIrregularS( Bin & ); 00170 void findIrregularT( Bin & ); 00171 00172 00173 inline int bbox( TrimVertex *, TrimVertex *, TrimVertex *, int ); 00174 static int bbox( REAL, REAL, REAL, REAL, REAL, REAL ); 00175 static int ccw( TrimVertex *, TrimVertex *, TrimVertex * ); 00176 void join_s( Bin &, Bin &, Arc_ptr, Arc_ptr ); 00177 void join_t( Bin &, Bin &, Arc_ptr , Arc_ptr ); 00178 int arc_split( Arc_ptr , int, REAL, int ); 00179 void check_s( Arc_ptr , Arc_ptr ); 00180 void check_t( Arc_ptr , Arc_ptr ); 00181 inline void link( Arc_ptr , Arc_ptr , Arc_ptr , Arc_ptr ); 00182 inline void simple_link( Arc_ptr , Arc_ptr ); 00183 00184 Bin* makePatchBoundary( const REAL *from, const REAL *to ); 00185 00186 /*in domain distance method, the tessellation is controled by two numbers: 00187 *GLU_U_STEP: number of u-segments per unit u length of domain 00188 *GLU_V_STEP: number of v-segments per unit v length of domain 00189 *These two numbers are normally stored in mapdesc->maxs(t)rate. 00190 *I (ZL) put these two numbers here so that I can optimize the untrimmed 00191 *case in the case of domain distance sampling. 00192 *These two numbers are set by set_domain_distance_u_rate() and ..._v_..(). 00193 */ 00194 REAL domain_distance_u_rate; 00195 REAL domain_distance_v_rate; 00196 int is_domain_distance_sampling; 00197 }; 00198 00199 inline void 00200 Subdivider::beginLoop( void ) 00201 { 00202 pjarc = 0; 00203 } 00204 00205 00206 #endif /* __glusubdivider_h_ */ Generated on Sun May 27 2012 04:23:41 for ReactOS by
1.7.6.1
|