BALL
1.4.1
|
00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: twoColoredTube.h,v 1.11.16.1 2007-03-25 21:26:12 oliver Exp $ 00005 // 00006 00007 #ifndef BALL_VIEW_PRIMITIVES_TWOCOLOREDTUBE_H 00008 #define BALL_VIEW_PRIMITIVES_TWOCOLOREDTUBE_H 00009 00010 #ifndef BALL_VIEW_DATATYPE_COLOREXTENSIONS_H 00011 # include <BALL/VIEW/DATATYPE/colorExtensions.h> 00012 #endif 00013 00014 #ifndef BALL_VIEW_KERNEL_GEOMETRICOBJECT_H 00015 # include <BALL/VIEW/KERNEL/geometricObject.h> 00016 #endif 00017 00018 #ifndef BALL_VIEW_DATATYPE_VERTEX2_H 00019 # include <BALL/VIEW/DATATYPE/vertex2.h> 00020 #endif 00021 00022 namespace BALL 00023 { 00024 namespace VIEW 00025 { 00045 class BALL_VIEW_EXPORT TwoColoredTube 00046 : public GeometricObject, 00047 public ColorExtension2, 00048 public Vertex2 00049 { 00050 public: 00051 00052 BALL_CREATE(TwoColoredTube) 00053 00054 00057 00072 TwoColoredTube(); 00073 00079 TwoColoredTube(const TwoColoredTube& two_colored_tube); 00080 00082 00084 00088 virtual ~TwoColoredTube(); 00089 00099 virtual void clear(); 00100 00102 00104 00110 void set(const TwoColoredTube& two_colored_tube); 00111 00115 const TwoColoredTube& operator = (const TwoColoredTube& two_colored_tube); 00116 00119 void swap(TwoColoredTube& two_colored_tube); 00120 00122 00125 00130 float getLength() const; 00131 00138 Vector3 getMiddleVertex() const; 00139 00141 00144 00156 virtual bool isValid() const; 00157 00172 virtual void dump(std::ostream& s = std::cout, Size depth = 0) const; 00173 00175 00177 00179 float getRadius() const 00180 { return radius_;} 00181 00183 void setRadius(float radius) 00184 { radius_ = radius;} 00185 00186 // Method to get all vertices from a geometric object 00187 virtual void getVertices(vector<Vector3>& vertices) const; 00188 00190 00191 private: 00192 00193 float radius_; 00194 }; 00195 00196 #ifndef BALL_NO_INLINE_FUNCTIONS 00197 # include <BALL/VIEW/PRIMITIVES/twoColoredTube.iC> 00198 #endif 00199 00200 } // namespace VIEW 00201 } // namespace BALL 00202 00203 #endif // BALL_VIEW_PRIMITIVES_TWOCOLOREDTUBE_H