[Liblas-commits] hg-main-tree: iterator work checkpoint

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Mar 22 10:34:11 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/64e82ef08e5d
changeset: 379:64e82ef08e5d
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Fri Mar 18 19:10:08 2011 -0400
description:
iterator work checkpoint
Subject: hg-main-tree: iterator work checkpoint -stage-based read methods now gone

details:   http://hg.libpc.orghg-main-tree/rev/dcfcf8c78bca
changeset: 380:dcfcf8c78bca
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Fri Mar 18 20:54:29 2011 -0400
description:
iterator work checkpoint -stage-based read methods now gone
Subject: hg-main-tree: put the Iters into their own files

details:   http://hg.libpc.orghg-main-tree/rev/7cbd8049b2aa
changeset: 381:7cbd8049b2aa
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Fri Mar 18 18:46:41 2011 -0700
description:
put the Iters into their own files
Subject: hg-main-tree: made Stages be const wrt other stages and iterators

details:   http://hg.libpc.orghg-main-tree/rev/48371a0708d3
changeset: 382:48371a0708d3
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Fri Mar 18 19:26:41 2011 -0700
description:
made Stages be const wrt other stages and iterators
Subject: hg-main-tree: merge

details:   http://hg.libpc.orghg-main-tree/rev/771da57f961e
changeset: 383:771da57f961e
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Tue Mar 22 07:34:07 2011 -0700
description:
merge

diffstat:

 CMakeLists.txt                                             |    1 +
 apps/pc2pc.cpp                                             |    3 -
 apps/pcinfo.cpp                                            |    4 +
 doc/_static/files/2011_Codesprint_libpc_design.pdf         |    0 
 doc/_static/files/2011_Codesprint_libpc_implementation.pdf |    0 
 doc/sprint/libpc-design.pptx                               |    0 
 doc/sprint/libpc-implementation.pptx                       |    0 
 doc/sprint/notes.txt                                       |   59 ---
 include/libpc/Filter.hpp                                   |    6 +-
 include/libpc/FilterIterator.hpp                           |    7 +-
 include/libpc/Iterator.hpp                                 |    9 +-
 include/libpc/Stage.hpp                                    |   42 +--
 include/libpc/drivers/faux/Iterator.hpp                    |   62 +++
 include/libpc/drivers/faux/Reader.hpp                      |   10 +-
 include/libpc/drivers/las/Iterator.hpp                     |   64 +++
 include/libpc/drivers/las/Reader.hpp                       |   13 +-
 include/libpc/drivers/liblas/Iterator.hpp                  |   71 +++
 include/libpc/drivers/liblas/Reader.hpp                    |   11 +-
 include/libpc/filters/CacheFilter.hpp                      |   14 +-
 include/libpc/filters/CacheFilterIterator.hpp              |   65 +++
 include/libpc/filters/ColorFilter.hpp                      |   12 +-
 include/libpc/filters/ColorFilterIterator.hpp              |   64 +++
 include/libpc/filters/CropFilter.hpp                       |   12 +-
 include/libpc/filters/CropFilterIterator.hpp               |   63 +++
 include/libpc/filters/DecimationFilter.hpp                 |   13 +-
 include/libpc/filters/DecimationFilterIterator.hpp         |   63 +++
 include/libpc/filters/MosaicFilter.hpp                     |   22 +-
 include/libpc/filters/MosaicFilterIterator.hpp             |   67 +++
 mpg-config.bat                                             |   16 +-
 src/CMakeLists.txt                                         |   25 +-
 src/Chipper.cpp                                            |    7 +-
 src/Filter.cpp                                             |    4 +-
 src/FilterIterator.cpp                                     |   14 +-
 src/Iterator.cpp                                           |    5 +-
 src/Stage.cpp                                              |   31 -
 src/Writer.cpp                                             |   10 +-
 src/drivers/faux/Iterator.cpp                              |  133 +++++++
 src/drivers/faux/Reader.cpp                                |   76 +---
 src/drivers/las/Iterator.cpp                               |  235 +++++++++++++
 src/drivers/las/Reader.cpp                                 |  185 +----------
 src/drivers/liblas/Iterator.cpp                            |  173 +++++++++
 src/drivers/liblas/Reader.cpp                              |  118 +------
 src/filters/CacheFilter.cpp                                |   71 +---
 src/filters/CacheFilterIterator.cpp                        |  117 ++++++
 src/filters/ColorFilter.cpp                                |   40 +-
 src/filters/ColorFilterIterator.cpp                        |   92 +++++
 src/filters/CropFilter.cpp                                 |   55 +--
 src/filters/CropFilterIterator.cpp                         |  102 +++++
 src/filters/DecimationFilter.cpp                           |   34 +-
 src/filters/DecimationFilterIterator.cpp                   |   83 ++++
 src/filters/MosaicFilter.cpp                               |   86 +---
 src/filters/MosaicFilterIterator.cpp                       |  126 ++++++
 test/unit/CacheFilterTest.cpp                              |   14 +-
 test/unit/DecimationFilterTest.cpp                         |    7 +-
 test/unit/FauxReaderTest.cpp                               |   17 +-
 test/unit/LiblasReaderTest.cpp                             |   14 +-
 test/unit/MosaicFilterTest.cpp                             |   12 +-
 57 files changed, 1816 insertions(+), 843 deletions(-)

