Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Torus.h

00001 /*
00002   File: Torus.h
00003 
00004   Copyright(C) C. Kotterink, Computed Graphics
00005 */
00006 #ifndef TORUS_H
00007 #define TORUS_H
00008 
00009 #include<ImplicitShape.h>
00010 #include<Vertex3.h>
00011 #include<real.h>
00012 
00015 class Torus : public ImplicitShape
00016 {
00017     DYNAMIC_OBJECT;
00018 public:
00019     Torus(
00020         Vertex3 position = Vertex3(0.0, 0.0, 0.0),
00021         Vertex3 normal = Vertex3(0.0, 1.0, 0.0),
00022         real major = 1.0,
00023         real minor = 0.1
00024     ) : p(position), n(normal), R(major), r(minor) {
00025         n.normalize();
00026     }
00027 
00028     // Inherited from ImplicitShape
00029     real distance(const Vertex3 &v);
00030 
00031     // Inherited from Shape
00032     Vertex3 normal(const Vertex3 &v);
00033 
00034     // Inherited from DynamicObject
00035     void parseSymbol(Token &t, ObjectFile &file);
00036     void writeParams(ostream &stream);
00037 
00038 protected:
00039     // Inherited from DynamicObject
00040     void createSymbols();
00041 
00042     Vertex3 p;
00043     Vertex3 n;  
00044     real r;
00045     real R;
00046 
00047 private:
00048     typedef ImplicitShape super;
00049 };
00050 #endif

This documentation was generated using doxygen. If you have any comments or additions please mail me.