Public Member Functions | |
| TrianglePool (UInt32 chunkSize=DEFAULT_CHUNK_SIZE) | |
| ~TrianglePool (void) | |
| Triangle * | createTriangle (void) |
| void | clear (void) |
| UInt32 | countElem (void) |
| void | setChunkSize (UInt32 chunkSize=DEFAULT_CHUNK_SIZE) |
Private Types | |
| enum | { DEFAULT_CHUNK_SIZE = 2048 } |
Private Attributes | |
| UInt32 | _defaultChunkSize |
| Chunk * | _first |
| Chunk * | _last |
Classes | |
| class | Chunk |
Definition at line 137 of file OSGHalfEdgeGraph.h.
anonymous enum [private] |
| osg::HalfEdgeGraph::TrianglePool::TrianglePool | ( | UInt32 | chunkSize = DEFAULT_CHUNK_SIZE |
) | [inline] |
Definition at line 239 of file OSGHalfEdgeGraph.inl.
00240 : _defaultChunkSize(chunkSize), _first(0), _last(0) 00241 { 00242 }
| osg::HalfEdgeGraph::TrianglePool::~TrianglePool | ( | void | ) | [inline] |
Definition at line 245 of file OSGHalfEdgeGraph.inl.
References clear().
00246 { 00247 clear(); 00248 }
| HalfEdgeGraph::Triangle * osg::HalfEdgeGraph::TrianglePool::createTriangle | ( | void | ) | [inline] |
Definition at line 251 of file OSGHalfEdgeGraph.inl.
References osg::HalfEdgeGraph::TrianglePool::Chunk::_data, _defaultChunkSize, _first, osg::HalfEdgeGraph::TrianglePool::Chunk::_freeElem, _last, osg::HalfEdgeGraph::TrianglePool::Chunk::_next, and osg::HalfEdgeGraph::TrianglePool::Chunk::_size.
Referenced by osg::HalfEdgeGraph::addTriangle().
00252 { 00253 if(!_first) 00254 { 00255 _first = _last = new Chunk(_defaultChunkSize); 00256 } 00257 else 00258 { 00259 if(_last->_freeElem == 0) 00260 _last = _last->_next = new Chunk(_defaultChunkSize); 00261 } 00262 return &(_last->_data[_last->_size - _last->_freeElem--]); 00263 }
| void osg::HalfEdgeGraph::TrianglePool::clear | ( | void | ) | [inline] |
Definition at line 266 of file OSGHalfEdgeGraph.inl.
Referenced by osg::HalfEdgeGraph::clear(), and ~TrianglePool().
| UInt32 osg::HalfEdgeGraph::TrianglePool::countElem | ( | void | ) | [inline] |
Definition at line 273 of file OSGHalfEdgeGraph.inl.
References _first, and osg::HalfEdgeGraph::TrianglePool::Chunk::countElem().
Referenced by osg::HalfEdgeGraph::calcOptPrim(), and osg::HalfEdgeGraph::triangleCount().
| void osg::HalfEdgeGraph::TrianglePool::setChunkSize | ( | UInt32 | chunkSize = DEFAULT_CHUNK_SIZE |
) | [inline] |
Definition at line 279 of file OSGHalfEdgeGraph.inl.
References _defaultChunkSize.
Referenced by osg::HalfEdgeGraph::reserve().
00280 { 00281 _defaultChunkSize = chunkSize; 00282 }
Definition at line 155 of file OSGHalfEdgeGraph.h.
Referenced by createTriangle(), and setChunkSize().
Chunk* osg::HalfEdgeGraph::TrianglePool::_first [private] |
Definition at line 156 of file OSGHalfEdgeGraph.h.
Referenced by clear(), countElem(), and createTriangle().
Chunk* osg::HalfEdgeGraph::TrianglePool::_last [private] |
1.5.5