glc_circle.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  Version 2.0.0 Beta 1, packaged on April 2010.
00006 
00007  http://glc-lib.sourceforge.net
00008 
00009  GLC-lib is free software; you can redistribute it and/or modify
00010  it under the terms of the GNU General Public License as published by
00011  the Free Software Foundation; either version 2 of the License, or
00012  (at your option) any later version.
00013 
00014  GLC-lib is distributed in the hope that it will be useful,
00015  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  GNU General Public License for more details.
00018 
00019  You should have received a copy of the GNU General Public License
00020  along with GLC-lib; if not, write to the Free Software
00021  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022 
00023 *****************************************************************************/
00024 
00026 
00027 #ifndef GLC_CIRCLE_H_
00028 #define GLC_CIRCLE_H_
00029 
00030 #include "glc_geometry.h"
00031 
00032 #include "../glc_config.h"
00033 
00036 
00041 
00042 class GLC_LIB_EXPORT GLC_Circle : public GLC_Geometry
00043 {
00045 
00047 
00048 public:
00049 
00051 
00052         GLC_Circle(const double &dRadius, double Angle= 2.0 * glc::PI);
00053 
00055         GLC_Circle(const GLC_Circle& sourceCircle);
00056 
00058         virtual ~GLC_Circle();
00059 
00061 
00063 
00065 
00066 public:
00067 
00069         inline int discretion() const
00070         { return m_Discret;}
00071 
00073         inline double radius() const
00074         {return m_Radius;}
00075 
00077         inline double diameter() const
00078         {return m_Radius * 2.0;}
00079 
00081         virtual const GLC_BoundingBox& boundingBox();
00082 
00084         virtual GLC_Geometry* clone() const;
00086 
00088 
00090 
00091 public:
00093 
00094         void setDiameter(double D);
00095 
00097 
00098         void setRadius(double R);
00099 
00101 
00103         void setDiscretion(int TargetDiscret);
00104 
00106 
00107         void setAngle(double AngleRadians);     // Angle in Radians
00108 
00110 
00112 
00114 
00115 private:
00116 
00118 
00120         virtual void glDraw(const GLC_RenderProperties&);
00122 
00124 
00126 
00127 private:
00129         void createWire();
00130 
00132 
00134 // private members
00136 private:
00138         double m_Radius;
00139 
00141         int m_Discret;
00142 
00144         double m_Angle;
00145 
00147         GLuint m_Step;
00148 
00149 };
00150 #endif //GLC_CIRCLE_H_

SourceForge.net Logo

©2005 Laurent Ribon