Changeset 958
- Timestamp:
- 11/06/08 10:42:11 (2 months ago)
- Files:
-
- 1 modified
-
trunk/include/liblas/detail/utility.hpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/liblas/detail/utility.hpp
r883 r958 194 194 }; 195 195 196 template <typename T> 197 bool compare_distance(const T& actual, const T& expected); 198 196 199 template <typename T> 197 200 struct Point 198 201 { 199 Point() : x(T()), y(T()), z(T()) {} 200 Point(T const& x, T const& y, T const& z) : x(x), y(y), z(z) {} 202 Point() 203 : x(T()), y(T()), z(T()) 204 {} 205 206 Point(T const& x, T const& y, T const& z) 207 : x(x), y(y), z(z) 208 {} 209 210 bool equal(Point<T> const& other) const 211 { 212 return (compare_distance(x, other.x) 213 && compare_distance(y, other.y) 214 && compare_distance(z, other.z)); 215 } 216 201 217 T x; 202 218 T y; 203 219 T z; 204 205 bool equal(Point<T> const& other) const206 {207 return ((x == other.x) && (y == other.y) && (z == other.z));208 }209 220 }; 210 221 … … 224 235 struct Extents 225 236 { 226 typename detail::Point < T > min; 227 typename detail::Point < T > max; 237 Extents() {} 238 Extents(detail::Point<T> const& min, detail::Point<T> const& max) 239 : min(min), max(max) 240 {} 228 241 229 242 bool equal(Extents<T> const& other) const … … 231 244 return (min == other.min && max == other.max); 232 245 } 246 247 typename detail::Point<T> min; 248 typename detail::Point<T> max; 233 249 }; 234 250 … … 259 275 260 276 template <typename T> 261 bool compare_d oubles(const T& actual, const T& expected)277 bool compare_distance(const T& actual, const T& expected) 262 278 { 263 279 const T epsilon = std::numeric_limits<T>::epsilon();
