[Liblas-commits] hg: 3 new changesets
liblas-commits at liblas.org
liblas-commits at liblas.org
Tue Aug 17 10:17:13 EDT 2010
changeset c64470d3e9f8 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=c64470d3e9f8
summary: don't need lasheader include
changeset 7288ae9cb053 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=7288ae9cb053
summary: whitespace normalization
changeset 99023a42b7b9 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=99023a42b7b9
summary: add project convenience method, not particularly lightweight
diffstat:
include/liblas/detail/fwd.hpp | 2 +-
include/liblas/lasbounds.hpp | 24 ++++++++++++++++++++++++
include/liblas/lastransform.hpp | 1 -
3 files changed, 25 insertions(+), 2 deletions(-)
diffs (78 lines):
diff -r e81d1fed87ba -r 99023a42b7b9 include/liblas/detail/fwd.hpp
--- a/include/liblas/detail/fwd.hpp Mon Aug 16 16:09:20 2010 -0500
+++ b/include/liblas/detail/fwd.hpp Tue Aug 17 09:15:25 2010 -0500
@@ -47,7 +47,7 @@
// Forward declarations
namespace liblas {
-template<typename T>class Bounds;
+template<typename T> class Bounds;
class Classification;
class Color;
class FilterI;
diff -r e81d1fed87ba -r 99023a42b7b9 include/liblas/lasbounds.hpp
--- a/include/liblas/lasbounds.hpp Mon Aug 16 16:09:20 2010 -0500
+++ b/include/liblas/lasbounds.hpp Tue Aug 17 09:15:25 2010 -0500
@@ -44,6 +44,7 @@
#include <liblas/detail/fwd.hpp>
#include <liblas/laspoint.hpp>
+#include <liblas/lastransform.hpp>
#include <liblas/detail/utility.hpp>
// boost
@@ -60,6 +61,7 @@
namespace liblas {
+
template <typename T>
class Bounds
{
@@ -199,6 +201,18 @@
maxs[index] = v;
}
+liblas::Point min() {
+ liblas::Point p;
+ p.SetCoordinates(mins(0), mins(1), mins(2));
+ return p;
+}
+
+liblas::Point max() {
+ liblas::Point p;
+ p.SetCoordinates(max(0), max(1), maxs(2));
+ return p;
+}
+
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]; }
@@ -294,6 +308,16 @@
}
}
+Bounds<T> project(liblas::SpatialReference const& in_ref, liblas::SpatialReference const& out_ref)
+{
+ liblas::ReprojectionTransform trans(in_ref, out_ref);
+
+ liblas::Point minimum = min();
+ liblas::Point maximum = max();
+ trans.transform(minimum);
+ trans.transform(maximum);
+ return Bounds<T>(minimum, maximum);
+}
};
} // namespace liblas
diff -r e81d1fed87ba -r 99023a42b7b9 include/liblas/lastransform.hpp
--- a/include/liblas/lastransform.hpp Mon Aug 16 16:09:20 2010 -0500
+++ b/include/liblas/lastransform.hpp Tue Aug 17 09:15:25 2010 -0500
@@ -43,7 +43,6 @@
#define LIBLAS_LASTRANSFORM_HPP_INCLUDED
#include <liblas/lasversion.hpp>
-#include <liblas/lasheader.hpp>
#include <liblas/laspoint.hpp>
#include <liblas/lasspatialreference.hpp>
// boost
More information about the Liblas-commits
mailing list