[Liblas-commits] hg: 2 new changesets
liblas-commits at liblas.org
liblas-commits at liblas.org
Wed Dec 22 16:05:02 EST 2010
changeset 3c0b0cf20bca in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=3c0b0cf20bca
summary: rename include files
changeset 41a8066d9663 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=41a8066d9663
summary: merge
diffstat:
apps/las2las.cpp | 26 +-
apps/lasindex_test.cpp | 2 +-
apps/laskernel.cpp | 3 +-
include/liblas/bounds.hpp | 599 ++++++++++++++++++++++++++++
include/liblas/classification.hpp | 244 +++++++++++
include/liblas/color.hpp | 170 +++++++
include/liblas/detail/index/indexoutput.hpp | 2 +-
include/liblas/detail/reader/header.hpp | 6 +-
include/liblas/detail/reader/reader.hpp | 1 -
include/liblas/detail/reader/zipreader.hpp | 3 -
include/liblas/detail/writer/base.hpp | 2 +-
include/liblas/detail/writer/header.hpp | 2 +-
include/liblas/detail/writer/point.hpp | 6 +-
include/liblas/dimension.hpp | 243 +++++++++++
include/liblas/error.hpp | 90 ++++
include/liblas/factory.hpp | 18 +-
include/liblas/filter.hpp | 396 ++++++++++++++++++
include/liblas/header.hpp | 445 ++++++++++++++++++++
include/liblas/index.hpp | 571 ++++++++++++++++++++++++++
include/liblas/iterator.hpp | 6 +-
include/liblas/lasbounds.hpp | 599 ----------------------------
include/liblas/lasclassification.hpp | 244 -----------
include/liblas/lascolor.hpp | 170 -------
include/liblas/lasdimension.hpp | 243 -----------
include/liblas/laserror.hpp | 90 ----
include/liblas/lasfilter.hpp | 396 ------------------
include/liblas/lasheader.hpp | 445 --------------------
include/liblas/lasindex.hpp | 571 --------------------------
include/liblas/laspoint.hpp | 253 -----------
include/liblas/lasreader.hpp | 152 -------
include/liblas/lasschema.hpp | 180 --------
include/liblas/lasspatialreference.hpp | 212 ---------
include/liblas/lastransform.hpp | 215 ----------
include/liblas/lasvariablerecord.hpp | 160 -------
include/liblas/lasversion.hpp | 101 ----
include/liblas/laswriter.hpp | 116 -----
include/liblas/liblas.hpp | 28 +-
include/liblas/point.hpp | 253 +++++++++++
include/liblas/reader.hpp | 152 +++++++
include/liblas/schema.hpp | 179 ++++++++
include/liblas/spatialreference.hpp | 212 +++++++++
include/liblas/transform.hpp | 215 ++++++++++
include/liblas/utility.hpp | 4 +-
include/liblas/variablerecord.hpp | 160 +++++++
include/liblas/version.hpp | 56 ++
include/liblas/writer.hpp | 116 +++++
src/CMakeLists.txt | 31 +-
src/detail/reader/cachedreader.cpp | 2 -
src/detail/reader/header.cpp | 7 +-
src/detail/reader/reader.cpp | 2 -
src/detail/reader/zipreader.cpp | 16 +-
src/detail/writer/header.cpp | 6 +-
src/detail/writer/point.cpp | 6 +-
src/detail/writer/writer.cpp | 2 -
src/detail/writer/zipwriter.cpp | 16 +-
src/factory.cpp | 51 +-
src/las_c_api.cpp | 12 +-
src/lasclassification.cpp | 2 +-
src/lascolor.cpp | 2 +-
src/lasdimension.cpp | 2 +-
src/laserror.cpp | 2 +-
src/lasfilter.cpp | 4 +-
src/lasheader.cpp | 6 +-
src/lasindex.cpp | 4 +-
src/laspoint.cpp | 6 +-
src/lasreader.cpp | 4 +-
src/lasschema.cpp | 2 +-
src/lasspatialreference.cpp | 2 +-
src/lastransform.cpp | 4 +-
src/lasvariablerecord.cpp | 2 +-
src/lasversion.cpp | 4 +-
src/laswriter.cpp | 6 +-
test/unit/bounds_test.cpp | 2 +-
test/unit/classification_test.cpp | 2 +-
test/unit/common.cpp | 2 +-
test/unit/common.hpp | 2 -
test/unit/error_test.cpp | 2 +-
test/unit/header_test.cpp | 3 -
test/unit/point_test.cpp | 11 +-
test/unit/reader_iterator_test.cpp | 3 -
test/unit/reader_test.cpp | 4 +-
test/unit/transform_test.cpp | 2 +-
test/unit/variablerecord_test.cpp | 1 -
test/unit/writer_test.cpp | 6 +-
84 files changed, 4282 insertions(+), 4318 deletions(-)
diffs (truncated from 9394 to 300 lines):
diff -r 3f63ce4340f0 -r 41a8066d9663 apps/las2las.cpp
--- a/apps/las2las.cpp Wed Dec 22 13:41:27 2010 -0600
+++ b/apps/las2las.cpp Wed Dec 22 15:04:51 2010 -0600
@@ -324,15 +324,23 @@
// Transforms alter our header as well. Setting scales, offsets, etc.
transforms = GetTransforms(vm, verbose, header);
- // This is quite busted for me on OS X...
-// if (output.compare(output.length()-4,4,".laz")==0)
-// {
-// #ifdef HAVE_LASZIP
-// header.SetIsCompressed(true);
-// #else
-// throw std::runtime_error("Compression support not enabled in liblas configuration");
-// #endif
-// }
+ switch (WriterFactory::InferFileTypeFromExtension(output))
+ {
+ case WriterFactory::FileType_LAS:
+ header.SetIsCompressed(false);
+ break;
+ case WriterFactory::FileType_LAZ:
+#ifdef HAVE_LASZIP
+ header.SetIsCompressed(true);
+#else
+ throw std::runtime_error("Compression support not enabled in liblas configuration");
+#endif
+ break;
+ case WriterFactory::FileType_Unknown:
+ default:
+ throw std::runtime_error("Unknown output file type");
+ break;
+ }
bool op = process( input,
output,
diff -r 3f63ce4340f0 -r 41a8066d9663 apps/lasindex_test.cpp
--- a/apps/lasindex_test.cpp Wed Dec 22 13:41:27 2010 -0600
+++ b/apps/lasindex_test.cpp Wed Dec 22 15:04:51 2010 -0600
@@ -17,7 +17,7 @@
#include <typeinfo>
#include <vector>
-#include <liblas/lasindex.hpp>
+#include <liblas/index.hpp>
using namespace liblas;
using namespace boost;
diff -r 3f63ce4340f0 -r 41a8066d9663 apps/laskernel.cpp
--- a/apps/laskernel.cpp Wed Dec 22 13:41:27 2010 -0600
+++ b/apps/laskernel.cpp Wed Dec 22 15:04:51 2010 -0600
@@ -111,7 +111,8 @@
oss << "Cannot open " << filename << "for read. Exiting...";
throw std::runtime_error(oss.str());
}
- liblas::Reader reader(ifs);
+ liblas::ReaderFactory factory;
+ liblas::Reader reader = factory.CreateWithStream(ifs);
liblas::Header header = reader.GetHeader();
ifs.close();
return header;
diff -r 3f63ce4340f0 -r 41a8066d9663 include/liblas/bounds.hpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/liblas/bounds.hpp Wed Dec 22 15:04:51 2010 -0600
@@ -0,0 +1,599 @@
+/******************************************************************************
+ * $Id$
+ *
+ * Project: libLAS - http://liblas.org - A BSD library for LAS format data.
+ * Purpose: LAS bounds class
+ * Author: Howard Butler, hobu.inc at gmail.com
+ *
+ ******************************************************************************
+ * Copyright (c) 2010, Howard Butler
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following
+ * conditions are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of the Martin Isenburg or Iowa Department
+ * of Natural Resources nor the names of its contributors may be
+ * used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ ****************************************************************************/
+
+#ifndef LIBLAS_LASBOUNDS_HPP_INCLUDED
+#define LIBLAS_LASBOUNDS_HPP_INCLUDED
+
+#include <liblas/detail/fwd.hpp>
+#include <liblas/point.hpp>
+#include <liblas/transform.hpp>
+#include <liblas/detail/private_utility.hpp>
+#include <liblas/export.hpp>
+// boost
+#include <boost/cstdint.hpp>
+
+#include <boost/concept_check.hpp>
+// std
+#include <cmath>
+#include <limits>
+#include <string>
+#include <sstream>
+#include <vector>
+
+
+namespace liblas {
+
+template <typename T>
+class LAS_DLL Range
+{
+public:
+ T min;
+ T max;
+
+ typedef T value_type;
+
+ Range(T mmin=std::numeric_limits<T>::max(), T mmax=std::numeric_limits<T>::min())
+ : min(mmin), max(mmax) {}
+
+
+ Range(Range const& other)
+ : min(other.min)
+ , max(other.max)
+ {
+ }
+
+ Range& operator=(Range<T> const& rhs)
+ {
+ if (&rhs != this)
+ {
+ min = rhs.min;
+ max = rhs.max;
+ }
+ return *this;
+ }
+
+ bool operator==(Range<T> const& rhs) const
+ {
+ return equal(rhs);
+ }
+
+ bool operator!=(Range const& rhs) const
+ {
+ return !(equal(rhs));
+ }
+
+ bool equal(Range const& other) const
+ {
+
+ if (!(detail::compare_distance(min, other.min))
+ || !(detail::compare_distance(max, other.max)))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ bool overlaps(Range const& r) const
+ {
+ return min <= r.max && max >= r.min;
+ }
+
+ bool contains(Range const& r) const
+ {
+ return min <= r.min && r.max <= max;
+ }
+
+ bool contains(T v) const
+ {
+ return min <= v && v <= max;
+ }
+
+ bool empty(void) const
+ {
+ return detail::compare_distance(min, std::numeric_limits<T>::max()) && detail::compare_distance(max, std::numeric_limits<T>::min());
+ }
+
+ void shift(T v)
+ {
+ min += v;
+ max += v;
+ }
+
+ void scale(T v)
+ {
+ min *= v;
+ max *= v;
+ }
+
+ void clip(Range const& r)
+ {
+ if (r.min > min)
+ min = r.min;
+ if (r.max < max)
+ max = r.max;
+ }
+
+ void grow(T v)
+ {
+ if (v < min)
+ min = v;
+ if (v > max)
+ max = v;
+ }
+
+ void grow(Range const& r)
+ {
+ grow(r.min);
+ grow(r.max);
+ }
+
+ T length() const
+ {
+ return max - min;
+ }
+};
+
+template <typename T>
+class Bounds
+{
+public:
+
+ typedef T value_type;
+ typedef typename std::vector< Range<T> >::size_type size_type;
+
+ typedef typename std::vector< Range<T> > RangeVec;
+private:
+
+ RangeVec ranges;
+
+public:
+
+Bounds<T>()
+{
+ ranges.resize(0);
+}
+
+Bounds(Bounds const& other)
+ :
+ ranges(other.ranges)
+{
+}
+
+Bounds(RangeVec const& rngs)
+ :
+ ranges(rngs)
+{
+}
+
+Bounds( T minx,
+ T miny,
+ T minz,
+ T maxx,
+ T maxy,
+ T maxz)
+{
+ ranges.resize(3);
+
+ ranges[0].min = minx;
+ ranges[1].min = miny;
+ ranges[2].min = minz;
+
+ ranges[0].max = maxx;
+ ranges[1].max = maxy;
+ ranges[2].max = maxz;
+
+#ifdef DEBUG
+ verify();
+#endif
+
+}
+
+Bounds( T minx,
+ T miny,
+ T maxx,
+ T maxy)
+{
+
More information about the Liblas-commits
mailing list