TAPs 0.7.7.3
TAPsOpenGL3DModel.hpp
Go to the documentation of this file.
00001 /******************************************************************************
00002 OpenGL3DModel.hpp
00003 
00004 An OpenGL 3D Texture Model
00005 
00006 SUKITTI PUNAK   (04/28/2007)
00007 UPDATE          (04/29/2007)
00008 ******************************************************************************/
00009 #ifndef TAPs_OPENGL_3D_MODEL_HPP
00010 #define TAPs_OPENGL_3D_MODEL_HPP
00011 
00012 #include "../OpenGLModel/TAPsOpenGLModel.hpp"
00013 
00014 // For DEBUG
00015 // Print the 3D texture data to screen after the SetData has been called.
00016 //#define TAPs_OPENGL_3D_MODEL_DEBUG
00017 
00018 BEGIN_NAMESPACE_TAPs__OpenGL
00019 //=============================================================================
00020 template <typename T>
00021 class OpenGL3DModel : public /*virtual*/ OpenGLModel<T> {
00022 //-----------------------------------------------------------------------------
00023 // Member Functions -----------------------------------------------------------
00024 public:
00025     //-------------------------------------------------------------------------
00026     // default constructor
00027     OpenGL3DModel ();
00028     //-------------------------------------------------------------------------
00029     // destructor
00030     virtual ~OpenGL3DModel ();
00031     //-------------------------------------------------------------------------
00032     void Default ();
00033     //-------------------------------------------------------------------------
00034     // Display By OpenGL
00035     virtual void DrawGL ( GLenum drawMode = GL_QUADS );
00036     //virtual void DrawGL ( GLenum );
00037     //-------------------------------------------------------------------------
00038     // Virtual Fns from Model class
00039     virtual void Initialize ();
00040     virtual T GetMaxHalfLength () const;    // get half length
00041     //-------------------------------------------------------------------------
00042     //template <typename T2>
00043     //bool SetData ( int sizeX, int sizeY, int sizeZ, T2 * pr3DRawData );
00044     bool SetData ( int sizeX, int sizeY, int sizeZ, unsigned char * pr3DRawData );
00045     //-------------------------------------------------------------------------
00046     // Get/Set Fn(s)
00047     // A derived model class should overwrite this fn in order to set display 
00048     // vertex normals status
00049     virtual inline void ToggleDisplayVertexNormals () {};
00050     virtual void DrawVertexNormals () {};
00051     //-------------------------------------------------------------------------
00052     #ifdef TAPs_OPENGL_3D_MODEL_DEBUG
00053     // Get data from 3D texture and print them out
00054     void PrintDataInThe3DTexture ();
00055     #endif
00056     //-------------------------------------------------------------------------
00057 //-DATA MEMBERS----------------------------------------------------------------
00058 private:
00059     GLuint  m_gluiName3DTexture;    // OpenGL 3D Texture
00060     //
00061     GLenum  m_3dt_target;           // texture target -- GL_TEXTURE_3D
00062     GLint   m_3dt_level;            // texture level -- 0 is the base texture level
00063     GLint   m_3dt_internalFormat;   // e.g. GL_RGB32F_ARB, GL_RGBA32F_ARB
00064     GLint   m_3dt_size[3];          // size of x, y, and z
00065     GLint   m_3dt_border;           // the width of the border, either 0 or 1
00066     GLenum  m_3dt_pixelFormat;      // e.g. GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE, etc.
00067     GLenum  m_3dt_dataType;         // GL_FLOAT, GL_UNSIGNED_BYTE, GL_BYTE, GL_INT, etc.
00068 };
00069 //=============================================================================
00070 END_NAMESPACE_TAPs__OpenGL
00071 //-----------------------------------------------------------------------------
00072 // Include definition if TAPs_USE_EXPORT is not defined
00073 //#if !defined( TAPs_USE_EXPORT )
00074     #include "TAPsOpenGL3DModel.cpp"
00075 //#endif
00076 //-----------------------------------------------------------------------------
00077 #endif
00078 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00079 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines