ReactOS  0.4.13-dev-259-g5ca9c9c
TrimVertexPool Class Reference

#include <trimvertpool.h>

Collaboration diagram for TrimVertexPool:

Public Member Functions

 TrimVertexPool (void)
 
 ~TrimVertexPool (void)
 
void clear (void)
 
TrimVertexget (int)
 

Private Attributes

Pool pool
 
TrimVertex ** vlist
 
int nextvlistslot
 
int vlistsize
 

Detailed Description

Definition at line 45 of file trimvertpool.h.

Constructor & Destructor Documentation

◆ TrimVertexPool()

TrimVertexPool::TrimVertexPool ( void  )

Definition at line 52 of file trimvertpool.cc.

53  : pool( sizeof(TrimVertex)*3, 32, "Threevertspool" )
54 {
55  // initialize array of pointers to vertex lists
56  nextvlistslot = 0;
59 }
#define INIT_VERTLISTSIZE
Definition: trimvertpool.h:43
TrimVertex ** vlist
Definition: trimvertpool.h:53
class TrimVertex * TrimVertex_p
Definition: trimvertex.h:53

◆ ~TrimVertexPool()

TrimVertexPool::~TrimVertexPool ( void  )

Definition at line 65 of file trimvertpool.cc.

66 {
67  // free all arrays of TrimVertices vertices
68  while( nextvlistslot ) {
69  delete [] vlist[--nextvlistslot];
70  }
71 
72  // reallocate space for array of pointers to vertex lists
73  if( vlist ) delete[] vlist;
74 }
TrimVertex ** vlist
Definition: trimvertpool.h:53

Member Function Documentation

◆ clear()

void TrimVertexPool::clear ( void  )

Definition at line 81 of file trimvertpool.cc.

82 {
83  // reinitialize pool of 3 vertex arrays
84  pool.clear();
85 
86  // free all arrays of TrimVertices vertices
87  while( nextvlistslot ) {
88  delete [] vlist[--nextvlistslot];
89  vlist[nextvlistslot] = 0;
90  }
91 
92  // reallocate space for array of pointers to vertex lists
93  if( vlist ) delete[] vlist;
95 }
TrimVertex ** vlist
Definition: trimvertpool.h:53
class TrimVertex * TrimVertex_p
Definition: trimvertex.h:53

Referenced by Subdivider::clear().

◆ get()

TrimVertex * TrimVertexPool::get ( int  n)

Definition at line 103 of file trimvertpool.cc.

104 {
105  TrimVertex *v;
106  if( n == 3 ) {
107  v = (TrimVertex *) pool.new_buffer();
108  } else {
109  if( nextvlistslot == vlistsize ) {
110  vlistsize *= 2;
111  TrimVertex_p *nvlist = new TrimVertex_p[vlistsize];
112  memcpy( nvlist, vlist, nextvlistslot * sizeof(TrimVertex_p) );
113  if( vlist ) delete[] vlist;
114  vlist = nvlist;
115  }
116  v = vlist[nextvlistslot++] = new TrimVertex[n];
117  }
118  return v;
119 }
TrimVertex ** vlist
Definition: trimvertpool.h:53
class TrimVertex * TrimVertex_p
Definition: trimvertex.h:53
GLdouble n
Definition: glext.h:7729
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
const GLdouble * v
Definition: gl.h:2040

Referenced by Subdivider::arc_split(), ArcTessellator::bezier(), ArcTessellator::pwl(), ArcTessellator::pwl_bottom(), ArcTessellator::pwl_left(), ArcTessellator::pwl_right(), ArcTessellator::pwl_top(), NurbsTessellator::pwlcurve(), and ArcTessellator::tessellateNonlinear().

Member Data Documentation

◆ nextvlistslot

int TrimVertexPool::nextvlistslot
private

Definition at line 54 of file trimvertpool.h.

Referenced by clear(), get(), TrimVertexPool(), and ~TrimVertexPool().

◆ pool

Pool TrimVertexPool::pool
private

Definition at line 52 of file trimvertpool.h.

◆ vlist

TrimVertex** TrimVertexPool::vlist
private

Definition at line 53 of file trimvertpool.h.

Referenced by clear(), get(), TrimVertexPool(), and ~TrimVertexPool().

◆ vlistsize

int TrimVertexPool::vlistsize
private

Definition at line 55 of file trimvertpool.h.

Referenced by clear(), get(), and TrimVertexPool().


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