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

FXGLSphere.h
1 /********************************************************************************
2 * *
3 * O p e n G L S p h e r e O b j e c t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2016 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (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 *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXGLSPHERE_H
22 #define FXGLSPHERE_H
23 
24 #ifndef FXGLSHAPE_H
25 #include "FXGLShape.h"
26 #endif
27 
28 namespace FX {
29 
30 
32 class FXAPI FXGLSphere : public FXGLShape {
33  FXDECLARE(FXGLSphere)
34 public:
35  FXfloat radius; // Radius of sphere
36  FXint slices; // Longitudinal subdivision
37  FXint stacks; // Latitudinal subdivision
38 protected:
39  FXGLSphere();
40  virtual void drawshape(FXGLViewer* viewer);
41 public:
42  enum {
43  ID_LAST=FXGLShape::ID_LAST
44  };
45 public:
46 
48  FXGLSphere(FXfloat x,FXfloat y,FXfloat z,FXfloat r=1.0f);
49 
51  FXGLSphere(FXfloat x,FXfloat y,FXfloat z,FXfloat r,const FXMaterial& mtl);
52 
54  FXGLSphere(const FXGLSphere& orig);
55 
57  virtual FXGLObject* copy();
58 
60  virtual void setRadius(FXfloat r);
61  FXfloat getRadius() const { return radius; }
62 
64  void setSlices(FXint s){ slices=s; }
65  FXint getSlices() const { return slices; }
66 
68  void setStacks(FXint s){ stacks=s; }
69  FXint getStacks() const { return stacks; }
70 
72  virtual void save(FXStream& store) const;
73 
75  virtual void load(FXStream& store);
76 
78  virtual ~FXGLSphere();
79  };
80 
81 }
82 
83 #endif

Copyright © 1997-2016 Jeroen van der Zijp