[Liblas-commits] hg: 5 new changesets

liblas-commits at liblas.org liblas-commits at liblas.org
Mon Dec 20 22:58:50 EST 2010


changeset 1463eaa99e36 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=1463eaa99e36
summary: use inequality test

changeset 0ef24cb72063 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=0ef24cb72063
summary: remove liblas::detail::reader::Point... unnecessary and adds at least one extra copy of stuff

changeset dea3bfa6b160 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=dea3bfa6b160
summary: only ask for time and color if our schema says we have it

changeset 8918fb8d2a00 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=8918fb8d2a00
summary: only ask for time and color if our schema says we have it

changeset 8a23d7247e87 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=8a23d7247e87
summary: collapse reading of actual point data into liblas::ReaderImpl, eliminating extra copying and setup

diffstat:

 include/liblas/detail/reader/cachedreader.hpp |    1 -
 include/liblas/detail/reader/point.hpp        |   88 ------------------
 include/liblas/detail/reader/reader.hpp       |    9 +-
 include/liblas/utility.hpp                    |    4 +
 src/CMakeLists.txt                            |    1 -
 src/detail/reader/cachedreader.cpp            |    5 +-
 src/detail/reader/point.cpp                   |   83 -----------------
 src/detail/reader/reader.cpp                  |   48 ++++++----
 src/utility.cpp                               |  121 +++++++++++++++++++------
 9 files changed, 133 insertions(+), 227 deletions(-)

diffs (truncated from 600 to 300 lines):

diff -r da97381c72bd -r 8a23d7247e87 include/liblas/detail/reader/cachedreader.hpp
--- a/include/liblas/detail/reader/cachedreader.hpp	Mon Dec 20 12:39:27 2010 -0600
+++ b/include/liblas/detail/reader/cachedreader.hpp	Mon Dec 20 21:58:37 2010 -0600
@@ -43,7 +43,6 @@
 #define LIBLAS_DETAIL_CACHEDREADERIMPL_HPP_INCLUDED
 
 #include <liblas/detail/fwd.hpp>
-#include <liblas/detail/reader/point.hpp>
 #include <liblas/detail/reader/header.hpp>
 #include <liblas/liblas.hpp>
 // boost
