/// This file is part of the X3DToolKit library
/// Copyright (C) 2002-2004  Yannick Le Goc (legoc@imag.fr)

/// http://artis.imag.fr/Members/Yannick.Legoc/X3D/

/// This library is free software; you can redistribute it and/or
/// modify it under the terms of the GNU Lesser General Public
/// License as published by the Free Software Foundation; either
/// version 2.1 of the License, or (at your option) any later version.

/// This library is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
/// Lesser General Public License for more details.

/// You should have received a copy of the GNU Lesser General Public
/// License along with this library; if not, write to the Free Software
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#ifndef X3DTK_GL_CYLINDER_H
#define X3DTK_GL_CYLINDER_H

#include "GL_X3DGeometryNode.h"

namespace X3DTK {
namespace GL {

class CylinderDrawArray;

/*! \brief Class declared in <b><X3DTK/GL/scenegraph.h></b> providing the GL implementation
 *  of X3D::Cylinder.
 *
 *  \ingroup GLSceneGraph
 */
 
class Cylinder : public X3DGeometryNode
{
public:
  /// Constructor.
  Cylinder();
  /// Destructor.
  virtual ~Cylinder();
  
  /// Radius attribute.
  void setRadius(const SFFloat &radius);
  /// Height attribute.
  void setHeight(const SFFloat &height);
  /// Side attribute.
  void setSide(const SFBool &side);
  /// Bottom attribute.
  void setBottom(const SFBool &bottom);
  /// Top attribute.
  void setTop(const SFBool &top);
  /// Cylinder array.
  void setCylinderArray(CylinderDrawArray *cylinderArray);
  
  /// Radius attribute.
  inline const SFFloat &getRadius() const {return _radius;};
  /// Height attribute.
  inline const SFFloat &getHeight() const {return _height;};
  /// Side attribute.
  inline const SFBool &getSide() const {return _side;};
  /// Bottom attribute.
  inline const SFBool &getBottom() const {return _bottom;};
  /// Top attribute.
  inline const SFBool &getTop() const {return _top;};
  /// Cylinder array.
  inline CylinderDrawArray *getCylinderArray() const {return _cylinderArray;};
  
  /// Updates the attributes of the node.
  virtual void update();
  /// Renders the node in an openGL context.
  virtual void draw() const; 

private:  
  /// Radius attribute.
  SFFloat _radius;
  /// Height attribute.
  SFFloat _height;
  /// Side attribute.
  SFBool _side;
  /// Bottom attribute.
  SFBool _bottom;
  /// Top attribute.
  SFBool _top;
  /// Cylinder array.
  CylinderDrawArray *_cylinderArray;
};

}
}

#endif
