vertexBufferNode.h

00001 /*  
00002     vertexBufferNode.h
00003     Copyright (c) 2007, Tobias Wolf <twolf@access.unizh.ch>
00004     Copyright (c) 2008, Stefan Eilemann <eile@equalizergraphics.com>
00005   *
00006  * This library is free software; you can redistribute it and/or modify it under
00007  * the terms of the GNU Lesser General Public License version 2.1 as published
00008  * by the Free Software Foundation.
00009  *  
00010  * This library is distributed in the hope that it will be useful, but WITHOUT
00011  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00012  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00013  * details.
00014  * 
00015  * You should have received a copy of the GNU Lesser General Public License
00016  * along with this library; if not, write to the Free Software Foundation, Inc.,
00017  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018   
00019     
00020     Header file of the VertexBufferNode class.
00021 */
00022 
00023 
00024 #ifndef MESH_VERTEXBUFFERNODE_H
00025 #define MESH_VERTEXBUFFERNODE_H
00026 
00027 
00028 #include "vertexBufferBase.h"
00029 
00030 namespace mesh 
00031 {
00032     /*  The class for regular (non-leaf) kd-tree nodes.  */
00033     class VertexBufferNode : public VertexBufferBase
00034     {
00035     public:
00036         VertexBufferNode() : _left( 0 ), _right( 0 ) {}
00037         virtual ~VertexBufferNode();
00038 
00039         virtual void render( VertexBufferState& state ) const;
00040         virtual Index getNumberOfVertices() const
00041             {return _left->getNumberOfVertices()+_right->getNumberOfVertices();}
00042 
00043         virtual const VertexBufferBase* getLeft() const { return _left; }
00044         virtual const VertexBufferBase* getRight() const { return _right; }
00045 
00046     protected:
00047         virtual void toStream( std::ostream& os );
00048         virtual void fromMemory( char** addr, VertexBufferData& globalData );
00049 
00050         virtual void setupTree( VertexData& data, const Index start,
00051                                 const Index length, const Axis axis,
00052                                 const size_t depth, 
00053                                 VertexBufferData& globalData );
00054         virtual const BoundingSphere& updateBoundingSphere();
00055         virtual void updateRange();
00056 
00057     private:
00058 
00059         VertexBufferBase*   _left;
00060         VertexBufferBase*   _right;
00061         friend class eqPly::VertexBufferDist;
00062     };
00063 }
00064 
00065 
00066 #endif // MESH_VERTEXBUFFERNODE_H
Generated on Mon Aug 10 18:58:41 2009 for Equalizer 0.9 by  doxygen 1.5.8