[Liblas-commits] libpc: start re-organizing things into separate driver directories

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Feb 25 16:13:58 EST 2011


details:   http://hg.liblas.orglibpc/rev/60ed8bcbc7c7
changeset: 104:60ed8bcbc7c7
user:      Howard Butler <hobu.inc at gmail.com>
date:      Fri Feb 25 15:07:13 2011 -0600
description:
start re-organizing things into separate driver directories
Subject: libpc: merge

details:   http://hg.liblas.orglibpc/rev/b0dbe671f1c9
changeset: 105:b0dbe671f1c9
user:      Howard Butler <hobu.inc at gmail.com>
date:      Fri Feb 25 15:13:52 2011 -0600
description:
merge

diffstat:

 apps/pc2pc.cpp                    |    4 +-
 include/libpc/LiblasHeader.hpp    |   63 ------------------
 include/libpc/LiblasReader.hpp    |   86 ------------------------
 include/libpc/LiblasWriter.hpp    |   69 -------------------
 src/CMakeLists.txt                |   14 ++--
 src/LiblasHeader.cpp              |   66 -------------------
 src/LiblasReader.cpp              |  130 -------------------------------------
 src/LiblasWriter.cpp              |   72 --------------------
 src/drivers/CMakeLists.txt        |   12 +++
 src/drivers/las/CMakeLists.txt    |    8 ++
 src/drivers/liblas/CMakeLists.txt |   18 +++++
 src/drivers/liblas/header.cpp     |   66 +++++++++++++++++++
 src/drivers/liblas/header.hpp     |   63 ++++++++++++++++++
 src/drivers/liblas/reader.cpp     |  132 ++++++++++++++++++++++++++++++++++++++
 src/drivers/liblas/reader.hpp     |   86 ++++++++++++++++++++++++
 src/drivers/liblas/writer.cpp     |  124 +++++++++++++++++++++++++++++++++++
 src/drivers/liblas/writer.hpp     |   76 +++++++++++++++++++++
 test/data/simple.las              |    0 
 test/unit/CMakeLists.txt          |    2 +
 test/unit/LiblasReaderTest.cpp    |    2 +-
 test/unit/LiblasWriterTest.cpp    |   12 ++-
 test/unit/UtilsTest.cpp           |    8 +-
 test/unit/support.cpp             |   57 ++++++++++++++++
 test/unit/support.hpp             |    7 ++
 24 files changed, 675 insertions(+), 502 deletions(-)

diffs (truncated from 1353 to 300 lines):

diff -r 3bf61c0aaa07 -r b0dbe671f1c9 apps/pc2pc.cpp
--- a/apps/pc2pc.cpp	Fri Feb 25 14:05:33 2011 -0600
+++ b/apps/pc2pc.cpp	Fri Feb 25 15:13:52 2011 -0600
@@ -24,7 +24,7 @@
 #include "libpc/LasReader.hpp"
 #include "libpc/LasHeader.hpp"
 #include "libpc/LasWriter.hpp"
-#include "libpc/LiblasReader.hpp"
+// #include "libpc/LiblasReader.hpp"
 
 using namespace libpc;
 
@@ -126,7 +126,7 @@
     test2();
 
     std::istream* ifs = Utils::openFile("test/data/1.2-with-color.las");
-    LiblasReader r(*ifs);
+    // LiblasReader r(*ifs);
 
     return 0;
 }
