//=========================================================================== // GoTools Core - SINTEF Geometry Tools Core library, version 2.0.1 // // Copyright (C) 2000-2007, 2010 SINTEF ICT, Applied Mathematics, Norway. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., // 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // // Contact information: E-mail: tor.dokken@sintef.no // SINTEF ICT, Department of Applied Mathematics, // P.O. Box 124 Blindern, // 0314 Oslo, Norway. // // Other licenses are also available for this software, notably licenses // for: // - Building commercial software. // - Building software whose source code you wish to keep private. //=========================================================================== 00015 #ifndef _LINECLOUD_H 00016 #define _LINECLOUD_H 00017 00018 00019 #include "GoTools/geometry/GeomObject.h" 00020 #include "GoTools/utils/Array.h" 00021 #include <vector> 00022 #include "GoTools/utils/config.h" 00023 00024 00025 namespace Go 00026 { 00027 00032 class GO_API LineCloud : public GeomObject 00033 { 00034 public: 00035 00037 LineCloud() 00038 {}; 00039 00043 00044 00045 00046 00047 00048 00049 00050 00051 template <typename ForwardIterator> 00052 LineCloud(ForwardIterator start, int numlines) 00053 : points_(numlines*2) 00054 { 00055 std::copy(start, start + 6*numlines, points_[0].begin()); 00056 } 00057 00059 virtual ~LineCloud(); 00060 00063 virtual void read (std::istream& is); 00064 00067 virtual void write (std::ostream& os) const; 00068 00071 virtual BoundingBox boundingBox() const; 00072 00076 virtual int dimension() const 00077 { return 3; } 00078 00082 virtual ClassType instanceType() const 00083 { return LineCloud::classType(); } 00084 00087 static ClassType classType() 00088 { return Class_LineCloud; } 00089 00092 // #ifdef _MSC_VER 00093 // #if _MSC_VER < 1300 00094 // virtual GeomObject* clone() const 00095 // { return new LineCloud(*this); } 00096 // #else 00097 // virtual LineCloud* clone() const 00098 // { return new LineCloud(*this); } 00099 // #endif // _MSC_VER < 1300 00100 // #else 00101 virtual LineCloud* clone() const 00102 { return new LineCloud(*this); } 00103 // #endif 00104 00111 void setCloud(const double* points, int numlines); 00112 00115 int numLines() const { return points_.size()/2; } 00116 00121 Vector3D& point(int i) { return points_[i]; } 00122 00127 const Vector3D& point(int i) const { return points_[i]; } 00128 00132 double* rawData() { return points_[0].begin(); } 00133 00134 private: 00135 std::vector<Vector3D> points_; 00136 }; 00137 00138 00139 } // namespace Go 00140 00141 00142 00143 #endif // _LINECLOUD_H 00144
Generated on Tue Sep 21 15:44:17 2010 for GoTools Core by  doxygen 1.6.3