ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

bin.cc
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  * bin.c++
00037  *
00038  * $Date: 2009-08-30 15:53:16 +0000 (Sun, 30 Aug 2009) $ $Revision: 1.1 $
00039  * $Header: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/glu32/libnurbs/internals/bin.cc,v 1.1 2004/02/02 16:39:10 navaraf Exp $
00040  */
00041 
00042 #include "glimports.h"
00043 #include "mystdio.h"
00044 #include "myassert.h"
00045 #include "bin.h"
00046 
00047 /*----------------------------------------------------------------------------
00048  * Constructor and destructor
00049  *----------------------------------------------------------------------------
00050  */
00051 Bin::Bin()
00052 {
00053     head = NULL;
00054 }
00055 
00056 Bin::~Bin()
00057 {
00058     assert( head == NULL);
00059 }
00060 
00061 /*----------------------------------------------------------------------------
00062  * remove_this_arc - remove given Arc_ptr from bin
00063  *----------------------------------------------------------------------------
00064  */
00065 
00066 void 
00067 Bin::remove_this_arc( Arc_ptr arc )
00068 {
00069     Arc_ptr *j;
00070     for( j = &(head); (*j != 0) && (*j != arc); j = &((*j)->link) );
00071 
00072     if( *j != 0 ) {
00073         if( *j == current )
00074         current = (*j)->link;
00075     *j = (*j)->link;
00076     }
00077 }
00078 
00079 /*----------------------------------------------------------------------------
00080  * numarcs - count number of arcs in bin
00081  *----------------------------------------------------------------------------
00082  */
00083 
00084 int
00085 Bin::numarcs()
00086 {
00087     long count = 0;
00088     for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() )
00089     count++;
00090     return count;
00091 }
00092 
00093 /*----------------------------------------------------------------------------
00094  * adopt - place an orphaned arcs into their new parents bin
00095  *----------------------------------------------------------------------------
00096  */
00097 
00098 void 
00099 Bin::adopt()
00100 {
00101     markall();
00102 
00103     Arc_ptr orphan;
00104     while( (orphan = removearc()) != NULL ) {
00105     for( Arc_ptr parent = orphan->next; parent != orphan; parent = parent->next ) {
00106         if (! parent->ismarked() ) {
00107         orphan->link = parent->link;
00108         parent->link = orphan;
00109         orphan->clearmark();
00110         break;
00111         }
00112     }
00113     }
00114 }
00115 
00116 
00117 /*----------------------------------------------------------------------------
00118  * show - print out descriptions of the arcs in the bin
00119  *----------------------------------------------------------------------------
00120  */
00121 
00122 void
00123 Bin::show( const char *name )
00124 {
00125 #ifndef NDEBUG
00126     dprintf( "%s\n", name );
00127     for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() )
00128         jarc->show( );
00129 #endif
00130 }
00131 
00132 
00133 
00134 /*----------------------------------------------------------------------------
00135  * markall - mark all arcs with an identifying tag
00136  *----------------------------------------------------------------------------
00137  */
00138 
00139 void 
00140 Bin::markall()
00141 {
00142     for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() )
00143     jarc->setmark();
00144 }
00145 
00146 /*----------------------------------------------------------------------------
00147  * listBezier - print out all arcs that are untessellated border arcs
00148  *----------------------------------------------------------------------------
00149  */
00150 
00151 void 
00152 Bin::listBezier( void )
00153 {
00154     for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() ) {
00155     if( jarc->isbezier( ) ) {
00156             assert( jarc->pwlArc->npts == 2 );  
00157         TrimVertex  *pts = jarc->pwlArc->pts;
00158             REAL s1 = pts[0].param[0];
00159             REAL t1 = pts[0].param[1];
00160             REAL s2 = pts[1].param[0];
00161             REAL t2 = pts[1].param[1];
00162 #ifndef NDEBUG
00163        dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 );
00164 #endif
00165     }
00166     }
00167 }
00168 

Generated on Sat May 26 2012 04:22:15 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.