00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
#include <vector>
00010 
#include "../src/RadialLayout.h"
00011 
#include "../src/main.h"
00012 
00013 
00014 
using std::vector;
00015 
00016 
00017 
00018 
00019 
00020 
00021 void RadialLayout::renderRadialLayout(GLUquadricObj *quadric_object)
00022 {
00023     
00024   glEnable(GL_BLEND);
00025   gluQuadricDrawStyle(quadric_object, GLU_FILL);
00026   glColor4f(1.0f, 0.3f, 0.3f, 0.3f);
00027   gluDisk(quadric_object, 0.0f, 0.03f, 200, 1);
00028   glDisable(GL_BLEND);
00029 
00030   glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE_MINUS_SRC_ALPHA);
00031   glEnable(GL_POLYGON_SMOOTH);
00032   glEnable(GL_BLEND);
00033   glColor4f(0.0f, 0.0f, 0.0f, 0.3f);
00034   glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
00035 
00036   
for (GLuint count = 0; count < 
num_displayed_rings_; count++)
00037   {
00038     gluQuadricDrawStyle(quadric_object, GLU_SILHOUETTE);
00039     
radius_of_rings_[count + 1] =
00040       (GLfloat) (0.50 + (
radius_of_rings_.at(count) * 0.8));
00041 
00042     gluDisk(quadric_object, 0.0f, 
radius_of_rings_.at(count), 200, 1);
00043   }
00044 
00045   glDisable(GL_POLYGON_SMOOTH);
00046 }
00047 
00048 
00049 
00050 
00051 
00052 
00053 void RadialLayout::setNumberDisplayedRings(GLuint num_displayed_rings)
00054 {
00055   
num_displayed_rings_ = num_displayed_rings;
00056 }
00057 
00058 
00059 
00060 
00061 
00062 
00063 GLuint 
RadialLayout::getNumDisplayedRings()
 const
00064 
{
00065   
return(
num_displayed_rings_);
00066 }
00067 
00068 
00069 
00070 
00071 
00072 
00073 void RadialLayout::setNumberOverallRings(GLuint num_overall_rings)
00074 {
00075   
num_overall_rings_ = num_overall_rings;
00076 }
00077 
00078 
00079 
00080 
00081 
00082 
00083 GLuint 
RadialLayout::getNumOverallRings()
 const
00084 
{
00085   
return(
num_overall_rings_);
00086 }
00087 
00088 
00089 
00090 
00091 
00092 
00093 
00094 void RadialLayout::setRadiusOfRing(GLuint ring_number, GLfloat ring_radius)
00095 {
00096 
00097 
00098 
00099 
00100 
00101 
00102 }
00103 
00104 
00105 
00106 
00107 
00108 
00109 
00110 GLfloat 
RadialLayout::getRadiusOfRing(GLuint ring_number)
00111 {
00112   
for (GLuint count = 0; count < 
num_displayed_rings_; count++)
00113   {
00114     
radius_of_rings_[count + 1] =
00115       (GLfloat) (0.50 + (
radius_of_rings_[count] * 0.8));
00116   }
00117   vector<GLfloat>::iterator iter = 
radius_of_rings_.begin();
00118   GLuint count = 0;
00119   
while (iter != 
radius_of_rings_.end())
00120   {
00121     
if (ring_number == count)
00122     {
00123       
return(*iter);
00124     }
00125     ++count;
00126     ++iter;
00127   }
00128   
return(NULL);
00129 }
00130 
00131 
00132 
00133 
00134 
00135 void RadialLayout::initRadiusOfRings(GLuint num_displayed_rings)
00136 {
00137   
num_displayed_rings_ = num_displayed_rings;
00138   
for (GLuint count = 0; count < 
num_displayed_rings_; count++)
00139   {
00140     
radius_of_rings_[count + 1] =
00141       (GLfloat) (0.50 + (
radius_of_rings_[count] * 0.8));
00142   }
00143   vector<GLfloat>::iterator iter = 
radius_of_rings_.begin();
00144 
00145 
00146 
00147 
00148 
00149 
00150 }
00151 
00152