GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_cylinder.h
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5  http://glc-lib.sourceforge.net
6 
7  GLC-lib is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  GLC-lib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GLC-lib; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21 *****************************************************************************/
22 
24 
25 #ifndef GLC_CYLINDER_H_
26 #define GLC_CYLINDER_H_
27 
28 #include "glc_mesh.h"
29 #include "../glc_config.h"
30 
33 
38 
40 {
42 
44 
45 public:
46 
48 
52  GLC_Cylinder(double dRadius, double dLength, int discretization= glc::GLC_POLYDISCRET);
53 
55  GLC_Cylinder(const GLC_Cylinder& sourceCylinder);
56 
58  virtual ~GLC_Cylinder();
59 
61 
63 
65 
66 public:
68  static quint32 chunckID();
69 
71  inline double length(void) const
72  {return m_Length;}
73 
75  inline double radius(void) const
76  {return m_Radius;}
77 
79  inline int discretion(void) const
80  {return m_Discret;}
81 
83  virtual GLC_Geometry* clone() const;
84 
86  bool EndedIsCaped() const {return m_EndedIsCaped;}
87 
89  virtual const GLC_BoundingBox& boundingBox(void);
90 
92 
94 
96 
97 public:
99 
100  void setLength(double Length);
101 
103 
104  void setRadius(double Radius);
105 
107 
108  void setDiscretion(int TargetDiscret);
109 
111  void setEndedCaps(bool CapsEnded);
112 
114 
116 
118 
119 private:
121 
123  virtual void glDraw(const GLC_RenderProperties&);
125 
127 
129 
130 private:
132  void createMeshAndWire();
133 
135 
137 // Private members
139 private:
140 
142  double m_Radius;
143 
145  double m_Length;
146 
149 
152 
154  static quint32 m_ChunkId;
155 
156 };
157 #endif //GLC_CYLINDER_H_

©2005-2013 Laurent Ribon