diffs (truncated from 3714 to 300 lines):

diff -r fa468a10815f -r 771da57f961e CMakeLists.txt
--- a/CMakeLists.txt	Fri Mar 18 11:03:09 2011 -0500
+++ b/CMakeLists.txt	Tue Mar 22 07:34:07 2011 -0700
@@ -342,6 +342,7 @@
     if(MRSID_FOUND)
         set(CMAKE_REQUIRED_LIBRARIES ${MRSID_LIBRARY})
         include_directories(${MRSID_INCLUDE_DIR})
+        add_definitions(-DHAVE_MRSID=1)
     endif()
 endif()
 
diff -r fa468a10815f -r 771da57f961e apps/pc2pc.cpp
--- a/apps/pc2pc.cpp	Fri Mar 18 11:03:09 2011 -0500
+++ b/apps/pc2pc.cpp	Tue Mar 22 07:34:07 2011 -0700
@@ -122,8 +122,6 @@
         writer.write(np);
     }
 
-#ifdef HAVE_ORACLE
-
     else if (hasOption("oracle"))
     {
 #ifdef HAVE_ORACLE
@@ -155,7 +153,6 @@
         throw configuration_error("libPC not compiled with Oracle support");
 #endif
     }    
-#endif
     else
     {
         libpc::drivers::liblas::LiblasReader reader(*ifs);
diff -r fa468a10815f -r 771da57f961e apps/pcinfo.cpp
--- a/apps/pcinfo.cpp	Fri Mar 18 11:03:09 2011 -0500
+++ b/apps/pcinfo.cpp	Tue Mar 22 07:34:07 2011 -0700
@@ -12,7 +12,9 @@
 
 #include <libpc/drivers/las/Reader.hpp>
 #include <libpc/drivers/liblas/Reader.hpp>
+#ifdef HAVE_MRSID
 #include <libpc/drivers/mrsid/Reader.hpp>
+#endif
 
 #include <iostream>
 
@@ -92,10 +94,12 @@
             else
                 reader = new libpc::drivers::liblas::LiblasReader(*ifs);
         }
+#ifdef HAVE_MRSID
         else if (!m_inputFile.substr(ext).compare("sid"))
         {
             reader = new libpc::drivers::mrsid::Reader(m_inputFile.c_str());
         }
