[Liblas-commits] libpc: get liblas linking in correctly
liblas-commits at liblas.org
liblas-commits at liblas.org
Thu Feb 24 15:09:04 EST 2011
details: http://hg.liblas.orglibpc/rev/a5450fd240c7
changeset: 95:a5450fd240c7
user: Michael P. Gerlek <mpg at flaxen.com>
date: Thu Feb 24 12:08:59 2011 -0800
description:
get liblas linking in correctly
diffstat:
apps/CMakeLists.txt | 1 +
apps/pc2pc.cpp | 4 ++++
src/CMakeLists.txt | 1 +
src/LiblasReader.cpp | 9 +++++++--
test/unit/CMakeLists.txt | 1 +
test/unit/LiblasReaderTest.cpp | 8 +++++---
test/unit/LiblasWriterTest.cpp | 10 ++++++----
7 files changed, 25 insertions(+), 9 deletions(-)
diffs (125 lines):
diff -r 08f19d42f84a -r a5450fd240c7 apps/CMakeLists.txt
--- a/apps/CMakeLists.txt Thu Feb 24 11:35:16 2011 -0800
+++ b/apps/CMakeLists.txt Thu Feb 24 12:08:59 2011 -0800
@@ -34,6 +34,7 @@
set(APPS_CPP_DEPENDENCIES
${LIBPC_LIB_NAME}
+ ${LIBLAS_LIBRARY}
${TIFF_LIBRARY}
${GEOTIFF_LIBRARY}
${GDAL_LIBRARY}
diff -r 08f19d42f84a -r a5450fd240c7 apps/pc2pc.cpp
--- a/apps/pc2pc.cpp Thu Feb 24 11:35:16 2011 -0800
+++ b/apps/pc2pc.cpp Thu Feb 24 12:08:59 2011 -0800
@@ -24,6 +24,7 @@
#include "libpc/LasReader.hpp"
#include "libpc/LasHeader.hpp"
#include "libpc/LasWriter.hpp"
+#include "libpc/LiblasReader.hpp"
using namespace libpc;
@@ -124,6 +125,9 @@
test2();
+ std::istream* ifs = Utils::openFile("test/data/1.2-with-color.las");
+ LiblasReader r(*ifs);
+
return 0;
}
#if 0
diff -r 08f19d42f84a -r a5450fd240c7 src/CMakeLists.txt
--- a/src/CMakeLists.txt Thu Feb 24 11:35:16 2011 -0800
+++ b/src/CMakeLists.txt Thu Feb 24 12:08:59 2011 -0800
@@ -122,6 +122,7 @@
target_link_libraries(${LIBPC_LIB_NAME}
${LIBPC_LIB_NAME}
+ ${LIBLAS_LIBRARY}
${TIFF_LIBRARY}
${GEOTIFF_LIBRARY}
${GDAL_LIBRARY}
diff -r 08f19d42f84a -r a5450fd240c7 src/LiblasReader.cpp
--- a/src/LiblasReader.cpp Thu Feb 24 11:35:16 2011 -0800
+++ b/src/LiblasReader.cpp Thu Feb 24 12:08:59 2011 -0800
@@ -32,13 +32,15 @@
* OF SUCH DAMAGE.
****************************************************************************/
+
#include "libpc/LiblasReader.hpp"
+
+#include <liblas/factory.hpp>
+
#include "libpc/LiblasHeader.hpp"
namespace libpc
{
-
-
LiblasReader::LiblasReader(std::istream& istream)
: Reader()
, m_istream(istream)
@@ -46,6 +48,9 @@
LiblasHeader* liblasHeader = new LiblasHeader;
setHeader(liblasHeader);
+ liblas::ReaderFactory f;
+ liblas::Reader reader = f.CreateWithStream(m_istream);
+
return;
}
diff -r 08f19d42f84a -r a5450fd240c7 test/unit/CMakeLists.txt
--- a/test/unit/CMakeLists.txt Thu Feb 24 11:35:16 2011 -0800
+++ b/test/unit/CMakeLists.txt Thu Feb 24 12:08:59 2011 -0800
@@ -40,6 +40,7 @@
TARGET_LINK_LIBRARIES(${LIBPC_UNIT_TEST}
${LIBPC_LIB_NAME}
+ ${LIBLAS_LIBRARY}
${ZLIB_LIBRARIES}
${TIFF_LIBRARY}
${GEOTIFF_LIBRARY}
diff -r 08f19d42f84a -r a5450fd240c7 test/unit/LiblasReaderTest.cpp
--- a/test/unit/LiblasReaderTest.cpp Thu Feb 24 11:35:16 2011 -0800
+++ b/test/unit/LiblasReaderTest.cpp Thu Feb 24 12:08:59 2011 -0800
@@ -11,9 +11,11 @@
BOOST_AUTO_TEST_CASE(test_1)
{
- //std::istream* ifs = Utils::openFile("test/data/1.2-with-color.las");
- //
- //LiblasReader reader(*ifs);
+ std::istream* ifs = Utils::openFile("test/data/1.2-with-color.las");
+
+ LiblasReader reader(*ifs);
+
+ Utils::closeFile(ifs);
return;
}
diff -r 08f19d42f84a -r a5450fd240c7 test/unit/LiblasWriterTest.cpp
--- a/test/unit/LiblasWriterTest.cpp Thu Feb 24 11:35:16 2011 -0800
+++ b/test/unit/LiblasWriterTest.cpp Thu Feb 24 12:08:59 2011 -0800
@@ -15,12 +15,14 @@
// remove file from earlier run, if needed
Utils::deleteFile("temp.las");
- //Bounds<double> bounds(1.0, 2.0, 3.0, 101.0, 102.0, 103.0);
- //FauxReader reader(bounds, 1000, FauxReader::Constant);
+ Bounds<double> bounds(1.0, 2.0, 3.0, 101.0, 102.0, 103.0);
+ FauxReader reader(bounds, 1000, FauxReader::Constant);
- //std::ostream* ofs = Utils::createFile("temp.las");
+ std::ostream* ofs = Utils::createFile("temp.las");
- //LiblasWriter writer(reader, *ofs);
+ LiblasWriter writer(reader, *ofs);
+
+ Utils::closeFile(ofs);
Utils::deleteFile("temp.las");
More information about the Liblas-commits
mailing list