BALL
1.4.1
|
00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: tube.h,v 1.11.16.1 2007-03-25 21:26:12 oliver Exp $ 00005 // 00006 00007 #ifndef BALL_VIEW_PRIMITIV_TUBE_H 00008 #define BALL_VIEW_PRIMITIV_TUBE_H 00009 00010 #ifndef BALL_VIEW_KERNEL_GEOMETRICOBJECT_H 00011 # include <BALL/VIEW/KERNEL/geometricObject.h> 00012 #endif 00013 00014 #ifndef BALL_VIEW_DATATYPE_VERTEX2_H 00015 # include <BALL/VIEW/DATATYPE/vertex2.h> 00016 #endif 00017 00018 namespace BALL 00019 { 00020 namespace VIEW 00021 { 00022 00037 class BALL_VIEW_EXPORT Tube 00038 : public GeometricObject, 00039 public Vertex2 00040 { 00041 public: 00042 00043 BALL_CREATE(Tube) 00044 00045 00048 00062 Tube(); 00063 00069 Tube(const Tube& tube); 00070 00072 00074 00078 virtual ~Tube(); 00079 00088 virtual void clear(); 00089 00091 00094 00099 void set(const Tube& tube); 00100 00104 const Tube& operator = (const Tube& tube); 00105 00110 void swap(Tube& tube); 00111 00113 00115 00120 float getLength() const 00121 {return (getVertex1() - getVertex2()).getLength();} 00122 00127 float getSquareLength() const 00128 {return (getVertex1() - getVertex2()).getSquareLength();} 00129 00131 00133 00146 virtual bool isValid() const; 00147 00160 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const; 00161 00162 // Method to get all vertices from a geometric object 00163 virtual void getVertices(vector<Vector3>& vertices) const; 00164 00166 00168 00171 float getRadius() const 00172 { return radius_;} 00173 00176 void setRadius(float radius) 00177 { radius_ = radius;} 00178 00180 00181 private: 00182 00183 float radius_; 00184 }; 00185 00186 } // namespace VIEW 00187 00188 } // namespace BALL 00189 00190 #endif // BALL_VIEW_PRIMITIV_TUBE_H