+#endif
     }
     else
     {
diff -r fa468a10815f -r 771da57f961e doc/_static/files/2011_Codesprint_libpc_design.pdf
Binary file doc/_static/files/2011_Codesprint_libpc_design.pdf has changed
diff -r fa468a10815f -r 771da57f961e doc/_static/files/2011_Codesprint_libpc_implementation.pdf
Binary file doc/_static/files/2011_Codesprint_libpc_implementation.pdf has changed
diff -r fa468a10815f -r 771da57f961e doc/sprint/libpc-design.pptx
Binary file doc/sprint/libpc-design.pptx has changed
diff -r fa468a10815f -r 771da57f961e doc/sprint/libpc-implementation.pptx
Binary file doc/sprint/libpc-implementation.pptx has changed
diff -r fa468a10815f -r 771da57f961e doc/sprint/notes.txt
--- a/doc/sprint/notes.txt	Fri Mar 18 11:03:09 2011 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-.. _sprint_notes:
-
-==============================================================================
-Montreal Sprint Notes
-==============================================================================
-
-* website
-
-* documentation format for headers
-
-* unit tests for CL apps
-
-* pcinfo tool - basic support
-
-* CL mssgs to stdout or stderr?  usage/help/error
-
-* platform macros -- LIBPC_OS_WIN32, etc
-
-* dump routines -- every class needs oper<<, dump()
-
-* build swig bindings from CMake
-  
-* typedef boost::uint32_t uint32_t ?
-
-* isolate strings for error messages (anywhere else?)
-
-* implement Signaller support in Stage
-
-* the "Capabilities" issue
-
-* the PointData templating issue
-
-* the sequential-or-random-reads issue
-
-* do we need Header class?
-
-* does Boost give math class support for Range, Vector, Bounds?
-
-* bitfields in Dimensions?
-
-* MG4/Lidar driver support, inc. CMake detection
-
-* Text driver
-
-* BAG driver
-
-* octtree for libpc::Stage
-
-* finish native las and liblas drivers
-
-* implement metadata/VLR support
-
-* implement spatial referencing support
-
-* update Notes to match realities
-
-* discuss funding opportunities
-
-* in-place writer ability, breaks model
diff -r fa468a10815f -r 771da57f961e include/libpc/Filter.hpp
--- a/include/libpc/Filter.hpp	Fri Mar 18 11:03:09 2011 -0500
+++ b/include/libpc/Filter.hpp	Tue Mar 22 07:34:07 2011 -0700
@@ -45,12 +45,12 @@
 class LIBPC_DLL Filter : public Stage
 {
 public:
-    Filter(Stage& prevStage);
+    Filter(const Stage& prevStage);
 
-    Stage& getPrevStage() const;
+    const Stage& getPrevStage() const;
 
 protected:
-    Stage& m_prevStage;
+    const Stage& m_prevStage;
 
 private:
     Filter& operator=(const Filter&); // not implemented
diff -r fa468a10815f -r 771da57f961e include/libpc/FilterIterator.hpp
--- a/include/libpc/FilterIterator.hpp	Fri Mar 18 11:03:09 2011 -0500
+++ b/include/libpc/FilterIterator.hpp	Tue Mar 22 07:34:07 2011 -0700
@@ -44,10 +44,13 @@
 class FilterIterator : public Iterator
 {
 public:
-    FilterIterator(Filter&, const Bounds<double>& bounds);
+    FilterIterator(const Filter&);
+
+protected:
+    Iterator& getPrevIterator();
 
 private:
-    Filter& m_stageAsFilter;
+    const Filter& m_stageAsFilter;
     Iterator* m_prevIterator;
 };
 
diff -r fa468a10815f -r 771da57f961e include/libpc/Iterator.hpp
--- a/include/libpc/Iterator.hpp	Fri Mar 18 11:03:09 2011 -0500
+++ b/include/libpc/Iterator.hpp	Tue Mar 22 07:34:07 2011 -0700
@@ -45,9 +45,9 @@
 class LIBPC_DLL Iterator
 {
 public:
-    Iterator(Stage& stage, const Bounds<double>& bounds);
+    Iterator(const Stage& stage);
 
-    Stage& getStage();
+    const Stage& getStage() const;
 
     // This reads a set of points at the current position in the file.
     //
@@ -81,7 +81,7 @@
     virtual boost::uint32_t readBuffer(PointData&) = 0;
 
     // Each concrete stage is repsonsible for managing its own current
-    // point index when a read or seek occurs.  Call this function to set
+    // point index when a read or seek occurs.  Call this function t o set
     // the value.
     void setCurrentPointIndex(boost::uint64_t delta);
 
@@ -89,9 +89,8 @@
     void incrementCurrentPointIndex(boost::uint64_t currentPointDelta);
 
 private:
-    Stage& m_stage;
+    const Stage& m_stage;
     boost::uint64_t m_currentPointIndex;
-    const Bounds<double> m_bounds;
 
     Iterator& operator=(const Iterator&); // not implemented
     Iterator(const Iterator&); // not implemented
diff -r fa468a10815f -r 771da57f961e include/libpc/Stage.hpp
--- a/include/libpc/Stage.hpp	Fri Mar 18 11:03:09 2011 -0500
+++ b/include/libpc/Stage.hpp	Tue Mar 22 07:34:07 2011 -0700
@@ -59,60 +59,20 @@
     // words.  The last word should generally be "Reader" or "Filter".
     virtual const std::string& getName() const = 0;
 
-    // This reads a set of points at the current position in the file.
-    //
-    // The schema of the PointData buffer we are given here might
-    // not match our own header's schema.  That's okay, though: all
-    // that matters is that the buffer we are given has the fields
-    // we need to write into.
-    //
-    // This is NOT virtual.  Derived classes should override the 
-    // readBuffer function below, not this one.
-    //
-    // Returns the number of valid points read.
-    boost::uint32_t read(PointData&);
-
-    // advance (or retreat) to the Nth point in the file (absolute, 
-    // not relative).  In some cases, this might be a very slow, painful
-    // function to call.
-    virtual void seekToPoint(boost::uint64_t pointNum) = 0;
-
     // returns the number of points this stage has available
     // (actually a convenience function that gets it from the header)
     boost::uint64_t getNumPoints() const;
 
-    // returns true after we've read all the points available to this stage
-    // (actually a convenience function that compares getCurrentPointIndex and getNumPoints)
-    bool atEnd() const;
-
     const Header& getHeader() const;
     Header& getHeader();
 
-    virtual Iterator* createIterator(const Bounds<double>& bounds) = 0;
+    virtual Iterator* createIterator() const = 0;
 
 protected:
-    // Implement this to do the actual work to fill in a buffer of points.
-    virtual boost::uint32_t readBuffer(PointData& pointData) = 0;
-
-    // Each concrete stage is repsonsible for managing its own current
-    // point index when a read or seek occurs.  Call this function to set
-    // the value.
-    void setCurrentPointIndex(boost::uint64_t delta);
-
-    // this is easier than saying setCurrentPointIndex(getCurrentPointIndex()+n)
-    void incrementCurrentPointIndex(boost::uint64_t currentPointDelta);
-
     void setHeader(Header*); // stage takes ownership
 
-        // Returns the current point number.  The first point is 0.
-    // If this number if > getNumPoints(), then no more points
-    // may be read (and atEnd() should be true).
-    boost::uint64_t getCurrentPointIndex() const;
-
 private:
     Header* m_header;
-    
-    boost::uint64_t m_currentPointIndex;
 
     Stage& operator=(const Stage&); // not implemented
     Stage(const Stage&); // not implemented
diff -r fa468a10815f -r 771da57f961e include/libpc/drivers/faux/Iterator.hpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/libpc/drivers/faux/Iterator.hpp	Tue Mar 22 07:34:07 2011 -0700
@@ -0,0 +1,62 @@
+/******************************************************************************
+* 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


More information about the Liblas-commits mailing list