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

FXGLCube.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * O p e n G L C u b e O b j e c t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXGLCube.h,v 1.17 2006/01/22 17:58:02 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXGLCUBE_H
25 #define FXGLCUBE_H
26 
27 #ifndef FXGLSHAPE_H
28 #include "FXGLShape.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 /// OpenGL Cube Object
35 class FXAPI FXGLCube : public FXGLShape {
37 public:
41 protected:
42  FXGLCube();
43  virtual void drawshape(FXGLViewer* viewer);
44 public:
45 
46  /// Construct with specified origin, width, height and depth
47  FXGLCube(FXfloat x,FXfloat y,FXfloat z,FXfloat w=1.0f,FXfloat h=1.0f,FXfloat d=1.0f);
48 
49  /// Construct with specified origin, width, height, depth and material
51 
52  /// Copy constructor
53  FXGLCube(const FXGLCube& orig);
54 
55  /// Copy this object
56  virtual FXGLObject* copy();
57 
58  /// Change width
59  void setWidth(FXfloat w){ width=w; }
60  FXfloat getWidth() const { return width; }
61 
62  /// Change height
63  void setHeight(FXfloat h){ height=h; }
64  FXfloat getHeight() const { return height; }
65 
66  /// Change depth
67  void setDepth(FXfloat d){ depth=d; }
68  FXfloat getDepth() const { return depth; }
69 
70  /// Save to a stream
71  virtual void save(FXStream& store) const;
72 
73  /// Load from a stream
74  virtual void load(FXStream& store);
75 
76  /// Destroy
77  virtual ~FXGLCube();
78  };
79 
80 }
81 
82 #endif
Definition: FXGLViewer.h:79
Basic OpenGL object.
Definition: FXGLObject.h:39
OpenGL viewer widget.
Definition: FXGLViewer.h:100
FXfloat width
Definition: FXGLCube.h:38
#define FXAPI
Definition: fxdefs.h:122
OpenGL Shape Object.
Definition: FXGLShape.h:64
OpenGL Cube Object.
Definition: FXGLCube.h:35
FXfloat depth
Definition: FXGLCube.h:40
float FXfloat
Definition: fxdefs.h:398
FXfloat height
Definition: FXGLCube.h:39
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92

Copyright © 1997-2005 Jeroen van der Zijp