[Liblas-commits] hg: add detail/utility.cpp to hold the
GeoTIFFPrint function
liblas-commits at liblas.org
liblas-commits at liblas.org
Tue Aug 24 10:45:35 EDT 2010
changeset bb542d024937 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=bb542d024937
summary: add detail/utility.cpp to hold the GeoTIFFPrint function
diffstat:
include/liblas/detail/utility.hpp | 45 +++++++++++++-----------------
src/CMakeLists.txt | 5 ++-
src/detail/utility.cpp | 56 +++++++++++++++++++++++++++++++++++++++
src/lasspatialreference.cpp | 8 ++--
4 files changed, 83 insertions(+), 31 deletions(-)
diffs (162 lines):
diff -r b08db92cda33 -r bb542d024937 include/liblas/detail/utility.hpp
--- a/include/liblas/detail/utility.hpp Tue Aug 24 14:46:13 2010 +0100
+++ b/include/liblas/detail/utility.hpp Tue Aug 24 09:45:20 2010 -0500
@@ -435,31 +435,26 @@
#endif
// Utility functor with accompanying to print GeoTIFF directory.
-struct geotiff_dir_printer
-{
- geotiff_dir_printer() {}
-
- std::string output() const { return m_oss.str(); }
- std::string::size_type size() const { return m_oss.str().size(); }
-
- void operator()(char* data, void* aux)
- {
- if (0 != data)
- {
- m_oss << data;
- }
- }
-
-private:
- std::ostringstream m_oss;
-};
-
-extern "C" int GeoTiffPrintMethod(char* data, void* aux)
-{
- geotiff_dir_printer* printer = reinterpret_cast<geotiff_dir_printer*>(aux);
- (*printer)(data, 0);
- return static_cast<int>(printer->size());
-}
+struct geotiff_dir_printer
+{
+ geotiff_dir_printer() {}
+
+ std::string output() const { return m_oss.str(); }
+ std::string::size_type size() const { return m_oss.str().size(); }
+
+ void operator()(char* data, void* aux)
+ {
+ if (0 != data)
+ {
+ m_oss << data;
+ }
+ }
+
+private:
+ std::ostringstream m_oss;
+};
+
+extern "C" int libLASGeoTIFFPrint(char* data, void* aux);
}} // namespace liblas::detail
diff -r b08db92cda33 -r bb542d024937 src/CMakeLists.txt
--- a/src/CMakeLists.txt Tue Aug 24 14:46:13 2010 +0100
+++ b/src/CMakeLists.txt Tue Aug 24 09:45:20 2010 -0500
@@ -80,8 +80,9 @@
lasvariablerecord.cpp
laswriter.cpp)
-set(LIBLAS_DETAIL_CPP) # Currently empty
-
+set(LIBLAS_DETAIL_CPP
+ detail/utility.cpp)
+
set(LIBLAS_DETAIL_INDEX_CPP
detail/index/indexcell.cpp
detail/index/indexoutput.cpp)
diff -r b08db92cda33 -r bb542d024937 src/detail/utility.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/detail/utility.cpp Tue Aug 24 09:45:20 2010 -0500
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * $Id$
+ *
+ * Project: libLAS - http://liblas.org - A BSD library for LAS format data.
+ * Purpose: Generic utility code for libLAS
+ * Author: Mateusz Loskot, mateusz at loskot.net
+ *
+ ******************************************************************************
+ * Copyright (c) 2010, Mateusz Loskot
+ *
+ * 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.
+ ****************************************************************************/
+
+#include <liblas/detail/utility.hpp>
+
+
+extern "C" int libLASGeoTIFFPrint(char* data, void* aux)
+{
+ liblas::detail::geotiff_dir_printer* printer = reinterpret_cast<liblas::detail::geotiff_dir_printer*>(aux);
+ (*printer)(data, 0);
+ return static_cast<int>(printer->size());
+}
+
+namespace liblas { namespace detail {
+
+
+
+}} // namespace liblas::detail
diff -r b08db92cda33 -r bb542d024937 src/lasspatialreference.cpp
--- a/src/lasspatialreference.cpp Tue Aug 24 14:46:13 2010 +0100
+++ b/src/lasspatialreference.cpp Tue Aug 24 09:45:20 2010 -0500
@@ -562,7 +562,7 @@
// if we have libgeotiff but not GDAL, we'll use the
// simple method in libgeotiff
-#if defined(HAVE_LIBGEOTIFF) && !defined(HAVE_GDAL)
+#if defined(HAVE_LIBGEOTIFF) && !defined(HAVE_GDAL)
GTIFDefn defn;
@@ -630,7 +630,7 @@
// if we have libgeotiff but not GDAL, we'll use the
// simple method in libgeotiff
-#if defined(HAVE_LIBGEOTIFF) && !defined(HAVE_GDAL)
+#if defined(HAVE_LIBGEOTIFF) && !defined(HAVE_GDAL)
int ret = 0;
ret = GTIFSetFromProj4( m_gtiff, v.c_str());
@@ -671,8 +671,8 @@
return std::string("");
#else
- detail::geotiff_dir_printer geotiff_printer;
- GTIFPrint(m_gtiff, detail::GeoTiffPrintMethod, &geotiff_printer);
+ detail::geotiff_dir_printer geotiff_printer;
+ GTIFPrint(m_gtiff, detail::libLASGeoTIFFPrint, &geotiff_printer);
return geotiff_printer.output();
#endif
}
More information about the Liblas-commits
mailing list