00001 /* 00002 File: ImplicitShape.h 00003 00004 Copyright(C) C. Kotterink, Computed Graphics 00005 */ 00006 #ifndef IMPLICITSHAPE_H 00007 #define IMPLICITSHAPE_H 00008 00009 #include<Color4.h> 00010 #include<Shape.h> 00011 #include<ObjectFile.h> 00012 #include<Shade.h> 00013 00014 #include<real.h> 00015 #include<vector> 00016 00017 class Vertex3; 00018 class Shade; 00019 00022 class ImplicitShape : public Shape 00023 { 00024 DYNAMIC_OBJECT; 00025 public: 00026 typedef vector<ImplicitShape*> ImplicitArray; 00027 static const real epsilon; 00028 00029 ImplicitShape() : bound(0) {} 00030 00031 virtual ~ImplicitShape(); 00032 00033 virtual real distance(const Vertex3 &v); 00034 00035 // Inherited from Shape 00036 Vertex3 normal(const Vertex3 &v); 00037 real intersect(const Ray &ray, real t = step, real T = infinity); 00038 00039 // Inherited from DynamicObject 00040 void parseSymbol(Token &t, ObjectFile &file); 00041 void writeParams(ostream &stream); 00042 00043 protected: 00044 // Inherited from DynamicObject 00045 void createSymbols(); 00046 00047 AABoundingBox *bound; 00048 00049 private: 00050 typedef Shape super; 00051 }; 00052 #endif 00053