ReactOS 0.4.15-dev-7942-gd23573b
Bin Class Reference

#include <bin.h>

Collaboration diagram for Bin:

Public Member Functions

 Bin ()
 
 ~Bin ()
 
Arc_ptr firstarc (void)
 
Arc_ptr nextarc (void)
 
Arc_ptr removearc (void)
 
int isnonempty (void)
 
void addarc (Arc_ptr)
 
void remove_this_arc (Arc_ptr)
 
int numarcs (void)
 
void adopt (void)
 
void markall (void)
 
void show (const char *)
 
void listBezier (void)
 

Private Attributes

Arc_ptr head
 
Arc_ptr current
 

Detailed Description

Definition at line 43 of file bin.h.

Constructor & Destructor Documentation

◆ Bin()

Bin::Bin ( )

Definition at line 49 of file bin.cc.

50{
51 head = NULL;
52 current = NULL;
53}
Arc_ptr head
Definition: bin.h:46
Arc_ptr current
Definition: bin.h:47
#define NULL
Definition: types.h:112

◆ ~Bin()

Bin::~Bin ( )

Definition at line 55 of file bin.cc.

56{
57 assert( head == NULL);
58}
#define assert(x)
Definition: debug.h:53

Member Function Documentation

◆ addarc()

void Bin::addarc ( Arc_ptr  jarc)
inline

Definition at line 70 of file bin.h.

71{
72 jarc->link = head;
73 head = jarc;
74}

Referenced by Subdivider::addArc(), Subdivider::makeBorderTrim(), and Subdivider::partition().

◆ adopt()

void Bin::adopt ( void  )

Definition at line 98 of file bin.cc.

99{
100 markall();
101
103 while( (orphan = removearc()) != NULL ) {
104 for( Arc_ptr parent = orphan->next; parent != orphan; parent = parent->next ) {
105 if (! parent->ismarked() ) {
106 orphan->link = parent->link;
107 parent->link = orphan;
108 orphan->clearmark();
109 break;
110 }
111 }
112 }
113}
void markall(void)
Definition: bin.cc:139
Arc_ptr removearc(void)
Definition: bin.h:82
class Arc * Arc_ptr
Definition: arc.h:50
r parent
Definition: btrfs.c:3010
Definition: send.c:34

◆ firstarc()

Arc_ptr Bin::firstarc ( void  )
inline

Definition at line 115 of file bin.h.

116{
117 current = head;
118 return nextarc( );
119}
Arc_ptr nextarc(void)
Definition: bin.h:97

Referenced by listBezier(), markall(), numarcs(), and show().

◆ isnonempty()

int Bin::isnonempty ( void  )
inline

Definition at line 54 of file bin.h.

54{ return (head ? 1 : 0); }

Referenced by Subdivider::drawSurfaces().

◆ listBezier()

void Bin::listBezier ( void  )

Definition at line 151 of file bin.cc.

152{
153 for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() ) {
154 if( jarc->isbezier( ) ) {
155 assert( jarc->pwlArc->npts == 2 );
156#ifndef NDEBUG
157 TrimVertex *pts = jarc->pwlArc->pts;
158 REAL s1 = pts[0].param[0];
159 REAL t1 = pts[0].param[1];
160 REAL s2 = pts[1].param[0];
161 REAL t2 = pts[1].param[1];
162 _glu_dprintf( "arc (%g,%g) (%g,%g)\n", s1, t1, s2, t2 );
163#endif
164 }
165 }
166}
Arc_ptr firstarc(void)
Definition: bin.h:115
REAL param[2]
Definition: trimvertex.h:45
float REAL
Definition: types.h:41
struct S1 s1
struct S2 s2

◆ markall()

void Bin::markall ( void  )

Definition at line 139 of file bin.cc.

140{
141 for( Arc_ptr jarc=firstarc(); jarc; jarc=nextarc() )
142 jarc->setmark();
143}

Referenced by adopt().

◆ nextarc()

Arc_ptr Bin::nextarc ( void  )
inline

Definition at line 97 of file bin.h.

98{
99 Arc_ptr jarc = current;
100
101#ifdef DEBUG
102 assert( jarc->check() != 0 );
103#endif
104
105 if( jarc ) current = jarc->link;
106 return jarc;
107}

Referenced by firstarc(), listBezier(), markall(), numarcs(), and show().

◆ numarcs()

int Bin::numarcs ( void  )

Definition at line 84 of file bin.cc.

85{
86 long count = 0;
87 for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() )
88 count++;
89 return count;
90}
GLuint GLuint GLsizei count
Definition: gl.h:1545

Referenced by Subdivider::split().

◆ remove_this_arc()

void Bin::remove_this_arc ( Arc_ptr  arc)

Definition at line 66 of file bin.cc.

67{
68 Arc_ptr *j;
69 for( j = &(head); (*j != 0) && (*j != arc); j = &((*j)->link) );
70
71 if( *j != 0 ) {
72 if( *j == current )
73 current = (*j)->link;
74 *j = (*j)->link;
75 }
76}
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

◆ removearc()

Arc_ptr Bin::removearc ( void  )
inline

Definition at line 82 of file bin.h.

83{
84 Arc_ptr jarc = head;
85
86 if( jarc ) head = jarc->link;
87 return jarc;
88}

Referenced by adopt(), and Subdivider::split().

◆ show()

void Bin::show ( const char name)

Definition at line 122 of file bin.cc.

123{
124#ifndef NDEBUG
125 _glu_dprintf( "%s\n", name );
126 for( Arc_ptr jarc = firstarc(); jarc; jarc = nextarc() )
127 jarc->show( );
128#endif
129}
Definition: name.c:39

Referenced by Subdivider::split().

Member Data Documentation

◆ current

Arc_ptr Bin::current
private

Definition at line 47 of file bin.h.

Referenced by Bin(), firstarc(), nextarc(), and remove_this_arc().

◆ head

Arc_ptr Bin::head
private

Definition at line 46 of file bin.h.

Referenced by addarc(), Bin(), firstarc(), isnonempty(), remove_this_arc(), removearc(), and ~Bin().


The documentation for this class was generated from the following files: