FXGLSphere.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                   O p e n G L   S p h e r e   O b j e c t                     *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1998,2006 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: FXGLSphere.h,v 1.18 2006/01/22 17:58:03 fox Exp $                        *
00023 ********************************************************************************/
00024 #ifndef FX_DISABLEGL
00025 
00026 #if FX_GRAPHINGMODULE
00027 
00028 #ifndef FXGLSPHERE_H
00029 #define FXGLSPHERE_H
00030 
00031 #ifndef FXGLSHAPE_H
00032 #include "FXGLShape.h"
00033 #endif
00034 
00035 namespace FX {
00036 
00037 
00039 class FXGRAPHINGMODULEAPI FXGLSphere : public FXGLShape {
00040   FXDECLARE(FXGLSphere)
00041 public:
00042   FXfloat radius;   // Radius of sphere
00043   FXint   slices;   // Longitudinal subdivision
00044   FXint   stacks;   // Latitudinal subdivision
00045 protected:
00046   FXGLSphere();
00047   virtual void drawshape(FXGLViewer* viewer);
00048 public:
00049   enum {
00050     ID_LAST=FXGLShape::ID_LAST
00051     };
00052 public:
00053 
00055   FXGLSphere(FXfloat x,FXfloat y,FXfloat z,FXfloat r=1.0f);
00056 
00058   FXGLSphere(FXfloat x,FXfloat y,FXfloat z,FXfloat r,const FXMaterial& mtl);
00059 
00061   FXGLSphere(const FXGLSphere& orig);
00062 
00064   virtual FXGLObject* copy();
00065 
00067   void setRadius(FXfloat r){ radius=r; }
00068   FXfloat getRadius() const { return radius; }
00069 
00071   void setSlices(FXint s){ slices=s; }
00072   FXint getSlices() const { return slices; }
00073 
00075   void setStacks(FXint s){ stacks=s; }
00076   FXint getStacks() const { return stacks; }
00077 
00079   virtual void save(FXStream& store) const;
00080 
00082   virtual void load(FXStream& store);
00083 
00085   virtual ~FXGLSphere();
00086   };
00087 
00088 }
00089 
00090 #endif
00091 #endif
00092 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:22 2009 for TnFOX by doxygen v1.4.7