GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_sphere.h
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2010 Laurent Bauer
5  Copyright (C) 2010 Laurent Ribon (laumaya@users.sourceforge.net)
6  http://glc-lib.sourceforge.net
7 
8  GLC-lib is free software; you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation; either version 3 of the License, or
11  (at your option) any later version.
12 
13  GLC-lib is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License
19  along with GLC-lib; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22  *****************************************************************************/
24 
25 #ifndef GLC_SPHERE_H_
26 #define GLC_SPHERE_H_
27 
28 #include "glc_mesh.h"
29 #include "../maths/glc_vector3d.h"
30 #include "../glc_config.h"
31 
34 
37 
39 {
41 
43 
44 public:
46  GLC_Sphere(double radius, int discretization= glc::GLC_POLYDISCRET);
47 
49  GLC_Sphere(double radius, const GLC_Point3d& center, int discretization= glc::GLC_POLYDISCRET);
50 
52  GLC_Sphere(const GLC_Sphere & sphere);
53 
55  virtual ~GLC_Sphere();
57 
59 
61 
62 public:
64  static quint32 chunckID();
65 
67  inline double radius(void) const
68  {return m_Radius;}
69 
71  inline int discretion(void) const
72  {return m_Discret;}
73 
75  virtual GLC_Geometry* clone() const;
76 
78  virtual const GLC_BoundingBox& boundingBox(void);
79 
81  inline GLC_Point3d center() const
82  {return m_Center;}
84 
86 
88 
89 public:
91 
92  void setRadius(double Radius);
93 
95 
96  void setDiscretion(int TargetDiscret);
97 
99  void setCenter(const GLC_Point3d& pos);
100 
102 
104 
106 
107 private:
109 
111  virtual void glDraw(const GLC_RenderProperties&);
113 
115 
117 
118 private:
120  void createMesh();
121 
123 
125 // Private members
127 private:
129  double m_Radius;
130 
133 
134  double m_ThetaMin;
135  double m_ThetaMax;
136  double m_PhiMin;
137  double m_PhiMax;
138 
140 
142  static quint32 m_ChunkId;
143 
144 };
145 
146 #endif /* GLC_SPHERE_H_ */

©2005-2013 Laurent Ribon