00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef _GOLINECLOUD_H
00034 #define _GOLINECLOUD_H
00035
00036
00037 #include "GeomObject.h"
00038 #include "Array.h"
00039 #include <vector>
00040
00041
00042 namespace Go
00043 {
00046
00047
00052 class LineCloud : public GeomObject
00053 {
00054 public:
00055
00057 LineCloud()
00058 {};
00059
00063
00064
00065
00066
00067
00068
00069
00070
00071 template <typename ForwardIterator>
00072 LineCloud(ForwardIterator start, int numlines)
00073 : points_(numlines*2)
00074 {
00075 std::copy(start, start + 6*numlines, points_[0].begin());
00076 }
00077
00079 virtual ~LineCloud();
00080
00083 virtual void read (std::istream& is);
00084
00087 virtual void write (std::ostream& os) const;
00088
00091 virtual BoundingBox boundingBox() const;
00092
00096 virtual int dimension() const
00097 { return 3; }
00098
00102 virtual ClassType instanceType() const
00103 { return LineCloud::classType(); }
00104
00107 static ClassType classType()
00108 { return Class_LineCloud; }
00109
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121 virtual LineCloud* clone() const
00122 { return new LineCloud(*this); }
00123
00124
00131 void setCloud(const double* points, int numlines);
00132
00135 int numLines() const { return points_.size()/2; }
00136
00141 Vector3D& point(int i) { return points_[i]; }
00142
00147 const Vector3D& point(int i) const { return points_[i]; }
00148
00152 double* rawData() { return points_[0].begin(); }
00153
00154 private:
00155 std::vector<Vector3D> points_;
00156 };
00157
00158
00160 }
00161
00162
00163
00164 #endif // _GOLINECLOUD_H
00165
00166