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

FXGLCube.h

00001 /********************************************************************************
00002 *                                                                               *
00003 *                        O p e n G L   C u b e    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: FXGLCube.h,v 1.11 2002/01/18 22:46:41 jeroen Exp $                       *
00023 ********************************************************************************/
00024 #ifndef FXGLCUBE_H
00025 #define FXGLCUBE_H
00026 
00027 #ifndef FXGLSHAPE_H
00028 #include "FXGLShape.h"
00029 #endif
00030 
00031 
00032 
00033 /// OpenGL Cube Object
00034 class FXAPI FXGLCube : public FXGLShape {
00035   FXDECLARE(FXGLCube)
00036 public:
00037   FXfloat width;
00038   FXfloat height;
00039   FXfloat depth;
00040 protected:
00041   FXGLCube();
00042   virtual void drawshape(FXGLViewer* viewer);
00043 public:
00044 
00045   /// Construct with specified origin, width, height and depth
00046   FXGLCube(FXfloat x,FXfloat y,FXfloat z,FXfloat w=1.0f,FXfloat h=1.0f,FXfloat d=1.0f);
00047 
00048   /// Construct with specified origin, width, height, depth and material
00049   FXGLCube(FXfloat x,FXfloat y,FXfloat z,FXfloat w,FXfloat h,FXfloat d,const FXMaterial& mtl);
00050 
00051   /// Copy constructor
00052   FXGLCube(const FXGLCube& orig);
00053 
00054   /// Copy this object
00055   virtual FXGLObject* copy();
00056 
00057   /// Change width
00058   void setWidth(FXfloat w){ width=w; }
00059   FXfloat getWidth() const { return width; }
00060 
00061   /// Change height
00062   void setHeight(FXfloat h){ height=h; }
00063   FXfloat getHeight() const { return height; }
00064 
00065   /// Change depth
00066   void setDepth(FXfloat d){ depth=d; }
00067   FXfloat getDepth() const { return depth; }
00068 
00069   /// Save to a stream
00070   virtual void save(FXStream& store) const;
00071 
00072   /// Load from a stream
00073   virtual void load(FXStream& store);
00074 
00075   /// Destroy
00076   virtual ~FXGLCube();
00077   };
00078 
00079 
00080 #endif