00001 /***************************************************************************** 00002 * SGL: A Scene Graph Library 00003 * 00004 * Copyright (C) 1997-2001 Scott McMillan All Rights Reserved. 00005 * 00006 * This library is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * 00011 * This library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Library General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Library General Public 00017 * License along with this library; if not, write to the Free 00018 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 ***************************************************************************** 00020 * File: sglCylinder.hpp 00021 * Author: John K. Hammond 00022 * Created: 1 October 2001 00023 * Summary: an leaf sglNode containing the geometry for "cylinders". 00024 *****************************************************************************/ 00025 00026 #ifndef SGL_CYLINDER_HPP 00027 #define SGL_CYLINDER_HPP 00028 00029 #include <sgldb.h> 00030 #include <sglTriangleStripSet.hpp> 00031 00066 //---------------------------------------------------------------------------- 00067 00068 class SGLDB_DLL_API sglCylinder : public sglTriangleStripSet 00069 { 00070 public: 00081 sglCylinder(unsigned int num_slices, unsigned int num_stacks, 00082 float height = 1.0f, 00083 float base_radius = 1.0f, float top_radius = 1.0f, 00084 bool end_caps_flag = true); 00085 00087 virtual ~sglCylinder(); 00088 00092 virtual void printInfo(ostream &ostrm, const char *indent_string) const; 00093 00094 protected: 00095 00096 private: 00097 sglCylinder(); // not implemented 00098 sglCylinder(const sglCylinder &); // not implemented 00099 sglCylinder &operator=(const sglCylinder &); // not implemented 00100 00101 void makeCylinder(); 00102 00103 private: 00104 unsigned int m_num_slices, m_num_stacks; 00105 float m_base_radius; 00106 float m_top_radius; 00107 float m_height; 00108 bool m_end_caps_flag; 00109 }; 00110 00111 #endif