Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXGLCylinder.h

00001 /********************************************************************************
00002 *                                                                               *
00003 *                     O p e n G L   C y l i n d e r    O b j e c t              *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,2002 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or                 *
00009 * modify it under the terms of the GNU Lesser General Public                    *
00010 * License as published by the Free Software Foundation; either                  *
00011 * version 2.1 of the License, or (at your option) any later version.            *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
00016 * Lesser General Public License for more details.                               *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public              *
00019 * License along with this library; if not, write to the Free Software           *
00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
00021 *********************************************************************************
00022 * $Id: FXGLCylinder.h,v 1.11 2002/01/18 22:46:41 jeroen Exp $                   *
00023 ********************************************************************************/
00024 #ifndef FXGLCYLINDER_H
00025 #define FXGLCYLINDER_H
00026 
00027 #ifndef FXGLSHAPE_H
00028 #include "FXGLShape.h"
00029 #endif
00030 
00031 
00032 
00033 /// OpenGL Cylinder Object
00034 class FXAPI FXGLCylinder : public FXGLShape {
00035   FXDECLARE(FXGLCylinder)
00036 public:
00037   FXfloat height;
00038   FXfloat radius;
00039 protected:
00040   FXGLCylinder();
00041   virtual void drawshape(FXGLViewer* viewer);
00042 public:
00043 
00044   /// Construct with specified origin, height and radius
00045   FXGLCylinder(FXfloat x,FXfloat y,FXfloat z,FXfloat h=1.0f, FXfloat r=1.0f);
00046 
00047   /// Construct with specified origin, height, radius and material
00048   FXGLCylinder(FXfloat x,FXfloat y,FXfloat z,FXfloat h,FXfloat r,const FXMaterial& mtl);
00049 
00050   /// Copy constructor
00051   FXGLCylinder(const FXGLCylinder& orig);
00052 
00053   /// Copy this object
00054   virtual FXGLObject* copy();
00055 
00056   /// Change radius
00057   void setRadius(FXfloat r){ radius=r; }
00058   FXfloat getRadius() const { return radius; }
00059 
00060   /// Change height
00061   void setHeight(FXfloat h){ height=h; }
00062   FXfloat getHeight() const { return height; }
00063 
00064   /// Save to a stream
00065   virtual void save(FXStream& store) const;
00066 
00067   /// Load from a stream
00068   virtual void load(FXStream& store);
00069 
00070   virtual ~FXGLCylinder();
00071   };
00072 
00073 #endif