[Liblas-commits] hg: add convenience accessors minx, miny, maxx, etc...

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Aug 16 11:18:16 EDT 2010


changeset de157e96750e in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=de157e96750e
summary: add convenience accessors minx, miny, maxx, etc...

diffstat:

 include/liblas/lasbounds.hpp |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r 889a3f634938 -r de157e96750e include/liblas/lasbounds.hpp
--- a/include/liblas/lasbounds.hpp	Sat Aug 14 21:21:48 2010 -0500
+++ b/include/liblas/lasbounds.hpp	Mon Aug 16 10:18:08 2010 -0500
@@ -168,7 +168,7 @@
 T min(std::size_t const& index) const
 {
     if (mins.size() <= index) {
-        return 0.0;
+        return 0;
     }
     return mins[index];
 }
@@ -199,6 +199,13 @@
     maxs[index] = v;
 }
 
+T minx() const { if (mins.size() == 0) return 0; return mins[0]; }
+T miny() const { if (mins.size() < 2) return 0; return mins[1]; }
+T minz() const { if (mins.size() < 3) return 0; return mins[2]; }
+T maxx() const { if (maxs.size() == 0) return 0; return maxs[0]; }
+T maxy() const { if (maxs.size() < 2) return 0; return maxs[1]; }
+T maxz() const { if (maxs.size() < 3) return 0; return maxs[2]; }
+
 inline bool operator==(Bounds<T> const& rhs) const
 {
     return equal(rhs);


More information about the Liblas-commits mailing list