diff -r 3bf61c0aaa07 -r b0dbe671f1c9 include/libpc/LiblasHeader.hpp
--- a/include/libpc/LiblasHeader.hpp	Fri Feb 25 14:05:33 2011 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
-*
-* 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 Hobu, Inc. or Flaxen Geo Consulting 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 INCLUDED_LIBLASHEADER_HPP
-#define INCLUDED_LIBLASHEADER_HPP
-
-#include <iostream>
-#include <string>
-
-#include <boost/cstdint.hpp>
-#include <boost/uuid/uuid.hpp>
-
-#include "libpc/Header.hpp"
-
-namespace libpc
-{
-
-class LIBPC_DLL LiblasHeader : public Header
-{
-public:
-    LiblasHeader();
-    
-private:
-    LiblasHeader& operator=(const LiblasHeader&); // nope
-    LiblasHeader(const LiblasHeader&); // nope
-};
-
-LIBPC_DLL std::ostream& operator<<(std::ostream& ostr, const LiblasHeader&);
-
-} // namespace libpc
-
-#endif
diff -r 3bf61c0aaa07 -r b0dbe671f1c9 include/libpc/LiblasReader.hpp
--- a/include/libpc/LiblasReader.hpp	Fri Feb 25 14:05:33 2011 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
-*
-* 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 Hobu, Inc. or Flaxen Geo Consulting 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 INCLUDED_LIBLASREADER_HPP
-#define INCLUDED_LIBLASREADER_HPP
-
-#include "libpc/Reader.hpp"
-
-#include <iostream>
-
-#include "libpc/LiblasHeader.hpp"
-
-// fwd decls
-namespace liblas
-{
-    class Reader;
-}
-
-
-namespace libpc
-{
-
-class LIBPC_DLL LiblasReader : public Reader
-{
-public:
-    LiblasReader(std::istream&);
-    ~LiblasReader();
-
-    virtual boost::uint32_t readPoints(PointData&);
-
-    // default is to reset() and then read N points manually
-    // override this if you can
-    virtual void seekToPoint(boost::uint64_t pointNum);
-
-    // default just resets the point index
-    virtual void reset();
-
-    const LiblasHeader& getLiblasHeader() const;
-
-private:
-    LiblasHeader& getLiblasHeader();
-    void setLiblasHeader(const LiblasHeader&);
-
-    std::istream& m_istream;
-
-    liblas::Reader *m_reader;
-
-
-    LiblasReader& operator=(const LiblasReader&); // not implemented
-    LiblasReader(const LiblasReader&); // not implemented
-};
-
-} // namespace libpc
-
-#endif
diff -r 3bf61c0aaa07 -r b0dbe671f1c9 include/libpc/LiblasWriter.hpp
--- a/include/libpc/LiblasWriter.hpp	Fri Feb 25 14:05:33 2011 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
-*
-* 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 Hobu, Inc. or Flaxen Geo Consulting 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 INCLUDED_LIBLASWRITER_HPP
-#define INCLUDED_LIBLASWRITER_HPP
-
-#include "libpc/Writer.hpp"
-
-namespace libpc
-{
-
-class LIBPC_DLL LiblasWriter : public Writer
-{
-public:
-    LiblasWriter(Stage& prevStage, std::ostream&);
-
-    //void write();
-
-protected:
-    // this is called once before the loop with the writeBuffer calls
-    virtual void writeBegin();
-
-    // called repeatedly, until out of data
-    virtual boost::uint32_t writeBuffer(const PointData&);
-
-    // called once, after the writeBuffer calls
-    virtual void writeEnd();
-
-private:
-    std::ostream& m_ostream;
-
-    LiblasWriter& operator=(const LiblasWriter&); // not implemented
-    LiblasWriter(const LiblasWriter&); // not implemented
-};
-
-} // namespace libpc
-
-#endif
diff -r 3bf61c0aaa07 -r b0dbe671f1c9 src/CMakeLists.txt
--- a/src/CMakeLists.txt	Fri Feb 25 14:05:33 2011 -0600
+++ b/src/CMakeLists.txt	Fri Feb 25 15:13:52 2011 -0600
@@ -38,9 +38,6 @@
   ${LIBPC_HEADERS_DIR}/LasHeaderWriter.hpp
   ${LIBPC_HEADERS_DIR}/LasReader.hpp
   ${LIBPC_HEADERS_DIR}/LasWriter.hpp
-  ${LIBPC_HEADERS_DIR}/LiblasHeader.hpp
-  ${LIBPC_HEADERS_DIR}/LiblasReader.hpp
-  ${LIBPC_HEADERS_DIR}/LiblasWriter.hpp
   ${LIBPC_HEADERS_DIR}/Metadata.hpp
   ${LIBPC_HEADERS_DIR}/MosaicFilter.hpp
   ${LIBPC_HEADERS_DIR}/Vector.hpp  
@@ -54,8 +51,13 @@
   ${LIBPC_HEADERS_DIR}/Utils.hpp
   ${LIBPC_HEADERS_DIR}/Writer.hpp)
 
+set (LIBPC_SOURCES "libpc_config.cpp" CACHE INTERNAL "sources to compile")
+
+add_subdirectory(drivers)
+
+
 set(LIBPC_CPP
-  libpc_config.cpp
+    ${LIBPC_SOURCES}
   Bounds.cpp
   Color.cpp
   ColorFilter.cpp
@@ -70,9 +72,6 @@
   LasHeaderWriter.cpp
   LasReader.cpp
   LasWriter.cpp
-  LiblasHeader.cpp
-  LiblasReader.cpp
-  LiblasWriter.cpp
   Metadata.cpp
   MosaicFilter.cpp
   Vector.cpp  
@@ -85,6 +84,7 @@
   Utils.cpp
   Writer.cpp)
 
+
 # Group source files for IDE source explorers (e.g. Visual Studio)
 source_group("CMake Files" FILES CMakeLists.txt)
 source_group("Header Files" FILES ${LIBPC_HPP})
diff -r 3bf61c0aaa07 -r b0dbe671f1c9 src/LiblasHeader.cpp
--- a/src/LiblasHeader.cpp	Fri Feb 25 14:05:33 2011 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000


More information about the Liblas-commits mailing list