glc_cylinder.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  http://glc-lib.sourceforge.net
00006 
00007  GLC-lib is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU Lesser General Public License as published by
00009  the Free Software Foundation; either version 3 of the License, or
00010  (at your option) any later version.
00011 
00012  GLC-lib is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU Lesser General Public License for more details.
00016 
00017  You should have received a copy of the GNU Lesser General Public License
00018  along with GLC-lib; if not, write to the Free Software
00019  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021 *****************************************************************************/
00022 
00024 
00025 #ifndef GLC_CYLINDER_H_
00026 #define GLC_CYLINDER_H_
00027 
00028 #include "glc_mesh.h"
00029 #include "../glc_config.h"
00030 
00033 
00038 
00039 class GLC_LIB_EXPORT GLC_Cylinder : public GLC_Mesh
00040 {
00042 
00044 
00045 public:
00046 
00048 
00052         GLC_Cylinder(double dRadius, double dLength);
00053 
00055         GLC_Cylinder(const GLC_Cylinder& sourceCylinder);
00056 
00058         virtual ~GLC_Cylinder();
00059 
00061 
00063 
00065 
00066 public:
00068         static quint32 chunckID();
00069 
00071         inline double length(void) const
00072         {return m_Length;}
00073 
00075         inline double radius(void) const
00076         {return m_Radius;}
00077 
00079         inline int discretion(void) const
00080         {return m_Discret;}
00081 
00083         virtual GLC_Geometry* clone() const;
00084 
00086         bool EndedIsCaped() const {return m_EndedIsCaped;}
00087 
00089         virtual const GLC_BoundingBox& boundingBox(void);
00090 
00092 
00094 
00096 
00097 public:
00099 
00100         void setLength(double Length);
00101 
00103 
00104         void setRadius(double Radius);
00105 
00107 
00108         void setDiscretion(int TargetDiscret);
00109 
00111         void setEndedCaps(bool CapsEnded);
00112 
00114 
00116 
00118 
00119 private:
00121 
00123         virtual void glDraw(const GLC_RenderProperties&);
00125 
00127 
00129 
00130 private:
00132         void createMeshAndWire();
00133 
00135 
00137 // Private members
00139 private:
00140 
00142         double m_Radius;
00143 
00145         double m_Length;
00146 
00148         int m_Discret;
00149 
00151         bool m_EndedIsCaped;
00152 
00154         static quint32 m_ChunkId;
00155 
00156 };
00157 #endif //GLC_CYLINDER_H_

SourceForge.net Logo

©2005-2011 Laurent Ribon