diff -r da97381c72bd -r 8a23d7247e87 include/liblas/detail/reader/point.hpp
--- a/include/liblas/detail/reader/point.hpp	Mon Dec 20 12:39:27 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/******************************************************************************
- * $Id$
- *
- * Project:  libLAS - http://liblas.org - A BSD library for LAS format data.
- * Purpose:  Point Reader implementation for C++ libLAS 
- * 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_DETAIL_READER_POINT_HPP_INCLUDED
-#define LIBLAS_DETAIL_READER_POINT_HPP_INCLUDED
-
-#include <liblas/lasversion.hpp>
-#include <liblas/lasspatialreference.hpp>
-#include <liblas/detail/fwd.hpp>
-#include <liblas/lasheader.hpp>
-#include <liblas/laspoint.hpp>
-#include <liblas/lasschema.hpp>
-// boost
-#include <boost/cstdint.hpp>
-// std
-#include <iosfwd>
-
-namespace liblas { namespace detail { namespace reader {
-
-class Point
-{
-public:
-
-    Point(std::istream& ifs, HeaderPtr header);
-    virtual ~Point();
-
-    liblas::Point& GetPoint() { return m_point; }
-    void read();
-    
-protected:
-
-    typedef std::istream::off_type off_type;
-    typedef std::istream::pos_type pos_type;
-        
-private:
-
-    // Blocked copying operations, declared but not defined.
-    Point(Point const& other);
-    Point& operator=(Point const& rhs);
-    
-    std::istream& m_ifs;
-    HeaderPtr m_header;
-    liblas::Point m_point;
-    std::vector<boost::uint8_t>::size_type m_record_size;
-};
-
-
-}}} // namespace liblas::detail::reader
-
-#endif // LIBLAS_DETAIL_READER_POINT_HPP_INCLUDED
diff -r da97381c72bd -r 8a23d7247e87 include/liblas/detail/reader/reader.hpp
--- a/include/liblas/detail/reader/reader.hpp	Mon Dec 20 12:39:27 2010 -0600
+++ b/include/liblas/detail/reader/reader.hpp	Mon Dec 20 21:58:37 2010 -0600
@@ -43,7 +43,7 @@
 #define LIBLAS_DETAIL_READERIMPL_HPP_INCLUDED
 
 #include <liblas/detail/fwd.hpp>
-#include <liblas/detail/reader/point.hpp>
+// #include <liblas/detail/reader/point.hpp>
 #include <liblas/detail/reader/header.hpp>
 #include <liblas/liblas.hpp>
 // boost
@@ -54,7 +54,7 @@
 
 namespace liblas { namespace detail { 
 
-typedef boost::shared_ptr< reader::Point > PointReaderPtr;
+// typedef boost::shared_ptr< reader::Point > PointReaderPtr;
 typedef boost::shared_ptr< reader::Header > HeaderReaderPtr;
 
 class ReaderImpl : public ReaderI
@@ -90,7 +90,7 @@
     boost::uint32_t m_size;
     boost::uint32_t m_current;
     
-    PointReaderPtr m_point_reader;
+    // PointReaderPtr m_point_reader;
     HeaderReaderPtr m_header_reader;
     
     HeaderPtr m_header;
@@ -99,6 +99,9 @@
 
     std::vector<liblas::FilterPtr> m_filters;
     std::vector<liblas::TransformPtr> m_transforms;
+    std::vector<boost::uint8_t>::size_type m_record_size;
+    bool bNeedHeaderCheck;
+    
 private:
 
     // Blocked copying operations, declared but not defined.
diff -r da97381c72bd -r 8a23d7247e87 include/liblas/utility.hpp
--- a/include/liblas/utility.hpp	Mon Dec 20 12:39:27 2010 -0600
+++ b/include/liblas/utility.hpp	Mon Dec 20 21:58:37 2010 -0600
@@ -87,6 +87,8 @@
     liblas::Point max;
     liblas::Header m_header;
     bool bHaveHeader; 
+    bool bHaveColor;
+    bool bHaveTime;
 };
 
 class LAS_DLL CoordinateSummary
@@ -111,6 +113,8 @@
     liblas::Point max;
     liblas::Header m_header;
     bool bHaveHeader; 
+    bool bHaveColor;
+    bool bHaveTime;    
 };
 
 LAS_DLL std::ostream& operator<<(std::ostream& os, liblas::Summary const& s);
diff -r da97381c72bd -r 8a23d7247e87 src/CMakeLists.txt
--- a/src/CMakeLists.txt	Mon Dec 20 12:39:27 2010 -0600
+++ b/src/CMakeLists.txt	Mon Dec 20 21:58:37 2010 -0600
@@ -138,7 +138,6 @@
 
 set(LIBLAS_DETAIL_READER_CPP
   detail/reader/header.cpp
-  detail/reader/point.cpp
   detail/reader/reader.cpp
   detail/reader/zipreader.cpp
   detail/reader/cachedreader.cpp)
diff -r da97381c72bd -r 8a23d7247e87 src/detail/reader/cachedreader.cpp
--- a/src/detail/reader/cachedreader.cpp	Mon Dec 20 12:39:27 2010 -0600
+++ b/src/detail/reader/cachedreader.cpp	Mon Dec 20 21:58:37 2010 -0600
@@ -142,9 +142,10 @@
         throw std::out_of_range("ReadNextPoint: file has no more points to read, end of file reached");
     } 
 
-    m_point_reader->read();
+    // m_point_reader->read();
+    detail::read_n(m_point->GetData().front(), m_ifs, m_record_size);
     ++m_current;
-    *m_point = m_point_reader->GetPoint();
+    // *m_point = m_point_reader->GetPoint();
 
 
     if (!m_transforms.empty())
diff -r da97381c72bd -r 8a23d7247e87 src/detail/reader/point.cpp
--- a/src/detail/reader/point.cpp	Mon Dec 20 12:39:27 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/******************************************************************************
- * $Id$
- *
- * Project:  libLAS - http://liblas.org - A BSD library for LAS format data.
- * Purpose:  Point Reader implementation for C++ libLAS 
- * 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.
- ****************************************************************************/
- 
-#include <liblas/lasheader.hpp>
-#include <liblas/detail/reader/reader.hpp>
-#include <liblas/detail/reader/point.hpp>
-#include <liblas/detail/private_utility.hpp>
-// boost
-#include <boost/array.hpp>
-#include <boost/cstdint.hpp>
-// std
-#include <cstring>
-#include <sstream> 
-
-using namespace boost;
-using namespace std;
-
-namespace liblas { namespace detail { namespace reader {
-
-Point::Point(std::istream& ifs, HeaderPtr header)
-    : m_ifs(ifs)
-    , m_header(header)
-    , m_point(m_header)
-    , m_record_size(m_header->GetSchema().GetByteSize())
-{
-}
-
-Point::~Point()
-{
-}
-
-void Point::read()
-{
-    assert(m_header);
-    assert(m_point.GetHeaderPtr());
-    assert(m_record_size > 0);
-    
-    if (m_point.GetHeaderPtr().get() != m_header.get())
-        m_point.SetHeaderPtr(m_header);
-    
-    detail::read_n(m_point.GetData().front(), m_ifs, m_record_size);
-
-}
-
-}}} // namespace liblas::detail::reader
diff -r da97381c72bd -r 8a23d7247e87 src/detail/reader/reader.cpp
--- a/src/detail/reader/reader.cpp	Mon Dec 20 12:39:27 2010 -0600
+++ b/src/detail/reader/reader.cpp	Mon Dec 20 21:58:37 2010 -0600
@@ -63,12 +63,13 @@
     : m_ifs(ifs)
     , m_size(0)
     , m_current(0)
-    , m_point_reader(PointReaderPtr())
+    // , m_point_reader(PointReaderPtr())
     , m_header_reader(new reader::Header(m_ifs))
     , m_header(HeaderPtr())
     , m_point(PointPtr(new liblas::Point()))
     , m_filters(0)
     , m_transforms(0)
+    , bNeedHeaderCheck(false)
 {
 
 }
@@ -85,13 +86,8 @@
     // Reset sizes and set internal cursor to the beginning of file.
     m_current = 0;
     m_size = m_header->GetPointRecordsCount();


More information about the Liblas-commits mailing list