vertexBufferLeaf.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef MESH_VERTEXBUFFERLEAF_H
00025 #define MESH_VERTEXBUFFERLEAF_H
00026
00027
00028 #include "vertexBufferBase.h"
00029
00030
00031 namespace mesh
00032 {
00033
00034 class VertexBufferLeaf : public VertexBufferBase
00035 {
00036 public:
00037 VertexBufferLeaf( VertexBufferData& data )
00038 : _globalData( data ), _vertexStart( 0 ),
00039 _indexStart( 0 ), _indexLength( 0 ) {}
00040 virtual ~VertexBufferLeaf() {}
00041
00042 virtual void render( VertexBufferState& state ) const;
00043 virtual Index getNumberOfVertices() const { return _indexLength; }
00044
00045 protected:
00046 virtual void toStream( std::ostream& os );
00047 virtual void fromMemory( char** addr, VertexBufferData& globalData );
00048
00049 virtual void setupTree( VertexData& data, const Index start,
00050 const Index length, const Axis axis,
00051 const size_t depth,
00052 VertexBufferData& globalData );
00053 virtual const BoundingSphere& updateBoundingSphere();
00054 virtual void updateRange();
00055
00056 private:
00057 void setupRendering( VertexBufferState& state, GLuint* data ) const;
00058 void renderImmediate( VertexBufferState& state ) const;
00059 void renderDisplayList( VertexBufferState& state ) const;
00060 void renderBufferObject( VertexBufferState& state ) const;
00061
00062 VertexBufferData& _globalData;
00063 Index _vertexStart;
00064 ShortIndex _vertexLength;
00065 Index _indexStart;
00066 Index _indexLength;
00067 friend class eqPly::VertexBufferDist;
00068 };
00069
00070
00071 }
00072
00073
00074 #endif // MESH_VERTEXBUFFERLEAF_H