glc_sphere.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2010 Laurent Bauer
00005  Copyright (C) 2010 Laurent Ribon (laumaya@users.sourceforge.net)
00006  http://glc-lib.sourceforge.net
00007 
00008  GLC-lib is free software; you can redistribute it and/or modify
00009  it under the terms of the GNU Lesser General Public License as published by
00010  the Free Software Foundation; either version 3 of the License, or
00011  (at your option) any later version.
00012 
00013  GLC-lib is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  GNU Lesser General Public License for more details.
00017 
00018  You should have received a copy of the GNU Lesser General Public License
00019  along with GLC-lib; if not, write to the Free Software
00020  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00021 
00022  *****************************************************************************/
00024 
00025 #ifndef GLC_SPHERE_H_
00026 #define GLC_SPHERE_H_
00027 
00028 #include "glc_mesh.h"
00029 
00030 #include "../glc_config.h"
00031 
00034 
00037 
00038 class GLC_LIB_EXPORT GLC_Sphere : public GLC_Mesh
00039 {
00041 
00043 
00044 public:
00046         GLC_Sphere(double radius);
00047 
00049         GLC_Sphere(const GLC_Sphere & sphere);
00050 
00052         virtual ~GLC_Sphere();
00054 
00056 
00058 
00059 public:
00061         static quint32 chunckID();
00062 
00064         inline double radius(void) const
00065         {return m_Radius;}
00066 
00068         inline int discretion(void) const
00069         {return m_Discret;}
00070 
00072         virtual GLC_Geometry* clone() const;
00073 
00075         virtual const GLC_BoundingBox& boundingBox(void);
00077 
00079 
00081 
00082 public:
00084 
00085         void setRadius(double Radius);
00086 
00088 
00089         void setDiscretion(int TargetDiscret);
00090 
00092 
00094 
00096 
00097 private:
00099 
00101         virtual void glDraw(const GLC_RenderProperties&);
00103 
00105 
00107 
00108 private:
00110         void createMesh();
00111 
00113 
00115 // Private members
00117 private:
00119         double m_Radius;
00120 
00122         int m_Discret;
00123 
00124         double m_ThetaMin;
00125         double m_ThetaMax;
00126         double m_PhiMin;
00127         double m_PhiMax;
00128 
00130         static quint32 m_ChunkId;
00131 
00132 };
00133 
00134 #endif /* GLC_SPHERE_H_ */

SourceForge.net Logo

©2005-2011 Laurent Ribon