VertexArrayObject.h

00001 #ifndef VERTEX_ARRAY_COMPONENT
00002 #define VERTEX_ARRAY_COMPONENT
00003 
00004 #include <stdio.h>
00005 #include <windows.h>
00006 #include <GL/gl.h>
00007 #include <GL/glu.h>
00008 #include <GL/glut.h>
00009 
00010 #include "Geometry.h"
00011 #include "RawObject.h"
00012 
00021 class VertexArrayObject: public RawObject
00022 {
00023 public:
00027         VertexArrayObject ();
00028 
00032         ~VertexArrayObject ();
00033 
00037         virtual void Draw ();
00038 
00043         double GetBoundingRadius ();
00044 
00049         BoundingBox GetBoundingBox ();
00050 
00054         void PrintToConsole ();
00055 
00063         void ComputeNormals (bool clock_wise);
00064 
00071         void ComputeSphericalTextureCoordinates (GLuint texture_id);
00072 
00074         static bool show_normals;
00075 
00077         static float normal_length;
00078 
00079 protected:
00089         void SetVertexData (float * data, int num_vertices);
00090 
00101         void SetVertexIndices (GLuint * indices, int num_faces);
00102 
00113         void SetTextureCoordinates (float * data, GLuint texture_id);
00114 
00115 private:
00116 
00118         float * vertex_pointer;
00119 
00121         int     num_vertices;
00122 
00124         GLuint * index_pointer;
00125 
00127         int num_faces;
00128 
00130         float * normal_pointer; 
00131 
00133         float * texture_pointer;
00134 
00136         GLuint texture_id;
00137 
00139         bool bounding_volumes_computed;
00140 
00142         BoundingBox bounding_box;
00143 
00145         double          bounding_radius;
00146 
00150         void Draw_Normals ();
00151 
00155         void ComputeBoundingVolumes ();
00156 };
00157 
00158 #endif

Generated on Sun Jul 2 13:20:40 2006 for Demo by  doxygen 1.4.6-NO