00001 #ifndef GLUTM_SHAPE_H
00002 #define GLUTM_SHAPE_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00033 #include <glutm/config.h>
00034
00035 #include <node/shape.h>
00036
00038
00045 class GlutSphere : public GltShape
00046 {
00047 public:
00055 GlutSphere(const bool solid = true,const GLdouble radius = 1.0,const GLint slices = 15,const GLint stacks = 15);
00057 ~GlutSphere();
00058
00059
00060
00061 virtual void draw() const;
00062 virtual GLdouble volume() const;
00063 virtual bool inside(const Vector &pos) const;
00064 virtual void boundingBox(BoundingBox &box) const;
00065 virtual bool povrayExport(std::ostream &os) const;
00066
00067
00068
00069
00070
00076 void position(const Vector &pos,const double radius);
00077
00078
00079
00080
00081
00083 GLdouble &radius();
00085 GLint &slices();
00087 GLint &stacks();
00088
00090 const GLdouble &radius() const;
00092 const GLint &slices() const;
00094 const GLint &stacks() const;
00095
00096 private:
00097
00098 GLdouble _radius;
00099 GLint _slices;
00100 GLint _stacks;
00101 };
00102
00104
00111 class GlutCube : public GltShape
00112 {
00113 public:
00119 GlutCube(const bool solid = true,const GLdouble size = 2.0);
00126 GlutCube(const bool solid ,const Vector &min,const Vector &max);
00128 ~GlutCube();
00129
00130 virtual void draw() const;
00131 virtual GLdouble volume() const;
00132 virtual void boundingBox(BoundingBox &box) const;
00133 virtual bool povrayExport(std::ostream &os) const;
00134
00135
00136
00137
00138
00144 void position(const Vector &min,const Vector &max);
00152 void position(const Vector &pos,const real width,const real height,const real depth);
00153
00154
00155
00156
00157
00159 GLdouble &size();
00161 const GLdouble &size() const;
00162
00163 private:
00164
00165 GLdouble _size;
00166 };
00167
00169
00176 class GlutCylinder : public GltShape
00177 {
00178 public:
00188 GlutCylinder(const bool solid = true,const GLdouble radius = 1.0,const GLdouble height = 1.0,const GLint slices = 15,const GLint stacks = 10,const GLint loops = 5);
00190 ~GlutCylinder();
00191
00192 virtual void draw() const;
00193 virtual GLdouble volume() const;
00194 virtual void boundingBox(BoundingBox &box) const;
00195 virtual bool povrayExport(std::ostream &os) const;
00196
00197
00198
00199
00200
00207 void position(const Vector &begin,const Vector &end,const double radius);
00208
00209
00210
00211
00212
00214 GLdouble &radius();
00216 GLdouble &height();
00218 GLint &slices();
00220 GLint &stacks();
00222 GLint &loops();
00223
00225 const GLdouble &radius() const;
00227 const GLdouble &height() const;
00229 const GLint &slices() const;
00231 const GLint &stacks() const;
00233 const GLint &loops() const;
00234
00235 private:
00236
00237 GLdouble _radius;
00238 GLdouble _height;
00239 GLint _slices;
00240 GLint _stacks;
00241 GLint _loops;
00242 };
00243
00245
00252 class GlutCone : public GltShape
00253 {
00254 public:
00263 GlutCone(const bool solid = true,const GLdouble base = 1.0,const GLdouble height = 1.0,const GLint slices = 15,const GLint stacks = 10);
00265 ~GlutCone();
00266
00267 virtual void draw() const;
00268 virtual GLdouble volume() const;
00269 virtual void boundingBox(BoundingBox &box) const;
00270
00272 GLdouble &base();
00274 GLdouble &height();
00276 GLint &slices();
00278 GLint &stacks();
00279
00281 const GLdouble &base() const;
00283 const GLdouble &height() const;
00285 const GLint &slices() const;
00287 const GLint &stacks() const;
00288
00289 private:
00290
00291 GLdouble _base;
00292 GLdouble _height;
00293 GLint _slices;
00294 GLint _stacks;
00295 };
00296
00298
00305 class GlutTorus : public GltShape
00306 {
00307 public:
00316 GlutTorus(const bool solid = true,const GLdouble innerRadius = 0.5,const GLdouble outerRadius = 1.0,const GLint nsides = 10,const GLint rings = 16);
00318 ~GlutTorus();
00319
00320 virtual void draw() const;
00321
00323 GLdouble &innerRadius();
00325 GLdouble &outerRadius();
00327 GLint &nsides();
00329 GLint &rings();
00330
00332 const GLdouble &innerRadius() const;
00334 const GLdouble &outerRadius() const;
00336 const GLint &nsides() const;
00338 const GLint &rings() const;
00339
00340 private:
00341
00342 GLdouble _innerRadius;
00343 GLdouble _outerRadius;
00344 GLint _nsides;
00345 GLint _rings;
00346 };
00347
00349
00356 class GlutDodecahedron : public GltShape
00357 {
00358 public:
00363 GlutDodecahedron(const bool solid = true);
00365 ~GlutDodecahedron();
00366
00367 virtual void draw() const;
00368 };
00369
00371
00378 class GlutOctahedron : public GltShape
00379 {
00380 public:
00385 GlutOctahedron(const bool solid = true);
00387 ~GlutOctahedron();
00388
00389 virtual void draw() const;
00390 };
00391
00393
00400 class GlutTetrahedron : public GltShape
00401 {
00402 public:
00407 GlutTetrahedron(const bool solid = true);
00409 ~GlutTetrahedron();
00410
00411 virtual void draw() const;
00412 };
00413
00415
00422 class GlutIcosahedron : public GltShape
00423 {
00424 public:
00429 GlutIcosahedron(const bool solid = true);
00431 ~GlutIcosahedron();
00432
00433 virtual void draw() const;
00434 };
00435
00437
00444 class GlutTeapot : public GltShape
00445 {
00446 public:
00452 GlutTeapot(const bool solid = true,const GLdouble size = 1.0);
00454 ~GlutTeapot();
00455
00456 virtual void draw() const;
00457
00459 GLdouble &size();
00461 const GLdouble &size() const;
00462
00463 private:
00464
00465 GLdouble _size;
00466 };
00467
00468 #endif