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