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

FXGLCube.h

Go to the documentation of this file.
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,2009 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (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                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 *********************************************************************************
00021 * $Id: FXGLCube.h,v 1.22 2009/01/06 13:07:24 fox Exp $                          *
00022 ********************************************************************************/
00023 #ifndef FXGLCUBE_H
00024 #define FXGLCUBE_H
00025 
00026 #ifndef FXGLSHAPE_H
00027 #include "FXGLShape.h"
00028 #endif
00029 
00030 namespace FX {
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   virtual void setWidth(FXfloat w);
00059   FXfloat getWidth() const { return width; }
00060 
00061   /// Change height
00062   virtual void setHeight(FXfloat h);
00063   FXfloat getHeight() const { return height; }
00064 
00065   /// Change depth
00066   virtual void setDepth(FXfloat 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 
00081 #endif

Copyright © 1997-2009 Jeroen van der Zijp